aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 6f0fe9f2..84d9afe3 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1620,7 +1620,9 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
1620 if ( (0 != (daemon->options & MHD_USE_TLS)) && 1620 if ( (0 != (daemon->options & MHD_USE_TLS)) &&
1621 (0 == (daemon->options & MHD_USE_POLL))) 1621 (0 == (daemon->options & MHD_USE_POLL)))
1622 { 1622 {
1623 while ( (MHD_CONNECTION_UPGRADE == con->state) || 1623 while ( (0 != urh->in_buffer_size) ||
1624 (0 != urh->out_buffer_size) ||
1625 (0 != urh->in_buffer_used) ||
1624 (0 != urh->out_buffer_used) ) 1626 (0 != urh->out_buffer_used) )
1625 { 1627 {
1626 /* use select */ 1628 /* use select */
@@ -1690,11 +1692,6 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
1690 &ws, 1692 &ws,
1691 &es); 1693 &es);
1692 process_urh (urh); 1694 process_urh (urh);
1693 if ( (0 == urh->in_buffer_size) &&
1694 (0 == urh->out_buffer_size) &&
1695 (0 == urh->in_buffer_used) &&
1696 (0 == urh->out_buffer_used) )
1697 break; /* connections died, we have no more purpose here */
1698 } 1695 }
1699 } 1696 }
1700#ifdef HAVE_POLL 1697#ifdef HAVE_POLL
@@ -1708,7 +1705,9 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
1708 p[0].fd = urh->connection->socket_fd; 1705 p[0].fd = urh->connection->socket_fd;
1709 p[1].fd = urh->mhd.socket; 1706 p[1].fd = urh->mhd.socket;
1710 1707
1711 while ( (MHD_CONNECTION_UPGRADE == con->state) || 1708 while ( (0 != urh->in_buffer_size) ||
1709 (0 != urh->out_buffer_size) ||
1710 (0 != urh->in_buffer_used) ||
1712 (0 != urh->out_buffer_used) ) 1711 (0 != urh->out_buffer_used) )
1713 { 1712 {
1714 int timeout; 1713 int timeout;
@@ -1738,11 +1737,6 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
1738 } 1737 }
1739 urh_from_pollfd(urh, p); 1738 urh_from_pollfd(urh, p);
1740 process_urh (urh); 1739 process_urh (urh);
1741 if ( (0 == urh->in_buffer_size) &&
1742 (0 == urh->out_buffer_size) &&
1743 (0 == urh->in_buffer_used) &&
1744 (0 == urh->out_buffer_used) )
1745 break; /* connections died, we have no more purpose here */
1746 } 1740 }
1747 } 1741 }
1748 /* end POLL */ 1742 /* end POLL */
@@ -2070,11 +2064,7 @@ thread_main_handle_connection (void *data)
2070 } 2064 }
2071#endif 2065#endif
2072#ifdef UPGRADE_SUPPORT 2066#ifdef UPGRADE_SUPPORT
2073 /* Check for 'MHD_CONNECTION_UPGRADE_CLOSED' too: 2067 if (MHD_CONNECTION_UPGRADE == con->state)
2074 * application can finish with "upgraded" connection
2075 * before this thread process it for the first time. */
2076 if ( (MHD_CONNECTION_UPGRADE == con->state) ||
2077 (MHD_CONNECTION_UPGRADE_CLOSED == con->state) )
2078 { 2068 {
2079 /* Normal HTTP processing is finished, 2069 /* Normal HTTP processing is finished,
2080 * notify application. */ 2070 * notify application. */