gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 09/13: daemon options: added missing HTTPS-related optio


From: gnunet
Subject: [libmicrohttpd] 09/13: daemon options: added missing HTTPS-related options error reports for non-HTTPS builds
Date: Mon, 16 May 2022 20:14:58 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 4b3b916a236c72a1149b880ebc1156e6f43e7d99
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon May 16 19:39:58 2022 +0300

    daemon options: added missing HTTPS-related options error reports for 
non-HTTPS builds
---
 src/microhttpd/daemon.c | 49 ++++++++++++++++++++++++++++---------------------
 1 file 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,
                                        MHD_OPTION_END))
             return MHD_NO;
           break;
-          /* all options taking 'enum' */
-#ifdef HTTPS_SUPPORT
+        /* all options taking 'enum' */
         case MHD_OPTION_HTTPS_CRED_TYPE:
+#ifdef HTTPS_SUPPORT
           if (MHD_NO == parse_options (daemon,
                                        servaddr,
                                        opt,
                                        (gnutls_credentials_type_t) oa[i].value,
                                        MHD_OPTION_END))
-            return MHD_NO;
-          break;
 #endif /* HTTPS_SUPPORT */
+          return MHD_NO;
+          break;
         /* all options taking 'MHD_socket' */
         case MHD_OPTION_LISTEN_SOCKET:
           if (MHD_NO == parse_options (daemon,
@@ -6434,25 +6434,32 @@ parse_options_va (struct MHD_Daemon *daemon,
                   (int) opt);
 #endif /* HAVE_MESSAGES */
       break;
+#ifndef HTTPS_SUPPORT
+    case MHD_OPTION_HTTPS_MEM_KEY:
+    case MHD_OPTION_HTTPS_MEM_CERT:
+    case MHD_OPTION_HTTPS_CRED_TYPE:
+    case MHD_OPTION_HTTPS_PRIORITIES:
+    case MHD_OPTION_HTTPS_MEM_TRUST:
+    case MHD_OPTION_HTTPS_CERT_CALLBACK:
+    case MHD_OPTION_HTTPS_MEM_DHPARAMS:
+    case MHD_OPTION_HTTPS_KEY_PASSWORD:
+    case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER:
+    case MHD_OPTION_HTTPS_CERT_CALLBACK2:
+#ifdef HAVE_MESSAGES
+      MHD_DLOG (daemon,
+                _ ("MHD HTTPS option %d passed to MHD "
+                   "compiled without HTTPS support.\n"),
+                opt);
+#endif
+      return MHD_NO;
+#endif /* HTTPS_SUPPORT */
+    case MHD_OPTION_END: /* Not possible */
     default:
 #ifdef HAVE_MESSAGES
-      if ( ( (opt >= MHD_OPTION_HTTPS_MEM_KEY) &&
-             (opt <= MHD_OPTION_HTTPS_PRIORITIES) ) ||
-           (opt == MHD_OPTION_HTTPS_MEM_TRUST) ||
-           (opt == MHD_OPTION_GNUTLS_PSK_CRED_HANDLER) )
-      {
-        MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD compiled without HTTPS 
support.\n"),
-                  opt);
-      }
-      else
-      {
-        MHD_DLOG (daemon,
-                  _ (
-                    "Invalid option %d! (Did you terminate the list with 
MHD_OPTION_END?).\n"),
-                  opt);
-      }
+      MHD_DLOG (daemon,
+                _ ("Invalid option %d! (Did you terminate "
+                   "the list with MHD_OPTION_END?).\n"),
+                opt);
 #endif
       return MHD_NO;
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]