From d14fc3b3d7e4b3a55e85bab2bd2d9895d0543933 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Wed, 27 Apr 2022 22:24:23 +0300 Subject: [PATCH] MHD_get_timeout*(): improved doxy --- src/include/microhttpd.h | 23 +++++++++++++---------- src/microhttpd/daemon.c | 35 +++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 023a44ad..0563e907 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h @@ -2902,10 +2902,11 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon, * return #MHD_YES will break MHD processing logic and result in "hung" * connections with data pending in network buffers and other problems. * - * It is important to always use this function when "external" polling is - * used. If this function returns #MHD_YES then #MHD_run() (or - * #MHD_run_from_select()) must be called right after return from polling - * function, regardless of the states of MHD fds. + * It is important to always use this function (or #MHD_get_timeout64(), + * #MHD_get_timeout64s() functions) when "external" polling is used. + * If this function returns #MHD_YES then #MHD_run() (or #MHD_run_from_select()) + * must be called right after return from polling function, regardless of + * the states of MHD FDs. * * In practice, if #MHD_YES is returned then #MHD_run() (or * #MHD_run_from_select()) must be called not later than @a timeout @@ -2937,10 +2938,11 @@ MHD_get_timeout (struct MHD_Daemon *daemon, * return #MHD_YES will break MHD processing logic and result in "hung" * connections with data pending in network buffers and other problems. * - * It is important to always use this function when "external" polling is - * used. If this function returns #MHD_YES then #MHD_run() (or - * #MHD_run_from_select()) must be called right after return from polling - * function, regardless of the states of MHD fds. + * It is important to always use this function (or #MHD_get_timeout(), + * #MHD_get_timeout64s() functions) when "external" polling is used. + * If this function returns #MHD_YES then #MHD_run() (or #MHD_run_from_select()) + * must be called right after return from polling function, regardless of + * the states of MHD FDs. * * In practice, if #MHD_YES is returned then #MHD_run() (or * #MHD_run_from_select()) must be called not later than @a timeout @@ -2975,8 +2977,9 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon, * processing logic and result in "hung" connections with data pending in * network buffers and other problems. * - * It is important to always use this function when "external" polling is - * used. If this function returns non-negative value then #MHD_run() (or + * It is important to always use this function (or #MHD_get_timeout(), + * #MHD_get_timeout64() functions) when "external" polling is used. + * If this function returns non-negative value then #MHD_run() (or * #MHD_run_from_select()) must be called right after return from polling * function, regardless of the states of MHD FDs. * diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 7e2b6284..4e349206 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c @@ -3895,15 +3895,16 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) * return #MHD_YES will break MHD processing logic and result in "hung" * connections with data pending in network buffers and other problems. * - * It is important to always use this function when "external" polling is - * used. If this function returns #MHD_YES then #MHD_run() (or - * #MHD_run_from_select()) must be called right after return from polling - * function, regardless of the states of MHD fds. + * It is important to always use this function (or #MHD_get_timeout64(), + * #MHD_get_timeout64s() functions) when "external" polling is used. + * If this function returns #MHD_YES then #MHD_run() (or #MHD_run_from_select()) + * must be called right after return from polling function, regardless of + * the states of MHD FDs. * * In practice, if #MHD_YES is returned then #MHD_run() (or * #MHD_run_from_select()) must be called not later than @a timeout - * millisecond even if not activity is detected on sockets by - * sockets polling function. + * millisecond even if no activity is detected on sockets by sockets + * polling function. * @remark To be called only from thread that process * daemon's select()/poll()/etc. * @@ -3945,15 +3946,18 @@ MHD_get_timeout (struct MHD_Daemon *daemon, * return #MHD_YES will break MHD processing logic and result in "hung" * connections with data pending in network buffers and other problems. * - * It is important to always use this function when "external" polling is - * used. If this function returns #MHD_YES then #MHD_run() (or - * #MHD_run_from_select()) must be called right after return from polling - * function, regardless of the states of MHD fds. + * It is important to always use this function (or #MHD_get_timeout(), + * #MHD_get_timeout64s() functions) when "external" polling is used. + * If this function returns #MHD_YES then #MHD_run() (or #MHD_run_from_select()) + * must be called right after return from polling function, regardless of + * the states of MHD FDs. * * In practice, if #MHD_YES is returned then #MHD_run() (or * #MHD_run_from_select()) must be called not later than @a timeout - * millisecond even if not activity is detected on sockets by - * sockets polling function. + * millisecond even if no activity is detected on sockets by sockets + * polling function. + * @remark To be called only from thread that process + * daemon's select()/poll()/etc. * * @param daemon daemon to query for timeout * @param timeout64 the pointer to the variable to be set to the @@ -4053,8 +4057,9 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon, * processing logic and result in "hung" connections with data pending in * network buffers and other problems. * - * It is important to always use this function when "external" polling is - * used. If this function returns non-negative value then #MHD_run() (or + * It is important to always use this function (or #MHD_get_timeout(), + * #MHD_get_timeout64() functions) when "external" polling is used. + * If this function returns non-negative value then #MHD_run() (or * #MHD_run_from_select()) must be called right after return from polling * function, regardless of the states of MHD FDs. * @@ -4062,6 +4067,8 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon, * #MHD_run_from_select()) must be called not later than returned amount of * millisecond even if no activity is detected on sockets by sockets * polling function. + * @remark To be called only from thread that process + * daemon's select()/poll()/etc. * * @param daemon the daemon to query for timeout * @return -1 if connections' timeouts are not set and no data processing