d_options.rec (25232B)
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: acme_alpn_required 257 Value: 141 258 Type: enum MHD_Bool 259 Comment: Require ACME ALPN challenge support in TLS backend. 260 + If this option is enabled then TLS backends without ACME ALPN challenge 261 + support will not be selected automatically. The daemon will fail to start 262 + if no TLS backend with ACME ALPN is available. 263 264 Name: tls_app_name 265 Value: 142 266 Type: struct MHD_DaemonOptionValueTlsAppName 267 Comment: Provide application name to load dedicated section in TLS backend's configuration file. 268 + Search for "System-wide configuration of the library" for GnuTLS documentation or 269 + for "config, OPENSSL LIBRARY CONFIGURATION" for OpenSSL documentation. 270 + If not specified the default backend configuration is used: 271 + "@LIBMICROHTTPD" (if available), then "@SYSTEM" (if available) then default priorities, then "NORMAL" for GnuTLS; 272 + "libmicrohttpd" (if available), then default name ("openssl_conf") for OpenSSL. 273 + Ignored when MbedTLS is used as daemon's TLS backend. 274 Argument1: char *app_name 275 Description1: the name of the application, used as converted to 276 + uppercase (with '@'-prefixed) for GnuTLS and as converted to 277 + lowercase for OpenSSL; must not be longer than 127 characters 278 Argument2: enum MHD_Bool disable_fallback 279 Description2: forbid use fallback/default configuration if specified 280 + configuration is not found; also forbid ignoring errors in the 281 + configuration on TLS backends, which may ignoring configuration 282 + errors 283 CustomSetter: /* custom setter */ 284 + settings->tls_app_name.v_disable_fallback = 285 + option->val.tls_app_name.v_disable_fallback; 286 + if (NULL == option->val.tls_app_name.v_app_name) 287 + return MHD_SC_CONFIGURATION_PARAM_NULL; 288 + else 289 + { 290 + size_t len; 291 + len = strlen (option->val.tls_app_name.v_app_name); 292 + if (128 <= len) 293 + return MHD_SC_CONFIGURATION_PARAM_TOO_LARGE; 294 + settings->tls_app_name.v_app_name = (char *)malloc (len + 1u); 295 + if (NULL == settings->tls_app_name.v_app_name) 296 + return MHD_SC_DAEMON_MEM_ALLOC_FAILURE; 297 + memcpy (settings->tls_app_name.v_app_name, 298 + option->val.tls_app_name.v_app_name, 299 + len + 1u); 300 + } 301 302 Name: tls_openssl_def_file 303 Value: 144 304 Type: struct MHD_DaemonOptionValueTlsOsslDefFile 305 Comment: Set the configuration pathname for OpenSSL configuration file 306 + Ignored OpenSSL is not used as daemon's TLS backend. 307 Argument1: char *pathname 308 Description1: the path and the name of the OpenSSL configuration file, 309 + if only the name is provided then standard path for 310 + configuration files is used, 311 + could be NULL to use default configuration file pathname 312 + or an empty (zero-size) string to disable file loading 313 Argument2: enum MHD_Bool disable_fallback 314 Description2: forbid use of fallback/default location and name of 315 + the OpenSSL configuration file; also forbid initialisation without 316 + configuration file 317 CustomSetter: /* custom setter */ 318 + settings->tls_openssl_def_file.v_disable_fallback = 319 + option->val.tls_openssl_def_file.v_disable_fallback; 320 + if (NULL == option->val.tls_openssl_def_file.v_pathname) 321 + settings->tls_openssl_def_file.v_pathname = NULL; 322 + else 323 + { 324 + size_t len; 325 + len = strlen (option->val.tls_openssl_def_file.v_pathname); 326 + settings->tls_openssl_def_file.v_pathname = (char *)malloc (len + 1u); 327 + if (NULL == settings->tls_openssl_def_file.v_pathname) 328 + return MHD_SC_DAEMON_MEM_ALLOC_FAILURE; 329 + memcpy (settings->tls_openssl_def_file.v_pathname, 330 + option->val.tls_openssl_def_file.v_pathname, 331 + len + 1u); 332 + } 333 334 # Connection handling 335 336 Name: DEFAULT_TIMEOUT_MILSEC 337 Value: 160 338 Comment: Specify the inactivity timeout for a connection in milliseconds. 339 + If a connection remains idle (no activity) for this many 340 + milliseconds, it is closed automatically. 341 + Use zero for no timeout; this is also the (unsafe!) 342 + default. 343 + Values larger than 1209600000 (two weeks) are silently 344 + clamped to 1209600000. 345 + Precise closing time is not guaranteed and depends on 346 + system clock granularity and amount of time spent on 347 + processing other connections. Typical precision is 348 + within +/- 30 milliseconds, while the worst case could 349 + be greater than +/- 1 second. 350 + Values below 1500 milliseconds are risky as they 351 + may cause valid connections to be aborted and may 352 + increase load the server load due to clients' repetitive 353 + automatic retries. 354 Argument1: uint_fast32_t timeout 355 Description1: the timeout in milliseconds, zero for no timeout 356 357 Name: GLOBAL_CONNECTION_LIMIT 358 Value: 161 359 Comment: Maximum number of (concurrent) network connections served by daemon. 360 + @note The real maximum number of network connections could be smaller 361 + than requested due to the system limitations, like FD_SETSIZE when 362 + polling by select() is used. 363 Argument1: unsigned int glob_limit 364 Description1: FIXME 365 366 Name: PER_IP_LIMIT 367 Value: 162 368 Comment: Limit on the number of (concurrent) network connections made to the server from the same IP address. 369 + 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. 370 Argument1: unsigned int limit 371 Description1: FIXME 372 373 Name: accept_policy 374 Value: 163 375 Type: struct MHD_DaemonOptionValueAcceptPol 376 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. 377 Argument1: MHD_AcceptPolicyCallback apc 378 Description1: the accept policy callback 379 Argument2: void *apc_cls 380 Description2: the closure for the callback 381 382 Name: CONN_BUFF_ZEROING 383 Value: 164 384 Comment: Set mode of connection memory buffer zeroing 385 Argument1: enum MHD_ConnBufferZeroingMode buff_zeroing 386 Description1: buffer zeroing mode 387 388 # Requests processing 389 390 Name: protocol_strict_level 391 Value: 200 392 Type: struct MHD_DaemonOptionValueStrctLvl 393 Comment: Set how strictly MHD will enforce the HTTP protocol. 394 Argument1: enum MHD_ProtocolStrictLevel sl 395 Description1: the level of strictness 396 Argument2: enum MHD_UseStictLevel how 397 Description2: the way how to use the requested level 398 399 Name: early_uri_logger 400 Value: 201 401 Type: struct MHD_DaemonOptionValueUriCB 402 Comment: Set a callback to be called first for every request when the request line is received (before any parsing of the header). 403 + This callback is the only way to get raw (unmodified) request URI as URI is parsed and modified by MHD in-place. 404 + Mandatory URI modification may apply before this call, like binary zero replacement, as required by RFCs. 405 Argument1: MHD_EarlyUriLogCallback cb 406 Description1: the early URI callback 407 Argument2: void *cls 408 Description2: the closure for the callback 409 410 Name: DISABLE_URI_QUERY_PLUS_AS_SPACE 411 Value: 202 412 Type: enum MHD_Bool 413 Comment: Disable converting plus ('+') character to space in GET parameters (URI part after '?'). 414 + 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. 415 + By default plus is converted to space in the query part of URI. 416 417 # Responses processing 418 419 Name: SUPPRESS_DATE_HEADER 420 Value: 240 421 Type: enum MHD_Bool 422 Comment: Suppresse use of 'Date:' header. 423 + According to RFC should be suppressed only if the system has no RTC. 424 + The 'Date:' is not suppressed (the header is enabled) by default. 425 426 Name: ENABLE_SHOUTCAST 427 Value: 241 428 Type: enum MHD_Bool 429 Comment: Use SHOUTcast for responses. 430 + This will cause *all* responses to begin with the SHOUTcast 'ICY' line instead of 'HTTP'. 431 432 # MHD limits 433 434 Name: conn_memory_limit 435 Value: 280 436 Type: size_t 437 Comment: Maximum memory size per connection. 438 + Default is 32kb. 439 + 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. 440 + The size should be large enough to fit all request headers (together with internal parsing information). 441 442 Name: large_pool_size 443 Value: 281 444 Type: size_t 445 Comment: The size of the shared memory pool for accamulated upload processing. 446 + 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. 447 + Default is 8Mb. 448 + Can be set to zero to disable share pool. 449 450 Name: stack_size 451 Value: 282 452 Type: size_t 453 Comment: Desired size of the stack for the threads started by MHD. 454 + Use 0 for system default, which is also MHD default. 455 + Works only with #MHD_D_OPTION_WM_WORKER_THREADS() or #MHD_D_OPTION_WM_THREAD_PER_CONNECTION(). 456 457 Name: fd_number_limit 458 Value: 283 459 Comment: The the maximum FD value. 460 + The limit is applied to all sockets used by MHD. 461 + If listen socket FD is equal or higher that specified value, the daemon fail to start. 462 + If new connection FD is equal or higher that specified value, the connection is rejected. 463 + Useful if application uses select() for polling the sockets, system FD_SETSIZE is good value for this option in such case. 464 + Silently ignored on W32 (WinSock sockets). 465 Argument1: MHD_Socket max_fd 466 Description1: FIXME 467 468 # MHD optimisations 469 470 Name: TURBO 471 Value: 320 472 Type: enum MHD_Bool 473 Comment: Enable `turbo`. 474 + Disables certain calls to `shutdown()`, enables aggressive non-blocking optimistic reads and other potentially unsafe optimisations. 475 + Most effects only happen with internal threads with epoll. 476 + The 'turbo' mode is not enabled (mode is disabled) by default. 477 478 Name: DISABLE_THREAD_SAFETY 479 Value: 321 480 Type: enum MHD_Bool 481 Comment: Disable some internal thread safety. 482 + 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. 483 + This flag turns off some internal thread-safety and allows MHD making some of the internal optimisations suitable only for single-threaded environment. 484 + Not compatible with any internal threads modes. 485 + If MHD is compiled with custom configuration for embedded projects without threads support, this option is mandatory. 486 + Thread safety is not disabled (safety is enabled) by default. 487 488 Name: DISALLOW_UPGRADE 489 Value: 322 490 Type: enum MHD_Bool 491 Comment: You need to set this option if you want to disable use of HTTP Upgrade. 492 + Upgrade may require usage of additional internal resources, which we can avoid providing if they will not be used. 493 + You should only use this option if you do not use upgrade functionality and need a generally minor boost in performance and resources saving. 494 + The upgrade is not disallowed (upgrade is allowed) by default. 495 496 Name: DISALLOW_SUSPEND_RESUME 497 Value: 323 498 Type: enum MHD_Bool 499 Comment: Disable #MHD_action_suspend() functionality. 500 + 501 + You should only use this function if you do not use suspend functionality and need a generally minor boost in performance. 502 + The suspend is not disallowed (suspend is allowed) by default. 503 504 Name: DISABLE_COOKIES 505 Value: 324 506 Type: enum MHD_Bool 507 Comment: Disable cookies parsing. 508 + 509 + Disable automatic cookies processing if cookies are not used. 510 + Cookies are automatically parsed by default. 511 CustomSetter: /* custom setter */ 512 + /* The is not an easy for automatic generations */ 513 + // TODO: remove options generator 514 + #ifdef MHD_SUPPORT_COOKIES 515 + settings->disable_cookies = option->val.disable_cookies; 516 + #else 517 + if (MHD_NO != option->val.disable_cookies) 518 + return MHD_SC_FEATURE_DISABLED; 519 + #endif 520 521 # Notification callbacks 522 523 Name: daemon_ready_callback 524 Value: 360 525 Type: struct MHD_DaemonOptionValueReadyCB 526 Comment: Set a callback to be called for pre-start finalisation. 527 + 528 + The specified callback will be called one time, after network initialisation, TLS pre-initialisation, but before the start of the internal threads (if allowed) 529 Argument1: MHD_DaemonReadyCallback cb 530 Description1: the pre-start callback 531 Argument2: void *cb_cls 532 Description2: the closure for the callback 533 534 Name: notify_connection 535 Value: 361 536 Type: struct MHD_DaemonOptionValueNotifConnCB 537 Comment: Set a function that should be called whenever a connection is started or closed. 538 Argument1: MHD_NotifyConnectionCallback ncc 539 Description1: the callback for notifications 540 Argument2: void *cls 541 Description2: the closure for the callback 542 543 Name: notify_stream 544 Value: 362 545 Type: struct MHD_DaemonOptionValueNotifStreamCB 546 Comment: Register a function that should be called whenever a stream is started or closed. 547 + For HTTP/1.1 this callback is called one time for every connection. 548 Argument1: MHD_NotifyStreamCallback nsc 549 Description1: the callback for notifications 550 Argument2: void *cls 551 Description2: the closure for the callback 552 553 # Digest Auth settings 554 555 Name: random_entropy 556 Value: 400 557 Comment: Set strong random data to be used by MHD. 558 + Currently the data is only needed for Digest Auth module. 559 + Daemon support for Digest Auth is enabled automatically if this option is used. 560 + The recommended size is between 8 and 32 bytes. Security can be lower for sizes less or equal four. 561 + Sizes larger then 32 (or, probably, larger than 16 - debatable) will not increase the security. 562 Argument1: size_t buf_size 563 Description1: the size of the buffer 564 Argument2: /* const */ void *buf 565 Description2: the buffer with strong random data, the content will be copied by MHD 566 Type: struct MHD_DaemonOptionEntropySeed 567 CustomSetter: /* custom setter */ 568 + /* The is not an easy for automatic generations */ 569 + if (0 != option->val.random_entropy.v_buf_size) 570 + { 571 + if (NULL != settings->random_entropy.v_buf) 572 + free (settings->random_entropy.v_buf); 573 + settings->random_entropy.v_buf = 574 + malloc (option->val.random_entropy.v_buf_size); 575 + if (NULL == settings->random_entropy.v_buf) 576 + return MHD_SC_DAEMON_MEM_ALLOC_FAILURE; 577 + memcpy (settings->random_entropy.v_buf, 578 + option->val.random_entropy.v_buf, 579 + option->val.random_entropy.v_buf_size); 580 + settings->random_entropy.v_buf_size = 581 + option->val.random_entropy.v_buf_size; 582 + } 583 584 585 Name: auth_digest_map_size 586 Value: 401 587 Comment: Specify the size of the internal hash map array that tracks generated digest nonces usage. 588 + 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. 589 + By default the size is 1000 entries. 590 Argument1: size_t size 591 Description1: the size of the map array 592 593 Name: auth_digest_nonce_timeout 594 Value: 403 595 Comment: Nonce validity time (in seconds) used for Digest Auth. 596 + If followed by zero value the value is silently ignored. 597 + @see #MHD_digest_auth_check(), MHD_digest_auth_check_digest() 598 Argument1: unsigned int timeout 599 Description1: FIXME 600 601 Name: auth_digest_def_max_nc 602 Value: 404 603 Comment: Default maximum nc (nonce count) value used for Digest Auth. 604 + If followed by zero value the value is silently ignored. 605 + @see #MHD_digest_auth_check(), MHD_digest_auth_check_digest() 606 Argument1: uint_fast32_t max_nc 607 Description1: FIXME