commit 58b3056ca8cecf0a7f3038d1db0333bee5cb7005
parent 57ab27681ef657ab91916c43c3e52b9cb1c07c0a
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 4 Sep 2016 15:51:15 +0000
-document better how to use MHD_resume_connection() with external event loop
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi
@@ -2238,6 +2238,12 @@ to resume a suspended connection at any time. Calling this function
on a connection that was not previously suspended will result in
undefined behavior.
+If you are using this function in ``external'' select mode, you must
+make sure to run @code{MHD_run} afterwards (before again calling
+@code{MHD_get_fdset}), as otherwise the change may not be reflected in
+the set returned by @code{MHD_get_fdset} and you may end up with a
+connection that is stuck until the next network activity.
+
You can check whether a connection is currently suspended using
@code{MHD_get_connection_info} by querying for
@code{MHD_CONNECTION_INFO_CONNECTION_SUSPENDED}.
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
@@ -1998,6 +1998,12 @@ MHD_suspend_connection (struct MHD_Connection *connection);
* function on a connection that was not previously suspended will
* result in undefined behavior.
*
+ * If you are using this function in ``external'' select mode, you must
+ * make sure to run #MHD_run() afterwards (before again calling
+ * #MHD_get_fdset(), as otherwise the change may not be reflected in
+ * the set returned by #MHD_get_fdset() and you may end up with a
+ * connection that is stuck until the next network activity.
+ *
* @param connection the connection to resume
*/
_MHD_EXTERN void