mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
-fix where we init daemon
This commit is contained in:
@@ -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)) )
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user