gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (6c3d5864 -> 129e28d3)


From: gnunet
Subject: [libmicrohttpd] branch master updated (6c3d5864 -> 129e28d3)
Date: Mon, 16 May 2022 20:14:49 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 6c3d5864 Makefile: fixed *.crt files names for dist target
     new 393c5a45 digestauth: simplified overflow check
     new 59b2e9f6 configure: additional warning flags
     new f11c4cdd configure: use correct quoting in OS detection part
     new 0a0fa0f1 configure: use standard Linux settings for Linux on ARM
     new 2ec6b3c7 Use '#ifdef PARAM' instead of '#if PARAM' for configuration 
options
     new 280aceef internal.h: fixed incorrect use of enum value as preprocessor 
value
     new 76069494 Fixed uninitialized value used in assert
     new 4fde24d4 Added missing in 'switch' enum values (no functional change)
     new 4b3b916a daemon options: added missing HTTPS-related options error 
reports for non-HTTPS builds
     new f0a5b72f MHD_connection_handle_read(): refactored states handling at 
the end of the function
     new 28e0215d MHD_connection_update_event_loop_info(): more complete TLS 
states handling
     new dd13417d W32 projects: enabled more warnings
     new 129e28d3 mhd_panic: minor macro improvement

The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac                             |  81 +++++++++++++++-------
 src/examples/demo.c                      |   6 +-
 src/examples/demo_https.c                |   6 +-
 src/include/mhd_options.h                |   4 +-
 src/microhttpd/connection.c              |  45 +++++++++++--
 src/microhttpd/daemon.c                  | 112 ++++++++++++++++++-------------
 src/microhttpd/digestauth.c              |   2 +-
 src/microhttpd/internal.h                |   2 +-
 src/microhttpd/memorypool.c              |   2 +-
 src/microhttpd/mhd_byteorder.h           |  18 ++---
 src/microhttpd/mhd_panic.h               |   4 +-
 src/microhttpd/mhd_send.c                |   8 +--
 src/microhttpd/mhd_sockets.h             |   2 +-
 src/microhttpd/postprocessor.c           |  13 ++++
 src/microhttpd/response.c                |   2 +
 src/microhttpd/sysfdsetsize.c            |  10 +--
 src/microhttpd/test_options.c            |   6 +-
 src/microhttpd/test_upgrade.c            |   2 +-
 src/microhttpd/test_upgrade_large.c      |   2 +-
 w32/common/common-build-settings.vcxproj |   6 +-
 20 files changed, 218 insertions(+), 115 deletions(-)

diff --git a/configure.ac b/configure.ac
index 652f5b10..ee3d5931 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,8 +145,10 @@ MHD_CHECK_ADD_CC_CFLAG([-fno-strict-aliasing], [CFLAGS_ac])
 
 AS_VAR_IF([enable_build_type],["neutral"],[],
   [ # Any non-neutral build types
-    MHD_CHECK_ADD_CC_CFLAGS([-Wall -Wnull-dereference 
-Wdeclaration-after-statement], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wall -fdelete-null-pointer-checks 
-Wnull-dereference], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wdeclaration-after-statement -Wimplicit 
-Wnested-externs], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wredundant-decls -Wtrampolines 
-Wunsafe-loop-optimizations], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wpoison-system-directories], [CFLAGS_ac])
     CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
     LDFLAGS="${user_LDFLAGS}"
     MHD_CHECK_ADD_CC_LDFLAG([-Wl,--warn-common], [LDFLAGS_ac])
@@ -166,9 +168,34 @@ AS_CASE([${enable_build_type}],[debug|debugger],
     MHD_CHECK_ADD_CC_CFLAGS([-Wformat-overflow -Wformat-truncation 
-Wformat-security -Wformat-signedness], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wmissing-include-dirs -Wshift-overflow=2 
-Wstringop-overflow=4 -Walloc-zero], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wduplicated-branches -Wduplicated-cond 
-Wfloat-equal -Wshadow -Wpointer-arith], [CFLAGS_ac])
-    MHD_CHECK_ADD_CC_CFLAGS([-Wbad-function-cast -Wcast-qual 
-Wcast-align=strict -Wwrite-strings -Wconversion], [CFLAGS_ac])
+    MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-Wshadow-all], [-Wshadow])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wbad-function-cast -Wcast-qual -Wwrite-strings 
-Wconversion], [CFLAGS_ac])
+    MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-Wcast-align=strict], [-Wcast-align])
     MHD_CHECK_ADD_CC_CFLAGS([-Wjump-misses-init -Wlogical-op 
-Waggregate-return -Wstrict-prototypes], [CFLAGS_ac])
-    MHD_CHECK_ADD_CC_CFLAGS([-Wold-style-definition -Wmissing-declarations 
-Wmissing-prototypes -Wshift-negative-value], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wold-style-definition -Wmissing-declarations 
-Wmissing-prototypes], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wuninitialized -Winit-self 
-Wshift-negative-value -Wswitch-enum], [CFLAGS_ac])
+    MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-Wstrict-overflow=4], 
[-Wstrict-overflow])
+    MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-Wnormalized=nfkc], [-Wnormalized])
+    MHD_CHECK_ADD_CC_CFLAGS([-Walloca -Wbidi-chars=any -Warray-bounds -Wpacked 
-Wvariadic-macros], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wundef], [CFLAGS_ac])
+
+    MHD_CHECK_ADD_CC_CFLAGS([-Wanon-enum-enum-conversion 
-Warray-bounds-pointer-arithmetic -Wassign-enum], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wbit-int-extension -Wbitfield-enum-conversion 
-Wparentheses -Wbool-operation], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wcast-function-type -Wcomma -Wcomment 
-Wcompound-token-split], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wconditional-uninitialized -Wdeprecated 
-Wdisabled-macro-expansion], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wdocumentation-pedantic -Wempty-init-stmt 
-Wenum-conversion -Wexpansion-to-defined], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wflexible-array-extensions -Wloop-analysis 
-Wformat-pedantic], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wformat-type-confusion -Wfour-char-constants], 
[CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wgcc-compat -Wgnu-anonymous-struct 
-Wgnu-compound-literal-initializer], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wgnu-conditional-omitted-operand 
-Wgnu-designator -Wgnu-empty-initializer], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wgnu-empty-struct 
-Wgnu-flexible-array-initializer -Wgnu-folding-constant], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wgnu-null-pointer-arithmetic -Wgnu-pointer-arith 
-Wgnu-redeclared-enum], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wgnu-union-cast 
-Wgnu-variable-sized-type-not-at-end -Widiomatic-parentheses], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wmissing-noreturn 
-Wmissing-variable-declarations -Wnested-anon-types], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wnewline-eof -Wover-aligned -Wredundant-parens 
-Wreserved-macro-identifier], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wshift-sign-overflow -Wtautological-compare 
-Wunaligned-access], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wunused -Wused-but-marked-unused 
-Wzero-as-null-pointer-constant -Wzero-length-array], [CFLAGS_ac])
+
     CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
     LDFLAGS="${user_LDFLAGS}"
     MHD_CHECK_ADD_CC_LDFLAG([-Wl,--enable-long-section-names], [LDFLAGS_ac])
@@ -205,6 +232,7 @@ AS_CASE([${enable_build_type}],[release|release-*],
     AS_VAR_IF([enable_build_type],["release-hardened"],
       [
         MHD_CHECK_ADD_CC_CFLAGS([-Wformat-security -Wstack-protector], 
[CFLAGS_ac])
+        MHD_CHECK_ADD_CC_CFLAGS([-Wuninitialized -Winit-self -Walloc-zero 
-Wbidi-chars=any], [CFLAGS_ac])
       ]
     )
     AS_VAR_IF([enable_build_type],["release"],
@@ -220,6 +248,7 @@ AS_CASE([${enable_build_type}],[release|release-*],
   ]
 )
 CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
+# Additional flags are checked and added at the end of 'configure'
 
 # Check for headers that are ALWAYS required
 AC_CHECK_HEADERS_ONCE([stdio.h string.h stdint.h errno.h limits.h fcntl.h], [],
@@ -317,7 +346,8 @@ AS_VAR_IF([enable_compiler_hardening],["yes"],
     CPPFLAGS="${CPPFLAGS_ac} ${user_CPPFLAGS}"
     CFLAGS="${user_CFLAGS}"
     
MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac],[-fstack-protector-strong],[-fstack-protector-all],[-fstack-protector])
-    MHD_CHECK_ADD_CC_CFLAGS([-fstack-clash-protection 
-ftrivial-auto-var-init=pattern],[CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-fstack-clash-protection],[CFLAGS_ac])
+    
MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac],[-ftrivial-auto-var-init=pattern],[-ftrivial-auto-var-init=zero])
     CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
     AS_IF([test "x${enable_static}" = "xyes" && test "x${pic_mode}" != "xyes"],
       [
@@ -587,48 +617,43 @@ shutdown_trig_select='no'
 AC_MSG_CHECKING([[for target host OS]])
 AS_CASE(["$host_os"],
  [*darwin* | *rhapsody* | *macosx*],
- [AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system])
+ [AC_DEFINE([OSX],[1],[This is an OS X system])
      CFLAGS_ac="-no-cpp-precomp -fno-common $CFLAGS_ac"
      mhd_host_os='Darwin'
      AC_MSG_RESULT([[$mhd_host_os]])],
  [kfreebsd*-gnu],
  [AC_DEFINE([SOMEBSD],[1],[This is a BSD system])
-     AC_DEFINE_UNQUOTED([FREEBSD],[1],[This is a FreeBSD system])
+     AC_DEFINE([FREEBSD],[1],[This is a FreeBSD system])
      mhd_host_os='FreeBSD kernel with GNU userland'
      AC_MSG_RESULT([[$mhd_host_os]])],
  [freebsd*],
- [AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
-     AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
+ [AC_DEFINE([SOMEBSD],[1],[This is a BSD system])
+     AC_DEFINE([FREEBSD],[1],[This is a FreeBSD system])
      mhd_host_os='FreeBSD'
      AC_MSG_RESULT([[$mhd_host_os]])],
  [openbsd*],
- [AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
-     AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
+ [AC_DEFINE([SOMEBSD],[1],[This is a BSD system])
+     AC_DEFINE([OPENBSD],[1],[This is an OpenBSD system])
      mhd_host_os='OpenBSD'
      AC_MSG_RESULT([[$mhd_host_os]])],
  [netbsd*],
- [AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
-     AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
+ [AC_DEFINE([SOMEBSD],[1],[This is a BSD system])
+     AC_DEFINE([NETBSD],[1],[This is a NetBSD system])
      mhd_host_os='NetBSD'
      AC_MSG_RESULT([[$mhd_host_os]])],
  [*solaris*],
- [AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
-     AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno does not 
work])
+ [AC_DEFINE([SOLARIS],[1],[This is a Solaris system])
+     AC_DEFINE([_REENTRANT],[1],[Need with solaris or errno does not work])
      mhd_host_os='Solaris'
      AC_MSG_RESULT([[$mhd_host_os]])
      AC_SEARCH_LIBS([gethostbyname], [nsl])
      AC_SEARCH_LIBS([socket], [socket])],
-  [*arm-linux*],
-  [AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
-     mhd_host_os='ARM Linux'
-     AC_MSG_RESULT([[$mhd_host_os]])
-     CFLAGS_ac="-fPIC -pipe $CFLAGS_ac"],
   [*linux*],
-  [AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
+  [AC_DEFINE([LINUX],[1],[This is a Linux kernel])
      mhd_host_os='Linux'
      AC_MSG_RESULT([[$mhd_host_os]])],
   [*cygwin*],
-  [AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
+  [AC_DEFINE([CYGWIN],[1],[This is a Cygwin system])
      mhd_host_os='Windows/Cygwin'
      AC_MSG_RESULT([[$mhd_host_os]])
      os_is_windows=yes],
@@ -653,7 +678,7 @@ AS_CASE(["$host_os"],
      os_is_native_w32=yes
    ],
    [*openedition*],
-   [AC_DEFINE_UNQUOTED(OS390,1,[This is a OS/390 system])
+   [AC_DEFINE([OS390],[1],[This is a OS/390 system])
      mhd_host_os='OS/390'
      AC_MSG_RESULT([[$mhd_host_os]])],
    [gnu*],
@@ -665,7 +690,7 @@ AS_CASE(["$host_os"],
      AC_MSG_RESULT([unrecognised OS])
      mhd_host_os="${host_os}"
      AC_MSG_WARN([Unrecognised OS $host_os])
-     AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
+     AC_DEFINE([OTHEROS],1,[Some strange OS])
  ])
 
 AM_CONDITIONAL([CYGWIN_TARGET], [[test "x$os_is_windows" = "xyes" && \
@@ -3615,6 +3640,16 @@ int main(void)
    CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
  ]
 )
+
+# Final flags that may interfere with autoconf detections
+AS_CASE([${enable_build_type}],[debug|debugger],
+  [ # Debug build or build for walking with debugger
+    CFLAGS="${user_CFLAGS}"
+    MHD_CHECK_ADD_CC_CFLAGS([-Wextra-semi -Wextra-semi-stmt], [CFLAGS_ac])
+    CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
+  ]
+)
+
 AM_CONDITIONAL([USE_SANITIZERS],
   [test -n "$enabled_sanitizers" && test "x$mhd_cv_cc_sanitizer_works" = 
"xyes"])
 AC_SUBST([AM_ASAN_OPTIONS])
diff --git a/src/examples/demo.c b/src/examples/demo.c
index 9aef573a..d2dc15e8 100644
--- a/src/examples/demo.c
+++ b/src/examples/demo.c
@@ -388,7 +388,7 @@ update_directory (void)
                                                         rdc.buf,
                                                         &free);
   mark_as_html (response);
-#if FORCE_CLOSE
+#ifdef FORCE_CLOSE
   (void) MHD_add_response_header (response,
                                   MHD_HTTP_HEADER_CONNECTION,
                                   "close");
@@ -577,7 +577,7 @@ process_upload_data (void *cls,
         fn[i] = '_';
     uc->fd = open (fn,
                    O_CREAT | O_EXCL
-#if O_LARGEFILE
+#ifdef O_LARGEFILE
                    | O_LARGEFILE
 #endif
                    | O_WRONLY,
@@ -933,7 +933,7 @@ main (int argc, char *const *argv)
                         &generate_page, NULL,
                         MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (256
                                                                       * 1024),
-#if PRODUCTION
+#ifdef PRODUCTION
                         MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 
(64),
 #endif
                         MHD_OPTION_CONNECTION_TIMEOUT, (unsigned
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c
index 56008d7f..dabb0205 100644
--- a/src/examples/demo_https.c
+++ b/src/examples/demo_https.c
@@ -390,7 +390,7 @@ update_directory (void)
                                                         rdc.buf,
                                                         &free);
   mark_as_html (response);
-#if FORCE_CLOSE
+#ifdef FORCE_CLOSE
   (void) MHD_add_response_header (response,
                                   MHD_HTTP_HEADER_CONNECTION,
                                   "close");
@@ -579,7 +579,7 @@ process_upload_data (void *cls,
         fn[i] = '_';
     uc->fd = open (fn,
                    O_CREAT | O_EXCL
-#if O_LARGEFILE
+#ifdef O_LARGEFILE
                    | O_LARGEFILE
 #endif
                    | O_WRONLY,
@@ -998,7 +998,7 @@ main (int argc, char *const *argv)
                         &generate_page, NULL,
                         MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (256
                                                                       * 1024),
-#if PRODUCTION
+#ifdef PRODUCTION
                         MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 
(64),
 #endif
                         MHD_OPTION_CONNECTION_TIMEOUT, (unsigned
diff --git a/src/include/mhd_options.h b/src/include/mhd_options.h
index a4cc0a36..9184e1ac 100644
--- a/src/include/mhd_options.h
+++ b/src/include/mhd_options.h
@@ -80,7 +80,7 @@
 #  endif
 #endif /* MHD_USE_POSIX_THREADS || MHD_USE_W32_THREADS */
 
-#if OS390
+#if defined(OS390)
 #define _OPEN_THREADS
 #define _OPEN_SYS_SOCK_IPV6
 #define _OPEN_MSGQ_EXT
@@ -109,7 +109,7 @@
 #define RESTRICT __restrict__
 #endif /* __VXWORKS__ || __vxworks || OS_VXWORKS */
 
-#if LINUX + 0 && (defined(HAVE_SENDFILE64) || defined(HAVE_LSEEK64)) && \
+#if defined(LINUX) && (defined(HAVE_SENDFILE64) || defined(HAVE_LSEEK64)) && \
   ! defined(_LARGEFILE64_SOURCE)
 /* On Linux, special macro is required to enable definitions of some xxx64 
functions */
 #define _LARGEFILE64_SOURCE 1
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index e563fb71..a260933c 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -885,7 +885,7 @@ MHD_connection_finish_forward_ (struct MHD_Connection 
*connection)
     DLL_remove (daemon->urh_head,
                 daemon->urh_tail,
                 urh);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
   if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
        (0 != epoll_ctl (daemon->epoll_upgrade_fd,
                         EPOLL_CTL_DEL,
@@ -904,7 +904,7 @@ MHD_connection_finish_forward_ (struct MHD_Connection 
*connection)
 #endif /* EPOLL_SUPPORT */
   if (MHD_INVALID_SOCKET != urh->mhd.socket)
   {
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
     if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
          (0 != epoll_ctl (daemon->epoll_upgrade_fd,
                           EPOLL_CTL_DEL,
@@ -2484,13 +2484,24 @@ MHD_connection_update_event_loop_info (struct 
MHD_Connection *connection)
       connection->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
       return;
     case MHD_TLS_CONN_HANDSHAKING:
+    case MHD_TLS_CONN_WR_CLOSING:
       if (0 == gnutls_record_get_direction (connection->tls_session))
         connection->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
       else
         connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
       return;
+    case MHD_TLS_CONN_CONNECTED:
+      break; /* Do normal processing */
+    case MHD_TLS_CONN_WR_CLOSED:
+    case MHD_TLS_CONN_TLS_FAILED:
+      connection->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
+      return;
+    case MHD_TLS_CONN_TLS_CLOSING:  /* Not implemented yet */
+    case MHD_TLS_CONN_TLS_CLOSED:   /* Not implemented yet */
+    case MHD_TLS_CONN_INVALID_STATE:
+    case MHD_TLS_CONN_NO_TLS: /* Not possible */
     default:
-      break;
+      MHD_PANIC (_ ("Invalid TLS state value.\n"));
     }
   }
 #endif /* HTTPS_SUPPORT */
@@ -2973,6 +2984,9 @@ parse_cookies_string_lenient (char *str,
     {
       value_start = 0;
       value_len = 0;
+#ifdef _DEBUG
+      val_quoted = false; /* This assignment used in assert */
+#endif
     }
     else
     {
@@ -4130,6 +4144,7 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection,
             __FUNCTION__,
             MHD_state_to_string (connection->state));
 #endif
+  /* TODO: check whether the next 'switch()' really needed */
   switch (connection->state)
   {
   case MHD_CONNECTION_INIT:
@@ -4142,6 +4157,8 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection,
   case MHD_CONNECTION_CONTINUE_SENT:
   case MHD_CONNECTION_BODY_RECEIVED:
   case MHD_CONNECTION_FOOTER_PART_RECEIVED:
+  case MHD_CONNECTION_FOOTERS_RECEIVED:
+  case MHD_CONNECTION_FULL_REQ_RECEIVED:
     /* nothing to do but default action */
     if (connection->read_closed)
     {
@@ -4157,8 +4174,9 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection,
     mhd_assert (0);
     return;
 #endif /* UPGRADE_SUPPORT */
-  default:
+  case MHD_CONNECTION_START_REPLY:
     /* shrink read buffer to how much is actually used */
+    /* TODO: remove shrink as it handled in special function */
     if ((0 != connection->read_buffer_size) &&
         (connection->read_buffer_size != connection->read_buffer_offset))
     {
@@ -4171,6 +4189,17 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection,
       connection->read_buffer_size = connection->read_buffer_offset;
     }
     break;
+  case MHD_CONNECTION_HEADERS_SENDING:
+  case MHD_CONNECTION_HEADERS_SENT:
+  case MHD_CONNECTION_NORMAL_BODY_UNREADY:
+  case MHD_CONNECTION_NORMAL_BODY_READY:
+  case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
+  case MHD_CONNECTION_CHUNKED_BODY_READY:
+  case MHD_CONNECTION_BODY_SENT:
+  case MHD_CONNECTION_FOOTERS_SENDING:
+  case MHD_CONNECTION_FOOTERS_SENT:
+  default:
+    mhd_assert (0); /* Should not be possible */
   }
   return;
 }
@@ -5308,7 +5337,13 @@ MHD_get_connection_info (struct MHD_Connection 
*connection,
       return NULL;
     connection->connection_info_dummy.tls_session = connection->tls_session;
     return &connection->connection_info_dummy;
-#endif /* HTTPS_SUPPORT */
+#else  /* ! HTTPS_SUPPORT */
+  case MHD_CONNECTION_INFO_CIPHER_ALGO:
+  case MHD_CONNECTION_INFO_PROTOCOL:
+  case MHD_CONNECTION_INFO_GNUTLS_SESSION:
+#endif /* ! HTTPS_SUPPORT */
+  case MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT:
+    return NULL; /* Not implemented */
   case MHD_CONNECTION_INFO_CLIENT_ADDRESS:
     if (0 < connection->addr_len)
     {
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index b179297b..64524b1b 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -46,7 +46,7 @@
 #include "mhd_send.h"
 #include "mhd_align.h"
 
-#if HAVE_SEARCH_H
+#ifdef HAVE_SEARCH_H
 #include <search.h>
 #else
 #include "tsearch.h"
@@ -237,7 +237,7 @@ struct MHD_IPCount
      * IPv4 address.
      */
     struct in_addr ipv4;
-#if HAVE_INET6
+#ifdef HAVE_INET6
     /**
      * IPv6 address.
      */
@@ -337,7 +337,7 @@ MHD_ip_addr_to_key (const struct sockaddr *addr,
     }
   }
 
-#if HAVE_INET6
+#ifdef HAVE_INET6
   if (sizeof (struct sockaddr_in6) <= (size_t) addrlen)
   {
     /* IPv6 addresses */
@@ -637,6 +637,9 @@ MHD_TLS_init (struct MHD_Daemon *daemon)
         gnutls_psk_allocate_server_credentials (&daemon->psk_cred))
       return GNUTLS_E_MEMORY_ERROR;
     return 0;
+  case GNUTLS_CRD_ANON:
+  case GNUTLS_CRD_SRP:
+  case GNUTLS_CRD_IA:
   default:
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
@@ -1882,7 +1885,7 @@ thread_main_handle_connection (void *data)
   fd_set ws;
   fd_set es;
   MHD_socket maxsock;
-#if WINDOWS
+#ifdef WINDOWS
 #ifdef HAVE_POLL
   unsigned int extra_slot;
 #endif /* HAVE_POLL */
@@ -2049,7 +2052,7 @@ thread_main_handle_connection (void *data)
         /* how did we get here!? */
         goto exit;
       }
-#if WINDOWS
+#ifdef WINDOWS
       if (MHD_ITC_IS_VALID_ (daemon->itc) )
       {
         if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
@@ -2087,7 +2090,7 @@ thread_main_handle_connection (void *data)
 #endif
         break;
       }
-#if WINDOWS
+#ifdef WINDOWS
       /* Clear ITC before other processing so additional
        * signals will trigger select() again */
       if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
@@ -2143,7 +2146,7 @@ thread_main_handle_connection (void *data)
         /* how did we get here!? */
         goto exit;
       }
-#if WINDOWS
+#ifdef WINDOWS
       extra_slot = 0;
       if (MHD_ITC_IS_VALID_ (daemon->itc))
       {
@@ -2154,7 +2157,7 @@ thread_main_handle_connection (void *data)
       }
 #endif
       if (MHD_sys_poll_ (p,
-#if WINDOWS
+#ifdef WINDOWS
                          1 + extra_slot,
 #else
                          1,
@@ -2170,7 +2173,7 @@ thread_main_handle_connection (void *data)
 #endif
         break;
       }
-#if WINDOWS
+#ifdef WINDOWS
       /* Clear ITC before other processing so additional
        * signals will trigger poll() again */
       if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
@@ -2442,7 +2445,7 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
                 "Server reached connection limit. Closing inbound 
connection.\n"));
 #endif
     MHD_socket_close_chk_ (client_socket);
-#if ENFILE
+#if defined(ENFILE) && (ENFILE + 0 != 0)
     errno = ENFILE;
 #endif
     return NULL;
@@ -2464,7 +2467,7 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
     MHD_ip_limit_del (daemon,
                       addr,
                       addrlen);
-#if EACCESS
+#if defined(EACCESS) && (EACCESS + 0 != 0)
     errno = EACCESS;
 #endif
     return NULL;
@@ -2580,7 +2583,7 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
       MHD_DLOG (daemon,
                 _ ("Failed to initialise TLS session.\n"));
 #endif
-#if EPROTO
+#if defined(EPROTO) && (EPROTO + 0 != 0)
       errno = EPROTO;
 #endif
       return NULL;
@@ -2626,6 +2629,9 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
       gnutls_psk_set_server_credentials_function (daemon->psk_cred,
                                                   &psk_gnutls_adapter);
       break;
+    case GNUTLS_CRD_ANON:
+    case GNUTLS_CRD_SRP:
+    case GNUTLS_CRD_IA:
     default:
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
@@ -2642,7 +2648,7 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
         free (connection->addr);
       free (connection);
       MHD_PANIC (_ ("Unknown credential type.\n"));
-#if EINVAL
+#if defined(EINVAL) && (EINVAL + 0 != 0)
       errno = EINVAL;
 #endif
       return NULL;
@@ -2754,7 +2760,7 @@ new_connection_process_ (struct MHD_Daemon *daemon,
               _ ("Error allocating memory: %s\n"),
               MHD_strerror_ (errno));
 #endif
-#if ENOMEM
+#if defined(ENOMEM) && (ENOMEM + 0 != 0)
     eno = ENOMEM;
 #endif
     (void) 0; /* Mute possible compiler warning */
@@ -2770,7 +2776,7 @@ new_connection_process_ (struct MHD_Daemon *daemon,
                 _ ("Server reached connection limit. "
                    "Closing inbound connection.\n"));
 #endif
-#if ENFILE
+#if defined(ENFILE) && (ENFILE + 0 != 0)
       eno = ENFILE;
 #endif
       (void) 0; /* Mute possible compiler warning */
@@ -2973,7 +2979,7 @@ internal_add_connection (struct MHD_Daemon *daemon,
               (int) FD_SETSIZE);
 #endif
     MHD_socket_close_chk_ (client_socket);
-#if ENFILE
+#if defined(ENFILE) && (ENFILE + 0 != 0)
     errno = ENFILE;
 #endif
     return MHD_NO;
@@ -2987,7 +2993,7 @@ internal_add_connection (struct MHD_Daemon *daemon,
               _ ("Epoll mode supports only non-blocking sockets\n"));
 #endif
     MHD_socket_close_chk_ (client_socket);
-#if EINVAL
+#if defined(EINVAL) && (EINVAL + 0 != 0)
     errno = EINVAL;
 #endif
     return MHD_NO;
@@ -3561,7 +3567,7 @@ MHD_add_connection (struct MHD_Daemon *daemon,
     }
     /* all pools are at their connection limit, must refuse */
     MHD_socket_close_chk_ (client_socket);
-#if ENFILE
+#if defined(ENFILE) && (ENFILE + 0 != 0)
     errno = ENFILE;
 #endif
     return MHD_NO;
@@ -3596,7 +3602,7 @@ MHD_add_connection (struct MHD_Daemon *daemon,
 static enum MHD_Result
 MHD_accept_connection (struct MHD_Daemon *daemon)
 {
-#if HAVE_INET6
+#ifdef HAVE_INET6
   struct sockaddr_in6 addrstorage;
 #else
   struct sockaddr_in addrstorage;
@@ -6300,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,
@@ -6374,6 +6380,7 @@ parse_options_va (struct MHD_Daemon *daemon,
                                        MHD_OPTION_END))
             return MHD_NO;
           break;
+        case MHD_OPTION_END: /* Not possible */
         default:
           return MHD_NO;
         }
@@ -6427,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;
     }
@@ -6599,7 +6613,7 @@ MHD_start_daemon_va (unsigned int flags,
   struct MHD_Daemon *daemon;
   MHD_socket listen_fd;
   struct sockaddr_in servaddr4;
-#if HAVE_INET6
+#ifdef HAVE_INET6
   struct sockaddr_in6 servaddr6;
 #endif
   const struct sockaddr *servaddr = NULL;
@@ -7032,7 +7046,7 @@ MHD_start_daemon_va (unsigned int flags,
     }
 
     /* check for user supplied sockaddr */
-#if HAVE_INET6
+#ifdef HAVE_INET6
     if (0 != (*pflags & MHD_USE_IPv6))
       addrlen = sizeof (struct sockaddr_in6);
     else
@@ -7040,7 +7054,7 @@ MHD_start_daemon_va (unsigned int flags,
     addrlen = sizeof (struct sockaddr_in);
     if (NULL == servaddr)
     {
-#if HAVE_INET6
+#ifdef HAVE_INET6
       if (0 != (*pflags & MHD_USE_IPv6))
       {
 #ifdef IN6ADDR_ANY_INIT
@@ -7054,7 +7068,7 @@ MHD_start_daemon_va (unsigned int flags,
 #ifdef IN6ADDR_ANY_INIT
         servaddr6.sin6_addr = static_in6any;
 #endif
-#if HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
         servaddr6.sin6_len = sizeof (struct sockaddr_in6);
 #endif
         servaddr = (struct sockaddr *) &servaddr6;
@@ -7069,7 +7083,7 @@ MHD_start_daemon_va (unsigned int flags,
         servaddr4.sin_port = htons (port);
         if (0 != INADDR_ANY)
           servaddr4.sin_addr.s_addr = htonl (INADDR_ANY);
-#if HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
         servaddr4.sin_len = sizeof (struct sockaddr_in);
 #endif
         servaddr = (struct sockaddr *) &servaddr4;
@@ -7798,7 +7812,7 @@ close_all_connections (struct MHD_Daemon *daemon)
   {
     shutdown (pos->socket_fd,
               SHUT_RDWR);
-#if MHD_WINSOCK_SOCKETS
+#ifdef MHD_WINSOCK_SOCKETS
     if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
          (MHD_ITC_IS_VALID_ (daemon->itc)) &&
          (! MHD_itc_activate_ (daemon->itc, "e")) )
@@ -8061,11 +8075,13 @@ MHD_get_daemon_info (struct MHD_Daemon *daemon,
   case MHD_DAEMON_INFO_LISTEN_FD:
     daemon->daemon_info_dummy_listen_fd.listen_fd = daemon->listen_fd;
     return &daemon->daemon_info_dummy_listen_fd;
-#ifdef EPOLL_SUPPORT
   case MHD_DAEMON_INFO_EPOLL_FD:
+#ifdef EPOLL_SUPPORT
     daemon->daemon_info_dummy_epoll_fd.epoll_fd = daemon->epoll_fd;
     return &daemon->daemon_info_dummy_epoll_fd;
-#endif
+#else  /* ! EPOLL_SUPPORT */
+    return NULL;
+#endif /* ! EPOLL_SUPPORT */
   case MHD_DAEMON_INFO_CURRENT_CONNECTIONS:
     if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
     {
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index 26f972b8..cda8b478 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -671,7 +671,7 @@ check_nonce_nc (struct MHD_Connection *connection,
   mod = daemon->nonce_nc_size;
   if (0 == mod)
     return MHD_DAUTH_NONCENC_STALE;  /* no array! */
-  if (nc + 64 < nc)
+  if (nc >= UINT64_MAX - 64)
     return MHD_DAUTH_NONCENC_STALE;  /* Overflow, unrealistically high value */
 
   nn = &daemon->nnc[get_nonce_nc_idx (mod, nonce, noncelen)];
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 26f5d43b..3dafe866 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -739,7 +739,7 @@ enum MHD_TLS_CONN_STATE
 /**
  * Should all state transitions be printed to stderr?
  */
-#define DEBUG_STATES MHD_NO
+#define DEBUG_STATES _MHD_MACRO_NO
 
 
 #ifdef HAVE_MESSAGES
diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index ab842b52..c239a2df 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -31,7 +31,7 @@
 #include <string.h>
 #include <stdint.h>
 #include "mhd_assert.h"
-#if HAVE_SYS_MMAN_H
+#ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
 #ifdef _WIN32
diff --git a/src/microhttpd/mhd_byteorder.h b/src/microhttpd/mhd_byteorder.h
index 3543803f..4ef095de 100644
--- a/src/microhttpd/mhd_byteorder.h
+++ b/src/microhttpd/mhd_byteorder.h
@@ -30,39 +30,39 @@
 
 #include <stdint.h>
 
-#if HAVE_ENDIAN_H
+#ifdef HAVE_ENDIAN_H
 #include <endian.h>
 #endif
 
-#if HAVE_SYS_PARAM_H
+#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 
-#if HAVE_MACHINE_ENDIAN_H
+#ifdef HAVE_MACHINE_ENDIAN_H
 #include <machine/endian.h>
 #endif
 
-#if HAVE_SYS_ENDIAN_H
+#ifdef HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
 #endif
 
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 
-#if HAVE_SYS_BYTEORDER_H
+#ifdef HAVE_SYS_BYTEORDER_H
 #include <sys/byteorder.h>
 #endif
 
-#if HAVE_SYS_MACHINE_H
+#ifdef HAVE_SYS_MACHINE_H
 #include <sys/machine.h>
 #endif
 
-#if HAVE_MACHINE_PARAM_H
+#ifdef HAVE_MACHINE_PARAM_H
 #include <machine/param.h>
 #endif
 
-#if HAVE_SYS_ISA_DEFS_H
+#ifdef HAVE_SYS_ISA_DEFS_H
 #include <sys/isa_defs.h>
 #endif
 
diff --git a/src/microhttpd/mhd_panic.h b/src/microhttpd/mhd_panic.h
index 623639b4..19fe9cd8 100644
--- a/src/microhttpd/mhd_panic.h
+++ b/src/microhttpd/mhd_panic.h
@@ -37,8 +37,8 @@
 #endif /* MHD_PANIC */
 
 /* If we have Clang or gcc >= 4.5, use __builtin_unreachable() */
-#if defined(__clang__) || (__GNUC__ > 4) || \
-  (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 4) || \
+  (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 5)
 #define BUILTIN_NOT_REACHED __builtin_unreachable ()
 #elif defined(_MSC_FULL_VER)
 #define BUILTIN_NOT_REACHED __assume (0)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index be471619..e632406e 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -853,7 +853,7 @@ MHD_send_data_ (struct MHD_Connection *connection,
 
       if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
       {
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
         /* EAGAIN, no longer write-ready */
         connection->epoll_state &=
           ~((enum MHD_EpollState) MHD_EPOLL_STATE_WRITE_READY);
@@ -879,7 +879,7 @@ MHD_send_data_ (struct MHD_Connection *connection,
       /* Treat any other error as a hard error. */
       return MHD_ERR_NOTCONN_;
     }
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
     else if (buffer_size > (size_t) ret)
       connection->epoll_state &=
         ~((enum MHD_EpollState) MHD_EPOLL_STATE_WRITE_READY);
@@ -1099,7 +1099,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
 
     if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
     {
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
       /* EAGAIN, no longer write-ready */
       connection->epoll_state &=
         ~((enum MHD_EpollState) MHD_EPOLL_STATE_WRITE_READY);
@@ -1125,7 +1125,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
     /* Treat any other error as a hard error. */
     return MHD_ERR_NOTCONN_;
   }
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
   else if ((header_size + body_size) > (size_t) ret)
     connection->epoll_state &=
       ~((enum MHD_EpollState) MHD_EPOLL_STATE_WRITE_READY);
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
index 224d8464..fede77dc 100644
--- a/src/microhttpd/mhd_sockets.h
+++ b/src/microhttpd/mhd_sockets.h
@@ -199,7 +199,7 @@ typedef SOCKET MHD_socket;
 #  define SHUT_RDWR SD_BOTH
 #endif
 
-#if HAVE_ACCEPT4 + 0 != 0 && (defined(HAVE_SOCK_NONBLOCK) || \
+#if defined(HAVE_ACCEPT4) && (defined(HAVE_SOCK_NONBLOCK) || \
   defined(SOCK_CLOEXEC) || defined(SOCK_NOSIGPIPE))
 #  define USE_ACCEPT4 1
 #endif
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index 39070334..103eb5e5 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -707,6 +707,16 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
       pp->buffer_pos = 0;
       pp->state = PP_Init;
       break;
+    case PP_NextBoundary:
+    case PP_ProcessEntryHeaders:
+    case PP_PerformCheckMultipart:
+    case PP_ProcessValueToBoundary:
+    case PP_PerformCleanup:
+    case PP_Nested_Init:
+    case PP_Nested_PerformMarking:
+    case PP_Nested_ProcessEntryHeaders:
+    case PP_Nested_ProcessValueToBoundary:
+    case PP_Nested_PerformCleanup:
     default:
       MHD_PANIC (_ ("internal error.\n")); /* should never happen! */
     }
@@ -1429,6 +1439,9 @@ post_process_multipart (struct MHD_PostProcessor *pp,
       pp->state = PP_Nested_ProcessEntryHeaders;
       state_changed = 1;
       break;
+    case PP_ProcessKey:
+    case PP_ProcessValue:
+    case PP_Callback:
     default:
       MHD_PANIC (_ ("internal error.\n")); /* should never happen! */
     }
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 35e0aaeb..13fb253b 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -937,6 +937,8 @@ MHD_set_response_options (struct MHD_Response *response,
   {
     switch (ro)
     {
+    case MHD_RO_END: /* Not possible */
+      break;
     default:
       ret = MHD_NO;
       break;
diff --git a/src/microhttpd/sysfdsetsize.c b/src/microhttpd/sysfdsetsize.c
index 150d4a59..f6452157 100644
--- a/src/microhttpd/sysfdsetsize.c
+++ b/src/microhttpd/sysfdsetsize.c
@@ -39,22 +39,22 @@
 #if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS)
 #include <sockLib.h>
 #endif /* OS_VXWORKS */
-#if HAVE_SYS_SELECT_H
+#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif /* HAVE_SYS_SELECT_H */
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif /* HAVE_SYS_TYPES_H */
-#if HAVE_SYS_TIME_H
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif /* HAVE_SYS_TIME_H */
-#if HAVE_TIME_H
+#ifdef HAVE_TIME_H
 #include <time.h>
 #endif /* HAVE_TIME_H */
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
-#if HAVE_SYS_SOCKET_H
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif /* HAVE_SYS_SOCKET_H */
 
diff --git a/src/microhttpd/test_options.c b/src/microhttpd/test_options.c
index 9283c2e1..655ca828 100644
--- a/src/microhttpd/test_options.c
+++ b/src/microhttpd/test_options.c
@@ -84,7 +84,7 @@ test_ip_addr_option ()
 {
   struct MHD_Daemon *d;
   struct sockaddr_in daemon_ip_addr;
-#if HAVE_INET6 && defined(USE_IPV6_TESTING)
+#if defined(HAVE_INET6) && defined(USE_IPV6_TESTING)
   struct sockaddr_in6 daemon_ip_addr6;
 #endif
 
@@ -93,7 +93,7 @@ test_ip_addr_option ()
   daemon_ip_addr.sin_port = 0;
   daemon_ip_addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
 
-#if HAVE_INET6 && defined(USE_IPV6_TESTING)
+#if defined(HAVE_INET6) && defined(USE_IPV6_TESTING)
   memset (&daemon_ip_addr6, 0, sizeof (struct sockaddr_in6));
   daemon_ip_addr6.sin6_family = AF_INET6;
   daemon_ip_addr6.sin6_port = 0;
@@ -109,7 +109,7 @@ test_ip_addr_option ()
 
   MHD_stop_daemon (d);
 
-#if HAVE_INET6 && defined(USE_IPV6_TESTING)
+#if defined(HAVE_INET6) && defined(USE_IPV6_TESTING)
   d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_IPv6, 0,
                         NULL, NULL, &ahc_echo, NULL, MHD_OPTION_SOCK_ADDR,
                         &daemon_ip_addr6, MHD_OPTION_END);
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index 5ceb6466..2cdc880b 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -1233,7 +1233,7 @@ run_mhd_loop (struct MHD_Daemon *daemon,
   else if (0 != (flags & MHD_USE_POLL))
     run_mhd_poll_loop (daemon);
 #endif /* HAVE_POLL */
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
   else if (0 != (flags & MHD_USE_EPOLL))
     run_mhd_epoll_loop (daemon);
 #endif
diff --git a/src/microhttpd/test_upgrade_large.c 
b/src/microhttpd/test_upgrade_large.c
index 312a3448..2979325b 100644
--- a/src/microhttpd/test_upgrade_large.c
+++ b/src/microhttpd/test_upgrade_large.c
@@ -1421,7 +1421,7 @@ run_mhd_loop (struct MHD_Daemon *daemon,
   else if (0 != (flags & MHD_USE_POLL))
     run_mhd_poll_loop (daemon);
 #endif /* HAVE_POLL */
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
   else if (0 != (flags & MHD_USE_EPOLL))
     run_mhd_epoll_loop (daemon);
 #endif
diff --git a/w32/common/common-build-settings.vcxproj 
b/w32/common/common-build-settings.vcxproj
index a4393a0e..bbf3205e 100644
--- a/w32/common/common-build-settings.vcxproj
+++ b/w32/common/common-build-settings.vcxproj
@@ -26,9 +26,11 @@
   <ItemDefinitionGroup>
     <ClCompile>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
+      <WarningLevel Condition="'%(ClCompile.ExternalWarningLevel)' != 
''">EnableAllWarnings</WarningLevel>
+      <WarningLevel Condition="'%(ClCompile.ExternalWarningLevel)' == 
''">Level4</WarningLevel>
+      <ExternalWarningLevel>Level3</ExternalWarningLevel>
       
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <DisableSpecificWarnings>4996;4820;4127;5045</DisableSpecificWarnings>
       <TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
       
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

-- 
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]