-fix where we init daemon

This commit is contained in:
Christian Grothoff
2016-09-04 16:43:28 +00:00
parent 6daee74663
commit eea55aeb1d
2 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -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)) )
+10 -9
View File
@@ -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,