瀏覽代碼

Added more comments for start upgrade callback function.

Evgeny Grin (Karlson2k) 8 年之前
父節點
當前提交
64b53a4e7c
共有 2 個文件被更改,包括 11 次插入0 次删除
  1. 8 0
      src/examples/upgrade_example.c
  2. 3 0
      src/include/microhttpd.h

+ 8 - 0
src/examples/upgrade_example.c

@@ -158,6 +158,9 @@ run_usock (void *cls)
  * but instead use #MHD_upgrade_action() for special operations
  * on @a sock.
  *
+ * Data forwarding to "upgraded" @a sock will be started as soon
+ * as this function return.
+ *
  * Except when in 'thread-per-connection' mode, implementations
  * of this function should never block (as it will still be called
  * from within the main event loop).
@@ -225,6 +228,11 @@ uh_cb (void *cls,
      a clean shutdown, as the we stop the daemon even if a worker thread
      is still running. Alas, this is a simple example... */
   pthread_detach (pt);
+
+  /* This callback must return as soon as possible. */
+
+  /* Data forwarding to "upgraded" socket will be started
+   * after return from this callback. */
 }
 
 

+ 3 - 0
src/include/microhttpd.h

@@ -2840,6 +2840,9 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
  * but instead use #MHD_upgrade_action() for special operations
  * on @a sock.
  *
+ * Data forwarding to "upgraded" @a sock will be started as soon
+ * as this function return.
+ *
  * Except when in 'thread-per-connection' mode, implementations
  * of this function should never block (as it will still be called
  * from within the main event loop).