aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-09-04 16:43:28 +0000
committerChristian Grothoff <christian@grothoff.org>2016-09-04 16:43:28 +0000
commiteea55aeb1d68159879e231ebfdb223bd21bdc525 (patch)
tree1c6f761128b0e4f80066c043525687e4f3c6c822
parent6daee7466367848d2304283c0c1ee8d8f653a5f0 (diff)
downloadlibmicrohttpd-eea55aeb1d68159879e231ebfdb223bd21bdc525.tar.gz
libmicrohttpd-eea55aeb1d68159879e231ebfdb223bd21bdc525.zip
-fix where we init daemon
-rw-r--r--src/microhttpd/connection.c2
-rw-r--r--src/microhttpd/test_upgrade_common.c19
2 files changed, 11 insertions, 10 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 4677fa7a..bd8af585 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3178,6 +3178,7 @@ MHD_queue_response (struct MHD_Connection *connection,
3178 ( (MHD_CONNECTION_HEADERS_PROCESSED != connection->state) && 3178 ( (MHD_CONNECTION_HEADERS_PROCESSED != connection->state) &&
3179 (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) ) 3179 (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) )
3180 return MHD_NO; 3180 return MHD_NO;
3181 daemon = connection->daemon;
3181 if ( (MHD_HTTP_SWITCHING_PROTOCOLS != status_code) && 3182 if ( (MHD_HTTP_SWITCHING_PROTOCOLS != status_code) &&
3182 (NULL != response->upgrade_handler) ) 3183 (NULL != response->upgrade_handler) )
3183 { 3184 {
@@ -3187,7 +3188,6 @@ MHD_queue_response (struct MHD_Connection *connection,
3187#endif 3188#endif
3188 return MHD_NO; 3189 return MHD_NO;
3189 } 3190 }
3190 daemon = connection->daemon;
3191 if ( (NULL != response->upgrade_handler) && 3191 if ( (NULL != response->upgrade_handler) &&
3192 (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && 3192 (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
3193 (0 == (daemon->options & MHD_USE_SUSPEND_RESUME)) ) 3193 (0 == (daemon->options & MHD_USE_SUSPEND_RESUME)) )
diff --git a/src/microhttpd/test_upgrade_common.c b/src/microhttpd/test_upgrade_common.c
index 14336345..5ec45ec9 100644
--- 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)
388 &es, 388 &es,
389 &max_fd)) 389 &max_fd))
390 abort (); 390 abort ();
391 MHD_get_timeout (daemon, 391 (void) MHD_get_timeout (daemon,
392 &to); 392 &to);
393 tv.tv_sec = to / 1000; 393 tv.tv_sec = to / 1000;
394 tv.tv_usec = 1000 * (to % 1000); 394 tv.tv_usec = 1000 * (to % 1000);
395 select (max_fd + 1, 395 if (0 > MHD_SYS_select_ (max_fd + 1,
396 &rs, 396 &rs,
397 &ws, 397 &ws,
398 &es, 398 &es,
399 &tv); 399 &tv))
400 abort ();
400 MHD_run_from_select (daemon, 401 MHD_run_from_select (daemon,
401 &rs, 402 &rs,
402 &ws, 403 &ws,
@@ -442,8 +443,8 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
442 to = 1000; 443 to = 1000;
443 444
444 FD_SET (ep, &rs); 445 FD_SET (ep, &rs);
445 MHD_get_timeout (daemon, 446 (void) MHD_get_timeout (daemon,
446 &to); 447 &to);
447 tv.tv_sec = to / 1000; 448 tv.tv_sec = to / 1000;
448 tv.tv_usec = 1000 * (to % 1000); 449 tv.tv_usec = 1000 * (to % 1000);
449 select (ep + 1, 450 select (ep + 1,