commit 6a2d317c8f56c04a80dbb2e8e7c524b68fd75d35
parent 2b7b4f07ddc2521ee75731fa0864b06b0297938b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 9 Apr 2024 00:23:33 +0200
microhttpd2.h: fixed all bcc and g++ warnings and errors
Diffstat:
1 file changed, 245 insertions(+), 236 deletions(-)
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
@@ -124,21 +124,7 @@
- Internals: Fix TCP FIN graceful closure issue for upgraded
connections (API implications?)
- - Enable providing default logarithmic implementation of URL scan
- => reduce strcmp(url) from >= 3n operations to "log n"
- per request. Match on method + URL (longest-prefix /foo/bar/* /foo/ /foo /fo, etc).
- "GET /foo/$ARG/$BAR/match"
- struct MHD_Dispatcher;
-
- struct MHD_Dispatcher *
- MHD_dispatcher_create (...);
- enum {no_url, no_method, found}
- MHD_dispatcher_dispatch (dispatcher, url, method, *result);
- MHD_RequestCallback
- MHD_dispatcher_get_callback (struct MHD_Dispatcher *dispatcher);
- struct MHD_dispatcher_destroy (*dispatcher);
-
- */
+*/
#ifndef MICROHTTPD2_H
#define MICROHTTPD2_H
@@ -879,7 +865,7 @@ typedef SOCKET MHD_socket;
* that must not be modified by the function
*/
# define MHD_FN_PAR_IN_(param_num) \
- __attribute__ ((access (read_only,pram_num)))
+ __attribute__ ((access (read_only,param_num)))
# endif /* !MHD_FN_PAR_IN_ */
/* Override detected value of MHD_FN_PAR_IN_SIZE_ by defining it before
@@ -891,7 +877,7 @@ typedef SOCKET MHD_socket;
* modified by the function
*/
# define MHD_FN_PAR_IN_SIZE_(param_num,size_num) \
- __attribute__ ((access (read_only,pram_num,size_num)))
+ __attribute__ ((access (read_only,param_num,size_num)))
# endif /* !MHD_FN_PAR_IN_SIZE_ */
/* Override detected value of MHD_FN_PAR_OUT_ by defining it before
@@ -902,7 +888,7 @@ typedef SOCKET MHD_socket;
* that could be written by the function, but not read.
*/
# define MHD_FN_PAR_OUT_(param_num) \
- __attribute__ ((access (write_only,pram_num)))
+ __attribute__ ((access (write_only,param_num)))
# endif /* !MHD_FN_PAR_OUT_ */
/* Override detected value of MHD_FN_PAR_OUT_SIZE_ by defining it before
@@ -914,7 +900,7 @@ typedef SOCKET MHD_socket;
* written by the function, but not read.
*/
# define MHD_FN_PAR_OUT_SIZE_(param_num,size_num) \
- __attribute__ ((access (write_only,pram_num,size_num)))
+ __attribute__ ((access (write_only,param_num,size_num)))
# endif /* !MHD_FN_PAR_OUT_SIZE_ */
/* Override detected value of MHD_FN_PAR_INOUT_ by defining it before
@@ -925,7 +911,7 @@ typedef SOCKET MHD_socket;
* that could be both read and written by the function.
*/
# define MHD_FN_PAR_INOUT_(param_num) \
- __attribute__ ((access (read_write,pram_num)))
+ __attribute__ ((access (read_write,param_num)))
# endif /* !MHD_FN_PAR_INOUT_ */
/* Override detected value of MHD_FN_PAR_INOUT_SIZE_ by defining it before
@@ -937,7 +923,7 @@ typedef SOCKET MHD_socket;
* both read and written by the function.
*/
# define MHD_FN_PAR_INOUT_SIZE_(param_num,size_num) \
- __attribute__ ((access (read_write,pram_num,size_num)))
+ __attribute__ ((access (read_write,param_num,size_num)))
# endif /* !MHD_FN_PAR_INOUT_SIZE_ */
# endif /* access */
@@ -2500,6 +2486,28 @@ enum MHD_FIXED_ENUM_MHD_APP_SET_ MHD_HTTP_PostEncoding
/* Obsoleted. W3C Mobile Web Best Practices Working Group */
#define MHD_HTTP_HEADER_X_DEVICE_USER_AGENT "X-Device-User-Agent"
+
+/**
+ * Predefined list of headers
+ * To be filled with HPACK static data
+ */
+enum MHD_PredefinedHeader
+{
+ MHD_PREDEF_ACCEPT_CHARSET = 15,
+ MHD_PREDEF_ACCEPT_LANGUAGE = 17
+};
+
+/**
+ * Get text version of the predefined header.
+ * @param stk the code of the predefined header
+ * @return the pointer to the text version,
+ * NULL if method is MHD_HTTP_METHOD_OTHER
+ * or not known.
+ */
+MHD_EXTERN_ const struct MHD_String *
+MHD_predef_header_to_string (enum MHD_PredefinedHeader stk)
+MHD_FN_PURE_;
+
/** @} */ /* end of group headers */
/**
@@ -2544,7 +2552,7 @@ typedef const struct MHD_Action *
MHD_EXTERN_ struct MHD_Daemon *
MHD_daemon_create (MHD_RequestCallback req_cb,
void *req_cb_cls)
-MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_IN_ (1);
+MHD_FN_MUST_CHECK_RESULT_;
/**
@@ -2562,7 +2570,7 @@ MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_IN_ (1);
*/
MHD_EXTERN_ enum MHD_StatusCode
MHD_daemon_start (struct MHD_Daemon *daemon)
-MHD_FN_PAR_NONNULL_ (1);
+MHD_FN_PAR_NONNULL_ (1) MHD_FN_MUST_CHECK_RESULT_;
/**
@@ -2571,7 +2579,7 @@ MHD_FN_PAR_NONNULL_ (1);
* connections. Note that the caller is responsible for closing the
* returned socket; however, if MHD is run using threads (anything but
* external select mode), it must not be closed until AFTER
- * #MHD_daemon_stop() has been called (as it is theoretically possible
+ * #MHD_daemon_destroy() has been called (as it is theoretically possible
* that an existing thread is still using it).
*
* @param[in,out] daemon the daemon to stop accepting new connections for
@@ -2603,11 +2611,11 @@ MHD_FN_PAR_NONNULL_ALL_;
/**
* The network status of the socket.
- * When set by MHD (by #MHD_get_watched_fds(), #MHD_get_watched_fds_update() and
+ * When set by MHD (by #MHD_SocketRegistrationUpdateCallback and
* similar) it indicates a request to watch for specific socket state:
* readiness for receiving the data, readiness for sending the data and/or
* exception state of the socket.
- * When set by application (and provided for #MHD_process_watched_fds() and
+ * When set by application (and provided for #MHD_daemon_event_update() and
* similar) it must indicate the actual status of the socket.
*
* Any actual state is a bitwise OR combination of #MHD_FD_STATE_RECV,
@@ -2620,7 +2628,7 @@ enum MHD_FIXED_ENUM_ MHD_FdState
* The socket is not ready for receiving or sending and
* does not have any exceptional state.
* The state never set by MHD, except de-registration of the sockets
- * in a MHD_SocketRegistrationUpdateCallback.
+ * in a #MHD_SocketRegistrationUpdateCallback.
*/
MHD_FD_STATE_NONE = 0
,
@@ -2628,30 +2636,30 @@ enum MHD_FIXED_ENUM_ MHD_FdState
/**
* Indicates that socket should be watched for incoming data
- * (when set by #MHD_get_watched_fds())
+ * (when set by #MHD_SocketRegistrationUpdateCallback)
* / socket has incoming data ready to read (when used for
- * #MHD_process_watched_fds())
+ * #MHD_daemon_event_update())
*/
MHD_FD_STATE_RECV = 1 << 0
,
/**
* Indicates that socket should be watched for availability for sending
- * (when set by #MHD_get_watched_fds())
+ * (when set by #MHD_SocketRegistrationUpdateCallback)
* / socket has ability to send data (when used for
- * #MHD_process_watched_fds())
+ * #MHD_daemon_event_update())
*/
MHD_FD_STATE_SEND = 1 << 1
,
/**
* Indicates that socket should be watched for disconnect, out-of-band
* data available or high priority data available (when set by
- * #MHD_get_watched_fds())
+ * #MHD_SocketRegistrationUpdateCallback)
* / socket has been disconnected, has out-of-band data available or
* has high priority data available (when used for
- * #MHD_process_watched_fds()). This status must not include "remote
+ * #MHD_daemon_event_update()). This status must not include "remote
* peer shut down writing" status.
- * Note: #MHD_get_watched_fds() always set it as exceptions must be
- * always watched.
+ * Note: #MHD_SocketRegistrationUpdateCallback() always set it as exceptions
+ * must be always watched.
*/
MHD_FD_STATE_EXCEPT = 1 << 2
,
@@ -2822,8 +2830,8 @@ MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_NONNULL_ (2);
* network events (if any) and then calls #MHD_SocketRegistrationUpdateCallback
* callback for every socket that needs to be added/updated/removed.
*
- * Available only for daemons stated in #MHD_TM_EXTERNAL_EVENT_LOOP_CB_LEVEL or
- * #MHD_TM_EXTERNAL_EVENT_LOOP_CB_EDGE modes.
+ * Available only for daemons stated in #MHD_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL or
+ * #MHD_WM_EXTERNAL_EVENT_LOOP_CB_EDGE modes.
*
* @param daemon the daemon handle
* @param[out] next_max_wait the optional pointer to receive the next maximum
@@ -2890,12 +2898,10 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_WorkMode
,
/**
* Work mode with one or more worker threads.
- * If #MHD_D_OPTION_UINT_NUM_WORKERS is not specified
- * then daemon starts with single worker thread that process
- * all connections.
- * If #MHD_D_OPTION_UINT_NUM_WORKERS used with value more
- * than one, then that number of worker threads and distributed
- * processing of requests among the workers.
+ * If specified number of threads is one, then daemon starts with single
+ * worker thread that handles all connections.
+ * If number of threads is larger than one, then that number of worker
+ * threads, and handling of connection is distributed among the workers.
* Use helper macro #MHD_D_OPTION_WM_WORKER_THREADS() to enable
* this mode.
*/
@@ -2937,7 +2943,7 @@ union MHD_WorkModeParam
* Work mode parameters for #MHD_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL and
* #MHD_WM_EXTERNAL_EVENT_LOOP_CB_EDGE modes
*/
- MHD_SocketRegistrationUpdateCallback v_external_event_loop_cb;
+ struct MHD_WorkModeExternalEventLoopCBParam v_external_event_loop_cb;
/**
* Number of worker threads for #MHD_WM_WORKER_THREADS.
* If set to one, then daemon starts with single worker thread that process
@@ -3492,11 +3498,11 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_TlsBackend
};
/**
- * Values for #MHD_OPTION_DIGEST_AUTH_NONCE_BIND_TYPE.
+ * Values for #MHD_D_O_DAUTH_NONCE_BIND_TYPE.
*
* These values can limit the scope of validity of MHD-generated nonces.
* Values can be combined with bitwise OR.
- * Any value, except #MHD_DAUTH_BIND_NONCE_NONE, enforce function
+ * Any value, except #MHD_D_OPTION_VALUE_DAUTH_BIND_NONCE_NONE, enforce function
* #MHD_digest_auth_check() (and similar functions) to check nonce by
* re-generating it again with the same parameters, which is CPU-intensive
* operation.
@@ -3506,7 +3512,7 @@ enum MHD_FIXED_FLAGS_ENUM_APP_SET_ MHD_DaemonOptionValueDAuthBindNonce
/**
* Generated nonces are valid for any request from any client until expired.
* This is default and recommended value.
- * #MHD_digest_auth_check3() (and similar functions) would check only whether
+ * #MHD_digest_auth_check() (and similar functions) would check only whether
* the nonce value that is used by client has been generated by MHD and not
* expired yet.
* It is recommended because RFC 7616 allows clients to use the same nonce
@@ -3539,8 +3545,9 @@ enum MHD_FIXED_FLAGS_ENUM_APP_SET_ MHD_DaemonOptionValueDAuthBindNonce
/**
* Generated nonces are valid only for the same URI including URI parameters
* and request method (GET, POST etc).
- * This value implies #MHD_DAUTH_BIND_NONCE_URI.
- * Not recommended for that same reasons as #MHD_DAUTH_BIND_NONCE_URI.
+ * This value implies #MHD_D_OPTION_VALUE_DAUTH_BIND_NONCE_URI.
+ * Not recommended for that same reasons as
+ * #MHD_D_OPTION_VALUE_DAUTH_BIND_NONCE_URI.
*/
MHD_D_OPTION_VALUE_DAUTH_BIND_NONCE_URI_PARAMS = (1 << 2)
,
@@ -3568,10 +3575,10 @@ enum MHD_FIXED_FLAGS_ENUM_APP_SET_ MHD_DaemonOptionValueDAuthBindNonce
struct MHD_ServerCredentialsContext;
MHD_EXTERN_ enum MHD_StatusCode
-MHD_connection_set_psk (struct MHD_ServerCredentialsContext *mscc,
- size_t psk_size,
- const /*void? */ char psk[MHD_FN_PAR_DYN_ARR_SIZE_ (
- psk_size)]);
+MHD_connection_set_psk (
+ struct MHD_ServerCredentialsContext *mscc,
+ size_t psk_size,
+ const /*void? */ char psk[MHD_FN_PAR_DYN_ARR_SIZE_ (psk_size)]);
#define MHD_connection_set_psk_unavailable(mscc) \
MHD_connection_set_psk (mscc, 0, NULL)
@@ -3712,7 +3719,7 @@ struct MHD_ConnectionNotificationData
*
* @param cls client-defined closure
* @param[in,out] data the details about the event
- * @see #MHD_daemon_set_notify_connection()
+ * @see #MHD_D_OPTION_NOTIFY_CONNECTION()
* @ingroup request
*/
typedef void
@@ -3791,7 +3798,7 @@ struct MHD_StreamNotificationData
*
* @param cls client-defined closure
* @param data the details about the event
- * @see #MHD_OPTION_NOTIFY_CONNECTION
+ * @see #MHD_D_OPTION_NOTIFY_STREAM()
* @ingroup request
*/
typedef void
@@ -6594,8 +6601,8 @@ MHD_RESTORE_WARN_VARIADIC_MACROS_
/**
* Run websever operation with possible blocking.
*
- * Supported only in #MHD_TM_EXTERNAL_PERIODIC and
- * #MHD_TM_EXTERNAL_SINGLE_FD_WATCH modes.
+ * Supported only in #MHD_WM_EXTERNAL_PERIODIC and
+ * #MHD_WM_EXTERNAL_SINGLE_FD_WATCH modes.
*
* This function does the following: waits for any network event not more than
* specified number of microseconds, processes all incoming and outgoing data,
@@ -6607,7 +6614,7 @@ MHD_RESTORE_WARN_VARIADIC_MACROS_
* if application needs to run a single thread only and does not have any other
* network activity.
*
- * In #MHD_TM_EXTERNAL_PERIODIC mode if @a microsec parameter is not zero
+ * In #MHD_WM_EXTERNAL_PERIODIC mode if @a microsec parameter is not zero
* this function determines the internal daemon timeout and use returned value
* as maximum wait time if it less than value of @a microsec parameter.
*
@@ -6620,13 +6627,13 @@ MHD_RESTORE_WARN_VARIADIC_MACROS_
* time, especially in user callbacks).
* If set to '0' then function does not block and processes
* only already available data (if any). Zero value is
- * recommended when used in #MHD_TM_EXTERNAL_SINGLE_FD_WATCH
+ * recommended when used in #MHD_WM_EXTERNAL_SINGLE_FD_WATCH
* and the watched FD has been triggered.
* If set to #MHD_WAIT_INDEFINITELY then function waits
* for events indefinitely (blocks until next network activity
* or connection timeout).
* Always used as zero value in
- * #MHD_TM_EXTERNAL_SINGLE_FD_WATCH mode.
+ * #MHD_WM_EXTERNAL_SINGLE_FD_WATCH mode.
* @return #MHD_SC_OK on success, otherwise
* an error code
* @ingroup event
@@ -6640,7 +6647,7 @@ MHD_FN_PAR_NONNULL_ (1);
* Run webserver operations (without blocking unless in client
* callbacks).
*
- * Supported only in #MHD_TM_EXTERNAL_SINGLE_FD_WATCH mode.
+ * Supported only in #MHD_WM_EXTERNAL_SINGLE_FD_WATCH mode.
*
* This function does the following: processes all incoming and outgoing data,
* processes new connections, processes any timed-out connection, and does
@@ -6648,7 +6655,7 @@ MHD_FN_PAR_NONNULL_ (1);
* Once all connections are processed, function returns.
*
* The optional @a next_max_wait pointer returns the same value as
- * if #MHD_daemon_get_timeout() would called immediately.
+ * if #MHD_DAEMON_INFO_DYNAMIC_MAX_TIME_TO_WAIT would requested immediately.
*
* @param daemon the daemon to run
* @return #MHD_SC_OK on success, otherwise
@@ -6666,10 +6673,6 @@ MHD_FN_PAR_NONNULL_ (1);
* for example if your HTTP server is behind NAT and needs to connect
* out to the HTTP client, or if you are building a proxy.
*
- * If you use this API in conjunction with a internal select or a
- * thread pool, you must set the option #MHD_USE_ITC to ensure that
- * the freshly added connection is immediately processed by MHD.
- *
* The given client socket will be managed (and closed!) by MHD after
* this call and must no longer be used directly by the application
* afterwards.
@@ -6692,7 +6695,7 @@ MHD_daemon_add_connection (struct MHD_Daemon *daemon,
const struct sockaddr *addr,
void *connection_cntx)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_IN_SIZE_ (4,3);
+MHD_FN_PAR_IN_ (4);
/* ********************* connection options ************** */
@@ -6777,9 +6780,9 @@ struct MHD_ConnectionOptionAndValue
*/
# define MHD_C_OPTION_TIMEOUT(timeout) \
MHD_NOWARN_COMPOUND_LITERALS_ \
- (const struct MHD_ConnectionOptionAndValue) \
+ (const struct MHD_ConnectionOptionAndValue) \
{ \
- .opt = (option), \
+ .opt = (MHD_C_O_TIMEOUT), \
.val.v_timeout = (timeout) \
} \
MHD_RESTORE_WARN_COMPOUND_LITERALS_
@@ -6790,7 +6793,7 @@ struct MHD_ConnectionOptionAndValue
*/
# define MHD_C_OPTION_TERMINATE() \
MHD_NOWARN_COMPOUND_LITERALS_ \
- (const struct MHD_ConnectionOptionAndValue) \
+ (const struct MHD_ConnectionOptionAndValue) \
{ \
.opt = (MHD_C_O_END) \
} \
@@ -6812,7 +6815,7 @@ MHD_C_OPTION_TIMEOUT (unsigned int timeout)
{
struct MHD_ConnectionOptionAndValue opt_val;
- opt_val.opt = option;
+ opt_val.opt = MHD_C_O_TIMEOUT;
opt_val.val.v_timeout = timeout;
return opt_val;
@@ -6962,10 +6965,10 @@ enum MHD_FLAGS_ENUM_ MHD_ValueKind
* fits within the available memory pool.
*
* @warning The encoding "multipart/form-data" has more fields than just
- * "name" and "value". See #MHD_request_get_post_processor_values_cb() and
- * #MHD_request_get_post_processor_values_list(). In particular it could be
- * important to check used "Transfer-Encoding". While it is deprecated and
- * not used by modern clients, hypothetically it can be used.
+ * "name" and "value". See #MHD_request_get_post_data_cb() and
+ * #MHD_request_get_post_data_list(). In particular it could be important
+ * to check used "Transfer-Encoding". While it is deprecated and not used
+ * by modern clients, formally it can be used.
*/
MHD_VK_POSTDATA = (1 << 3)
,
@@ -7083,7 +7086,7 @@ MHD_request_get_values_list (
size_t num_elements,
struct MHD_NameValueKind elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)])
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_ (4);
+MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_SIZE_ (4,3);
/**
@@ -7402,7 +7405,7 @@ MHD_action_suspend (struct MHD_Request *request,
MHD_FN_RETURNS_NONNULL_ MHD_FN_PAR_NONNULL_ALL_;
/**
- * Converts a @a response to an action. If @a MHD_R_O_REUSABLE
+ * Converts a @a response to an action. If #MHD_R_O_REUSABLE
* is not set, the reference to the @a response is consumed
* by the conversion. If #MHD_R_O_REUSABLE is #MHD_YES,
* then the @a response can be used again to create actions in
@@ -7523,7 +7526,7 @@ struct MHD_RequestTerminationData
* @param data the details about the event
* @param request_context request context value, as originally
* returned by the #MHD_EarlyUriLogCallback
- * @see #MHD_option_request_completion()
+ * @see #MHD_R_OPTION_TERMINATION_CALLBACK()
* @ingroup request
*/
typedef void
@@ -7557,8 +7560,8 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_ResponseOption
/**
* Enable special processing of the response as body-less (with undefined
* body size). No automatic "Content-Length" or "Transfer-Encoding: chunked"
- * headers are added when the response is used with #MHD_HTTP_NOT_MODIFIED
- * code or to respond to HEAD request.
+ * headers are added when the response is used with
+ * #MHD_HTTP_STATUS_NOT_MODIFIED code or to respond to HEAD request.
* The flag also allow to set arbitrary "Content-Length" by
* #MHD_response_add_header() function.
* This flag value can be used only with responses created without body
@@ -7599,9 +7602,9 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_ResponseOption
* This option can be used to communicate with some broken client, which does
* not implement HTTP/1.1 features, but advertises HTTP/1.1 support.
* The parameter value must be placed to the
- * @a v_http_1_0_compatible_stric member.
+ * @a v_http_1_0_compatible_strict member.
*/
- MHD_R_O_HTTP_1_0_COMPATIBLE_STRIC = 80
+ MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT = 80
,
/**
* Only respond in HTTP/1.0-mode.
@@ -7693,9 +7696,9 @@ union MHD_ResponseOptionValue
*/
enum MHD_Bool v_conn_close;
/**
- * Value for #MHD_R_O_HTTP_1_0_COMPATIBLE_STRIC
+ * Value for #MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT
*/
- enum MHD_Bool v_http_1_0_compatible_stric;
+ enum MHD_Bool v_http_1_0_compatible_strict;
/**
* Value for #MHD_R_O_HTTP_1_0_SERVER
*/
@@ -7739,19 +7742,19 @@ struct MHD_ResponseOptionAndValue
* values
*/
# define MHD_R_OPTION_REUSABLE(bool_val) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_REUSABLE), \
- .val.v_reusable = (bool_val) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_REUSABLE), \
+ .val.v_reusable = (bool_val) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/**
* Enable special processing of the response as body-less (with undefined body
* size). No automatic "Content-Length" or "Transfer-Encoding: chunked" headers
- * are added when the response is used with #MHD_HTTP_NOT_MODIFIED code or to
- * respond to HEAD request.
+ * are added when the response is used with #MHD_HTTP_STATUS_NOT_MODIFIED code
+ * or to respond to HEAD request.
* The flag also allow to set arbitrary "Content-Length" by
* #MHD_response_add_header() function.
* This flag value can be used only with responses created without body
@@ -7765,13 +7768,13 @@ struct MHD_ResponseOptionAndValue
* values
*/
# define MHD_R_OPTION_HEAD_ONLY_RESPONSE(bool_val) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_HEAD_ONLY_RESPONSE), \
- .val.v_head_only_response = (bool_val) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_HEAD_ONLY_RESPONSE), \
+ .val.v_head_only_response = (bool_val) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/**
* Force use of chunked encoding even if the response content size is known.
@@ -7781,13 +7784,13 @@ struct MHD_ResponseOptionAndValue
* values
*/
# define MHD_R_OPTION_CHUNKED_ENC(bool_val) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_CHUNKED_ENC), \
- .val.v_chunked_enc = (bool_val) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_CHUNKED_ENC), \
+ .val.v_chunked_enc = (bool_val) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/**
* Force close connection after sending the response, prevents keep-alive
@@ -7797,13 +7800,13 @@ struct MHD_ResponseOptionAndValue
* values
*/
# define MHD_R_OPTION_CONN_CLOSE(bool_val) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_CONN_CLOSE), \
- .val.v_conn_close = (bool_val) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_CONN_CLOSE), \
+ .val.v_conn_close = (bool_val) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/**
* Only respond in conservative (dumb) HTTP/1.0-compatible mode.
@@ -7819,14 +7822,14 @@ struct MHD_ResponseOptionAndValue
* @return the object of struct MHD_ResponseOptionAndValue with the requested
* values
*/
-# define MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRIC(bool_val) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+# define MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRICT(bool_val) \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_HTTP_1_0_COMPATIBLE_STRIC), \
- .val.v_http_1_0_compatible_stric = (bool_val) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT), \
+ .val.v_http_1_0_compatible_strict = (bool_val) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/**
* Only respond in HTTP/1.0-mode.
@@ -7847,13 +7850,13 @@ struct MHD_ResponseOptionAndValue
* values
*/
# define MHD_R_OPTION_HTTP_1_0_SERVER(bool_val) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_HTTP_1_0_SERVER), \
- .val.v_http_1_0_server = (bool_val) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_HTTP_1_0_SERVER), \
+ .val.v_http_1_0_server = (bool_val) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/**
* Disable sanity check preventing clients from manually setting the HTTP
@@ -7865,13 +7868,13 @@ struct MHD_ResponseOptionAndValue
* values
*/
# define MHD_R_OPTION_INSANITY_HEADER_CONTENT_LENGTH(bool_val) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_INSANITY_HEADER_CONTENT_LENGTH), \
- .val.v_insanity_header_content_length = (bool_val) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_INSANITY_HEADER_CONTENT_LENGTH), \
+ .val.v_insanity_header_content_length = (bool_val) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/**
* Set a function to be called once MHD is finished with the request.
@@ -7882,14 +7885,14 @@ struct MHD_ResponseOptionAndValue
* values
*/
# define MHD_R_OPTION_TERMINATION_CALLBACK(term_cb,term_cb_cls) \
- MHD_NOWARN_COMPOUND_LITERALS_ \
+ MHD_NOWARN_COMPOUND_LITERALS_ \
(const struct MHD_ResponseOptionAndValue) \
- { \
- .opt = (MHD_R_O_TERMINATION_CALLBACK), \
- .val.v_termination_callback.v_term_cb = (term_cb), \
- .val.v_termination_callback.v_term_cb_cls = (term_cb_cls) \
- } \
- MHD_RESTORE_WARN_COMPOUND_LITERALS_
+ { \
+ .opt = (MHD_R_O_TERMINATION_CALLBACK), \
+ .val.v_termination_callback.v_term_cb = (term_cb), \
+ .val.v_termination_callback.v_term_cb_cls = (term_cb_cls) \
+ } \
+ MHD_RESTORE_WARN_COMPOUND_LITERALS_
/* = MHD Response Option macros above are generated automatically = */
@@ -7932,8 +7935,8 @@ MHD_R_OPTION_REUSABLE (enum MHD_Bool bool_val)
/**
* Enable special processing of the response as body-less (with undefined body
* size). No automatic "Content-Length" or "Transfer-Encoding: chunked" headers
- * are added when the response is used with #MHD_HTTP_NOT_MODIFIED code or to
- * respond to HEAD request.
+ * are added when the response is used with #MHD_HTTP_STATUS_NOT_MODIFIED code
+ * or to respond to HEAD request.
* The flag also allow to set arbitrary "Content-Length" by
* #MHD_response_add_header() function.
* This flag value can be used only with responses created without body
@@ -8011,12 +8014,12 @@ MHD_R_OPTION_CONN_CLOSE (enum MHD_Bool bool_val)
* values
*/
static MHD_INLINE struct MHD_ResponseOptionAndValue
-MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRIC (enum MHD_Bool bool_val)
+MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRICT (enum MHD_Bool bool_val)
{
struct MHD_ResponseOptionAndValue opt_val;
- opt_val.opt = MHD_R_O_HTTP_1_0_COMPATIBLE_STRIC;
- opt_val.val.v_http_1_0_compatible_stric = bool_val;
+ opt_val.opt = MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT;
+ opt_val.val.v_http_1_0_compatible_strict = bool_val;
return opt_val;
}
@@ -8132,7 +8135,7 @@ MHD_RESTORE_WARN_UNUSED_FUNC_
* error code otherwise
*/
MHD_EXTERN_ enum MHD_StatusCode
-MHD_response_options_set (struct MHD_Response *daemon,
+MHD_response_options_set (struct MHD_Response *response,
const struct MHD_ResponseOptionAndValue *options,
size_t options_max_num)
MHD_FN_PAR_NONNULL_ALL_;
@@ -8173,7 +8176,7 @@ MHD_NOWARN_VARIADIC_MACROS_
*/
# define MHD_RESPONSE_OPTIONS_SET(response,...) \
MHD_NOWARN_COMPOUND_LITERALS_ \
- MHD_response_options_set (daemon, \
+ MHD_response_options_set (response, \
((const struct MHD_ResponseOptionAndValue[]) \
{__VA_ARGS__, MHD_R_OPTION_TERMINATE ()}), \
MHD_OPTIONS_ARRAY_MAX_SIZE) \
@@ -8183,7 +8186,7 @@ MHD_C_DECLRATIONS_FINISH_HERE_
# include <vector>
MHD_C_DECLRATIONS_START_HERE_
/**
- * Set the requested options for the daemon.
+ * Set the requested options for the response.
*
* If any option fail other options may be or may be not applied.
*
@@ -8192,16 +8195,16 @@ MHD_C_DECLRATIONS_START_HERE_
* MHD_RESPONE_OPTIONS_SET(d, MHD_R_OPTION_REUSABLE(MHD_YES),
* MHD_R_OPTION_TERMINATION_CALLBACK(func, cls))
*
- * @param daemon the daemon to set the options
+ * @param response the response to set the option
* @param ... the list of the options, each option must be created
- * by helpers MHD_D_OPTION_NameOfOption(option_value)
+ * by helpers MHD_RESPONSE_OPTION_NameOfOption(option_value)
* @return ::MHD_SC_OK on success,
* error code otherwise
*/
-# define MHD_DAEMON_OPTIONS_SET(daemon,...) \
+# define MHD_RESPONSE_OPTIONS_SET(response,...) \
MHD_NOWARN_CPP_INIT_LIST_ \
- MHD_daemon_options_set (daemon, \
- (std::vector<struct MHD_DaemonOptionAndValue> \
+ MHD_response_options_set (response, \
+ (std::vector<struct MHD_ResponseOptionAndValue> \
{__VA_ARGS__,MHD_R_OPTION_TERMINATE ()}).data (), \
MHD_OPTIONS_ARRAY_MAX_SIZE) \
MHD_RESTORE_WARN_CPP_INIT_LIST_
@@ -8391,8 +8394,8 @@ MHD_response_from_callback (enum MHD_HTTP_StatusCode sc,
* header information.
*
* @param sc status code to use for the response;
- * #MHD_HTTP_NO_CONTENT is only valid if @a size is 0;
- * @param size the size of the data portion of the response
+ * #MHD_HTTP_STATUS_NO_CONTENT is only valid if @a size is 0;
+ * @param buffer_size the size of the data portion of the response
* @param buffer the @a size bytes containing the response's data portion,
* needs to be valid while the response is used
* @param free_cb the callback to free any allocated data, called
@@ -8428,7 +8431,7 @@ MHD_FN_PAR_IN_SIZE_ (3,2);
* header information.
*
* @param sc status code to use for the response
- * @param size the size of the data portion of the response
+ * @param buffer_size the size of the data portion of the response
* @param buffer the @a size bytes containing the response's data portion,
* an internal copy will be made, there is no need to
* keep this data after return from this function
@@ -8444,6 +8447,24 @@ MHD_FN_PAR_IN_SIZE_ (3,2);
/**
+ * I/O vector type. Provided for use with #MHD_response_from_iovec().
+ * @ingroup response
+ */
+struct MHD_IoVec
+{
+ /**
+ * The pointer to the memory region for I/O.
+ */
+ const void *iov_base;
+
+ /**
+ * The size in bytes of the memory region for I/O.
+ */
+ size_t iov_len;
+};
+
+
+/**
* Create a response object with an array of memory buffers
* used as the response body.
*
@@ -8453,6 +8474,7 @@ MHD_FN_PAR_IN_SIZE_ (3,2);
* of the response is not used, while all headers (including automatic
* headers) are used.
*
+ * @param sc status code to use for the response
* @param iov_count the number of elements in @a iov
* @param iov the array for response data buffers, an internal copy of this
* will be made
@@ -8482,10 +8504,10 @@ MHD_response_from_iovec (
* fd should be in 'blocking' mode
* @param offset offset to start reading from in the file;
* reading file beyond 2 GiB may be not supported by OS or
- * MHD build; see ::MHD_FEATURE_LARGE_FILE
+ * MHD build; see #MHD_LIB_INFO_FIXED_HAS_LARGE_FILE
* @param size size of the data portion of the response;
* sizes larger than 2 GiB may be not supported by OS or
- * MHD build; see ::MHD_FEATURE_LARGE_FILE
+ * MHD build; see #MHD_LIB_INFO_FIXED_HAS_LARGE_FILE
* @return NULL on error (i.e. invalid arguments, out of memory)
* @ingroup response
*/
@@ -8507,6 +8529,7 @@ MHD_FN_PAR_FD_READ_ (2);
* of the response is not used, while all headers (including automatic
* headers) are used.
*
+ * @param sc status code to use for the response
* @param fd file descriptor referring to a read-end of a pipe with the
* data; will be closed when response is destroyed;
* fd should be in 'blocking' mode
@@ -8521,8 +8544,8 @@ MHD_response_from_pipe (enum MHD_HTTP_StatusCode sc,
/**
* Destroy response.
* Should be called if response was created but not consumed.
- * Also must be called if response has #MHD_RESP_OPT_BOOL_REUSABLE
- * set. The actual destroy can be happen later, if the response
+ * Also must be called if response has #MHD_R_O_REUSABLE set.
+ * The actual destroy can be happen later, if the response
* is still being used in any request.
* The function does not block.
*
@@ -8603,8 +8626,8 @@ MHD_action_continue (struct MHD_Request *req);
/**
* Function to process data uploaded by a client.
*
- * @param cls argument given together with the function
- * pointer when the handler was registered with MHD
+ * @param upload_cls the argument given together with the function
+ * pointer when the handler was registered with MHD
* @param request the request is being processed
* @param content_data_size the size of the @a content_data,
* zero if all data have been processed
@@ -8621,7 +8644,7 @@ MHD_action_continue (struct MHD_Request *req);
* @ingroup action
*/
typedef const struct MHD_Action *
-(MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_NONNULL_ (3)
+(MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_IN_SIZE_ (4,3)
*MHD_UploadCallback)(void *upload_cls,
struct MHD_Request *request,
size_t content_data_size,
@@ -8742,6 +8765,7 @@ typedef const struct MHD_Action *
/**
* Create an action to parse the POSTed body from the client.
*
+ * @param request the request to create action for
* @param pp_buffer_size how much data should the post processor
* buffer in memory. May allocate memory from
* the shared "large" memory pool if necessary.
@@ -8756,12 +8780,13 @@ typedef const struct MHD_Action *
* the final action; values smaller than @a pp_stream_limit that
* fit into @a pp_buffer_size will be available via
* #MHD_request_get_values_cb(), #MHD_request_get_values_list() and
- * #MHD_request_get_post_processor_values()
+ * #MHD_request_get_post_data_cb(), #MHD_request_get_post_data_list()
+ * @param done_cb_cls closure for @a done_cb
* @sa #MHD_D_OPTION_LARGE_POOL_SIZE()
* @ingroup action
*/
MHD_EXTERN_ struct MHD_Action *
-MHD_action_post_processor (struct MHD_Request *req,
+MHD_action_post_processor (struct MHD_Request *request,
size_t pp_buffer_size,
size_t pp_stream_limit,
enum MHD_HTTP_PostEncoding enc,
@@ -8769,7 +8794,7 @@ MHD_action_post_processor (struct MHD_Request *req,
void *reader_cls,
MHD_PostDataFinished done_cb,
void *done_cb_cls)
-MHD_FN_PAR_NONNULL_ (2);
+MHD_FN_PAR_NONNULL_ (1);
/**
@@ -8817,7 +8842,7 @@ struct MHD_PostData
* is queued. If the data is needed beyond this point, it should be copied.
*
* @param cls closure
- * @param nvt the name, the value and the kind of the element
+ * @param data the element of the post data
* @return #MHD_YES to continue iterating,
* #MHD_NO to abort the iteration
* @ingroup request
@@ -8863,7 +8888,7 @@ MHD_request_get_post_data_list (
size_t num_elements,
struct MHD_PostData elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)])
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_SIZE_ (3,2);
/* ***************** (c) WebSocket support ********** */
@@ -9293,7 +9318,7 @@ enum MHD_FIXED_ENUM_MHD_APP_SET_ MHD_DigestAuthMultiAlgo
* Authorization client's header.
*
* Userhash is not designed to hide the username in local database or files,
- * as username in cleartext is required for #MHD_digest_auth_check3() function
+ * as username in cleartext is required for #MHD_digest_auth_check() function
* to check the response, but it can be used to hide username in HTTP headers.
*
* This function could be used when the new username is added to the username
@@ -9312,10 +9337,10 @@ enum MHD_FIXED_ENUM_MHD_APP_SET_ MHD_DigestAuthMultiAlgo
* @param realm the realm
* @param[out] userhash_bin the output buffer for userhash as binary data;
* if this function succeeds, then this buffer has
- * #MHD_digest_get_hash_size(algo) bytes of userhash
+ * #MHD_digest_get_hash_size() bytes of userhash
* upon return
* @param bin_buf_size the size of the @a userhash_bin buffer, must be
- * at least #MHD_digest_get_hash_size(algo) bytes long
+ * at least #MHD_digest_get_hash_size() bytes long
* @return MHD_SC_OK on success,
* error code otherwise
* @sa #MHD_digest_auth_calc_userhash_hex()
@@ -9328,7 +9353,7 @@ MHD_digest_auth_calc_userhash (enum MHD_DigestAuthAlgo algo,
size_t bin_buf_size,
void *userhash_bin)
MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (2)
-MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (4,3);
+MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (5,4);
/**
@@ -9340,7 +9365,7 @@ MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (4,3);
* Authorization client's header.
*
* Userhash is not designed to hide the username in local database or files,
- * as username in cleartext is required for #MHD_digest_auth_check3() function
+ * as username in cleartext is required for #MHD_digest_auth_check() function
* to check the response, but it can be used to hide username in HTTP headers.
*
* This function could be used when the new username is added to the username
@@ -9358,10 +9383,10 @@ MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (4,3);
* @param username the username
* @param realm the realm
* @param hex_buf_size the size of the @a userhash_hex buffer, must be
- * at least #MHD_digest_get_hash_size(algo)*2+1 chars long
+ * at least #MHD_digest_get_hash_size()*2+1 chars long
* @param[out] userhash_hex the output buffer for userhash as hex string;
* if this function succeeds, then this buffer has
- * #MHD_digest_get_hash_size(algo)*2 chars long
+ * #MHD_digest_get_hash_size()*2 chars long
* userhash zero-terminated string
* @return MHD_SC_OK on success,
* error code otherwise
@@ -9376,7 +9401,7 @@ MHD_digest_auth_calc_userhash_hex (
size_t hex_buf_size,
char userhash_hex[MHD_FN_PAR_DYN_ARR_SIZE_ (hex_buf_size)])
MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (2)
-MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (4,3);
+MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (5,4);
/**
@@ -9406,7 +9431,7 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_DigestAuthUsernameType
,
/**
* The username is specified by 'username*' parameter with
- * the extended notation (see RFC 5987 #section-3.2.1).
+ * the extended notation (see RFC 5987, section-3.2.1).
* The only difference between standard and extended types is
* the way how username value is encoded in the header.
*/
@@ -9414,7 +9439,7 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_DigestAuthUsernameType
,
/**
* The username provided in form of 'userhash' as
- * specified by RFC 7616 #section-3.4.4.
+ * specified by RFC 7616, section-3.4.4.
* @sa #MHD_digest_auth_calc_userhash_hex(), #MHD_digest_auth_calc_userhash()
*/
MHD_DIGEST_AUTH_UNAME_TYPE_USERHASH = (1 << 1)
@@ -9564,7 +9589,7 @@ struct MHD_DigestAuthInfo
* Used only if username type is userhash, always NULL otherwise.
* When not NULL, this points to binary sequence @a userhash_bin_size bytes
* long.
- * The valid size should be #MHD_digest_get_hash_size(algo) bytes.
+ * The valid size should be #MHD_digest_get_hash_size() bytes.
* @warning This is a binary data, no zero termination.
* @warning To avoid buffer overruns, always check the size of the data before
* use, because @a userhash_bin can point even to zero-sized
@@ -9589,7 +9614,7 @@ struct MHD_DigestAuthInfo
* The 'realm' parameter value, as specified by client.
* If not specified by client then string pointer is NULL.
*/
- struct MHD_StringNull realm;
+ struct MHD_StringNullable realm;
/**
* The 'qop' parameter value.
@@ -9635,7 +9660,7 @@ struct MHD_DigestAuthUsernameInfo
/**
* The type of username used by client.
* The 'invalid' and 'missing' types are not used in this structure,
- * instead NULL is returned by #MHD_digest_auth_get_username3().
+ * instead NULL is returned for #MHD_REQUEST_INFO_DYNAMIC_DAUTH_USERNAME_INFO.
*/
enum MHD_DigestAuthUsernameType uname_type;
@@ -9647,8 +9672,8 @@ struct MHD_DigestAuthUsernameInfo
* extracted from the extended notation).
* When userhash is used by the client, this member is NULL and
* @a userhash_hex and @a userhash_bin are set.
- * The buffer pointed by the @a username becomes invalid when the pointer
- * to the structure is freed by #MHD_free().
+ * The buffer pointed by the @a username becomes invalid when a response
+ * for the requested is provided (or request is aborted).
*/
struct MHD_String username;
@@ -9657,8 +9682,8 @@ struct MHD_DigestAuthUsernameInfo
* Valid only if username type is userhash.
* This is unqoted string without decoding of the hexadecimal
* digits (as provided by the client).
- * The buffer pointed by the @a userhash_hex becomes invalid when the pointer
- * to the structure is freed by #MHD_free().
+ * The buffer pointed by the @a userhash_hex becomes invalid when a response
+ * for the requested is provided (or request is aborted).
* @sa #MHD_digest_auth_calc_userhash_hex()
*/
struct MHD_String userhash_hex;
@@ -9668,9 +9693,9 @@ struct MHD_DigestAuthUsernameInfo
* Used only if username type is userhash, always NULL otherwise.
* When not NULL, this points to binary sequence @a userhash_hex_len /2 bytes
* long.
- * The valid size should be #MHD_digest_get_hash_size(algo) bytes.
- * The buffer pointed by the @a userhash_bin becomes invalid when the pointer
- * to the structure is freed by #MHD_free().
+ * The valid size should be #MHD_digest_get_hash_size() bytes.
+ * The buffer pointed by the @a userhash_bin becomes invalid when a response
+ * for the requested is provided (or request is aborted).
* @warning This is a binary data, no zero termination.
* @warning To avoid buffer overruns, always check the size of the data before
* use, because @a userhash_bin can point even to zero-sized
@@ -9747,14 +9772,15 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_DigestAuthResult
,
/**
* The 'nonce' was generated by MHD for other conditions.
- * This value is only returned if #MHD_OPTION_DIGEST_AUTH_NONCE_BIND_TYPE
- * is set to anything other than #MHD_DAUTH_BIND_NONCE_NONE.
+ * This value is only returned if #MHD_D_O_DAUTH_NONCE_BIND_TYPE is set
+ * to anything other than #MHD_D_OPTION_VALUE_DAUTH_BIND_NONCE_NONE.
* The interpretation of this code could be different. For example, if
- * #MHD_DAUTH_BIND_NONCE_URI is set and client just used the same 'nonce' for
- * another URI, the code could be handled as #MHD_DAUTH_NONCE_STALE as
- * RFCs allow nonces re-using for other URIs in the same "protection
- * space". However, if only #MHD_DAUTH_BIND_NONCE_CLIENT_IP bit is set and
- * it is know that clients have fixed IP addresses, this return code could
+ * #MHD_D_OPTION_VALUE_DAUTH_BIND_NONCE_URI is set and client just used
+ * the same 'nonce' for another URI, the code could be handled as
+ * #MHD_DAUTH_NONCE_STALE as RFCs allow nonces re-using for other URIs
+ * in the same "protection space".
+ * However, if only #MHD_D_OPTION_VALUE_DAUTH_BIND_NONCE_CLIENT_IP bit is set
+ * and it is know that clients have fixed IP addresses, this return code could
* be handled like #MHD_DAUTH_NONCE_WRONG.
*/
MHD_DAUTH_NONCE_OTHER_COND = -18
@@ -9836,10 +9862,10 @@ MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_CSTR_ (4);
* @param realm the realm
* @param password the password
* @param bin_buf_size the size of the @a userdigest_bin buffer, must be
- * at least #MHD_digest_get_hash_size(algo) bytes long
+ * at least #MHD_digest_get_hash_size() bytes long
* @param[out] userdigest_bin the output buffer for userdigest;
* if this function succeeds, then this buffer has
- * #MHD_digest_get_hash_size(algo) bytes of
+ * #MHD_digest_get_hash_size() bytes of
* userdigest upon return
* @return #MHD_SC_OK on success,
* error code otherwise.
@@ -10104,7 +10130,7 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_LibInfoFixed
,
/**
* Get whether automatic parsing of HTTP Cookie header is supported.
- * If disabled, no #MHD_COOKIE_KIND will be generated by MHD.
+ * If disabled, no #MHD_VK_COOKIE will be generated by MHD.
* The result is placed in @a v_bool member.
*/
MHD_LIB_INFO_FIXED_HAS_COOKIE_PARSING = 14
@@ -10133,8 +10159,8 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_LibInfoFixed
,
/**
* Get whether HTTP Digest authorization is supported. If
- * supported then options #MHD_OPTION_DIGEST_AUTH_RANDOM,
- * #MHD_OPTION_NONCE_NC_SIZE and functions
+ * supported then options #MHD_D_O_RANDOM_ENTROPY,
+ * #MHD_D_O_DAUTH_MAP_SIZE and functions
* #MHD_action_digest_auth_required_response () and
* #MHD_digest_auth_check() can be used.
* The result is placed in @a v_bool member.
@@ -10226,16 +10252,15 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_LibInfoFixed
MHD_LIB_INFO_FIXED_TYPE_IPv6 = 52
,
/**
- * Get whether TCP Fast Open is supported. If supported then
- * flag #MHD_USE_TCP_FASTOPEN and option
- * #MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE can be used.
+ * Get whether TCP Fast Open is supported by MHD build.
+ * If supported then option #MHD_D_O_TCP_FASTOPEN can be used.
* The result is placed in @a v_bool member.
*/
MHD_LIB_INFO_FIXED_HAS_TCP_FASTOPEN = 53
,
/**
* Get whether MHD support automatic detection of bind port number.
- * @sa #MHD_DAEMON_INFO_BIND_PORT
+ * @sa #MHD_D_O_BIND_PORT
* The result is placed in @a v_bool member.
*/
MHD_LIB_INFO_FIXED_HAS_AUTODETECT_BIND_PORT = 54
@@ -10269,10 +10294,8 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_LibInfoFixed
,
/**
* Get whether reading files beyond 2 GiB boundary is supported.
- * If supported then #MHD_create_response_from_fd(),
- * #MHD_create_response_from_fd64 #MHD_create_response_from_fd_at_offset()
- * and #MHD_create_response_from_fd_at_offset64() can be used with sizes and
- * offsets larger than 2 GiB. If not supported value of size+offset is
+ * If supported then #MHD_response_from_fd() can be used with sizes and
+ * offsets larger than 2 GiB. If not supported value of size+offset could be
* limited to 2 GiB.
* The result is placed in @a v_bool member.
*/
@@ -10293,27 +10316,13 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_LibInfoFixed
MHD_LIB_INFO_FIXED_TYPE_TLS = 100
,
/**
- * Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK is
- * supported.
- * The result is placed in @a v_bool member.
- */
- MHD_LIB_INFO_FIXED_HAS_TLS_CERT_CALLBACK = 101
- ,
- /**
* Get whether password encrypted private key for HTTPS daemon is
* supported. If supported then option
- * ::MHD_OPTION_HTTPS_KEY_PASSWORD can be used.
+ * #MHD_D_OPTION_TLS_KEY_CERT can be used with non-NULL @a mem_pass
* The result is placed in @a v_bool member.
*/
MHD_LIB_INFO_FIXED_HAS_TLS_KEY_PASSWORD = 102
,
- /**
- * Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK2 is
- * supported.
- * The result is placed in @a v_bool member.
- */
- MHD_LIB_INFO_FIXED_HAS_TLS_CERT_CALLBACK2 = 103
- ,
/* * Sentinel * */
/**
@@ -10491,7 +10500,7 @@ MHD_EXTERN_ enum MHD_StatusCode
MHD_lib_get_info_fixed_sz (enum MHD_LibInfoFixed info_type,
union MHD_LibInfoFixedData *return_data,
size_t return_data_size)
-MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_SIZE_ (2,3)
+MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_ (2)
MHD_FN_PURE_;
/**
@@ -10510,7 +10519,7 @@ MHD_FN_PURE_;
/**
* Types of information about MHD,
- * used by #MHD_lib_get_dymanic_info_sz().
+ * used by #MHD_lib_get_info_dynamic_sz().
* This information may vary over time.
*/
enum MHD_FIXED_ENUM_APP_SET_ MHD_LibInfoDynamic
@@ -10539,7 +10548,7 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_LibInfoDynamic
/**
- * The data provided by #MHD_lib_get_dynamic_info_sz().
+ * The data provided by #MHD_lib_get_info_dynamic_sz().
* The resulting value may vary over time.
*/
union MHD_LibInfoDynamicData
@@ -10571,10 +10580,10 @@ union MHD_LibInfoDynamicData
* @ingroup specialized
*/
MHD_EXTERN_ enum MHD_StatusCode
-MHD_lib_get_info_dynamic_sz (enum MHD_LibDynamicInfo info_type,
- union MHD_LibDynamicInfoData *return_data,
+MHD_lib_get_info_dynamic_sz (enum MHD_LibInfoDynamic info_type,
+ union MHD_LibInfoDynamicData *return_data,
size_t return_data_size)
-MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_SIZE_ (2,3);
+MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_ (2);
/**
* Get dynamic information about MHD that may be changed at run-time.
@@ -10684,7 +10693,7 @@ MHD_daemon_get_info_fixed_sz (struct MHD_Daemon *daemon,
union MHD_DaemonInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
/**
@@ -10742,7 +10751,7 @@ enum MHD_DaemonInfoDynamicType
* This value enforces specific underlying integer type for the enum.
* Do not use.
*/
- MHD_DAEMON_INFO_FIXED_SENTINEL = 65535
+ MHD_DAEMON_INFO_DYNAMIC_SENTINEL = 65535
};
@@ -10791,7 +10800,7 @@ MHD_daemon_get_info_dynamic_sz (struct MHD_Daemon *daemon,
union MHD_DaemonInfoDynamicData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
/**
* Obtain dynamic information about the given daemon.
@@ -10892,7 +10901,7 @@ MHD_connection_get_info_fixed_sz (
union MHD_ConnectionInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
@@ -11081,7 +11090,7 @@ MHD_connection_get_info_dynamic_sz (
union MHD_ConnectionInfoDynamicData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
/**
@@ -11170,7 +11179,7 @@ MHD_stream_get_info_fixed_sz (
union MHD_StreamInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
@@ -11250,7 +11259,7 @@ MHD_stream_get_info_dynamic_sz (
union MHD_StreamInfoDynamicData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
/**
@@ -11345,7 +11354,7 @@ union MHD_RequestInfoFixedData
/**
* The HTTP version type.
*/
- enum MHD_HTTP_Version v_http_ver;
+ enum MHD_HTTP_ProtocolVersion v_http_ver;
/**
* The HTTP method type.
@@ -11374,7 +11383,7 @@ MHD_request_get_info_fixed_sz (struct MHD_Request *request,
union MHD_RequestInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
@@ -11510,7 +11519,7 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_RequestInfoDynamicType
,
/**
* Returns the client-specific pointer to a `void *` that
- * is specific to this request. // TODO: check reference
+ * is specific to this request.
* The result is placed in @a v_pvoid member.
*/
MHD_REQUEST_INFO_DYNAMIC_CLIENT_CONTEXT = 31
@@ -11622,7 +11631,7 @@ MHD_request_get_info_dynamic_sz (struct MHD_Request *request,
union MHD_RequestInfoDynamicData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;