diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-16 19:39:58 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-16 20:36:38 +0300 |
commit | 4b3b916a236c72a1149b880ebc1156e6f43e7d99 (patch) | |
tree | 82e0b57b23b75a06a56391d305923300fe3ae582 /src/microhttpd/daemon.c | |
parent | 4fde24d42211b8a7637bc1cfbe00f1f35e98e58f (diff) | |
download | libmicrohttpd-4b3b916a236c72a1149b880ebc1156e6f43e7d99.tar.gz libmicrohttpd-4b3b916a236c72a1149b880ebc1156e6f43e7d99.zip |
daemon options: added missing HTTPS-related options error reports for non-HTTPS builds
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r-- | src/microhttpd/daemon.c | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 5f1a3e0d..64524b1b 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -6306,17 +6306,17 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
6306 | MHD_OPTION_END)) | 6306 | MHD_OPTION_END)) |
6307 | return MHD_NO; | 6307 | return MHD_NO; |
6308 | break; | 6308 | break; |
6309 | /* all options taking 'enum' */ | 6309 | /* all options taking 'enum' */ |
6310 | #ifdef HTTPS_SUPPORT | ||
6311 | case MHD_OPTION_HTTPS_CRED_TYPE: | 6310 | case MHD_OPTION_HTTPS_CRED_TYPE: |
6311 | #ifdef HTTPS_SUPPORT | ||
6312 | if (MHD_NO == parse_options (daemon, | 6312 | if (MHD_NO == parse_options (daemon, |
6313 | servaddr, | 6313 | servaddr, |
6314 | opt, | 6314 | opt, |
6315 | (gnutls_credentials_type_t) oa[i].value, | 6315 | (gnutls_credentials_type_t) oa[i].value, |
6316 | MHD_OPTION_END)) | 6316 | MHD_OPTION_END)) |
6317 | return MHD_NO; | ||
6318 | break; | ||
6319 | #endif /* HTTPS_SUPPORT */ | 6317 | #endif /* HTTPS_SUPPORT */ |
6318 | return MHD_NO; | ||
6319 | break; | ||
6320 | /* all options taking 'MHD_socket' */ | 6320 | /* all options taking 'MHD_socket' */ |
6321 | case MHD_OPTION_LISTEN_SOCKET: | 6321 | case MHD_OPTION_LISTEN_SOCKET: |
6322 | if (MHD_NO == parse_options (daemon, | 6322 | if (MHD_NO == parse_options (daemon, |
@@ -6434,25 +6434,32 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
6434 | (int) opt); | 6434 | (int) opt); |
6435 | #endif /* HAVE_MESSAGES */ | 6435 | #endif /* HAVE_MESSAGES */ |
6436 | break; | 6436 | break; |
6437 | #ifndef HTTPS_SUPPORT | ||
6438 | case MHD_OPTION_HTTPS_MEM_KEY: | ||
6439 | case MHD_OPTION_HTTPS_MEM_CERT: | ||
6440 | case MHD_OPTION_HTTPS_CRED_TYPE: | ||
6441 | case MHD_OPTION_HTTPS_PRIORITIES: | ||
6442 | case MHD_OPTION_HTTPS_MEM_TRUST: | ||
6443 | case MHD_OPTION_HTTPS_CERT_CALLBACK: | ||
6444 | case MHD_OPTION_HTTPS_MEM_DHPARAMS: | ||
6445 | case MHD_OPTION_HTTPS_KEY_PASSWORD: | ||
6446 | case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER: | ||
6447 | case MHD_OPTION_HTTPS_CERT_CALLBACK2: | ||
6448 | #ifdef HAVE_MESSAGES | ||
6449 | MHD_DLOG (daemon, | ||
6450 | _ ("MHD HTTPS option %d passed to MHD " | ||
6451 | "compiled without HTTPS support.\n"), | ||
6452 | opt); | ||
6453 | #endif | ||
6454 | return MHD_NO; | ||
6455 | #endif /* HTTPS_SUPPORT */ | ||
6456 | case MHD_OPTION_END: /* Not possible */ | ||
6437 | default: | 6457 | default: |
6438 | #ifdef HAVE_MESSAGES | 6458 | #ifdef HAVE_MESSAGES |
6439 | if ( ( (opt >= MHD_OPTION_HTTPS_MEM_KEY) && | 6459 | MHD_DLOG (daemon, |
6440 | (opt <= MHD_OPTION_HTTPS_PRIORITIES) ) || | 6460 | _ ("Invalid option %d! (Did you terminate " |
6441 | (opt == MHD_OPTION_HTTPS_MEM_TRUST) || | 6461 | "the list with MHD_OPTION_END?).\n"), |
6442 | (opt == MHD_OPTION_GNUTLS_PSK_CRED_HANDLER) ) | 6462 | opt); |
6443 | { | ||
6444 | MHD_DLOG (daemon, | ||
6445 | _ ( | ||
6446 | "MHD HTTPS option %d passed to MHD compiled without HTTPS support.\n"), | ||
6447 | opt); | ||
6448 | } | ||
6449 | else | ||
6450 | { | ||
6451 | MHD_DLOG (daemon, | ||
6452 | _ ( | ||
6453 | "Invalid option %d! (Did you terminate the list with MHD_OPTION_END?).\n"), | ||
6454 | opt); | ||
6455 | } | ||
6456 | #endif | 6463 | #endif |
6457 | return MHD_NO; | 6464 | return MHD_NO; |
6458 | } | 6465 | } |