aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-04-27 17:05:10 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-04-27 22:11:55 +0300
commit860aa4e0ed63d3f1dc706bf669b9592fc4aef778 (patch)
treea9e5e3cf10dcc5a68dc6084e87f66995e6cbdc5a /src/include
parentd77c8b429a1e017592f1e53a28d5c2509164c3ce (diff)
downloadlibmicrohttpd-860aa4e0ed63d3f1dc706bf669b9592fc4aef778.tar.gz
libmicrohttpd-860aa4e0ed63d3f1dc706bf669b9592fc4aef778.zip
Added new function MHD_get_timeout64s()
Diffstat (limited to 'src/include')
-rw-r--r--src/include/microhttpd.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 3c2ad376..023a44ad 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -96,11 +96,11 @@ extern "C"
96 * they are parsed as decimal numbers. 96 * they are parsed as decimal numbers.
97 * Example: 0x01093001 = 1.9.30-1. 97 * Example: 0x01093001 = 1.9.30-1.
98 */ 98 */
99#define MHD_VERSION 0x00097508 99#define MHD_VERSION 0x00097509
100 100
101/* If generic headers don't work on your platform, include headers 101/* If generic headers don't work on your platform, include headers
102 which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 102 which define 'va_list', 'size_t', 'ssize_t', 'intptr_t',
103 'uint16_t', 'uint32_t', 'uint64_t', 'off_t', 'struct sockaddr', 103 'uint16_t', 'uint32_t', 'uint64_t', 'int64_t', 'off_t', 'struct sockaddr',
104 'socklen_t', 'fd_set' and "#define MHD_PLATFORM_H" before 104 'socklen_t', 'fd_set' and "#define MHD_PLATFORM_H" before
105 including "microhttpd.h". Then the following "standard" 105 including "microhttpd.h". Then the following "standard"
106 includes won't be used (which might be a good idea, especially 106 includes won't be used (which might be a good idea, especially
@@ -2961,6 +2961,44 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon,
2961 2961
2962 2962
2963/** 2963/**
2964 * Obtain timeout value for external polling function for this daemon.
2965 *
2966 * This function set value to the amount of milliseconds for which polling
2967 * function (`select()`, `poll()` or epoll) should at most block, not the
2968 * timeout value set for connections.
2969 *
2970 * Any "external" sockets polling function must be called with the timeout
2971 * value provided by this function (if returned value is non-negative).
2972 * Smaller timeout values can be used for polling function if it is required
2973 * for any reason, but using larger timeout value or no timeout (indefinite
2974 * timeout) when this function returns non-negative value will break MHD
2975 * processing logic and result in "hung" connections with data pending in
2976 * network buffers and other problems.
2977 *
2978 * It is important to always use this function when "external" polling is
2979 * used. If this function returns non-negative value then #MHD_run() (or
2980 * #MHD_run_from_select()) must be called right after return from polling
2981 * function, regardless of the states of MHD FDs.
2982 *
2983 * In practice, if zero or positive value is returned then #MHD_run() (or
2984 * #MHD_run_from_select()) must be called not later than returned amount of
2985 * millisecond even if no activity is detected on sockets by sockets
2986 * polling function.
2987 *
2988 * @param daemon the daemon to query for timeout
2989 * @return -1 if connections' timeouts are not set and no data processing
2990 * is pending, so external polling function may wait for sockets
2991 * activity for indefinite amount of time,
2992 * otherwise returned value is the the maximum amount of millisecond
2993 * that external polling function must wait for the activity of FDs.
2994 * @note Available since #MHD_VERSION 0x00097509
2995 * @ingroup event
2996 */
2997_MHD_EXTERN int64_t
2998MHD_get_timeout64s (struct MHD_Daemon *daemon);
2999
3000
3001/**
2964 * Run webserver operations (without blocking unless in client callbacks). 3002 * Run webserver operations (without blocking unless in client callbacks).
2965 * 3003 *
2966 * This method should be called by clients in combination with 3004 * This method should be called by clients in combination with