Преглед изворни кода

-document better how to use MHD_resume_connection() with external event loop

Christian Grothoff пре 9 година
родитељ
комит
58b3056ca8
2 измењених фајлова са 12 додато и 0 уклоњено
  1. 6 0
      doc/libmicrohttpd.texi
  2. 6 0
      src/include/microhttpd.h

+ 6 - 0
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}.

+ 6 - 0
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