libmicrohttpd

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

commit eea55aeb1d68159879e231ebfdb223bd21bdc525
parent 6daee7466367848d2304283c0c1ee8d8f653a5f0
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  4 Sep 2016 16:43:28 +0000

-fix where we init daemon

Diffstat:
Msrc/microhttpd/connection.c | 2+-
Msrc/microhttpd/test_upgrade_common.c | 19++++++++++---------
2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -3178,6 +3178,7 @@ MHD_queue_response (struct MHD_Connection *connection, ( (MHD_CONNECTION_HEADERS_PROCESSED != connection->state) && (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) ) return MHD_NO; + daemon = connection->daemon; if ( (MHD_HTTP_SWITCHING_PROTOCOLS != status_code) && (NULL != response->upgrade_handler) ) { @@ -3187,7 +3188,6 @@ MHD_queue_response (struct MHD_Connection *connection, #endif return MHD_NO; } - daemon = connection->daemon; if ( (NULL != response->upgrade_handler) && (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && (0 == (daemon->options & MHD_USE_SUSPEND_RESUME)) ) diff --git a/src/microhttpd/test_upgrade_common.c b/src/microhttpd/test_upgrade_common.c @@ -388,15 +388,16 @@ run_mhd_select_loop (struct MHD_Daemon *daemon) &es, &max_fd)) abort (); - MHD_get_timeout (daemon, - &to); + (void) MHD_get_timeout (daemon, + &to); tv.tv_sec = to / 1000; tv.tv_usec = 1000 * (to % 1000); - select (max_fd + 1, - &rs, - &ws, - &es, - &tv); + if (0 > MHD_SYS_select_ (max_fd + 1, + &rs, + &ws, + &es, + &tv)) + abort (); MHD_run_from_select (daemon, &rs, &ws, @@ -442,8 +443,8 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon) to = 1000; FD_SET (ep, &rs); - MHD_get_timeout (daemon, - &to); + (void) MHD_get_timeout (daemon, + &to); tv.tv_sec = to / 1000; tv.tv_usec = 1000 * (to % 1000); select (ep + 1,