diff options
Diffstat (limited to 'src/microhttpd/connection_https.c')
-rw-r--r-- | src/microhttpd/connection_https.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c index bbfebd22..f1f1f90c 100644 --- a/src/microhttpd/connection_https.c +++ b/src/microhttpd/connection_https.c | |||
@@ -152,8 +152,6 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) | |||
152 | break; | 152 | break; |
153 | /* close connection if necessary */ | 153 | /* close connection if necessary */ |
154 | case MHD_CONNECTION_CLOSED: | 154 | case MHD_CONNECTION_CLOSED: |
155 | gnutls_bye (connection->tls_session, | ||
156 | GNUTLS_SHUT_RDWR); | ||
157 | return MHD_connection_handle_idle (connection); | 155 | return MHD_connection_handle_idle (connection); |
158 | default: | 156 | default: |
159 | if ( (0 != gnutls_record_check_pending (connection->tls_session)) && | 157 | if ( (0 != gnutls_record_check_pending (connection->tls_session)) && |
@@ -183,4 +181,22 @@ MHD_set_https_callbacks (struct MHD_Connection *connection) | |||
183 | connection->idle_handler = &MHD_tls_connection_handle_idle; | 181 | connection->idle_handler = &MHD_tls_connection_handle_idle; |
184 | } | 182 | } |
185 | 183 | ||
184 | |||
185 | /** | ||
186 | * Initiate shutdown of TLS layer of connection. | ||
187 | * | ||
188 | * @param connection to use | ||
189 | * @return #MHD_YES if succeed, #MHD_NO otherwise. | ||
190 | */ | ||
191 | int | ||
192 | MHD_tls_connection_shutdown (struct MHD_Connection *connection) | ||
193 | { | ||
194 | if (MHD_NO != connection->tls_closed) | ||
195 | return MHD_NO; | ||
196 | |||
197 | connection->tls_closed = MHD_YES; | ||
198 | return (GNUTLS_E_SUCCESS == gnutls_bye(connection->tls_session, GNUTLS_SHUT_WR)) ? | ||
199 | MHD_YES : MHD_NO; | ||
200 | } | ||
201 | |||
186 | /* end of connection_https.c */ | 202 | /* end of connection_https.c */ |