diff options
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r-- | src/microhttpd/daemon.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 6f09b845..97fcc813 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -686,7 +686,7 @@ urh_to_fdset (struct MHD_UpgradeResponseHandle *urh, | |||
686 | fd_setsize)) ) | 686 | fd_setsize)) ) |
687 | return MHD_NO; | 687 | return MHD_NO; |
688 | if ( (0 != urh->in_buffer_used) && | 688 | if ( (0 != urh->in_buffer_used) && |
689 | (MHD_NO == urh->was_closed) && | 689 | (! urh->was_closed) && |
690 | (MHD_INVALID_SOCKET != urh->mhd.socket) && | 690 | (MHD_INVALID_SOCKET != urh->mhd.socket) && |
691 | (! MHD_add_to_fd_set_ (urh->mhd.socket, | 691 | (! MHD_add_to_fd_set_ (urh->mhd.socket, |
692 | ws, | 692 | ws, |
@@ -694,7 +694,7 @@ urh_to_fdset (struct MHD_UpgradeResponseHandle *urh, | |||
694 | fd_setsize)) ) | 694 | fd_setsize)) ) |
695 | return MHD_NO; | 695 | return MHD_NO; |
696 | if ( (urh->in_buffer_used < urh->in_buffer_size) && | 696 | if ( (urh->in_buffer_used < urh->in_buffer_size) && |
697 | (MHD_NO == urh->was_closed) && | 697 | (! urh->was_closed) && |
698 | (MHD_INVALID_SOCKET != urh->connection->socket_fd) && | 698 | (MHD_INVALID_SOCKET != urh->connection->socket_fd) && |
699 | (! MHD_add_to_fd_set_ (urh->connection->socket_fd, | 699 | (! MHD_add_to_fd_set_ (urh->connection->socket_fd, |
700 | rs, | 700 | rs, |
@@ -985,15 +985,15 @@ process_urh (struct MHD_UpgradeResponseHandle *urh) | |||
985 | { | 985 | { |
986 | /* Daemon shutting down, application will not receive any more data. */ | 986 | /* Daemon shutting down, application will not receive any more data. */ |
987 | #ifdef HAVE_MESSAGES | 987 | #ifdef HAVE_MESSAGES |
988 | if (MHD_NO == urh->was_closed) | 988 | if (! urh->was_closed) |
989 | { | 989 | { |
990 | MHD_DLOG (urh->connection->daemon, | 990 | MHD_DLOG (urh->connection->daemon, |
991 | _("Initiated daemon shutdown while \"upgraded\" connection was not closed.\n")); | 991 | _("Initiated daemon shutdown while \"upgraded\" connection was not closed.\n")); |
992 | } | 992 | } |
993 | #endif | 993 | #endif |
994 | urh->was_closed = MHD_YES; | 994 | urh->was_closed = true; |
995 | } | 995 | } |
996 | if (MHD_NO != urh->was_closed) | 996 | if (urh->was_closed) |
997 | { | 997 | { |
998 | /* Application was closed connections: no more data | 998 | /* Application was closed connections: no more data |
999 | * can be forwarded to application socket. */ | 999 | * can be forwarded to application socket. */ |
@@ -1111,8 +1111,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh) | |||
1111 | } | 1111 | } |
1112 | 1112 | ||
1113 | /* handle reading from application and writing to HTTPS client */ | 1113 | /* handle reading from application and writing to HTTPS client */ |
1114 | if ( ((0 != (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) || | 1114 | if ( ( (0 != (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) || |
1115 | (MHD_NO != urh->was_closed)) && | 1115 | (urh->was_closed) ) && |
1116 | (urh->out_buffer_used < urh->out_buffer_size) ) | 1116 | (urh->out_buffer_used < urh->out_buffer_size) ) |
1117 | { | 1117 | { |
1118 | /* If application signaled MHD about socket closure then | 1118 | /* If application signaled MHD about socket closure then |
@@ -1132,7 +1132,7 @@ process_urh (struct MHD_UpgradeResponseHandle *urh) | |||
1132 | buf_size); | 1132 | buf_size); |
1133 | if (-1 == res) | 1133 | if (-1 == res) |
1134 | { | 1134 | { |
1135 | if (MHD_NO != urh->was_closed) | 1135 | if (urh->was_closed) |
1136 | { | 1136 | { |
1137 | /* Connection was shut down or all data received and | 1137 | /* Connection was shut down or all data received and |
1138 | * application will not forward any more data. */ | 1138 | * application will not forward any more data. */ |
@@ -1751,7 +1751,7 @@ thread_main_handle_connection (void *data) | |||
1751 | 1751 | ||
1752 | /* "Upgraded" data will not be used in this thread from this point. */ | 1752 | /* "Upgraded" data will not be used in this thread from this point. */ |
1753 | con->urh->clean_ready = MHD_YES; | 1753 | con->urh->clean_ready = MHD_YES; |
1754 | /* If 'urh->was_closed' set to MHD_YES, connection will be | 1754 | /* If 'urh->was_closed' set to true, connection will be |
1755 | * moved immediately to cleanup list. Otherwise connection | 1755 | * moved immediately to cleanup list. Otherwise connection |
1756 | * will stay in suspended list until 'urh' will be marked | 1756 | * will stay in suspended list until 'urh' will be marked |
1757 | * with 'was_closed' by application. */ | 1757 | * with 'was_closed' by application. */ |
@@ -2496,7 +2496,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
2496 | if ( (! pos->resuming) | 2496 | if ( (! pos->resuming) |
2497 | #ifdef UPGRADE_SUPPORT | 2497 | #ifdef UPGRADE_SUPPORT |
2498 | || ( (NULL != urh) && | 2498 | || ( (NULL != urh) && |
2499 | ( (MHD_NO == urh->was_closed) || | 2499 | ( (! urh->was_closed) || |
2500 | (MHD_NO == urh->clean_ready) ) ) | 2500 | (MHD_NO == urh->clean_ready) ) ) |
2501 | #endif /* UPGRADE_SUPPORT */ | 2501 | #endif /* UPGRADE_SUPPORT */ |
2502 | ) | 2502 | ) |
@@ -3468,7 +3468,7 @@ MHD_poll_all (struct MHD_Daemon *daemon, | |||
3468 | * 'daemon->urh_head' list. */ | 3468 | * 'daemon->urh_head' list. */ |
3469 | MHD_connection_finish_forward_ (urh->connection); | 3469 | MHD_connection_finish_forward_ (urh->connection); |
3470 | urh->clean_ready = MHD_YES; | 3470 | urh->clean_ready = MHD_YES; |
3471 | /* If 'urh->was_closed' set to MHD_YES, connection will be | 3471 | /* If 'urh->was_closed' set to true, connection will be |
3472 | * moved immediately to cleanup list. Otherwise connection | 3472 | * moved immediately to cleanup list. Otherwise connection |
3473 | * will stay in suspended list until 'urh' will be marked | 3473 | * will stay in suspended list until 'urh' will be marked |
3474 | * with 'was_closed' by application. */ | 3474 | * with 'was_closed' by application. */ |
@@ -3664,7 +3664,7 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon) | |||
3664 | { | 3664 | { |
3665 | MHD_connection_finish_forward_ (urh->connection); | 3665 | MHD_connection_finish_forward_ (urh->connection); |
3666 | urh->clean_ready = MHD_YES; | 3666 | urh->clean_ready = MHD_YES; |
3667 | /* If 'urh->was_closed' set to MHD_YES, connection will be | 3667 | /* If 'urh->was_closed' set to true, connection will be |
3668 | * moved immediately to cleanup list. Otherwise connection | 3668 | * moved immediately to cleanup list. Otherwise connection |
3669 | * will stay in suspended list until 'urh' will be marked | 3669 | * will stay in suspended list until 'urh' will be marked |
3670 | * with 'was_closed' by application. */ | 3670 | * with 'was_closed' by application. */ |
@@ -5618,11 +5618,11 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
5618 | else | 5618 | else |
5619 | { | 5619 | { |
5620 | #ifdef HAVE_MESSAGES | 5620 | #ifdef HAVE_MESSAGES |
5621 | if (MHD_NO == susp->urh->was_closed) | 5621 | if (! susp->urh->was_closed) |
5622 | MHD_DLOG (daemon, | 5622 | MHD_DLOG (daemon, |
5623 | _("Initiated daemon shutdown while \"upgraded\" connection was not closed.\n")); | 5623 | _("Initiated daemon shutdown while \"upgraded\" connection was not closed.\n")); |
5624 | #endif | 5624 | #endif |
5625 | susp->urh->was_closed = MHD_YES; | 5625 | susp->urh->was_closed = true; |
5626 | /* If thread-per-connection is used, connection's thread | 5626 | /* If thread-per-connection is used, connection's thread |
5627 | * may still processing "upgrade" (exiting). */ | 5627 | * may still processing "upgrade" (exiting). */ |
5628 | if (! used_thr_p_c) | 5628 | if (! used_thr_p_c) |