diff options
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r-- | src/include/microhttpd.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index f8210d9b..3f47e2f0 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -2227,6 +2227,8 @@ MHD_add_connection (struct MHD_Daemon *daemon, | |||
2227 | * use external select with @code{select()} or with @code{epoll()}. | 2227 | * use external select with @code{select()} or with @code{epoll()}. |
2228 | * In the latter case, it will only add the single @code{epoll()} file | 2228 | * In the latter case, it will only add the single @code{epoll()} file |
2229 | * descriptor used by MHD to the sets. | 2229 | * descriptor used by MHD to the sets. |
2230 | * It's necessary to use #MHD_get_timeout() in combination with | ||
2231 | * this function. | ||
2230 | * | 2232 | * |
2231 | * This function must be called only for daemon started | 2233 | * This function must be called only for daemon started |
2232 | * without #MHD_USE_INTERNAL_POLLING_THREAD flag. | 2234 | * without #MHD_USE_INTERNAL_POLLING_THREAD flag. |
@@ -2264,6 +2266,8 @@ MHD_get_fdset (struct MHD_Daemon *daemon, | |||
2264 | * use external select with @code{select()} or with @code{epoll()}. | 2266 | * use external select with @code{select()} or with @code{epoll()}. |
2265 | * In the latter case, it will only add the single @code{epoll()} file | 2267 | * In the latter case, it will only add the single @code{epoll()} file |
2266 | * descriptor used by MHD to the sets. | 2268 | * descriptor used by MHD to the sets. |
2269 | * It's necessary to use #MHD_get_timeout() in combination with | ||
2270 | * this function. | ||
2267 | * | 2271 | * |
2268 | * This function must be called only for daemon started | 2272 | * This function must be called only for daemon started |
2269 | * without #MHD_USE_INTERNAL_POLLING_THREAD flag. | 2273 | * without #MHD_USE_INTERNAL_POLLING_THREAD flag. |
@@ -2296,6 +2300,8 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon, | |||
2296 | * daemon FDs in fd_sets, call FD_ZERO for each fd_set | 2300 | * daemon FDs in fd_sets, call FD_ZERO for each fd_set |
2297 | * before calling this function. Size of fd_set is | 2301 | * before calling this function. Size of fd_set is |
2298 | * determined by current value of FD_SETSIZE. | 2302 | * determined by current value of FD_SETSIZE. |
2303 | * It's necessary to use #MHD_get_timeout() in combination with | ||
2304 | * this function. | ||
2299 | * | 2305 | * |
2300 | * This function could be called only for daemon started | 2306 | * This function could be called only for daemon started |
2301 | * without #MHD_USE_INTERNAL_POLLING_THREAD flag. | 2307 | * without #MHD_USE_INTERNAL_POLLING_THREAD flag. |
@@ -2317,17 +2323,21 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon, | |||
2317 | 2323 | ||
2318 | 2324 | ||
2319 | /** | 2325 | /** |
2320 | * Obtain timeout value for `select()` for this daemon (only needed if | 2326 | * Obtain timeout value for polling function for this daemon. |
2321 | * connection timeout is used). The returned value is how many milliseconds | 2327 | * This function set value to amount of milliseconds for which polling |
2322 | * `select()` or `poll()` should at most block, not the timeout value set for | 2328 | * function (`select()` or `poll()`) should at most block, not the |
2323 | * connections. This function MUST NOT be called if MHD is running with | 2329 | * timeout value set for connections. |
2324 | * #MHD_USE_THREAD_PER_CONNECTION. | 2330 | * It is important to always use this function, even if connection |
2331 | * timeout is not set, as in some cases MHD may already have more | ||
2332 | * data to process on next turn (data pending in TLS buffers, | ||
2333 | * connections are already ready with epoll etc.) and returned timeout | ||
2334 | * will be zero. | ||
2325 | * | 2335 | * |
2326 | * @param daemon daemon to query for timeout | 2336 | * @param daemon daemon to query for timeout |
2327 | * @param timeout set to the timeout (in milliseconds) | 2337 | * @param timeout set to the timeout (in milliseconds) |
2328 | * @return #MHD_YES on success, #MHD_NO if timeouts are | 2338 | * @return #MHD_YES on success, #MHD_NO if timeouts are |
2329 | * not used (or no connections exist that would | 2339 | * not used (or no connections exist that would |
2330 | * necessiate the use of a timeout right now). | 2340 | * necessitate the use of a timeout right now). |
2331 | * @ingroup event | 2341 | * @ingroup event |
2332 | */ | 2342 | */ |
2333 | _MHD_EXTERN int | 2343 | _MHD_EXTERN int |
@@ -2338,7 +2348,8 @@ MHD_get_timeout (struct MHD_Daemon *daemon, | |||
2338 | /** | 2348 | /** |
2339 | * Run webserver operations (without blocking unless in client | 2349 | * Run webserver operations (without blocking unless in client |
2340 | * callbacks). This method should be called by clients in combination | 2350 | * callbacks). This method should be called by clients in combination |
2341 | * with #MHD_get_fdset if the client-controlled select method is used. | 2351 | * with #MHD_get_fdset if the client-controlled select method is used and |
2352 | * #MHD_get_timeout(). | ||
2342 | * | 2353 | * |
2343 | * This function is a convenience method, which is useful if the | 2354 | * This function is a convenience method, which is useful if the |
2344 | * fd_sets from #MHD_get_fdset were not directly passed to `select()`; | 2355 | * fd_sets from #MHD_get_fdset were not directly passed to `select()`; |
@@ -2360,8 +2371,8 @@ MHD_run (struct MHD_Daemon *daemon); | |||
2360 | 2371 | ||
2361 | /** | 2372 | /** |
2362 | * Run webserver operations. This method should be called by clients | 2373 | * Run webserver operations. This method should be called by clients |
2363 | * in combination with #MHD_get_fdset if the client-controlled select | 2374 | * in combination with #MHD_get_fdset and #MHD_get_timeout() if the |
2364 | * method is used. | 2375 | * client-controlled select method is used. |
2365 | * | 2376 | * |
2366 | * You can use this function instead of #MHD_run if you called | 2377 | * You can use this function instead of #MHD_run if you called |
2367 | * `select()` on the result from #MHD_get_fdset. File descriptors in | 2378 | * `select()` on the result from #MHD_get_fdset. File descriptors in |