commit a77fe211313dcf29e2b42736a6532a298183169f
parent 6d8b65a9c1ba39a7b2e78723bb7cfb2e8fba68e6
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 30 Aug 2010 13:42:58 +0000
nicer logging
Diffstat:
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
@@ -1411,8 +1411,15 @@ do_read (struct MHD_Connection *connection)
if (errno == EINTR)
return MHD_NO;
#if HAVE_MESSAGES
- MHD_DLOG (connection->daemon,
- "Failed to receive data: %s\n", STRERROR (errno));
+#if HTTPS_SUPPORT
+ if (0 != (connection->daemon->options & MHD_USE_SSL))
+ MHD_DLOG (connection->daemon,
+ "Failed to receive data: %s\n",
+ gnutls_strerror (bytes_read));
+ else
+#endif
+ MHD_DLOG (connection->daemon,
+ "Failed to receive data: %s\n", STRERROR (errno));
#endif
connection_close_error (connection);
return MHD_YES;
@@ -1451,8 +1458,15 @@ do_write (struct MHD_Connection *connection)
if (errno == EINTR)
return MHD_NO;
#if HAVE_MESSAGES
- MHD_DLOG (connection->daemon,
- "Failed to send data: %s\n", STRERROR (errno));
+#if HTTPS_SUPPORT
+ if (0 != (connection->daemon->options & MHD_USE_SSL))
+ MHD_DLOG (connection->daemon,
+ "Failed to send data: %s\n",
+ gnutls_strerror (ret));
+ else
+#endif
+ MHD_DLOG (connection->daemon,
+ "Failed to send data: %s\n", STRERROR (errno));
#endif
connection_close_error (connection);
return MHD_YES;