diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-23 19:07:38 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-24 15:51:28 +0300 |
commit | 3e15e43b1fa979a53eab353fa95dc2ed10fcb17c (patch) | |
tree | 00a972424386e99d5ac8ec95d6f8567844c1479e | |
parent | 0701ed2e8a521a55c3ce8c2137e360a71ec2db9b (diff) | |
download | libmicrohttpd-3e15e43b1fa979a53eab353fa95dc2ed10fcb17c.tar.gz libmicrohttpd-3e15e43b1fa979a53eab353fa95dc2ed10fcb17c.zip |
Added some remarks about functions' thread safety.
-rw-r--r-- | src/microhttpd/connection.c | 6 | ||||
-rw-r--r-- | src/microhttpd/connection.h | 4 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 2 | ||||
-rw-r--r-- | src/microhttpd/response.c | 3 | ||||
-rw-r--r-- | src/microhttpd/response.h | 6 |
5 files changed, 18 insertions, 3 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index e2271bba..bcc24705 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -492,6 +492,8 @@ need_100_continue (struct MHD_Connection *connection) | |||
492 | /** | 492 | /** |
493 | * Close the given connection and give the | 493 | * Close the given connection and give the |
494 | * specified termination code to the user. | 494 | * specified termination code to the user. |
495 | * @remark To be called only from thread that | ||
496 | * process connection's recv(), send() and response. | ||
495 | * | 497 | * |
496 | * @param connection connection to close | 498 | * @param connection connection to close |
497 | * @param termination_code termination reason to give | 499 | * @param termination_code termination reason to give |
@@ -2563,6 +2565,8 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2563 | /** | 2565 | /** |
2564 | * Clean up the state of the given connection and move it into the | 2566 | * Clean up the state of the given connection and move it into the |
2565 | * clean up queue for final disposal. | 2567 | * clean up queue for final disposal. |
2568 | * @remark To be called only from thread that process connection's | ||
2569 | * recv(), send() and response. | ||
2566 | * | 2570 | * |
2567 | * @param connection handle for the connection to clean up | 2571 | * @param connection handle for the connection to clean up |
2568 | */ | 2572 | */ |
@@ -2613,6 +2617,8 @@ cleanup_connection (struct MHD_Connection *connection) | |||
2613 | /** | 2617 | /** |
2614 | * This function was created to handle per-connection processing that | 2618 | * This function was created to handle per-connection processing that |
2615 | * has to happen even if the socket cannot be read or written to. | 2619 | * has to happen even if the socket cannot be read or written to. |
2620 | * @remark To be called only from thread that process connection's | ||
2621 | * recv(), send() and response. | ||
2616 | * | 2622 | * |
2617 | * @param connection connection to handle | 2623 | * @param connection connection to handle |
2618 | * @return #MHD_YES if we should continue to process the | 2624 | * @return #MHD_YES if we should continue to process the |
diff --git a/src/microhttpd/connection.h b/src/microhttpd/connection.h index 4067af78..0fce7346 100644 --- a/src/microhttpd/connection.h +++ b/src/microhttpd/connection.h | |||
@@ -72,6 +72,8 @@ MHD_connection_handle_write (struct MHD_Connection *connection); | |||
72 | * has to happen even if the socket cannot be read or written to. All | 72 | * has to happen even if the socket cannot be read or written to. All |
73 | * implementations (multithreaded, external select, internal select) | 73 | * implementations (multithreaded, external select, internal select) |
74 | * call this function. | 74 | * call this function. |
75 | * @remark To be called only from thread that process connection's | ||
76 | * recv(), send() and response. | ||
75 | * | 77 | * |
76 | * @param connection connection to handle | 78 | * @param connection connection to handle |
77 | * @return MHD_YES if we should continue to process the | 79 | * @return MHD_YES if we should continue to process the |
@@ -84,6 +86,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection); | |||
84 | /** | 86 | /** |
85 | * Close the given connection and give the | 87 | * Close the given connection and give the |
86 | * specified termination code to the user. | 88 | * specified termination code to the user. |
89 | * @remark To be called only from thread that | ||
90 | * process connection's recv(), send() and response. | ||
87 | * | 91 | * |
88 | * @param connection connection to close | 92 | * @param connection connection to close |
89 | * @param termination_code termination reason to give | 93 | * @param termination_code termination reason to give |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index b7d0e0e7..916542f4 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -3683,6 +3683,8 @@ MHD_run (struct MHD_Daemon *daemon) | |||
3683 | /** | 3683 | /** |
3684 | * Close the given connection, remove it from all of its | 3684 | * Close the given connection, remove it from all of its |
3685 | * DLLs and move it into the cleanup queue. | 3685 | * DLLs and move it into the cleanup queue. |
3686 | * @remark To be called only from thread that | ||
3687 | * process daemon's select()/poll()/etc. | ||
3686 | * | 3688 | * |
3687 | * @param pos connection to move to cleanup | 3689 | * @param pos connection to move to cleanup |
3688 | */ | 3690 | */ |
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index d0c72238..97b131cd 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -698,6 +698,9 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, | |||
698 | * We are done sending the header of a given response to the client. | 698 | * We are done sending the header of a given response to the client. |
699 | * Now it is time to perform the upgrade and hand over the connection | 699 | * Now it is time to perform the upgrade and hand over the connection |
700 | * to the application. | 700 | * to the application. |
701 | * @remark To be called only from thread that process connection's | ||
702 | * recv(), send() and response. Must be called right after sending | ||
703 | * response headers. | ||
701 | * | 704 | * |
702 | * @param response the response that was created for an upgrade | 705 | * @param response the response that was created for an upgrade |
703 | * @param connection the specific connection we are upgrading | 706 | * @param connection the specific connection we are upgrading |
diff --git a/src/microhttpd/response.h b/src/microhttpd/response.h index ce7e131c..3f4717de 100644 --- a/src/microhttpd/response.h +++ b/src/microhttpd/response.h | |||
@@ -40,15 +40,15 @@ MHD_increment_response_rc (struct MHD_Response *response); | |||
40 | * We are done sending the header of a given response | 40 | * We are done sending the header of a given response |
41 | * to the client. Now it is time to perform the upgrade | 41 | * to the client. Now it is time to perform the upgrade |
42 | * and hand over the connection to the application. | 42 | * and hand over the connection to the application. |
43 | * @remark To be called only from thread that process connection's | ||
44 | * recv(), send() and response. Must be called right after sending | ||
45 | * response headers. | ||
43 | * | 46 | * |
44 | * @param response the response that was created for an upgrade | 47 | * @param response the response that was created for an upgrade |
45 | * @param connection the specific connection we are upgrading | 48 | * @param connection the specific connection we are upgrading |
46 | * @return #MHD_YES on success, #MHD_NO on failure (will cause | 49 | * @return #MHD_YES on success, #MHD_NO on failure (will cause |
47 | * connection to be closed) | 50 | * connection to be closed) |
48 | */ | 51 | */ |
49 | // FIXME: This function will need to be called at the right place(s) | ||
50 | // in the connection processing (just after we are done sending the header) | ||
51 | // (for responses that have the 'upgrade_header' callback set). | ||
52 | int | 52 | int |
53 | MHD_response_execute_upgrade_ (struct MHD_Response *response, | 53 | MHD_response_execute_upgrade_ (struct MHD_Response *response, |
54 | struct MHD_Connection *connection); | 54 | struct MHD_Connection *connection); |