libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit f2426d2b0ff551f3585eda7f68fe1e7c8e4aa5c4
parent 3118c44d9c7624b3cf7f87c57d056169f6511e3b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Mon,  3 Oct 2016 21:13:38 +0000

Fix using select()/poll() loop when MHD compiled with HTTPS, but upgraded connection is HTTP

Diffstat:
Msrc/microhttpd/daemon.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -1133,7 +1133,8 @@ thread_main_connection_upgrade (struct MHD_Connection *con) /* Here, we need to bi-directionally forward until the application tells us that it is done with the socket; */ - if (0 == (daemon->options & MHD_USE_POLL)) + if ( (0 != (daemon->options & MHD_USE_SSL)) && + (0 == (daemon->options & MHD_USE_POLL))) { while (MHD_CONNECTION_UPGRADE == con->state) { @@ -1192,7 +1193,7 @@ thread_main_connection_upgrade (struct MHD_Connection *con) } } #ifdef HAVE_POLL - else + else if (0 != (daemon->options & MHD_USE_SSL)) { /* use poll() */ const unsigned int timeout = UINT_MAX;