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