浏览代码

Re-generated daemon settings

Evgeny Grin (Karlson2k) 1 年之前
父节点
当前提交
87ea7d20af

+ 85 - 24
src/include/microhttpd2.h

@@ -173,6 +173,7 @@ enum MHD_Bool
 
 #ifndef MHD_STRINGS_DEFINED
 
+
 /**
  * String with length data.
  * This type should always have valid @a cstr pointer.
@@ -290,8 +291,8 @@ struct MHD_Request;
 
 
 /**
- * @brief Actions are returned by the application to drive the request
- * handling of MHD.
+ * @brief Actions are returned by the application when processed client header
+ * to drive the request handling of MHD.
  *
  * @defgroup action Request actions
  */
@@ -1349,7 +1350,6 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
    * cannot be provided due to some error or other reasons.
    */
   MHD_SC_INFO_GET_TYPE_UNAVAILALBE = 60204
-
 };
 
 /**
@@ -1494,7 +1494,7 @@ MHD_FN_CONST_;
 /* Safe.     Idempotent.     RFC9110, Section 9.3.8. */
 #define MHD_HTTP_METHOD_STR_TRACE    "TRACE"
 /* Not safe. Not idempotent. RFC9110, Section 18.2. */
-#define MHD_HTTP_METHOD_STR_ASTERISK "*"
+#define MHD_HTTP_METHOD_STR_ASTERISK  "*"
 
 /* Additional HTTP methods. */
 /* Not safe. Idempotent.     RFC3744, Section 8.1. */
@@ -1564,6 +1564,7 @@ MHD_FN_CONST_;
 
 #ifndef MHD_HTTP_POSTENCODING_DEFINED
 
+
 /**
  * @brief Possible encodings for HTML forms submitted as HTTP POST requests
  *
@@ -1609,6 +1610,7 @@ enum MHD_FIXED_ENUM_MHD_APP_SET_ MHD_HTTP_PostEncoding
 #define MHD_HTTP_POSTENCODING_DEFINED 1
 #endif /* ! MHD_HTTP_POSTENCODING_DEFINED */
 
+
 /**
  * @brief Standard headers found in HTTP requests and responses.
  *
@@ -3364,6 +3366,7 @@ typedef void
                            const struct MHD_String *full_uri,
                            struct MHD_EarlyUriCbData *req_data);
 
+
 /**
  * The `enum MHD_ConnectionNotificationCode` specifies types
  * of connection notifications.
@@ -3458,7 +3461,6 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StreamNotificationCode
    * @ingroup request
    */
   MHD_STREAM_NOTIFY_CLOSED = 1
-
 };
 
 /**
@@ -3672,13 +3674,13 @@ MHD_D_OPTION_POLL_SYSCALL (
  * Set a callback to use for logging
  * @param log_cb the callback to use for logging,
  *   NULL to disable logging
- * @param lob_cb_cls the closure for the logging callback
+ * @param log_cb_cls the closure for the logging callback
  * @return structure with the requested setting
  */
 struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_LOG_CALLBACK (
   MHD_LoggingCallback log_cb,
-  void *lob_cb_cls
+  void *log_cb_cls
   );
 
 /**
@@ -3707,12 +3709,14 @@ Does not work with #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_LISTEN_SOCKET().
 If no listen socket optins (#MHD_D_OPTION_BIND_PORT(), #MHD_D_OPTION_BIND_SA(), #MHD_D_OPTION_LISTEN_SOCKET()) are used, MHD does not listen for incoming connection.
  * @param sa_len the size of the socket address pointed by @a sa.
  * @param sa the address to bind to; can be IPv4 (AF_INET), IPv6 (AF_INET6) or even a UNIX domain socket (AF_UNIX)
+ * @param dual When a previous version of the protocol exist (like IPv4 when @a v_sa is IPv6) bind to both protocols (IPv6 and IPv4).
  * @return structure with the requested setting
  */
 struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_BIND_SA (
   size_t sa_len,
-  const struct sockaddr *sa
+  /* const */ struct sockaddr *sa,
+  enum MHD_Bool dual
   );
 
 /**
@@ -3766,6 +3770,7 @@ MHD_D_OPTION_TCP_FASTOPEN (
  * Use the given backlog for the listen() call.
  *
 Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
+ * Zero parameter treated as MHD/system default.
  * @param backlog_size FIXME
  * @return structure with the requested setting
  */
@@ -3859,7 +3864,10 @@ MHD_D_OPTION_DEFAULT_TIMEOUT (
   );
 
 /**
- * Maximum number of (concurrent) network connections served by daemon
+ * Maximum number of (concurrent) network connections served by daemon.
+ * @note The real maximum number of network connections could be smaller
+ *       than requested due to the system limitations, like FD_SETSIZE when
+ *       polling by select() is used.
  * @param glob_limit FIXME
  * @return structure with the requested setting
  */
@@ -3990,8 +3998,7 @@ MHD_D_OPTION_STACK_SIZE (
  * If listen socket FD is equal or higher that specified value, the daemon fail to start.
  * If new connection FD is equal or higher that specified value, the connection is rejected.
  * Useful if application uses select() for polling the sockets, system FD_SETSIZE is good value for this option in such case.
- * Does not work with #MHD_D_OPTION_WM_WORKER_THREADS() or #MHD_D_OPTION_WM_THREAD_PER_CONNECTION().
- * Does not work on W32 (WinSock sockets).
+ * Silently ignored on W32 (WinSock sockets).
  * @param max_fd FIXME
  * @return structure with the requested setting
  */
@@ -4101,7 +4108,7 @@ MHD_D_OPTION_NOTIFY_STREAM (
 struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_RANDOM_ENTROPY (
   size_t buf_size,
-  const void *buf
+  /* const */ void *buf
   );
 
 /**
@@ -4211,7 +4218,12 @@ MHD_R_OPTION_CONN_CLOSE (
  * Response still use HTTP/1.1 version in header, but always close the connection after sending the response and do not use chunked encoding for the response.
  * You can also set the #MHD_R_O_HTTP_1_0_SERVER flag to force HTTP/1.0 version in the response.
  * Responses are still compatible with HTTP/1.1.
- * 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.
+ * Summary:
+ * + declared reply version: HTTP/1.1
+ * + keep-alive: no
+ * + chunked: no
+ *
+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.
  * @param val the value of the parameter * @return structure with the requested setting
  */
 struct MHD_ResponseOptionAndValue
@@ -4226,7 +4238,12 @@ MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRICT (
  * Chunked encoding will not be used for the response.
  * Due to backward compatibility, responses still can be used with HTTP/1.1 clients.
  * This option can be used to emulate HTTP/1.0 server (for response part only as chunked encoding in requests (if any) is processed by MHD).
- * With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
+ * Summary:
+ * + declared reply version: HTTP/1.0
+ * + keep-alive: possible
+ * + chunked: no
+ *
+With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
  * @param val the value of the parameter * @return structure with the requested setting
  */
 struct MHD_ResponseOptionAndValue
@@ -5228,7 +5245,7 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_HTTP_ProtocolVersion
  * HTTP/2 (and later) is not used inside the HTTP protocol.
  * @param pv the protocol version
  * @return the string representation of the protocol version,
- *         NULL for unknown values
+ *         NULL for invalid values
  */
 MHD_EXTERN_ const struct MHD_String *
 MHD_protocol_version_to_string (enum MHD_HTTP_ProtocolVersion pv)
@@ -5511,6 +5528,7 @@ struct MHD_DynContentZCIoVec
  * The action type returned by Dynamic Content Creator callback
  */
 struct MHD_DynamicContentCreatorAction;
+
 /**
  * The context used for Dynamic Content Creator callback
  */
@@ -5518,8 +5536,9 @@ struct MHD_DynamicContentCreatorContext;
 
 
 /**
- * Set action to "continue processing", the data is provided in the
- * buffer and/or in the zero-copy @a iov_data.
+ * Create "continue processing" action with optional chunk-extension.
+ * The data is provided in the buffer and/or in the zero-copy @a iov_data.
+ *
  * If data is provided both in the buffer and @a ivo_data then
  * data in the buffer sent first, following the iov data.
  * The total size of the data in the buffer and in @a iov_data must
@@ -5546,13 +5565,45 @@ MHD_DCC_action_continue_zc (
 MHD_FN_PAR_NONNULL_ (1)
 MHD_FN_PAR_CSTR_ (4);
 
-#define MHD_DCC_action_continue(ctx,data_size,chunk_ext) \
-        MHD_DCC_action_continue_zc (ctx, data_size, NULL, chunk_ext)
 
 /**
- * Set action to "finished".
+ * Create "continue processing" action with optional chunk-extension.
+ * The data is provided in the buffer.
+ *
+ * @param[in,out] ctx the pointer the context as provided to the callback
+ * @param data_size the amount of the data placed to the provided buffer (not @a iov_data),
+ *                  cannot be larger than provided buffer size,
+ *                  must be non-zero.
+ * @param chunk_ext the optional pointer to chunk extension string,
+ *                  can be NULL to not use chunk extension,
+ *                  ignored if chunked encoding is not used
+ * @return the pointer to the action if succeed,
+ *         NULL (equivalent of MHD_DCC_action_abort())in case of any error
+ */
+#define MHD_DCC_action_continue_ce(ctx,data_size,chunk_ext) \
+        MHD_DCC_action_continue_zc ((ctx), (data_size), NULL, (chunk_ext))
+
+
+/**
+ * Create "continue processing" action, the data is provided in the buffer.
+ *
+ * @param[in,out] ctx the pointer the context as provided to the callback
+ * @param data_size the amount of the data placed to the provided buffer;
+ *                  cannot be larger than provided buffer size,
+ *                  must be non-zero.
+ *
+ * @return the pointer to the action if succeed,
+ *         NULL (equivalent of MHD_DCC_action_abort())in case of any error
+ */
+#define MHD_DCC_action_continue(ctx,data_size) \
+        MHD_DCC_action_continue_ce ((ctx), (data_size), NULL)
+
+
+/**
+ * Create "finished" action with optional footers.
  * If function failed for any reason, the action is automatically
  * set to "stop with error".
+ *
  * @param[in,out] ctx the pointer the context as provided to the callback
  * @param num_footers number of elements in the @a footers array,
  *                    must be zero if @a footers is NULL
@@ -5571,12 +5622,21 @@ MHD_DCC_action_finished_with_footer (
 MHD_FN_PAR_NONNULL_ (1);
 
 
-#define MHD_DCC_action_finished(action) \
-        MHD_DCC_set_action_finished_with_footer (action, 0, NULL)
+/**
+ * Create "finished" action.
+ * If function failed for any reason, the action is automatically
+ * set to "stop with error".
+ *
+ * @param[in,out] ctx the pointer the context as provided to the callback
+ * @return the pointer to the action if succeed,
+ *         NULL (equivalent of MHD_DCC_action_abort())in case of any error
+ */
+#define MHD_DCC_action_finished(ctx) \
+        MHD_DCC_action_finished_with_footer ((ctx), 0, NULL)
 
 
 /**
- * Set action to "suspend".
+ * Create "suspend" action.
  * If function failed for any reason, the action is automatically
  * set to "stop with error".
  * @param[in,out] ctx the pointer the context as provided to the callback
@@ -5589,7 +5649,7 @@ MHD_FN_PAR_NONNULL_ (1)
 MHD_FN_RETURNS_NONNULL_;
 
 /**
- * Set action to "stop with error".
+ * Create "stop with error" action.
  * @param[in,out] ctx the pointer the context as provided to the callback
  * @return always NULL (the action "stop with error")
  */
@@ -8944,6 +9004,7 @@ union MHD_RequestInfoDynamicData
    * The pointer to pointer to the data.
    */
   void **v_ppvoid;
+
   /**
    * The information about client provided username for digest auth
    */

+ 64 - 56
src/include/microhttpd2_generated_daemon_options.h

@@ -1,5 +1,3 @@
-/* EDITED MANUALLY */
-
 /**
  * The options (parameters) for MHD daemon
  */
@@ -401,8 +399,7 @@ struct MHD_DaemonOptionValueSA
   /* const */ struct sockaddr *v_sa;
 
   /**
-   * When a previous version of the protocol exist (like IPv4 when @a v_sa is
-   * IPv6) bind to both protocols (IPv6 and IPv4).
+   * When a previous version of the protocol exist (like IPv4 when @a v_sa is IPv6) bind to both protocols (IPv6 and IPv4).
    */
   enum MHD_Bool v_dual;
 
@@ -571,7 +568,7 @@ struct MHD_DaemonOptionValueNotifStreamCB
 /**
  * Data for #MHD_D_O_RANDOM_ENTROPY
  */
-struct MHD_DaemonOptionValueRand
+struct MHD_DaemonOptionEntropySeed
 {
   /**
    * the size of the buffer
@@ -795,7 +792,7 @@ union MHD_DaemonOptionValue
    * Value for #MHD_D_O_RANDOM_ENTROPY.
    * the size of the buffer
    */
-  struct MHD_DaemonOptionValueRand random_entropy;
+  struct MHD_DaemonOptionEntropySeed random_entropy;
 
   /**
    * Value for #MHD_D_O_DAUTH_MAP_SIZE.
@@ -910,15 +907,17 @@ Does not work with #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_LISTEN_SOCKET().
 If no listen socket optins (#MHD_D_OPTION_BIND_PORT(), #MHD_D_OPTION_BIND_SA(), #MHD_D_OPTION_LISTEN_SOCKET()) are used, MHD does not listen for incoming connection.
  * @param sa_len the size of the socket address pointed by @a sa.
  * @param sa the address to bind to; can be IPv4 (AF_INET), IPv6 (AF_INET6) or even a UNIX domain socket (AF_UNIX)
+ * @param dual When a previous version of the protocol exist (like IPv4 when @a v_sa is IPv6) bind to both protocols (IPv6 and IPv4).
  * @return structure with the requested setting
  */
-#  define MHD_D_OPTION_BIND_SA(sa_len,sa) \
+#  define MHD_D_OPTION_BIND_SA(sa_len,sa,dual) \
         MHD_NOWARN_COMPOUND_LITERALS_ \
           (const struct MHD_DaemonOptionAndValue) \
         { \
           .opt = MHD_D_O_BIND_SA,  \
           .val.bind_sa.v_sa_len = (sa_len), \
-          .val.bind_sa.v_sa = (sa) \
+          .val.bind_sa.v_sa = (sa), \
+          .val.bind_sa.v_dual = (dual) \
         } \
         MHD_RESTORE_WARN_COMPOUND_LITERALS_
 /**
@@ -981,6 +980,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
  * Use the given backlog for the listen() call.
  *
 Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
+ * Zero parameter treated as MHD/system default.
  * @param backlog_size FIXME
  * @return structure with the requested setting
  */
@@ -1098,7 +1098,10 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
         } \
         MHD_RESTORE_WARN_COMPOUND_LITERALS_
 /**
- * Maximum number of (concurrent) network connections served by daemon
+ * Maximum number of (concurrent) network connections served by daemon.
+ * @note The real maximum number of network connections could be smaller
+ *       than requested due to the system limitations, like FD_SETSIZE when
+ *       polling by select() is used.
  * @param glob_limit FIXME
  * @return structure with the requested setting
  */
@@ -1262,8 +1265,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
  * If listen socket FD is equal or higher that specified value, the daemon fail to start.
  * If new connection FD is equal or higher that specified value, the connection is rejected.
  * Useful if application uses select() for polling the sockets, system FD_SETSIZE is good value for this option in such case.
- * Does not work with #MHD_D_OPTION_WM_WORKER_THREADS() or #MHD_D_OPTION_WM_THREAD_PER_CONNECTION().
- * Does not work on W32 (WinSock sockets).
+ * Silently ignored on W32 (WinSock sockets).
  * @param max_fd FIXME
  * @return structure with the requested setting
  */
@@ -1485,7 +1487,7 @@ MHD_NOWARN_UNUSED_FUNC_
  * @param wmp the object created by one of the next functions/macros: #MHD_WM_OPTION_EXTERNAL_PERIODIC(), #MHD_WM_OPTION_EXTERNAL_EVENT_LOOP_CB_LEVEL(), #MHD_WM_OPTION_EXTERNAL_EVENT_LOOP_CB_EDGE(), #MHD_WM_OPTION_EXTERNAL_SINGLE_FD_WATCH(), #MHD_WM_OPTION_WORKER_THREADS(), #MHD_WM_OPTION_THREAD_PER_CONNECTION()
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_WORK_MODE (
   struct MHD_WorkModeWithParam wmp
   )
@@ -1504,7 +1506,7 @@ MHD_D_OPTION_WORK_MODE (
  * @param els FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_POLL_SYSCALL (
   enum MHD_SockPollSyscall els
   )
@@ -1525,7 +1527,7 @@ MHD_D_OPTION_POLL_SYSCALL (
  * @param log_cb_cls the closure for the logging callback
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_LOG_CALLBACK (
   MHD_LoggingCallback log_cb,
   void *log_cb_cls
@@ -1553,7 +1555,7 @@ If no listen socket optins (#MHD_D_OPTION_BIND_PORT(), #MHD_D_OPTION_BIND_SA(),
  *   ignored if @a af is #MHD_AF_NONE
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_BIND_PORT (
   enum MHD_AddressFamily af,
   uint_least16_t port
@@ -1577,12 +1579,14 @@ Does not work with #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_LISTEN_SOCKET().
 If no listen socket optins (#MHD_D_OPTION_BIND_PORT(), #MHD_D_OPTION_BIND_SA(), #MHD_D_OPTION_LISTEN_SOCKET()) are used, MHD does not listen for incoming connection.
  * @param sa_len the size of the socket address pointed by @a sa.
  * @param sa the address to bind to; can be IPv4 (AF_INET), IPv6 (AF_INET6) or even a UNIX domain socket (AF_UNIX)
+ * @param dual When a previous version of the protocol exist (like IPv4 when @a v_sa is IPv6) bind to both protocols (IPv6 and IPv4).
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_BIND_SA (
   size_t sa_len,
-  const struct sockaddr *sa
+  /* const */ struct sockaddr *sa,
+  enum MHD_Bool dual
   )
 {
   struct MHD_DaemonOptionAndValue opt_val;
@@ -1590,6 +1594,7 @@ MHD_D_OPTION_BIND_SA (
   opt_val.opt = MHD_D_O_BIND_SA;
   opt_val.val.bind_sa.v_sa_len = sa_len;
   opt_val.val.bind_sa.v_sa = sa;
+  opt_val.val.bind_sa.v_dual = dual;
 
   return opt_val;
 }
@@ -1605,7 +1610,7 @@ If no listen socket optins (#MHD_D_OPTION_BIND_PORT(), #MHD_D_OPTION_BIND_SA(),
  * @param listen_fd the listen socket to use, ignored if set to #MHD_INVALID_SOCKET
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_LISTEN_SOCKET (
   MHD_Socket listen_fd
   )
@@ -1626,7 +1631,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
  * @param reuse_type FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_LISTEN_ADDR_REUSE (
   enum MHD_DaemonOptionBindType reuse_type
   )
@@ -1654,7 +1659,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
  *   silently ignored on platforms without support for custom queue size
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_TCP_FASTOPEN (
   enum MHD_TCPFastOpenType option,
   unsigned int queue_length
@@ -1674,10 +1679,11 @@ MHD_D_OPTION_TCP_FASTOPEN (
  * Use the given backlog for the listen() call.
  *
 Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
+ * Zero parameter treated as MHD/system default.
  * @param backlog_size FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_LISTEN_BACKLOG (
   unsigned int backlog_size
   )
@@ -1697,7 +1703,7 @@ MHD_D_OPTION_LISTEN_BACKLOG (
  * Silently ignored when MHD creates internal threads as for them SIGPIPE is suppressed automatically.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_SIGPIPE_SUPPRESSED (
   enum MHD_Bool val
   )
@@ -1717,7 +1723,7 @@ MHD_D_OPTION_SIGPIPE_SUPPRESSED (
  *   #MHD_TLS_BACKEND_NONE for non-TLS (plain TCP) connections
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_TLS (
   enum MHD_TlsBackend backend
   )
@@ -1740,7 +1746,7 @@ MHD_D_OPTION_TLS (
  *   could be NULL is private does not need a password
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_TLS_KEY_CERT (
   const char *mem_key,
   const char *mem_cert,
@@ -1764,7 +1770,7 @@ MHD_D_OPTION_TLS_KEY_CERT (
  * @param mem_client_ca the CA certificate in memory (not a filename)
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_TLS_CLIENT_CA (
   const char *mem_client_ca
   )
@@ -1784,7 +1790,7 @@ MHD_D_OPTION_TLS_CLIENT_CA (
  * @param psk_cb_cls the closure for @a psk_cb
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_TLS_PSK_CALLBACK (
   MHD_PskServerCredentialsCallback psk_cb,
   void *psk_cb_cls
@@ -1806,7 +1812,7 @@ MHD_D_OPTION_TLS_PSK_CALLBACK (
  * By default ALPN is automatically used for TLS connections.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_NO_ALPN (
   enum MHD_Bool val
   )
@@ -1827,7 +1833,7 @@ MHD_D_OPTION_NO_ALPN (
  * @param timeout the in seconds, zero for no timeout
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DEFAULT_TIMEOUT (
   unsigned int timeout
   )
@@ -1842,11 +1848,14 @@ MHD_D_OPTION_DEFAULT_TIMEOUT (
 
 
 /**
- * Maximum number of (concurrent) network connections served by daemon
+ * Maximum number of (concurrent) network connections served by daemon.
+ * @note The real maximum number of network connections could be smaller
+ *       than requested due to the system limitations, like FD_SETSIZE when
+ *       polling by select() is used.
  * @param glob_limit FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_GLOBAL_CONNECTION_LIMIT (
   unsigned int glob_limit
   )
@@ -1866,7 +1875,7 @@ MHD_D_OPTION_GLOBAL_CONNECTION_LIMIT (
  * @param limit FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_PER_IP_LIMIT (
   unsigned int limit
   )
@@ -1886,7 +1895,7 @@ MHD_D_OPTION_PER_IP_LIMIT (
  * @param apc_cls the closure for the callback
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_ACCEPT_POLICY (
   MHD_AcceptPolicyCallback apc,
   void *apc_cls
@@ -1908,7 +1917,7 @@ MHD_D_OPTION_ACCEPT_POLICY (
  * @param how the way how to use the requested level
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_PROTOCOL_STRICT_LEVEL (
   enum MHD_ProtocolStrictLevel sl,
   enum MHD_UseStictLevel how
@@ -1932,7 +1941,7 @@ MHD_D_OPTION_PROTOCOL_STRICT_LEVEL (
  * @param cls the closure for the callback
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_EARLY_URI_LOGGER (
   MHD_EarlyUriLogCallback cb,
   void *cls
@@ -1954,7 +1963,7 @@ MHD_D_OPTION_EARLY_URI_LOGGER (
  * By default plus is converted to space in the query part of URI.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DISABLE_URI_QUERY_PLUS_AS_SPACE (
   enum MHD_Bool val
   )
@@ -1974,7 +1983,7 @@ MHD_D_OPTION_DISABLE_URI_QUERY_PLUS_AS_SPACE (
  * The 'Date:' is not suppressed (the header is enabled) by default.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_SUPPRESS_DATE_HEADER (
   enum MHD_Bool val
   )
@@ -1993,7 +2002,7 @@ MHD_D_OPTION_SUPPRESS_DATE_HEADER (
  * This will cause *all* responses to begin with the SHOUTcast 'ICY' line instead of 'HTTP'.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_ENABLE_SHOUTCAST (
   enum MHD_Bool val
   )
@@ -2014,7 +2023,7 @@ MHD_D_OPTION_ENABLE_SHOUTCAST (
  * The size should be large enough to fit all request headers (together with internal parsing information).
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_CONN_MEMORY_LIMIT (
   size_t val
   )
@@ -2035,7 +2044,7 @@ MHD_D_OPTION_CONN_MEMORY_LIMIT (
  * Can be set to zero to disable share pool.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_LARGE_POOL_SIZE (
   size_t val
   )
@@ -2055,7 +2064,7 @@ MHD_D_OPTION_LARGE_POOL_SIZE (
  * Works only with #MHD_D_OPTION_WM_WORKER_THREADS() or #MHD_D_OPTION_WM_THREAD_PER_CONNECTION().
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_STACK_SIZE (
   size_t val
   )
@@ -2075,12 +2084,11 @@ MHD_D_OPTION_STACK_SIZE (
  * If listen socket FD is equal or higher that specified value, the daemon fail to start.
  * If new connection FD is equal or higher that specified value, the connection is rejected.
  * Useful if application uses select() for polling the sockets, system FD_SETSIZE is good value for this option in such case.
- * Does not work with #MHD_D_OPTION_WM_WORKER_THREADS() or #MHD_D_OPTION_WM_THREAD_PER_CONNECTION().
- * Does not work on W32 (WinSock sockets).
+ * Silently ignored on W32 (WinSock sockets).
  * @param max_fd FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_FD_NUMBER_LIMIT (
   MHD_Socket max_fd
   )
@@ -2101,7 +2109,7 @@ MHD_D_OPTION_FD_NUMBER_LIMIT (
  * The 'turbo' mode is not enabled (mode is disabled) by default.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_TURBO (
   enum MHD_Bool val
   )
@@ -2124,7 +2132,7 @@ MHD_D_OPTION_TURBO (
  * Thread safety is not disabled (safety is enabled) by default.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DISABLE_THREAD_SAFETY (
   enum MHD_Bool val
   )
@@ -2145,7 +2153,7 @@ MHD_D_OPTION_DISABLE_THREAD_SAFETY (
  * The upgrade is not disallowed (upgrade is allowed) by default.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DISALLOW_UPGRADE (
   enum MHD_Bool val
   )
@@ -2166,7 +2174,7 @@ You should only use this function if you do not use suspend functionality and ne
  * The suspend is not disallowed (suspend is allowed) by default.
  * @param val the value of the parameter * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DISALLOW_SUSPEND_RESUME (
   enum MHD_Bool val
   )
@@ -2188,7 +2196,7 @@ The specified callback will be called one time, after network initialisation, TL
  * @param cb_cls the closure for the callback
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DAEMON_READY_CALLBACK (
   MHD_DaemonReadyCallback cb,
   void *cb_cls
@@ -2210,7 +2218,7 @@ MHD_D_OPTION_DAEMON_READY_CALLBACK (
  * @param cls the closure for the callback
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_NOTIFY_CONNECTION (
   MHD_NotifyConnectionCallback ncc,
   void *cls
@@ -2233,7 +2241,7 @@ MHD_D_OPTION_NOTIFY_CONNECTION (
  * @param cls the closure for the callback
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_NOTIFY_STREAM (
   MHD_NotifyStreamCallback nsc,
   void *cls
@@ -2258,10 +2266,10 @@ MHD_D_OPTION_NOTIFY_STREAM (
  * @param buf the buffer with strong random data, the content will be copied by MHD
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_RANDOM_ENTROPY (
   size_t buf_size,
-  const void *buf
+  /* const */ void *buf
   )
 {
   struct MHD_DaemonOptionAndValue opt_val;
@@ -2281,7 +2289,7 @@ MHD_D_OPTION_RANDOM_ENTROPY (
  * @param size the size of the map array
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DAUTH_MAP_SIZE (
   size_t size
   )
@@ -2303,7 +2311,7 @@ MHD_D_OPTION_DAUTH_MAP_SIZE (
  * @param bind_type FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DAUTH_NONCE_BIND_TYPE (
   enum MHD_DaemonOptionValueDAuthBindNonce bind_type
   )
@@ -2324,7 +2332,7 @@ MHD_D_OPTION_DAUTH_NONCE_BIND_TYPE (
  * @param timeout FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DAUTH_DEF_NONCE_TIMEOUT (
   unsigned int timeout
   )
@@ -2345,7 +2353,7 @@ MHD_D_OPTION_DAUTH_DEF_NONCE_TIMEOUT (
  * @param max_nc FIXME
  * @return structure with the requested setting
  */
-static MHD_INLINE struct MHD_daemonOptionAndValue
+static MHD_INLINE struct MHD_DaemonOptionAndValue
 MHD_D_OPTION_DAUTH_DEF_MAX_NC (
   uint_fast32_t max_nc
   )

+ 26 - 6
src/include/microhttpd2_generated_response_options.h

@@ -51,7 +51,7 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_ResponseOption
    * + keep-alive: no
    * + chunked: no
    *
-   * 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.
+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.
    */
   MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT = 80
   ,
@@ -68,7 +68,7 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_ResponseOption
    * + keep-alive: possible
    * + chunked: no
    *
-   * With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
+With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
    */
   MHD_R_O_HTTP_1_0_SERVER = 81
   ,
@@ -237,7 +237,12 @@ struct MHD_ResponseOptionAndValue
  * Response still use HTTP/1.1 version in header, but always close the connection after sending the response and do not use chunked encoding for the response.
  * You can also set the #MHD_R_O_HTTP_1_0_SERVER flag to force HTTP/1.0 version in the response.
  * Responses are still compatible with HTTP/1.1.
- * 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.
+ * Summary:
+ * + declared reply version: HTTP/1.1
+ * + keep-alive: no
+ * + chunked: no
+ *
+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.
  * @param val the value of the parameter * @return structure with the requested setting
  */
 #  define MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRICT(val) \
@@ -255,7 +260,12 @@ struct MHD_ResponseOptionAndValue
  * Chunked encoding will not be used for the response.
  * Due to backward compatibility, responses still can be used with HTTP/1.1 clients.
  * This option can be used to emulate HTTP/1.0 server (for response part only as chunked encoding in requests (if any) is processed by MHD).
- * With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
+ * Summary:
+ * + declared reply version: HTTP/1.0
+ * + keep-alive: possible
+ * + chunked: no
+ *
+With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
  * @param val the value of the parameter * @return structure with the requested setting
  */
 #  define MHD_R_OPTION_HTTP_1_0_SERVER(val) \
@@ -394,7 +404,12 @@ MHD_R_OPTION_CONN_CLOSE (
  * Response still use HTTP/1.1 version in header, but always close the connection after sending the response and do not use chunked encoding for the response.
  * You can also set the #MHD_R_O_HTTP_1_0_SERVER flag to force HTTP/1.0 version in the response.
  * Responses are still compatible with HTTP/1.1.
- * 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.
+ * Summary:
+ * + declared reply version: HTTP/1.1
+ * + keep-alive: no
+ * + chunked: no
+ *
+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.
  * @param val the value of the parameter * @return structure with the requested setting
  */
 static MHD_INLINE struct MHD_responseOptionAndValue
@@ -418,7 +433,12 @@ MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRICT (
  * Chunked encoding will not be used for the response.
  * Due to backward compatibility, responses still can be used with HTTP/1.1 clients.
  * This option can be used to emulate HTTP/1.0 server (for response part only as chunked encoding in requests (if any) is processed by MHD).
- * With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
+ * Summary:
+ * + declared reply version: HTTP/1.0
+ * + keep-alive: possible
+ * + chunked: no
+ *
+With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
  * @param val the value of the parameter * @return structure with the requested setting
  */
 static MHD_INLINE struct MHD_responseOptionAndValue

+ 0 - 6
src/mhd2/daemon_options.h

@@ -133,12 +133,6 @@ struct DaemonOptions {
   unsigned int global_connection_limit;
 
 
-  /**
-   * // TODO: add settings
-   */
-  size_t global_large_buffer_size;
-
-
   /**
    * Value for #MHD_D_O_PER_IP_LIMIT.
    * FIXME

+ 40 - 39
src/mhd2/daemon_set_options.c

@@ -6,8 +6,6 @@
  * @author daemon-options-generator.c
  */
 
-/* EDITED MANUALLY */
-
 #include "mhd_sys_options.h"
 #include "sys_base_types.h"
 #include "sys_malloc.h"
@@ -16,11 +14,12 @@
 #include "daemon_options.h"
 #include "mhd_public_api.h"
 
-
-MHD_FN_PAR_NONNULL_ALL_ MHD_EXTERN_ enum MHD_StatusCode
-MHD_daemon_set_options (struct MHD_Daemon *daemon,
-                        const struct MHD_DaemonOptionAndValue *options,
-                        size_t options_max_num)
+MHD_FN_PAR_NONNULL_ALL_ MHD_EXTERN_
+enum MHD_StatusCode
+MHD_daemon_set_options (
+  struct MHD_Daemon *daemon,
+  const struct MHD_DaemonOptionAndValue *options,
+  size_t options_max_num)
 {
   struct DaemonOptions *const settings = daemon->settings;
   size_t i;
@@ -28,10 +27,11 @@ MHD_daemon_set_options (struct MHD_Daemon *daemon,
   if (mhd_DAEMON_STATE_NOT_STARTED != daemon->state)
     return MHD_SC_TOO_LATE;
 
-  for (i=0;i<options_max_num;i++)
+  for (i = 0; i < options_max_num; i++)
   {
     const struct MHD_DaemonOptionAndValue *const option = options + i;
-    switch (option->opt) {
+    switch (option->opt)
+    {
     case MHD_D_O_END:
       return MHD_SC_OK;
     case MHD_D_O_WORK_MODE:
@@ -41,7 +41,7 @@ MHD_daemon_set_options (struct MHD_Daemon *daemon,
       settings->poll_syscall = option->val.poll_syscall;
       continue;
     case MHD_D_O_LOG_CALLBACK:
-      /* Note: set directly to the daemon! */
+      /* Note: set directly to the daemon */
       daemon->log_params = option->val.log_callback;
       continue;
     case MHD_D_O_BIND_PORT:
@@ -49,21 +49,21 @@ MHD_daemon_set_options (struct MHD_Daemon *daemon,
       settings->bind_port.v_port = option->val.bind_port.v_port;
       continue;
     case MHD_D_O_BIND_SA:
-      /* The is not an easy for automatic generations */
-      if (0 != option->val.bind_sa.v_sa_len)
-      {
-        if (NULL != settings->bind_sa.v_sa)
-          free (settings->bind_sa.v_sa);
+      /* custom setter */
+       if (0 != option->val.bind_sa.v_sa_len)
+       {
+         if (NULL != settings->bind_sa.v_sa)
+           free (settings->bind_sa.v_sa);
 
-        settings->bind_sa.v_sa = malloc (option->val.bind_sa.v_sa_len);
-        if (NULL == settings->bind_sa.v_sa)
-          return MHD_SC_DAEMON_MALLOC_FAILURE;
+   settings->bind_sa.v_sa = malloc (option->val.bind_sa.v_sa_len);
+         if (NULL == settings->bind_sa.v_sa)
+           return MHD_SC_DAEMON_MALLOC_FAILURE;
 
-        memcpy (settings->bind_sa.v_sa, option->val.bind_sa.v_sa,
-                option->val.bind_sa.v_sa_len);
-        settings->bind_sa.v_sa_len = option->val.bind_sa.v_sa_len;
-        settings->bind_sa.v_dual = option->val.bind_sa.v_dual;
-      }
+   memcpy (settings->bind_sa.v_sa, option->val.bind_sa.v_sa,
+                 option->val.bind_sa.v_sa_len);
+         settings->bind_sa.v_sa_len = option->val.bind_sa.v_sa_len;
+         settings->bind_sa.v_dual = option->val.bind_sa.v_dual;
+       }
       continue;
     case MHD_D_O_LISTEN_SOCKET:
       settings->listen_socket = option->val.listen_socket;
@@ -166,23 +166,24 @@ MHD_daemon_set_options (struct MHD_Daemon *daemon,
       settings->notify_stream.v_cls = option->val.notify_stream.v_cls;
       continue;
     case MHD_D_O_RANDOM_ENTROPY:
-      /* The is not an easy for automatic generations */
-      if (0 != option->val.random_entropy.v_buf_size)
-      {
-        if (NULL != settings->random_entropy.v_buf)
-          free (settings->random_entropy.v_buf);
+      /* custom setter */
+       /* The is not an easy for automatic generations */
+       if (0 != option->val.random_entropy.v_buf_size)
+       {
+         if (NULL != settings->random_entropy.v_buf)
+           free (settings->random_entropy.v_buf);
 
-        settings->random_entropy.v_buf =
-          malloc (option->val.random_entropy.v_buf_size);
-        if (NULL == settings->random_entropy.v_buf)
-          return MHD_SC_DAEMON_MALLOC_FAILURE;
+   settings->random_entropy.v_buf =
+           malloc (option->val.random_entropy.v_buf_size);
+         if (NULL == settings->random_entropy.v_buf)
+           return MHD_SC_DAEMON_MALLOC_FAILURE;
 
-        memcpy (settings->random_entropy.v_buf,
-                option->val.random_entropy.v_buf,
-                option->val.random_entropy.v_buf_size);
-        settings->random_entropy.v_buf_size =
-          option->val.random_entropy.v_buf_size;
-      }
+   memcpy (settings->random_entropy.v_buf,
+                 option->val.random_entropy.v_buf,
+                 option->val.random_entropy.v_buf_size);
+         settings->random_entropy.v_buf_size =
+           option->val.random_entropy.v_buf_size;
+       }
       continue;
     case MHD_D_O_DAUTH_MAP_SIZE:
       settings->dauth_map_size = option->val.dauth_map_size;
@@ -197,7 +198,7 @@ MHD_daemon_set_options (struct MHD_Daemon *daemon,
       settings->dauth_def_max_nc = option->val.dauth_def_max_nc;
       continue;
     case MHD_D_O_SENTINEL:
-    default:
+    default: /* for -Wswitch-default -Wswitch-enum */ 
       break;
     }
     return MHD_SC_OPTION_UNKNOWN;