libmicrohttpd2

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

d_options.rec (24471B)


      1 # *-* mode: rec -*-
      2 #
      3 # MHD option registry
      4 #
      5 %rec: D_Options
      6 # recutils supports only signed 32 bit values
      7 %typedef: enum_value range 1 0x7FFFFFFF
      8 %key: Name
      9 %singular: Value
     10 %type: Value enum_value
     11 %auto: Value
     12 %mandatory: Value
     13 %mandatory: Comment
     14 %allowed: Type Argument1 Description1 Member1 Argument2 Description2 Member2 Argument3 Description3 Member3
     15 %type: Name,Type,Argument1,Member1,Argument2,Member2,Argument3,Member3 line
     16 %unique: Type Value Argument1 Description1 Member1 Argument2 Description2 Member2 Argument3 Description3 Member3
     17 
     18 # MHD behaviour
     19 
     20 Name: WORK_MODE
     21 Value: 40
     22 Comment: Set MHD work (threading and polling) mode.
     23 + Consider use of #MHD_D_OPTION_WM_EXTERNAL_PERIODIC(), #MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL(), #MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_EDGE(), #MHD_D_OPTION_WM_EXTERNAL_SINGLE_FD_WATCH(), #MHD_D_OPTION_WM_WORKER_THREADS() or #MHD_D_OPTION_WM_THREAD_PER_CONNECTION() instead of direct use of this parameter.
     24 Argument1: struct MHD_WorkModeWithParam wmp
     25 Description1: 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()
     26 
     27 Name: poll_syscall
     28 Value: 41
     29 Comment: Select a sockets watch system call used for internal polling.
     30 Argument1: enum MHD_SockPollSyscall els
     31 Description1: FIXME
     32 
     33 Name: reregister_all
     34 Value: 45
     35 Type: enum MHD_Bool
     36 Comment: Instruct MHD to register all sockets every processing round.
     37 +
     38 + By default (this options is not enabled) every processing round (every time
     39 + when #MHD_daemon_event_update() is called) MHD calls
     40 + #MHD_SocketRegistrationUpdateCallback only for the new sockets, for
     41 + the removed sockets and for the updated sockets.
     42 + Some sockets are registered when #MHD_daemon_start() is called.
     43 +
     44 + If this options is enabled, then #MHD_SocketRegistrationUpdateCallback is
     45 + called for every socket each processing round. No sockets are registered when
     46 + the daemon is being started.
     47 
     48 Name: log_callback
     49 Value: 60
     50 Comment: Set a callback to use for logging
     51 Type: struct MHD_DaemonOptionValueLog
     52 Argument1: MHD_LoggingCallback log_cb
     53 Description1: the callback to use for logging,
     54 + NULL to disable logging.
     55 + The logging to stderr is enabled by default.
     56 Argument2: void *log_cb_cls
     57 Description2: the closure for the logging callback
     58 # Note: CG does not exactly like this...
     59 CustomSetter: /* Note: set directly to the daemon */
     60 + daemon->log_params = option->val.log_callback;
     61 
     62 # Listen socket
     63 
     64 Name: bind_port
     65 Value: 80
     66 Type: struct MHD_DaemonOptionValueBind
     67 Comment: Bind to the given TCP port and address family.
     68 +
     69 + Does not work with #MHD_D_OPTION_BIND_SA() or #MHD_D_OPTION_LISTEN_SOCKET().
     70 +
     71 + 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.
     72 Argument1: enum MHD_AddressFamily af
     73 Description1: the address family to use,
     74 + the #MHD_AF_NONE to disable listen socket (the same effect as if this option is not used)
     75 Argument2: uint_least16_t port
     76 Description2: port to use, 0 to let system assign any free port,
     77 + ignored if @a af is #MHD_AF_NONE
     78 
     79 Name: bind_sa
     80 Value: 81
     81 Type: struct MHD_DaemonOptionValueSA
     82 Comment: Bind to the given socket address.
     83 +
     84 + Does not work with #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_LISTEN_SOCKET().
     85 +
     86 + 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.
     87 Argument1: size_t sa_len
     88 Description1: the size of the socket address pointed by @a sa.
     89 Argument2: /* const */ struct sockaddr *sa
     90 Description2: the address to bind to; can be IPv4 (AF_INET), IPv6 (AF_INET6) or even a UNIX domain socket (AF_UNIX)
     91 Argument3: enum MHD_Bool dual
     92 Description3: When a previous version of the protocol exist (like IPv4 when @a v_sa is IPv6) bind to both protocols (IPv6 and IPv4).
     93 CustomSetter: /* custom setter */
     94 + if (0 != option->val.bind_sa.v_sa_len)
     95 + {
     96 +   if (NULL != settings->bind_sa.v_sa)
     97 +     free (settings->bind_sa.v_sa);
     98 +   settings->bind_sa.v_sa = (struct sockaddr *)
     99 +                            malloc (option->val.bind_sa.v_sa_len);
    100 +   if (NULL == settings->bind_sa.v_sa)
    101 +     return MHD_SC_DAEMON_MEM_ALLOC_FAILURE;
    102 +   memcpy (settings->bind_sa.v_sa, option->val.bind_sa.v_sa,
    103 +           option->val.bind_sa.v_sa_len);
    104 +   settings->bind_sa.v_sa_len = option->val.bind_sa.v_sa_len;
    105 +   settings->bind_sa.v_dual = option->val.bind_sa.v_dual;
    106 + }
    107 
    108 Name: listen_socket
    109 Value: 82
    110 Comment: Accept connections from the given socket.  Socket
    111 + must be a TCP or UNIX domain (SOCK_STREAM) socket.
    112 +
    113 + Does not work with #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA().
    114 +
    115 + 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.
    116 Argument1: MHD_Socket listen_fd
    117 Description1: the listen socket to use, ignored if set to #MHD_INVALID_SOCKET
    118 
    119 Name: listen_addr_reuse
    120 Value: 100
    121 Comment: Select mode of reusing address:port listen address.
    122 +
    123 + Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
    124 Argument1: enum MHD_DaemonOptionBindType reuse_type
    125 Description1: FIXME
    126 
    127 Name: tcp_fastopen
    128 Value: 101
    129 Type: struct MHD_DaemonOptionValueTFO
    130 Comment: Configure TCP_FASTOPEN option, including setting a
    131 + custom @a queue_length.
    132 +
    133 + Note that having a larger queue size can cause resource exhaustion
    134 + attack as the TCP stack has to now allocate resources for the SYN
    135 + packet along with its DATA.
    136 +
    137 + Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
    138 Argument1: enum MHD_TCPFastOpenType option
    139 Description1: the type use of of TCP FastOpen
    140 Argument2: unsigned int queue_length
    141 Description2: the length of the queue, zero to use system or MHD default,
    142 + silently ignored on platforms without support for custom queue size
    143 
    144 Name: LISTEN_BACKLOG
    145 Value: 102
    146 Comment: Use the given backlog for the listen() call.
    147 +
    148 + Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used.
    149 + Zero parameter treated as MHD/system default.
    150 Argument1: unsigned int backlog_size
    151 Description1: FIXME
    152 
    153 Name: sigpipe_suppressed
    154 Value: 103
    155 Type: enum MHD_Bool
    156 Comment: Inform that SIGPIPE is suppressed or handled by application.
    157 + If suppressed/handled, MHD uses network functions that could generate SIGPIPE, like `sendfile()`.
    158 + Silently ignored when MHD creates internal threads as for them SIGPIPE is suppressed automatically.
    159 
    160 # TLS settings
    161 
    162 Name: TLS
    163 Value: 120
    164 Comment: Enable TLS (HTTPS) and select TLS backend
    165 Argument1: enum MHD_TlsBackend backend
    166 Description1: the TLS backend to use,
    167 + #MHD_TLS_BACKEND_NONE for non-TLS (plain TCP) connections
    168 
    169 Name: tls_cert_key
    170 Value: 121
    171 Comment: Provide TLS key and certificate data in-memory.
    172 + Works only if TLS mode is enabled.
    173 Type: struct MHD_DaemonOptionValueTlsCert
    174 Argument1: /* const */ char *mem_cert
    175 Description1: The X.509 certificates chain in PEM format loaded into memory (not a filename).
    176 + The first certificate must be the server certificate, following by the chain of signing
    177 + certificates up to (but not including) CA root certificate.
    178 Argument2: const char *mem_key
    179 Description2: the private key in PEM format loaded into memory (not a filename)
    180 Argument3: const char *mem_pass
    181 Description3: the option passphrase phrase to decrypt the private key,
    182 + could be NULL if private key does not need a password
    183 CustomSetter: /* custom setter */
    184 + if ((NULL == option->val.tls_cert_key.v_mem_cert)
    185 +     || (NULL == option->val.tls_cert_key.v_mem_key))
    186 +   return MHD_SC_TLS_CONF_BAD_CERT;
    187 + else
    188 + {
    189 +   size_t cert_size;
    190 +   size_t key_size;
    191 +   size_t pass_size;
    192 +   cert_size = strlen (option->val.tls_cert_key.v_mem_cert);
    193 +   key_size = strlen (option->val.tls_cert_key.v_mem_key);
    194 +   if ((0 == cert_size)
    195 +       || (0 == key_size))
    196 +     return MHD_SC_TLS_CONF_BAD_CERT;
    197 +   ++cert_size; /* Space for zero-termination */
    198 +   ++key_size;  /* Space for zero-termination */
    199 +   if (NULL != option->val.tls_cert_key.v_mem_pass)
    200 +     pass_size = strlen (option->val.tls_cert_key.v_mem_pass);
    201 +   else
    202 +     pass_size = 0;
    203 +   if (0 != pass_size)
    204 +     ++pass_size; /* Space for zero-termination */
    205 +   if (NULL != settings->tls_cert_key.v_mem_cert)
    206 +     free (settings->tls_cert_key.v_mem_cert); // TODO: Support multiple certificates!!
    207 +   settings->tls_cert_key.v_mem_cert = (char *) malloc (cert_size
    208 +                                                        + key_size
    209 +                                                        + pass_size);
    210 +   if (NULL == settings->tls_cert_key.v_mem_cert)
    211 +     return MHD_SC_DAEMON_MEM_ALLOC_FAILURE;
    212 +   memcpy (settings->tls_cert_key.v_mem_cert,
    213 +           option->val.tls_cert_key.v_mem_cert,
    214 +           cert_size);
    215 +   memcpy (settings->tls_cert_key.v_mem_cert + cert_size,
    216 +           option->val.tls_cert_key.v_mem_key,
    217 +           key_size);
    218 +   settings->tls_cert_key.v_mem_key =
    219 +     settings->tls_cert_key.v_mem_cert + cert_size;
    220 +   if (0 != pass_size)
    221 +   {
    222 +     memcpy (settings->tls_cert_key.v_mem_cert + cert_size + key_size,
    223 +             option->val.tls_cert_key.v_mem_pass,
    224 +             pass_size);
    225 +     settings->tls_cert_key.v_mem_pass =
    226 +       settings->tls_cert_key.v_mem_cert + cert_size + key_size;
    227 +   }
    228 +   else
    229 +     settings->tls_cert_key.v_mem_pass = NULL;
    230 + }
    231 
    232 
    233 Name: tls_client_ca
    234 Value: 122
    235 Comment: Provide the certificate of the certificate authority (CA) to be used by the MHD daemon for client authentication.
    236 + Works only if TLS mode is enabled.
    237 Argument1: const char *mem_client_ca
    238 Description1: the CA certificate in memory (not a filename)
    239 
    240 Name: tls_psk_callback
    241 Value: 130
    242 Type: struct MHD_DaemonOptionValueTlsPskCB
    243 Comment: Configure PSK to use for the TLS key exchange.
    244 Argument1: MHD_PskServerCredentialsCallback psk_cb
    245 Description1: the function to call to obtain pre-shared key
    246 Argument2: void *psk_cb_cls
    247 Description2: the closure for @a psk_cb
    248 
    249 Name: no_alpn
    250 Value: 140
    251 Type: enum MHD_Bool
    252 Comment: Control ALPN for TLS connection.
    253 + Silently ignored for non-TLS.
    254 + By default ALPN is automatically used for TLS connections.
    255 
    256 Name: tls_app_name
    257 Value: 142
    258 Type: struct MHD_DaemonOptionValueTlsAppName
    259 Comment: Provide application name to load dedicated section in TLS backend's configuration file.
    260 + Search for "System-wide configuration of the library" for GnuTLS documentation or
    261 + for "config, OPENSSL LIBRARY CONFIGURATION" for OpenSSL documentation.
    262 + If not specified the default backend configuration is used:
    263 + "@LIBMICROHTTPD" (if available), then "@SYSTEM" (if available) then default priorities, then "NORMAL" for GnuTLS;
    264 + "libmicrohttpd" (if available), then default name ("openssl_conf") for OpenSSL.
    265 + Ignored when MbedTLS is used as daemon's TLS backend.
    266 Argument1: char *app_name
    267 Description1: the name of the application, used as converted to
    268 + uppercase (with '@'-prefixed) for GnuTLS and as converted to
    269 + lowercase for OpenSSL; must not be longer than 127 characters
    270 Argument2: enum MHD_Bool disable_fallback
    271 Description2: forbid use fallback/default configuration if specified
    272 + configuration is not found; also forbid ignoring errors in the
    273 + configuration on TLS backends, which may ignoring configuration
    274 + errors
    275 CustomSetter: /* custom setter */
    276 + settings->tls_app_name.v_disable_fallback =
    277 +   option->val.tls_app_name.v_disable_fallback;
    278 + if (NULL == option->val.tls_app_name.v_app_name)
    279 +   return MHD_SC_CONFIGURATION_PARAM_NULL;
    280 + else
    281 + {
    282 +   size_t len;
    283 +   len = strlen (option->val.tls_app_name.v_app_name);
    284 +   if (128 <= len)
    285 +     return MHD_SC_CONFIGURATION_PARAM_TOO_LARGE;
    286 +   settings->tls_app_name.v_app_name = (char *) malloc (len + 1u);
    287 +   if (NULL == settings->tls_app_name.v_app_name)
    288 +     return MHD_SC_DAEMON_MEM_ALLOC_FAILURE;
    289 +   memcpy (settings->tls_app_name.v_app_name,
    290 +           option->val.tls_app_name.v_app_name,
    291 +           len + 1u);
    292 + }
    293 
    294 Name: tls_openssl_def_file
    295 Value: 144
    296 Type: struct MHD_DaemonOptionValueTlsOsslDefFile
    297 Comment: Set the configuration pathname for OpenSSL configuration file
    298 + Ignored OpenSSL is not used as daemon's TLS backend.
    299 Argument1: char *pathname
    300 Description1: the path and the name of the OpenSSL configuration file,
    301 + if only the name is provided then standard path for
    302 + configuration files is used,
    303 + could be NULL to use default configuration file pathname
    304 + or an empty (zero-size) string to disable file loading
    305 Argument2: enum MHD_Bool disable_fallback
    306 Description2: forbid use of fallback/default location and name of
    307 + the OpenSSL configuration file; also forbid initialisation without
    308 + configuration file
    309 CustomSetter: /* custom setter */
    310 + settings->tls_openssl_def_file.v_disable_fallback =
    311 +   option->val.tls_openssl_def_file.v_disable_fallback;
    312 + if (NULL == option->val.tls_openssl_def_file.v_pathname)
    313 +   settings->tls_openssl_def_file.v_pathname = NULL;
    314 + else
    315 + {
    316 +   size_t len;
    317 +   len = strlen (option->val.tls_openssl_def_file.v_pathname);
    318 +   settings->tls_openssl_def_file.v_pathname = (char *) malloc (len + 1u);
    319 +   if (NULL == settings->tls_openssl_def_file.v_pathname)
    320 +     return MHD_SC_DAEMON_MEM_ALLOC_FAILURE;
    321 +   memcpy (settings->tls_openssl_def_file.v_pathname,
    322 +           option->val.tls_openssl_def_file.v_pathname,
    323 +           len + 1u);
    324 + }
    325 
    326 # Connection handling
    327 
    328 Name: DEFAULT_TIMEOUT
    329 Value: 160
    330 Comment: Specify inactivity timeout for connection.
    331 + When no activity for specified time on connection, it is closed
    332 + automatically.
    333 + Use zero for no timeout, which is also the (unsafe!) default.
    334 + Very large values (years) can be silently truncated to smaller values.
    335 Argument1: unsigned int timeout
    336 Description1: the in seconds, zero for no timeout
    337 
    338 Name: GLOBAL_CONNECTION_LIMIT
    339 Value: 161
    340 Comment: Maximum number of (concurrent) network connections served by daemon.
    341 + @note The real maximum number of network connections could be smaller
    342 +       than requested due to the system limitations, like FD_SETSIZE when
    343 +       polling by select() is used.
    344 Argument1: unsigned int glob_limit
    345 Description1: FIXME
    346 
    347 Name: PER_IP_LIMIT
    348 Value: 162
    349 Comment: Limit on the number of (concurrent) network connections made to the server from the same IP address.
    350 + Can be used to prevent one IP from taking over all of the allowed connections. If the same IP tries to establish more than the specified number of connections, they will be immediately rejected.
    351 Argument1: unsigned int limit
    352 Description1: FIXME
    353 
    354 Name: accept_policy
    355 Value: 163
    356 Type: struct MHD_DaemonOptionValueAcceptPol
    357 Comment: Set a policy callback that accepts/rejects connections based on the client's IP address.  The callbeck function will be called before servicing any new incoming connection.
    358 Argument1: MHD_AcceptPolicyCallback apc
    359 Description1: the accept policy callback
    360 Argument2: void *apc_cls
    361 Description2: the closure for the callback
    362 
    363 Name: CONN_BUFF_ZEROING
    364 Value: 164
    365 Comment: Set mode of connection memory buffer zeroing
    366 Argument1: enum MHD_ConnBufferZeroingMode buff_zeroing
    367 Description1: buffer zeroing mode
    368 
    369 # Requests processing
    370 
    371 Name: protocol_strict_level
    372 Value: 200
    373 Type: struct MHD_DaemonOptionValueStrctLvl
    374 Comment: Set how strictly MHD will enforce the HTTP protocol.
    375 Argument1: enum MHD_ProtocolStrictLevel sl
    376 Description1: the level of strictness
    377 Argument2: enum MHD_UseStictLevel how
    378 Description2: the way how to use the requested level
    379 
    380 Name: early_uri_logger
    381 Value: 201
    382 Type: struct MHD_DaemonOptionValueUriCB
    383 Comment: Set a callback to be called first for every request when the request line is received (before any parsing of the header).
    384 + This callback is the only way to get raw (unmodified) request URI as URI is parsed and modified by MHD in-place.
    385 + Mandatory URI modification may apply before this call, like binary zero replacement, as required by RFCs.
    386 Argument1: MHD_EarlyUriLogCallback cb
    387 Description1: the early URI callback
    388 Argument2: void *cls
    389 Description2: the closure for the callback
    390 
    391 Name: DISABLE_URI_QUERY_PLUS_AS_SPACE
    392 Value: 202
    393 Type: enum MHD_Bool
    394 Comment: Disable converting plus ('+') character to space in GET parameters (URI part after '?').
    395 + Plus conversion is not required by HTTP RFCs, however it required by HTML specifications, see https://url.spec.whatwg.org/#application/x-www-form-urlencoded for details.
    396 + By default plus is converted to space in the query part of URI.
    397 
    398 # Responses processing
    399 
    400 Name: SUPPRESS_DATE_HEADER
    401 Value: 240
    402 Type: enum MHD_Bool
    403 Comment: Suppresse use of 'Date:' header.
    404 + According to RFC should be suppressed only if the system has no RTC.
    405 + The 'Date:' is not suppressed (the header is enabled) by default.
    406 
    407 Name: ENABLE_SHOUTCAST
    408 Value: 241
    409 Type: enum MHD_Bool
    410 Comment: Use SHOUTcast for responses.
    411 + This will cause *all* responses to begin with the SHOUTcast 'ICY' line instead of 'HTTP'.
    412 
    413 # MHD limits
    414 
    415 Name: conn_memory_limit
    416 Value: 280
    417 Type: size_t
    418 Comment: Maximum memory size per connection.
    419 + Default is 32kb.
    420 + Values above 128kb are unlikely to result in much performance benefit, as half of the memory will be typically used for IO, and TCP buffers are unlikely to support window sizes above 64k on most systems.
    421 + The size should be large enough to fit all request headers (together with internal parsing information).
    422 
    423 Name: large_pool_size
    424 Value: 281
    425 Type: size_t
    426 Comment: The size of the shared memory pool for accamulated upload processing.
    427 + The same large pool is shared for all connections server by MHD and used when application requests avoiding of incremental upload processing to accamulate complete content upload before giving it to the application.
    428 + Default is 8Mb.
    429 + Can be set to zero to disable share pool.
    430 
    431 Name: stack_size
    432 Value: 282
    433 Type: size_t
    434 Comment: Desired size of the stack for the threads started by MHD.
    435 + Use 0 for system default, which is also MHD default.
    436 + Works only with #MHD_D_OPTION_WM_WORKER_THREADS() or #MHD_D_OPTION_WM_THREAD_PER_CONNECTION().
    437 
    438 Name: fd_number_limit
    439 Value: 283
    440 Comment: The the maximum FD value.
    441 + The limit is applied to all sockets used by MHD.
    442 + If listen socket FD is equal or higher that specified value, the daemon fail to start.
    443 + If new connection FD is equal or higher that specified value, the connection is rejected.
    444 + Useful if application uses select() for polling the sockets, system FD_SETSIZE is good value for this option in such case.
    445 + Silently ignored on W32 (WinSock sockets).
    446 Argument1: MHD_Socket max_fd
    447 Description1: FIXME
    448 
    449 # MHD optimisations
    450 
    451 Name: TURBO
    452 Value: 320
    453 Type: enum MHD_Bool
    454 Comment: Enable `turbo`.
    455 + Disables certain calls to `shutdown()`, enables aggressive non-blocking optimistic reads and other potentially unsafe optimisations.
    456 + Most effects only happen with internal threads with epoll.
    457 + The 'turbo' mode is not enabled (mode is disabled) by default.
    458 
    459 Name: DISABLE_THREAD_SAFETY
    460 Value: 321
    461 Type: enum MHD_Bool
    462 Comment: Disable some internal thread safety.
    463 + Indicates that MHD daemon will be used by application in single-threaded mode only.  When this flag is set then application must call any MHD function only within a single thread.
    464 + This flag turns off some internal thread-safety and allows MHD making some of the internal optimisations suitable only for single-threaded environment.
    465 + Not compatible with any internal threads modes.
    466 + If MHD is compiled with custom configuration for embedded projects without threads support, this option is mandatory.
    467 + Thread safety is not disabled (safety is enabled) by default.
    468 
    469 Name: DISALLOW_UPGRADE
    470 Value: 322
    471 Type: enum MHD_Bool
    472 Comment: You need to set this option if you want to disable use of HTTP Upgrade.
    473 + Upgrade may require usage of additional internal resources, which we can avoid providing if they will not be used.
    474 + You should only use this option if you do not use upgrade functionality and need a generally minor boost in performance and resources saving.
    475 + The upgrade is not disallowed (upgrade is allowed) by default.
    476 
    477 Name: DISALLOW_SUSPEND_RESUME
    478 Value: 323
    479 Type: enum MHD_Bool
    480 Comment: Disable #MHD_action_suspend() functionality.
    481 +
    482 + You should only use this function if you do not use suspend functionality and need a generally minor boost in performance.
    483 + The suspend is not disallowed (suspend is allowed) by default.
    484 
    485 Name: DISABLE_COOKIES
    486 Value: 324
    487 Type: enum MHD_Bool
    488 Comment: Disable cookies parsing.
    489 +
    490 + Disable automatic cookies processing if cookies are not used.
    491 + Cookies are automatically parsed by default.
    492 CustomSetter: /* custom setter */
    493 + /* The is not an easy for automatic generations */
    494 + // TODO: remove options generator, put preprocessor directives to
    495 + //       the first column
    496 + #ifdef MHD_SUPPORT_COOKIES
    497 + settings->disable_cookies = option->val.disable_cookies;
    498 + #else
    499 + if (MHD_NO != option->val.disable_cookies)
    500 +   return MHD_SC_FEATURE_DISABLED;
    501 + #endif
    502 
    503 # Notification callbacks
    504 
    505 Name: daemon_ready_callback
    506 Value: 360
    507 Type: struct MHD_DaemonOptionValueReadyCB
    508 Comment: Set a callback to be called for pre-start finalisation.
    509 +
    510 + The specified callback will be called one time, after network initialisation, TLS pre-initialisation, but before the start of the internal threads (if allowed)
    511 Argument1: MHD_DaemonReadyCallback cb
    512 Description1: the pre-start callback
    513 Argument2: void *cb_cls
    514 Description2: the closure for the callback
    515 
    516 Name: notify_connection
    517 Value: 361
    518 Type: struct MHD_DaemonOptionValueNotifConnCB
    519 Comment: Set a function that should be called whenever a connection is started or closed.
    520 Argument1: MHD_NotifyConnectionCallback ncc
    521 Description1: the callback for notifications
    522 Argument2: void *cls
    523 Description2: the closure for the callback
    524 
    525 Name: notify_stream
    526 Value: 362
    527 Type: struct MHD_DaemonOptionValueNotifStreamCB
    528 Comment: Register a function that should be called whenever a stream is started or closed.
    529 + For HTTP/1.1 this callback is called one time for every connection.
    530 Argument1: MHD_NotifyStreamCallback nsc
    531 Description1: the callback for notifications
    532 Argument2: void *cls
    533 Description2: the closure for the callback
    534 
    535 # Digest Auth settings
    536 
    537 Name: random_entropy
    538 Value: 400
    539 Comment: Set strong random data to be used by MHD.
    540 + Currently the data is only needed for Digest Auth module.
    541 + Daemon support for Digest Auth is enabled automatically if this option is used.
    542 + The recommended size is between 8 and 32 bytes. Security can be lower for sizes less or equal four.
    543 + Sizes larger then 32 (or, probably, larger than 16 - debatable) will not increase the security.
    544 Argument1: size_t buf_size
    545 Description1: the size of the buffer
    546 Argument2: /* const */ void *buf
    547 Description2: the buffer with strong random data, the content will be copied by MHD
    548 Type: struct MHD_DaemonOptionEntropySeed
    549 CustomSetter: /* custom setter */
    550 + /* The is not an easy for automatic generations */
    551 + if (0 != option->val.random_entropy.v_buf_size)
    552 + {
    553 +   if (NULL != settings->random_entropy.v_buf)
    554 +     free (settings->random_entropy.v_buf);
    555 +   settings->random_entropy.v_buf =
    556 +     malloc (option->val.random_entropy.v_buf_size);
    557 +   if (NULL == settings->random_entropy.v_buf)
    558 +     return MHD_SC_DAEMON_MEM_ALLOC_FAILURE;
    559 +   memcpy (settings->random_entropy.v_buf,
    560 +           option->val.random_entropy.v_buf,
    561 +           option->val.random_entropy.v_buf_size);
    562 +   settings->random_entropy.v_buf_size =
    563 +     option->val.random_entropy.v_buf_size;
    564 + }
    565 
    566 
    567 Name: auth_digest_map_size
    568 Value: 401
    569 Comment: Specify the size of the internal hash map array that tracks generated digest nonces usage.
    570 + When the size of the map is too small then need to handle concurrent DAuth requests, a lot of stale nonce results will be produced.
    571 + By default the size is 1000 entries.
    572 Argument1: size_t size
    573 Description1: the size of the map array
    574 
    575 Name: auth_digest_nonce_timeout
    576 Value: 403
    577 Comment: Nonce validity time (in seconds) used for Digest Auth.
    578 + If followed by zero value the value is silently ignored.
    579 + @see #MHD_digest_auth_check(), MHD_digest_auth_check_digest()
    580 Argument1: unsigned int timeout
    581 Description1: FIXME
    582 
    583 Name: auth_digest_def_max_nc
    584 Value: 404
    585 Comment: Default maximum nc (nonce count) value used for Digest Auth.
    586 + If followed by zero value the value is silently ignored.
    587 + @see #MHD_digest_auth_check(), MHD_digest_auth_check_digest()
    588 Argument1: uint_fast32_t max_nc
    589 Description1: FIXME