aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2020-10-31 20:25:06 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2020-10-31 20:50:37 +0300
commit9a224cc6eda2c42f2775ff7740753436bbee90ef (patch)
tree9257eb98223532d144eb8a8cebe54851bd4d1765
parentcec7ee05dca77cd62cce9bb52e612b8c429d500f (diff)
downloadlibmicrohttpd-9a224cc6eda2c42f2775ff7740753436bbee90ef.tar.gz
libmicrohttpd-9a224cc6eda2c42f2775ff7740753436bbee90ef.zip
Speed-up closure of upgraded connection with daemon shutdown
-rw-r--r--src/microhttpd/daemon.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 91ad5406..f75d02b1 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1734,8 +1734,9 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
1734 { 1734 {
1735 struct timeval*tvp; 1735 struct timeval*tvp;
1736 struct timeval tv; 1736 struct timeval tv;
1737 if ( (con->tls_read_ready) && 1737 if (((con->tls_read_ready) &&
1738 (urh->in_buffer_used < urh->in_buffer_size)) 1738 (urh->in_buffer_used < urh->in_buffer_size)) ||
1739 (daemon->shutdown))
1739 { /* No need to wait if incoming data is already pending in TLS buffers. */ 1740 { /* No need to wait if incoming data is already pending in TLS buffers. */
1740 tv.tv_sec = 0; 1741 tv.tv_sec = 0;
1741 tv.tv_usec = 0; 1742 tv.tv_usec = 0;
@@ -1792,8 +1793,9 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
1792 1793
1793 urh_update_pollfd (urh, p); 1794 urh_update_pollfd (urh, p);
1794 1795
1795 if ( (con->tls_read_ready) && 1796 if (((con->tls_read_ready) &&
1796 (urh->in_buffer_used < urh->in_buffer_size)) 1797 (urh->in_buffer_used < urh->in_buffer_size)) ||
1798 (daemon->shutdown))
1797 timeout = 0; /* No need to wait if incoming data is already pending in TLS buffers. */ 1799 timeout = 0; /* No need to wait if incoming data is already pending in TLS buffers. */
1798 else 1800 else
1799 timeout = -1; 1801 timeout = -1;