diff --git a/src/daemon/connection_https.c b/src/daemon/connection_https.c index d193fef6..78797aa4 100644 --- a/src/daemon/connection_https.c +++ b/src/daemon/connection_https.c @@ -204,7 +204,8 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) return MHD_YES; /* close connection if necessary */ case MHD_CONNECTION_CLOSED: - MHD_tls_connection_close (connection); + if (connection->socket_fd != -1) + MHD_tls_connection_close (connection); return MHD_NO; case MHD_TLS_HANDSHAKE_FAILED: MHD_tls_connection_close_err (connection, diff --git a/src/daemon/https/tls/gnutls_buffers.c b/src/daemon/https/tls/gnutls_buffers.c index cb2b9e08..67bf5c9b 100644 --- a/src/daemon/https/tls/gnutls_buffers.c +++ b/src/daemon/https/tls/gnutls_buffers.c @@ -1223,7 +1223,8 @@ mhd_gtls_handshake_buffer_get_ptr (mhd_gtls_session_t session, if (length != NULL) *length = session->internals.handshake_hash_buffer.length; - _gnutls_buffers_log ("BUF[HSK]: Peeked %d bytes of Data\n", *length); + _gnutls_buffers_log ("BUF[HSK]: Peeked %d bytes of Data\n", + session->internals.handshake_hash_buffer.length) if (data_ptr != NULL) *data_ptr = session->internals.handshake_hash_buffer.data;