aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-26 18:52:53 +0200
committerChristian Grothoff <christian@grothoff.org>2019-10-26 18:52:53 +0200
commit5e5dbf980de763480f7957f64af78bbb2159d9a0 (patch)
treec769f03c3d7b78df899023ff4366042670ca23f8 /src/microhttpd
parentb8516d23ba11cf3a94fcbf2ea228ea0456354017 (diff)
downloadlibmicrohttpd-5e5dbf980de763480f7957f64af78bbb2159d9a0.tar.gz
libmicrohttpd-5e5dbf980de763480f7957f64af78bbb2159d9a0.zip
add tests for empty reply in HTTPS
Diffstat (limited to 'src/microhttpd')
-rw-r--r--src/microhttpd/mhd_send.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index e50be96e..db621cb2 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -240,7 +240,8 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
240 ssize_t ret; 240 ssize_t ret;
241 241
242 /* error handling from send_param_adapter() */ 242 /* error handling from send_param_adapter() */
243 if ((MHD_INVALID_SOCKET == s) || (MHD_CONNECTION_CLOSED == connection->state)) 243 if ( (MHD_INVALID_SOCKET == s) ||
244 (MHD_CONNECTION_CLOSED == connection->state) )
244 { 245 {
245 return MHD_ERR_NOTCONN_; 246 return MHD_ERR_NOTCONN_;
246 } 247 }
@@ -382,10 +383,22 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
382{ 383{
383#ifdef HTTPS_SUPPORT 384#ifdef HTTPS_SUPPORT
384 if (0 != (connection->daemon->options & MHD_USE_TLS)) 385 if (0 != (connection->daemon->options & MHD_USE_TLS))
385 return MHD_send_on_connection_ (connection, 386 {
386 header, 387 ssize_t ret;
387 header_size, 388
388 MHD_SSO_HDR_CORK); 389 ret = MHD_send_on_connection_ (connection,
390 header,
391 header_size,
392 MHD_SSO_HDR_CORK);
393 if ( (ret == header_size) &&
394 (0 == buffer_size) &&
395 connection->sk_cork_on)
396 {
397 (void) gnutls_record_uncork (connection->tls_session, 0);
398 connection->sk_cork_on = false;
399 }
400 return ret;
401 }
389#endif 402#endif
390#if defined(HAVE_SENDMSG) || defined(HAVE_WRITEV) 403#if defined(HAVE_SENDMSG) || defined(HAVE_WRITEV)
391 MHD_socket s = connection->socket_fd; 404 MHD_socket s = connection->socket_fd;