MHD_tls_connection_shutdown(): remember real result of TLS shutdown

This commit is contained in:
Evgeny Grin (Karlson2k)
2017-06-03 22:26:26 +03:00
parent a21ff8a9ef
commit 3516d336f1
+6 -6
View File
@@ -142,12 +142,12 @@ MHD_set_https_callbacks (struct MHD_Connection *connection)
int
MHD_tls_connection_shutdown (struct MHD_Connection *connection)
{
if (connection->tls_closed)
return MHD_NO;
connection->tls_closed = true;
return (GNUTLS_E_SUCCESS == gnutls_bye(connection->tls_session, GNUTLS_SHUT_WR)) ?
MHD_YES : MHD_NO;
if (! connection->tls_closed)
{
connection->tls_closed =
(GNUTLS_E_SUCCESS == gnutls_bye(connection->tls_session, GNUTLS_SHUT_WR));
}
return connection->tls_closed ? MHD_YES : MHD_NO;;
}
/* end of connection_https.c */