]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/blobdiff - src/tlsproxy.c
src/: Move log related functions/defines to log.[hc].
[tlsproxy/tlsproxy.git] / src / tlsproxy.c
index 0e095689374b7cae7e4ce51546491d1e9ade25d4..85ca776af98516a91f3d98e789ba2fc266e190bf 100644 (file)
@@ -48,6 +48,14 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #define DH_SIZE 1024
 
 
+/* For gnutls_*() functions. */
+#define GNUTLS_ERROR_EXIT(error, message) \
+    if (GNUTLS_E_SUCCESS != error) { \
+        fprintf(stderr, "%s: %s\n", message, gnutls_strerror(error)); \
+        exit(EXIT_FAILURE); \
+    }
+
+
 /* Server should shut down. Set by SIGINT handler. */
 static volatile int done;