libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 64b53a4e7c904a7dd9ce03e38bae75edd06902b5
parent e264d9ec9ef98e6f26f5f547ec941927a35ffa56
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Mon, 15 May 2017 20:06:09 +0300

Added more comments for start upgrade callback function.

Diffstat:
Msrc/examples/upgrade_example.c | 8++++++++
Msrc/include/microhttpd.h | 3+++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/examples/upgrade_example.c b/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. */ } diff --git a/src/include/microhttpd.h b/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).