libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit 21cb8fa118e7703ce21f517a7af46fe0fe72722c
parent f13e22da83b616dc3d16c1ece11b17a5b452d7f7
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Wed, 23 Apr 2025 18:30:46 +0200

Doxy and comments fixes

Diffstat:
Msrc/include/microhttpd2.h | 16++++++++--------
Msrc/include/microhttpd2_main.h.in | 8++++----
Msrc/include/microhttpd2_preamble.h.in | 8++++----
Msrc/mhd2/mhd_send.h | 6+++---
Msrc/mhd2/mhd_sockets_funcs.h | 6+++---
Msrc/mhd2/mhd_str.c | 16++++++++--------
Msrc/mhd2/mhd_str.h | 6+++---
Msrc/mhd2/tls_gnu_funcs.h | 7++++---
Msrc/mhd2/tls_multi_funcs.h | 7++++---
Msrc/mhd2/tls_open_funcs.h | 7++++---
10 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h @@ -3623,17 +3623,18 @@ enum MHD_FIXED_FLAGS_ENUM_APP_SET_ MHD_DaemonOptionValueDAuthBindNonce }; +struct MHD_ServerCredentialsContext; + + /** * Context required to provide a pre-shared key to the * server. * - * @param ... + * @param mscc the context * @param psk_size the number of bytes in @a psk * @param psk the pre-shared-key; should be allocated with malloc(), * will be freed by MHD */ -struct MHD_ServerCredentialsContext; - MHD_EXTERN_ enum MHD_StatusCode MHD_connection_set_psk ( struct MHD_ServerCredentialsContext *mscc, @@ -3655,7 +3656,6 @@ MHD_connection_set_psk ( * @param connection the HTTPS connection * @param username the user name claimed by the other side * @param mscc context to pass to #MHD_connection_set_psk(). - * @return 0 on success, -1 on errors */ typedef void (*MHD_PskServerCredentialsCallback)( @@ -8063,8 +8063,8 @@ MHD_FN_PAR_IN_SIZE_ (5, 4); * nonce and the same credentials, without asking user * for the new password * @param mqop the QOP to use - * @param algo digest algorithm to use; if several algorithms are allowed - * then one challenge for each allowed algorithm is added + * @param malgo digest algorithm to use; if several algorithms are allowed + * then one challenge for each allowed algorithm is added * @param userhash_support if set to #MHD_YES then support of userhash is * indicated, allowing client to provide * hash("username:realm") instead of the username in @@ -8139,8 +8139,8 @@ MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_CSTR_ (4); * nonce and the same credentials, without asking user * for the new password * @param mqop the QOP to use - * @param algo digest algorithm to use; if several algorithms are allowed - * then one challenge for each allowed algorithm is added + * @param malgo digest algorithm to use; if several algorithms are allowed + * then one challenge for each allowed algorithm is added * @param userhash_support if set to #MHD_YES then support of userhash is * indicated, allowing client to provide * hash("username:realm") instead of the username in diff --git a/src/include/microhttpd2_main.h.in b/src/include/microhttpd2_main.h.in @@ -3354,8 +3354,8 @@ MHD_FN_PAR_IN_SIZE_ (5, 4); * nonce and the same credentials, without asking user * for the new password * @param mqop the QOP to use - * @param algo digest algorithm to use; if several algorithms are allowed - * then one challenge for each allowed algorithm is added + * @param malgo digest algorithm to use; if several algorithms are allowed + * then one challenge for each allowed algorithm is added * @param userhash_support if set to #MHD_YES then support of userhash is * indicated, allowing client to provide * hash("username:realm") instead of the username in @@ -3430,8 +3430,8 @@ MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_CSTR_ (4); * nonce and the same credentials, without asking user * for the new password * @param mqop the QOP to use - * @param algo digest algorithm to use; if several algorithms are allowed - * then one challenge for each allowed algorithm is added + * @param malgo digest algorithm to use; if several algorithms are allowed + * then one challenge for each allowed algorithm is added * @param userhash_support if set to #MHD_YES then support of userhash is * indicated, allowing client to provide * hash("username:realm") instead of the username in diff --git a/src/include/microhttpd2_preamble.h.in b/src/include/microhttpd2_preamble.h.in @@ -3623,17 +3623,18 @@ enum MHD_FIXED_FLAGS_ENUM_APP_SET_ MHD_DaemonOptionValueDAuthBindNonce }; +struct MHD_ServerCredentialsContext; + + /** * Context required to provide a pre-shared key to the * server. * - * @param ... + * @param mscc the context * @param psk_size the number of bytes in @a psk * @param psk the pre-shared-key; should be allocated with malloc(), * will be freed by MHD */ -struct MHD_ServerCredentialsContext; - MHD_EXTERN_ enum MHD_StatusCode MHD_connection_set_psk ( struct MHD_ServerCredentialsContext *mscc, @@ -3655,7 +3656,6 @@ MHD_connection_set_psk ( * @param connection the HTTPS connection * @param username the user name claimed by the other side * @param mscc context to pass to #MHD_connection_set_psk(). - * @return 0 on success, -1 on errors */ typedef void (*MHD_PskServerCredentialsCallback)( diff --git a/src/mhd2/mhd_send.h b/src/mhd2/mhd_send.h @@ -51,8 +51,8 @@ mhd_send_init_once (void); * and full buffer is sent. * * @param connection the MHD_Connection structure - * @param buffer_size the size of the @a buffer (in bytes) - * @param buffer content of the buffer to send + * @param buf_size the size of the @a buf (in bytes) + * @param buf content of the buffer to send * @param push_data set to true to force push the data to the network from * system buffers (usually set for the last piece of data), * set to false to prefer holding incomplete network packets @@ -106,7 +106,7 @@ MHD_FN_PAR_IN_SIZE_ (3,2) MHD_FN_PAR_IN_SIZE_ (6,5) MHD_FN_PAR_OUT_ (8); /** * Function for sending responses backed by file FD. * - * @param connection the MHD connection structure + * @param c the MHD connection structure * @param[out] sent the pointer to get amount of actually sent bytes * in total (from both buffers combined) * @return mhd_SOCKET_ERR_NO_ERROR if send succeed (the @a sent gets diff --git a/src/mhd2/mhd_sockets_funcs.h b/src/mhd2/mhd_sockets_funcs.h @@ -45,7 +45,7 @@ mhd_socket_nonblocking (MHD_Socket sckt); /** * Change socket options to be non-inheritable. * - * @param sock the socket to manipulate + * @param sckt the socket to manipulate * @return true on success, false otherwise */ MHD_INTERNAL bool @@ -54,7 +54,7 @@ mhd_socket_noninheritable (MHD_Socket sckt); /** * Change socket options to be closed "hard". * - * @param sock the socket to manipulate + * @param sckt the socket to manipulate * @return true on success, false otherwise */ MHD_INTERNAL bool @@ -63,7 +63,7 @@ mhd_socket_set_hard_close (MHD_Socket sckt); /** * Shutdown sending on socket * - * @param sock the socket to manipulate + * @param sckt the socket to manipulate * @return true on success, false otherwise */ MHD_INTERNAL bool diff --git a/src/mhd2/mhd_str.c b/src/mhd2/mhd_str.c @@ -949,27 +949,27 @@ MHD_INTERNAL bool mhd_str_remove_tokens_caseless (char *restrict str, size_t *restrict str_len, const char *const restrict tkns, - const size_t tokens_len) + const size_t tkns_len) { size_t pt; /**< position in @a tokens */ bool token_removed; - mhd_assert (NULL == memchr (tkns, 0, tokens_len)); + mhd_assert (NULL == memchr (tkns, 0, tkns_len)); token_removed = false; pt = 0; - while (pt < tokens_len && *str_len != 0) + while (pt < tkns_len && *str_len != 0) { const char *tkn; /**< the current token */ size_t tkn_len; /* Skip any initial whitespaces and empty tokens in 'tokens' */ - while ( (pt < tokens_len) && + while ( (pt < tkns_len) && ((' ' == tkns[pt]) || ('\t' == tkns[pt]) || (',' == tkns[pt])) ) pt++; - if (pt >= tokens_len) + if (pt >= tkns_len) break; /* No more tokens, nothing to remove */ /* Found non-whitespace char which is not a comma */ @@ -979,16 +979,16 @@ mhd_str_remove_tokens_caseless (char *restrict str, do { pt++; - } while (pt < tokens_len && + } while (pt < tkns_len && (' ' != tkns[pt] && '\t' != tkns[pt] && ',' != tkns[pt])); /* Found end of the token string, space, tab, or comma */ tkn_len = pt - (size_t) (tkn - tkns); /* Skip all spaces and tabs */ - while (pt < tokens_len && (' ' == tkns[pt] || '\t' == tkns[pt])) + while (pt < tkns_len && (' ' == tkns[pt] || '\t' == tkns[pt])) pt++; /* Found end of the token string or non-whitespace char */ - } while (pt < tokens_len && ',' != tkns[pt]); + } while (pt < tkns_len && ',' != tkns[pt]); /* 'tkn' is the input token with 'tkn_len' chars */ mhd_assert (0 != tkn_len); diff --git a/src/mhd2/mhd_str.h b/src/mhd2/mhd_str.h @@ -200,8 +200,8 @@ mhd_str_remove_token_caseless (const char *restrict str, * @param[in,out] str the string to update * @param[in,out] str_len the length of the @a str, not including optional * terminating null-character, not null-terminated - * @param tokens the token to find - * @param tokens_len the length of @a tokens, not including optional + * @param tkns the token to find + * @param tkns_len the length of @a tokens, not including optional * terminating null-character. * @return 'true' if any token has been removed, * 'false' otherwise. @@ -210,7 +210,7 @@ MHD_INTERNAL bool mhd_str_remove_tokens_caseless (char *restrict str, size_t *restrict str_len, const char *const restrict tkns, - const size_t tokens_len); + const size_t tkns_len); #ifndef MHD_FAVOR_SMALL_CODE diff --git a/src/mhd2/tls_gnu_funcs.h b/src/mhd2/tls_gnu_funcs.h @@ -239,8 +239,8 @@ MHD_FN_PAR_NONNULL_ALL_; * Send data to the remote side over TLS connection * * @param c_tls the connection TLS handle - * @param buffer_size the size of the @a buffer (in bytes) - * @param buffer content of the buffer to send + * @param buf_size the size of the @a buf (in bytes) + * @param buf content of the buffer to send * @param[out] sent the pointer to get amount of actually sent bytes * @return mhd_SOCKET_ERR_NO_ERROR if send succeed (the @a sent gets * the sent size) or socket error @@ -258,7 +258,8 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (3,2) MHD_FN_PAR_OUT_ (4); /** * Get the TLS session used in connection * @param c_tls the connection TLS handle - * @param tls_ver_out the pointer to variable to be set to the TLS version + * @param tls_sess_out the pointer to variable to be set to the TLS session + * handle */ MHD_INTERNAL void mhd_tls_gnu_conn_get_tls_sess ( diff --git a/src/mhd2/tls_multi_funcs.h b/src/mhd2/tls_multi_funcs.h @@ -218,8 +218,8 @@ MHD_FN_PAR_NONNULL_ALL_; * Send data to the remote side over TLS connection * * @param c_tls the connection TLS handle - * @param buffer_size the size of the @a buffer (in bytes) - * @param buffer content of the buffer to send + * @param buf_size the size of the @a buf (in bytes) + * @param buf content of the buffer to send * @param[out] sent the pointer to get amount of actually sent bytes * @return mhd_SOCKET_ERR_NO_ERROR if send succeed (the @a sent gets * the sent size) or socket error @@ -237,7 +237,8 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (3,2) MHD_FN_PAR_OUT_ (4); /** * Get the TLS session used in connection * @param c_tls the connection TLS handle - * @param tls_ver_out the pointer to variable to be set to the TLS version + * @param tls_sess_out the pointer to variable to be set to the TLS session + * handle */ MHD_INTERNAL void mhd_tls_multi_conn_get_tls_sess ( diff --git a/src/mhd2/tls_open_funcs.h b/src/mhd2/tls_open_funcs.h @@ -223,8 +223,8 @@ MHD_FN_PAR_NONNULL_ALL_; * Send data to the remote side over TLS connection * * @param c_tls the connection TLS handle - * @param buffer_size the size of the @a buffer (in bytes) - * @param buffer content of the buffer to send + * @param buf_size the size of the @a buf (in bytes) + * @param buf content of the buffer to send * @param[out] sent the pointer to get amount of actually sent bytes * @return mhd_SOCKET_ERR_NO_ERROR if send succeed (the @a sent gets * the sent size) or socket error @@ -242,7 +242,8 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (3,2) MHD_FN_PAR_OUT_ (4); /** * Get the TLS session used in connection * @param c_tls the connection TLS handle - * @param tls_ver_out the pointer to variable to be set to the TLS version + * @param tls_sess_out the pointer to variable to be set to the TLS session + * handle */ MHD_INTERNAL void mhd_tls_open_conn_get_tls_sess (