aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 95e6d4c4..0aa0f8aa 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -787,7 +787,7 @@ MHD_handle_connection (void *data)
787 int num_ready; 787 int num_ready;
788 fd_set rs; 788 fd_set rs;
789 fd_set ws; 789 fd_set ws;
790 MHD_socket max; 790 MHD_socket maxsock;
791 struct timeval tv; 791 struct timeval tv;
792 struct timeval *tvp; 792 struct timeval *tvp;
793 unsigned int timeout; 793 unsigned int timeout;
@@ -846,27 +846,27 @@ MHD_handle_connection (void *data)
846 int err_state = 0; 846 int err_state = 0;
847 FD_ZERO (&rs); 847 FD_ZERO (&rs);
848 FD_ZERO (&ws); 848 FD_ZERO (&ws);
849 max = 0; 849 maxsock = MHD_INVALID_SOCKET;
850 switch (con->event_loop_info) 850 switch (con->event_loop_info)
851 { 851 {
852 case MHD_EVENT_LOOP_INFO_READ: 852 case MHD_EVENT_LOOP_INFO_READ:
853 if (MHD_YES != 853 if (MHD_YES !=
854 add_to_fd_set (con->socket_fd, &rs, &max, FD_SETSIZE)) 854 add_to_fd_set (con->socket_fd, &rs, &maxsock, FD_SETSIZE))
855 err_state = 1; 855 err_state = 1;
856 break; 856 break;
857 case MHD_EVENT_LOOP_INFO_WRITE: 857 case MHD_EVENT_LOOP_INFO_WRITE:
858 if (MHD_YES != 858 if (MHD_YES !=
859 add_to_fd_set (con->socket_fd, &ws, &max, FD_SETSIZE)) 859 add_to_fd_set (con->socket_fd, &ws, &maxsock, FD_SETSIZE))
860 err_state = 1; 860 err_state = 1;
861 if ( (con->read_buffer_size > con->read_buffer_offset) && 861 if ( (con->read_buffer_size > con->read_buffer_offset) &&
862 (MHD_YES != 862 (MHD_YES !=
863 add_to_fd_set (con->socket_fd, &rs, &max, FD_SETSIZE)) ) 863 add_to_fd_set (con->socket_fd, &rs, &maxsock, FD_SETSIZE)) )
864 err_state = 1; 864 err_state = 1;
865 break; 865 break;
866 case MHD_EVENT_LOOP_INFO_BLOCK: 866 case MHD_EVENT_LOOP_INFO_BLOCK:
867 if ( (con->read_buffer_size > con->read_buffer_offset) && 867 if ( (con->read_buffer_size > con->read_buffer_offset) &&
868 (MHD_YES != 868 (MHD_YES !=
869 add_to_fd_set (con->socket_fd, &rs, &max, FD_SETSIZE)) ) 869 add_to_fd_set (con->socket_fd, &rs, &maxsock, FD_SETSIZE)) )
870 err_state = 1; 870 err_state = 1;
871 tv.tv_sec = 0; 871 tv.tv_sec = 0;
872 tv.tv_usec = 0; 872 tv.tv_usec = 0;
@@ -880,7 +880,7 @@ MHD_handle_connection (void *data)
880 if (MHD_INVALID_PIPE_ != spipe) 880 if (MHD_INVALID_PIPE_ != spipe)
881 { 881 {
882 if (MHD_YES != 882 if (MHD_YES !=
883 add_to_fd_set (spipe, &rs, &max, FD_SETSIZE)) 883 add_to_fd_set (spipe, &rs, &maxsock, FD_SETSIZE))
884 err_state = 1; 884 err_state = 1;
885 } 885 }
886#endif 886#endif
@@ -893,7 +893,7 @@ MHD_handle_connection (void *data)
893 goto exit; 893 goto exit;
894 } 894 }
895 895
896 num_ready = MHD_SYS_select_ (max + 1, &rs, &ws, NULL, tvp); 896 num_ready = MHD_SYS_select_ (maxsock + 1, &rs, &ws, NULL, tvp);
897 if (num_ready < 0) 897 if (num_ready < 0)
898 { 898 {
899 if (EINTR == MHD_socket_errno_) 899 if (EINTR == MHD_socket_errno_)
@@ -2318,7 +2318,7 @@ MHD_select (struct MHD_Daemon *daemon,
2318 fd_set rs; 2318 fd_set rs;
2319 fd_set ws; 2319 fd_set ws;
2320 fd_set es; 2320 fd_set es;
2321 MHD_socket max; 2321 MHD_socket maxsock;
2322 struct timeval timeout; 2322 struct timeval timeout;
2323 struct timeval *tv; 2323 struct timeval *tv;
2324 MHD_UNSIGNED_LONG_LONG ltimeout; 2324 MHD_UNSIGNED_LONG_LONG ltimeout;
@@ -2330,7 +2330,7 @@ MHD_select (struct MHD_Daemon *daemon,
2330 FD_ZERO (&rs); 2330 FD_ZERO (&rs);
2331 FD_ZERO (&ws); 2331 FD_ZERO (&ws);
2332 FD_ZERO (&es); 2332 FD_ZERO (&es);
2333 max = MHD_INVALID_SOCKET; 2333 maxsock = MHD_INVALID_SOCKET;
2334 if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) 2334 if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
2335 { 2335 {
2336 if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) && 2336 if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) &&
@@ -2338,7 +2338,7 @@ MHD_select (struct MHD_Daemon *daemon,
2338 may_block = MHD_NO; 2338 may_block = MHD_NO;
2339 2339
2340 /* single-threaded, go over everything */ 2340 /* single-threaded, go over everything */
2341 if (MHD_NO == MHD_get_fdset2 (daemon, &rs, &ws, &es, &max, FD_SETSIZE)) 2341 if (MHD_NO == MHD_get_fdset2 (daemon, &rs, &ws, &es, &maxsock, FD_SETSIZE))
2342 { 2342 {
2343#if HAVE_MESSAGES 2343#if HAVE_MESSAGES
2344 MHD_DLOG (daemon, "Could not obtain daemon fdsets"); 2344 MHD_DLOG (daemon, "Could not obtain daemon fdsets");
@@ -2362,7 +2362,7 @@ MHD_select (struct MHD_Daemon *daemon,
2362 if ( (MHD_INVALID_SOCKET != daemon->socket_fd) && 2362 if ( (MHD_INVALID_SOCKET != daemon->socket_fd) &&
2363 (MHD_YES != add_to_fd_set (daemon->socket_fd, 2363 (MHD_YES != add_to_fd_set (daemon->socket_fd,
2364 &rs, 2364 &rs,
2365 &max, 2365 &maxsock,
2366 FD_SETSIZE)) ) 2366 FD_SETSIZE)) )
2367 { 2367 {
2368#if HAVE_MESSAGES 2368#if HAVE_MESSAGES
@@ -2374,7 +2374,7 @@ MHD_select (struct MHD_Daemon *daemon,
2374 if ( (MHD_INVALID_PIPE_ != daemon->wpipe[0]) && 2374 if ( (MHD_INVALID_PIPE_ != daemon->wpipe[0]) &&
2375 (MHD_YES != add_to_fd_set (daemon->wpipe[0], 2375 (MHD_YES != add_to_fd_set (daemon->wpipe[0],
2376 &rs, 2376 &rs,
2377 &max, 2377 &maxsock,
2378 FD_SETSIZE)) ) 2378 FD_SETSIZE)) )
2379 { 2379 {
2380#if defined(MHD_WINSOCK_SOCKETS) 2380#if defined(MHD_WINSOCK_SOCKETS)
@@ -2386,7 +2386,7 @@ MHD_select (struct MHD_Daemon *daemon,
2386 FD_CLR (daemon->socket_fd, &rs); 2386 FD_CLR (daemon->socket_fd, &rs);
2387 if (MHD_YES != add_to_fd_set (daemon->wpipe[0], 2387 if (MHD_YES != add_to_fd_set (daemon->wpipe[0],
2388 &rs, 2388 &rs,
2389 &max, 2389 &maxsock,
2390 FD_SETSIZE)) 2390 FD_SETSIZE))
2391 { 2391 {
2392#endif /* MHD_WINSOCK_SOCKETS */ 2392#endif /* MHD_WINSOCK_SOCKETS */