diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-15 13:31:36 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-15 13:31:36 +0100 |
commit | 925adb38895740003e6309d8170202fde1c337d1 (patch) | |
tree | 009c481a844163a357125fb6b3cb239e363c92b9 /src/microhttpd | |
parent | e5fd7e14da95d93568cba31aa5a756cf63505d3f (diff) | |
download | libmicrohttpd-925adb38895740003e6309d8170202fde1c337d1.tar.gz libmicrohttpd-925adb38895740003e6309d8170202fde1c337d1.zip |
convert clean_ready to 'bool'
Diffstat (limited to 'src/microhttpd')
-rw-r--r-- | src/microhttpd/daemon.c | 16 | ||||
-rw-r--r-- | src/microhttpd/internal.h | 12 | ||||
-rw-r--r-- | src/microhttpd/response.c | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 2c976a8d..d7692394 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1753,7 +1753,7 @@ thread_main_handle_connection (void *data) | |||
1753 | /* MHD_connection_finish_forward_() was called by thread_main_connection_upgrade(). */ | 1753 | /* MHD_connection_finish_forward_() was called by thread_main_connection_upgrade(). */ |
1754 | 1754 | ||
1755 | /* "Upgraded" data will not be used in this thread from this point. */ | 1755 | /* "Upgraded" data will not be used in this thread from this point. */ |
1756 | con->urh->clean_ready = MHD_YES; | 1756 | con->urh->clean_ready = true; |
1757 | /* If 'urh->was_closed' set to true, connection will be | 1757 | /* If 'urh->was_closed' set to true, connection will be |
1758 | * moved immediately to cleanup list. Otherwise connection | 1758 | * moved immediately to cleanup list. Otherwise connection |
1759 | * will stay in suspended list until 'urh' will be marked | 1759 | * will stay in suspended list until 'urh' will be marked |
@@ -2501,7 +2501,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
2501 | #ifdef UPGRADE_SUPPORT | 2501 | #ifdef UPGRADE_SUPPORT |
2502 | || ( (NULL != urh) && | 2502 | || ( (NULL != urh) && |
2503 | ( (! urh->was_closed) || | 2503 | ( (! urh->was_closed) || |
2504 | (MHD_NO == urh->clean_ready) ) ) | 2504 | (! urh->clean_ready) ) ) |
2505 | #endif /* UPGRADE_SUPPORT */ | 2505 | #endif /* UPGRADE_SUPPORT */ |
2506 | ) | 2506 | ) |
2507 | continue; | 2507 | continue; |
@@ -3079,7 +3079,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon, | |||
3079 | (0 == urh->out_buffer_used) ) | 3079 | (0 == urh->out_buffer_used) ) |
3080 | { | 3080 | { |
3081 | MHD_connection_finish_forward_ (urh->connection); | 3081 | MHD_connection_finish_forward_ (urh->connection); |
3082 | urh->clean_ready = MHD_YES; | 3082 | urh->clean_ready = true; |
3083 | /* Resuming will move connection to cleanup list. */ | 3083 | /* Resuming will move connection to cleanup list. */ |
3084 | MHD_resume_connection(urh->connection); | 3084 | MHD_resume_connection(urh->connection); |
3085 | } | 3085 | } |
@@ -3478,7 +3478,7 @@ MHD_poll_all (struct MHD_Daemon *daemon, | |||
3478 | /* MHD_connection_finish_forward_() will remove connection from | 3478 | /* MHD_connection_finish_forward_() will remove connection from |
3479 | * 'daemon->urh_head' list. */ | 3479 | * 'daemon->urh_head' list. */ |
3480 | MHD_connection_finish_forward_ (urh->connection); | 3480 | MHD_connection_finish_forward_ (urh->connection); |
3481 | urh->clean_ready = MHD_YES; | 3481 | urh->clean_ready = true; |
3482 | /* If 'urh->was_closed' set to true, connection will be | 3482 | /* If 'urh->was_closed' set to true, connection will be |
3483 | * moved immediately to cleanup list. Otherwise connection | 3483 | * moved immediately to cleanup list. Otherwise connection |
3484 | * will stay in suspended list until 'urh' will be marked | 3484 | * will stay in suspended list until 'urh' will be marked |
@@ -3660,7 +3660,7 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon) | |||
3660 | * one time for TLS data and one time for socketpair data. | 3660 | * one time for TLS data and one time for socketpair data. |
3661 | * If forwarding was finished on first time, second time must | 3661 | * If forwarding was finished on first time, second time must |
3662 | * be skipped as urh must not be used anymore. */ | 3662 | * be skipped as urh must not be used anymore. */ |
3663 | if (MHD_NO != urh->clean_ready) | 3663 | if (urh->clean_ready) |
3664 | continue; | 3664 | continue; |
3665 | 3665 | ||
3666 | /* Update our state based on what is ready according to epoll() */ | 3666 | /* Update our state based on what is ready according to epoll() */ |
@@ -3677,7 +3677,7 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon) | |||
3677 | (0 == urh->out_buffer_used) ) | 3677 | (0 == urh->out_buffer_used) ) |
3678 | { | 3678 | { |
3679 | MHD_connection_finish_forward_ (urh->connection); | 3679 | MHD_connection_finish_forward_ (urh->connection); |
3680 | urh->clean_ready = MHD_YES; | 3680 | urh->clean_ready = true; |
3681 | /* If 'urh->was_closed' set to true, connection will be | 3681 | /* If 'urh->was_closed' set to true, connection will be |
3682 | * moved immediately to cleanup list. Otherwise connection | 3682 | * moved immediately to cleanup list. Otherwise connection |
3683 | * will stay in suspended list until 'urh' will be marked | 3683 | * will stay in suspended list until 'urh' will be marked |
@@ -5606,7 +5606,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
5606 | with chance to detect that application is done. */ | 5606 | with chance to detect that application is done. */ |
5607 | process_urh (urh); | 5607 | process_urh (urh); |
5608 | MHD_connection_finish_forward_ (urh->connection); | 5608 | MHD_connection_finish_forward_ (urh->connection); |
5609 | urh->clean_ready = MHD_YES; | 5609 | urh->clean_ready = true; |
5610 | /* Resuming will move connection to cleanup list. */ | 5610 | /* Resuming will move connection to cleanup list. */ |
5611 | MHD_resume_connection(urh->connection); | 5611 | MHD_resume_connection(urh->connection); |
5612 | } | 5612 | } |
@@ -5637,7 +5637,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
5637 | #ifdef HTTPS_SUPPORT | 5637 | #ifdef HTTPS_SUPPORT |
5638 | else if (used_tls && | 5638 | else if (used_tls && |
5639 | used_thr_p_c && | 5639 | used_thr_p_c && |
5640 | (MHD_NO == susp->urh->clean_ready) ) | 5640 | (! susp->urh->clean_ready) ) |
5641 | shutdown (urh->app.socket, | 5641 | shutdown (urh->app.socket, |
5642 | SHUT_RDWR); /* Wake thread by shutdown of app socket. */ | 5642 | SHUT_RDWR); /* Wake thread by shutdown of app socket. */ |
5643 | #endif /* HTTPS_SUPPORT */ | 5643 | #endif /* HTTPS_SUPPORT */ |
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 48da46d3..c47ed06d 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -1098,27 +1098,27 @@ struct MHD_UpgradeResponseHandle | |||
1098 | volatile bool was_closed; | 1098 | volatile bool was_closed; |
1099 | 1099 | ||
1100 | /** | 1100 | /** |
1101 | * Set to #MHD_YES if connection is ready for cleanup. | 1101 | * Set to true if connection is ready for cleanup. |
1102 | * | 1102 | * |
1103 | * In TLS mode functions #MHD_connection_finish_forward_() must | 1103 | * In TLS mode functions #MHD_connection_finish_forward_() must |
1104 | * be called before setting this flag to #MHD_YES. | 1104 | * be called before setting this flag to true. |
1105 | * | 1105 | * |
1106 | * In thread-per-connection mode #MHD_YES in this flag means | 1106 | * In thread-per-connection mode, true in this flag means |
1107 | * that connection's thread exited or about to exit and will | 1107 | * that connection's thread exited or about to exit and will |
1108 | * not use MHD_Connection::urh data anymore. | 1108 | * not use MHD_Connection::urh data anymore. |
1109 | * | 1109 | * |
1110 | * In any mode #MHD_YES in this flag also means that | 1110 | * In any mode true in this flag also means that |
1111 | * MHD_Connection::urh data will not be used for socketpair | 1111 | * MHD_Connection::urh data will not be used for socketpair |
1112 | * forwarding and forwarding itself is finished. | 1112 | * forwarding and forwarding itself is finished. |
1113 | * | 1113 | * |
1114 | * When BOTH @e was_closed (changed by command from application) | 1114 | * When BOTH @e was_closed (changed by command from application) |
1115 | * AND @e clean_ready (changed internally by MHD) are set to | 1115 | * AND @e clean_ready (changed internally by MHD) are set to |
1116 | * #MHD_YES, function #MHD_resume_connection() will move this | 1116 | * true, function #MHD_resume_connection() will move this |
1117 | * connection to cleanup list. | 1117 | * connection to cleanup list. |
1118 | * @remark This flag could be changed from thread that process | 1118 | * @remark This flag could be changed from thread that process |
1119 | * connection's recv(), send() and response. | 1119 | * connection's recv(), send() and response. |
1120 | */ | 1120 | */ |
1121 | int clean_ready; | 1121 | bool clean_ready; |
1122 | }; | 1122 | }; |
1123 | #endif /* UPGRADE_SUPPORT */ | 1123 | #endif /* UPGRADE_SUPPORT */ |
1124 | 1124 | ||
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index d9055416..7b1a8074 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -912,10 +912,10 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
912 | urh->app.socket = MHD_INVALID_SOCKET; | 912 | urh->app.socket = MHD_INVALID_SOCKET; |
913 | urh->mhd.socket = MHD_INVALID_SOCKET; | 913 | urh->mhd.socket = MHD_INVALID_SOCKET; |
914 | /* Non-TLS connection do not hold any additional resources. */ | 914 | /* Non-TLS connection do not hold any additional resources. */ |
915 | urh->clean_ready = MHD_YES; | 915 | urh->clean_ready = true; |
916 | } | 916 | } |
917 | #else /* ! HTTPS_SUPPORT */ | 917 | #else /* ! HTTPS_SUPPORT */ |
918 | urh->clean_ready = MHD_YES; | 918 | urh->clean_ready = true; |
919 | #endif /* ! HTTPS_SUPPORT */ | 919 | #endif /* ! HTTPS_SUPPORT */ |
920 | connection->urh = urh; | 920 | connection->urh = urh; |
921 | /* As far as MHD's event loops are concerned, this connection is | 921 | /* As far as MHD's event loops are concerned, this connection is |