diff options
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r-- | src/microhttpd/daemon.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index a298a1a4..62cd3ce8 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -659,19 +659,19 @@ urh_to_fdset (struct MHD_UpgradeResponseHandle *urh, | |||
659 | max_fd, | 659 | max_fd, |
660 | fd_setsize)) ) | 660 | fd_setsize)) ) |
661 | return MHD_NO; | 661 | return MHD_NO; |
662 | if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->mhd.celi)) && | 662 | if ( (0 == (MHD_EPOLL_STATE_WRITE_READY & urh->mhd.celi)) && |
663 | (! MHD_add_to_fd_set_ (urh->mhd.socket, | 663 | (! MHD_add_to_fd_set_ (urh->mhd.socket, |
664 | ws, | 664 | ws, |
665 | max_fd, | 665 | max_fd, |
666 | fd_setsize)) ) | 666 | fd_setsize)) ) |
667 | return MHD_NO; | 667 | return MHD_NO; |
668 | if ( (0 != (MHD_EPOLL_STATE_READ_READY & urh->app.celi)) && | 668 | if ( (0 == (MHD_EPOLL_STATE_READ_READY & urh->app.celi)) && |
669 | (! MHD_add_to_fd_set_ (urh->connection->socket_fd, | 669 | (! MHD_add_to_fd_set_ (urh->connection->socket_fd, |
670 | rs, | 670 | rs, |
671 | max_fd, | 671 | max_fd, |
672 | fd_setsize)) ) | 672 | fd_setsize)) ) |
673 | return MHD_NO; | 673 | return MHD_NO; |
674 | if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->app.celi)) && | 674 | if ( (0 == (MHD_EPOLL_STATE_WRITE_READY & urh->app.celi)) && |
675 | (! MHD_add_to_fd_set_ (urh->connection->socket_fd, | 675 | (! MHD_add_to_fd_set_ (urh->connection->socket_fd, |
676 | ws, | 676 | ws, |
677 | max_fd, | 677 | max_fd, |
@@ -2639,10 +2639,17 @@ MHD_select (struct MHD_Daemon *daemon, | |||
2639 | may_block = MHD_NO; | 2639 | may_block = MHD_NO; |
2640 | 2640 | ||
2641 | /* single-threaded, go over everything */ | 2641 | /* single-threaded, go over everything */ |
2642 | if (MHD_NO == MHD_get_fdset2 (daemon, &rs, &ws, &es, &maxsock, FD_SETSIZE)) | 2642 | if (MHD_NO == |
2643 | MHD_get_fdset2 (daemon, | ||
2644 | &rs, | ||
2645 | &ws, | ||
2646 | &es, | ||
2647 | &maxsock, | ||
2648 | FD_SETSIZE)) | ||
2643 | { | 2649 | { |
2644 | #ifdef HAVE_MESSAGES | 2650 | #ifdef HAVE_MESSAGES |
2645 | MHD_DLOG (daemon, "Could not obtain daemon fdsets"); | 2651 | MHD_DLOG (daemon, |
2652 | "Could not obtain daemon fdsets"); | ||
2646 | #endif | 2653 | #endif |
2647 | err_state = MHD_YES; | 2654 | err_state = MHD_YES; |
2648 | } | 2655 | } |
@@ -2657,7 +2664,8 @@ MHD_select (struct MHD_Daemon *daemon, | |||
2657 | FD_SETSIZE)) ) | 2664 | FD_SETSIZE)) ) |
2658 | { | 2665 | { |
2659 | #ifdef HAVE_MESSAGES | 2666 | #ifdef HAVE_MESSAGES |
2660 | MHD_DLOG (daemon, "Could not add listen socket to fdset"); | 2667 | MHD_DLOG (daemon, |
2668 | "Could not add listen socket to fdset"); | ||
2661 | #endif | 2669 | #endif |
2662 | return MHD_NO; | 2670 | return MHD_NO; |
2663 | } | 2671 | } |
@@ -2726,7 +2734,11 @@ MHD_select (struct MHD_Daemon *daemon, | |||
2726 | timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE)(ltimeout / 1000); | 2734 | timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE)(ltimeout / 1000); |
2727 | tv = &timeout; | 2735 | tv = &timeout; |
2728 | } | 2736 | } |
2729 | num_ready = MHD_SYS_select_ (maxsock + 1, &rs, &ws, &es, tv); | 2737 | num_ready = MHD_SYS_select_ (maxsock + 1, |
2738 | &rs, | ||
2739 | &ws, | ||
2740 | &es, | ||
2741 | tv); | ||
2730 | if (MHD_YES == daemon->shutdown) | 2742 | if (MHD_YES == daemon->shutdown) |
2731 | return MHD_NO; | 2743 | return MHD_NO; |
2732 | if (num_ready < 0) | 2744 | if (num_ready < 0) |