gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated: applying uncrustify


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated: applying uncrustify to ensure uniform indentation
Date: Thu, 17 Oct 2019 17:00:38 +0200

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

grothoff pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 972103dc applying uncrustify to ensure uniform indentation
972103dc is described below

commit 972103dc288e2a2396e060018e7c3733f29a940d
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Oct 17 16:56:41 2019 +0200

    applying uncrustify to ensure uniform indentation
---
 .gitignore                                         |    1 +
 bootstrap                                          |   25 +-
 contrib/uncrustify.cfg                             |    2 +-
 contrib/uncrustify_precommit                       |   35 +
 src/examples/authorization_example.c               |   59 +-
 src/examples/benchmark.c                           |   79 +-
 src/examples/benchmark_https.c                     |  168 +-
 src/examples/chunked_example.c                     |   76 +-
 src/examples/connection_close.c                    |   76 +-
 src/examples/demo.c                                |  748 +-
 src/examples/demo_https.c                          |  846 +--
 src/examples/digest_auth_example.c                 |  142 +-
 src/examples/dual_stack_example.c                  |   44 +-
 src/examples/fileserver_example_dirs.c             |  162 +-
 src/examples/fileserver_example_external_select.c  |  137 +-
 src/examples/http_chunked_compression.c            |  139 +-
 src/examples/http_compression.c                    |   63 +-
 src/examples/https_fileserver_example.c            |  114 +-
 src/examples/minimal_example_comet.c               |   35 +-
 src/examples/msgs_i18n.c                           |   47 +-
 src/examples/post_example.c                        |  509 +-
 src/examples/querystring_example.c                 |   50 +-
 src/examples/refuse_post_example.c                 |   59 +-
 src/examples/suspend_resume_epoll.c                |   64 +-
 src/examples/timeout.c                             |   39 +-
 src/examples/upgrade_example.c                     |  118 +-
 src/gnutls/check_record_pending.c                  |    8 +-
 src/gnutls/handshake.c                             |   24 +-
 src/gnutls/idle_ready.c                            |   18 +-
 src/gnutls/init.c                                  |   38 +-
 src/gnutls/init.h                                  |    2 +-
 src/gnutls/recv.c                                  |    6 +-
 src/gnutls/send.c                                  |   16 +-
 src/gnutls/setup_connection.c                      |   83 +-
 src/gnutls/shutdown_connection.c                   |    8 +-
 src/gnutls/strerror.c                              |    6 +-
 src/gnutls/update_event_loop_info.c                |   36 +-
 src/include/autoinit_funcs.h                       |  105 +-
 src/include/mhd_options.h                          |   14 +-
 src/include/microhttpd.h                           |  390 +-
 src/include/microhttpd2.h                          |  488 +-
 src/include/microhttpd_tls.h                       |   56 +-
 src/include/platform.h                             |   16 +-
 src/lib/action_continue.c                          |    4 +-
 src/lib/action_from_response.c                     |   53 +-
 src/lib/action_parse_post.c                        |    4 +-
 src/lib/action_process_upload.c                    |    8 +-
 src/lib/action_suspend.c                           |   70 +-
 src/lib/base64.c                                   |   55 +-
 src/lib/base64.h                                   |    2 +-
 src/lib/connection_add.c                           | 1204 ++--
 src/lib/connection_add.h                           |    4 +-
 src/lib/connection_call_handlers.c                 | 4040 +++++------
 src/lib/connection_call_handlers.h                 |   12 +-
 src/lib/connection_cleanup.c                       |  132 +-
 src/lib/connection_cleanup.h                       |    6 +-
 src/lib/connection_close.c                         |   58 +-
 src/lib/connection_close.h                         |    4 +-
 src/lib/connection_finish_forward.c                |   46 +-
 src/lib/connection_finish_forward.h                |    2 +-
 src/lib/connection_info.c                          |   12 +-
 src/lib/connection_options.c                       |   70 +-
 src/lib/connection_update_last_activity.c          |   11 +-
 src/lib/connection_update_last_activity.h          |    2 +-
 src/lib/daemon_close_all_connections.c             |  179 +-
 src/lib/daemon_close_all_connections.h             |    2 +-
 src/lib/daemon_create.c                            |   50 +-
 src/lib/daemon_destroy.c                           |  158 +-
 src/lib/daemon_epoll.c                             |  533 +-
 src/lib/daemon_epoll.h                             |    4 +-
 src/lib/daemon_get_timeout.c                       |   78 +-
 src/lib/daemon_info.c                              |   98 +-
 src/lib/daemon_ip_limit.c                          |  120 +-
 src/lib/daemon_ip_limit.h                          |   12 +-
 src/lib/daemon_options.c                           |  140 +-
 src/lib/daemon_poll.c                              |  368 +-
 src/lib/daemon_poll.h                              |   14 +-
 src/lib/daemon_quiesce.c                           |  103 +-
 src/lib/daemon_run.c                               |   36 +-
 src/lib/daemon_select.c                            |  699 +-
 src/lib/daemon_select.h                            |    6 +-
 src/lib/daemon_start.c                             | 1013 +--
 src/lib/init.c                                     |   40 +-
 src/lib/init.h                                     |    2 +-
 src/lib/internal.c                                 |  288 +-
 src/lib/internal.h                                 |  161 +-
 src/lib/md5.c                                      |  226 +-
 src/lib/md5.h                                      |   24 +-
 src/lib/memorypool.c                               |  118 +-
 src/lib/memorypool.h                               |   12 +-
 src/lib/mhd_assert.h                               |   16 +-
 src/lib/mhd_byteorder.h                            |   47 +-
 src/lib/mhd_compat.c                               |   24 +-
 src/lib/mhd_compat.h                               |   18 +-
 src/lib/mhd_itc.c                                  |    6 +-
 src/lib/mhd_itc.h                                  |  103 +-
 src/lib/mhd_itc_types.h                            |    2 +-
 src/lib/mhd_limits.h                               |   38 +-
 src/lib/mhd_locks.h                                |   47 +-
 src/lib/mhd_mono_clock.c                           |  178 +-
 src/lib/mhd_mono_clock.h                           |    6 +-
 src/lib/mhd_sockets.c                              |  239 +-
 src/lib/mhd_sockets.h                              |  239 +-
 src/lib/mhd_str.c                                  |  347 +-
 src/lib/mhd_str.h                                  |  103 +-
 src/lib/mhd_threads.c                              |  162 +-
 src/lib/mhd_threads.h                              |   78 +-
 src/lib/reason_phrase.c                            |    2 +-
 src/lib/request.c                                  |   72 +-
 src/lib/request_info.c                             |   12 +-
 src/lib/request_resume.c                           |  185 +-
 src/lib/request_resume.h                           |    2 +-
 src/lib/response.c                                 |  126 +-
 src/lib/response_for_upgrade.c                     |   20 +-
 src/lib/response_from_buffer.c                     |   46 +-
 src/lib/response_from_callback.c                   |   14 +-
 src/lib/response_from_fd.c                         |   85 +-
 src/lib/response_options.c                         |    5 +-
 src/lib/sysfdsetsize.c                             |    2 +-
 src/lib/tsearch.c                                  |  122 +-
 src/lib/tsearch.h                                  |   24 +-
 src/lib/upgrade_process.c                          |  491 +-
 src/lib/upgrade_process.h                          |    2 +-
 src/lib/version.c                                  |  155 +-
 src/microhttpd/base64.c                            |   55 +-
 src/microhttpd/base64.h                            |    2 +-
 src/microhttpd/connection.h                        |    2 +-
 src/microhttpd/connection_https.c                  |  127 +-
 src/microhttpd/connection_https.h                  |    2 +-
 src/microhttpd/daemon.c                            | 7164 ++++++++++----------
 src/microhttpd/digestauth.c                        |  936 +--
 src/microhttpd/internal.c                          |  290 +-
 src/microhttpd/internal.h                          |  161 +-
 src/microhttpd/md5.c                               |  181 +-
 src/microhttpd/md5.h                               |   18 +-
 src/microhttpd/memorypool.h                        |   10 +-
 src/microhttpd/mhd_assert.h                        |   16 +-
 src/microhttpd/mhd_bithelpers.h                    |  152 +-
 src/microhttpd/mhd_byteorder.h                     |   47 +-
 src/microhttpd/mhd_compat.c                        |   24 +-
 src/microhttpd/mhd_compat.h                        |   18 +-
 src/microhttpd/mhd_itc.c                           |    6 +-
 src/microhttpd/mhd_itc.h                           |  103 +-
 src/microhttpd/mhd_itc_types.h                     |    2 +-
 src/microhttpd/mhd_limits.h                        |   38 +-
 src/microhttpd/mhd_locks.h                         |   47 +-
 src/microhttpd/mhd_mono_clock.c                    |  178 +-
 src/microhttpd/mhd_mono_clock.h                    |    6 +-
 src/microhttpd/mhd_send.c                          |  347 +-
 src/microhttpd/mhd_send.h                          |    6 +-
 src/microhttpd/mhd_sockets.h                       |  239 +-
 src/microhttpd/mhd_str.c                           |  369 +-
 src/microhttpd/mhd_str.h                           |  109 +-
 src/microhttpd/mhd_threads.h                       |   78 +-
 src/microhttpd/postprocessor.c                     | 1205 ++--
 src/microhttpd/reason_phrase.c                     |  184 +-
 src/microhttpd/response.c                          |  611 +-
 src/microhttpd/sha256.c                            |  254 +-
 src/microhttpd/sha256.h                            |    4 +-
 src/microhttpd/sysfdsetsize.c                      |    2 +-
 src/microhttpd/test_daemon.c                       |   69 +-
 src/microhttpd/test_helpers.h                      |   34 +-
 src/microhttpd/test_http_reasons.c                 |  124 +-
 src/microhttpd/test_options.c                      |   32 +-
 src/microhttpd/test_postprocessor.c                |   68 +-
 src/microhttpd/test_postprocessor_amp.c            |   30 +-
 src/microhttpd/test_postprocessor_large.c          |   16 +-
 src/microhttpd/test_shutdown_select.c              |  285 +-
 src/microhttpd/test_start_stop.c                   |   50 +-
 src/microhttpd/test_str.c                          | 4627 +++++++------
 src/microhttpd/test_str_token.c                    |  127 +-
 src/microhttpd/tsearch.c                           |  122 +-
 src/microhttpd/tsearch.h                           |   24 +-
 src/testcurl/curl_version_check.c                  |  108 +-
 src/testcurl/gauger.h                              |  114 +-
 src/testcurl/https/test_empty_response.c           |  170 +-
 src/testcurl/https/test_https_get.c                |   55 +-
 src/testcurl/https/test_https_get_parallel.c       |   67 +-
 .../https/test_https_get_parallel_threads.c        |   72 +-
 src/testcurl/https/test_https_get_select.c         |  185 +-
 src/testcurl/https/test_https_multi_daemon.c       |  106 +-
 src/testcurl/https/test_https_session_info.c       |  113 +-
 src/testcurl/https/test_https_sni.c                |  156 +-
 src/testcurl/https/test_https_time_out.c           |   75 +-
 src/testcurl/https/test_tls_authentication.c       |   67 +-
 src/testcurl/https/test_tls_extensions.c           |  144 +-
 src/testcurl/https/test_tls_options.c              |  114 +-
 src/testcurl/https/tls_test_common.c               |  317 +-
 src/testcurl/https/tls_test_common.h               |   35 +-
 src/testcurl/https/tls_test_keys.h                 |  260 +-
 src/testcurl/mhd_has_in_name.h                     |   20 +-
 src/testcurl/perf_get.c                            |  526 +-
 src/testcurl/perf_get_concurrent.c                 |  368 +-
 src/testcurl/test_callback.c                       |  232 +-
 src/testcurl/test_concurrent_stop.c                |  188 +-
 src/testcurl/test_delete.c                         |  287 +-
 src/testcurl/test_digestauth.c                     |  157 +-
 src/testcurl/test_digestauth_sha256.c              |  159 +-
 src/testcurl/test_digestauth_with_arguments.c      |  164 +-
 src/testcurl/test_get.c                            |  808 +--
 src/testcurl/test_get_chunked.c                    |  289 +-
 src/testcurl/test_get_response_cleanup.c           |  259 +-
 src/testcurl/test_get_sendfile.c                   |  394 +-
 src/testcurl/test_iplimit.c                        |  338 +-
 src/testcurl/test_large_put.c                      |  522 +-
 src/testcurl/test_long_header.c                    |  168 +-
 src/testcurl/test_parse_cookies.c                  |  173 +-
 src/testcurl/test_post.c                           |  560 +-
 src/testcurl/test_post_loop.c                      |  692 +-
 src/testcurl/test_postform.c                       |  385 +-
 src/testcurl/test_process_arguments.c              |  176 +-
 src/testcurl/test_process_headers.c                |  325 +-
 src/testcurl/test_put.c                            |  335 +-
 src/testcurl/test_put_chunked.c                    |  305 +-
 src/testcurl/test_quiesce.c                        |  510 +-
 src/testcurl/test_quiesce_stream.c                 |   80 +-
 src/testcurl/test_termination.c                    |   62 +-
 src/testcurl/test_timeout.c                        |  178 +-
 src/testcurl/test_urlparse.c                       |   77 +-
 src/testzzuf/socat.c                               |   50 +-
 src/testzzuf/test_get.c                            |  262 +-
 src/testzzuf/test_get_chunked.c                    |  246 +-
 src/testzzuf/test_long_header.c                    |  164 +-
 src/testzzuf/test_post.c                           |  348 +-
 src/testzzuf/test_post_form.c                      |  342 +-
 src/testzzuf/test_put.c                            |  310 +-
 src/testzzuf/test_put_chunked.c                    |  275 +-
 src/testzzuf/test_put_large.c                      |  324 +-
 228 files changed, 25865 insertions(+), 24404 deletions(-)

diff --git a/.gitignore b/.gitignore
index 88f8ab32..46beb093 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,3 +48,4 @@ po/configargs.stamp
 **~
 doc/libmicrohttpd.log
 src/examples/suspend_resume_epoll
+uncrustify.cfg
diff --git a/bootstrap b/bootstrap
index dce3249e..7e150794 100755
--- a/bootstrap
+++ b/bootstrap
@@ -8,4 +8,27 @@ fi
 
 test -n "$bs_scrdir" && cd "$bs_scrdir" || echo "Warning: cannot get sources 
directory" 1>&2
 
-autoreconf -I m4 -i ${1+"$@"}
+# This is more portable than `which' but comes with
+# the caveat of not(?) properly working on busybox's ash:
+existence()
+{
+    command -v "$1" >/dev/null 2>&1
+}
+
+
+if existence uncrustify; then
+    echo "Installing uncrustify hook and configuration"
+    # Install uncrustify format symlink (if possible)
+    ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null
+    # Install pre-commit hook (if possible)
+    ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null
+else
+    echo "Uncrustify not detected, hook not installed. Please install 
uncrustify if you plan on doing development"
+fi
+
+if existence libtool || existence libtoolize || existence glibtoolize || 
existence slibtool; then
+    autoreconf -I m4 -i ${1+"$@"}
+else
+    echo "*** No libtoolize (libtool) or libtool found, please install it ***" 
>&2;
+    exit 1
+fi
diff --git a/contrib/uncrustify.cfg b/contrib/uncrustify.cfg
index 6ced05d7..f56c8e73 100644
--- a/contrib/uncrustify.cfg
+++ b/contrib/uncrustify.cfg
@@ -4,7 +4,7 @@ output_tab_size = 2
 indent_columns = 2
 indent_with_tabs = 0
 indent_case_brace = 2
-indent_label=0
+indent_label=-16
 
 code_width=80
 #cmd_width=80
diff --git a/contrib/uncrustify_precommit b/contrib/uncrustify_precommit
new file mode 100755
index 00000000..fd29998c
--- /dev/null
+++ b/contrib/uncrustify_precommit
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# use as .git/hooks/pre-commit
+
+exec 1>&2
+
+RET=0
+changed=$(git diff --cached --name-only)
+crustified=""
+
+for f in $changed;
+do
+ if echo $f | grep \\.[c,h]\$ > /dev/null
+ then
+    # compare result of uncrustify with changes
+    #
+    # only change any of the invocations here if
+    # they are portable across all cmp and shell
+    # implementations !
+    uncrustify -q -c uncrustify.cfg -f $f | cmp -s $f -
+    if test $? = 1 ;
+    then
+      crustified=" $crustified $f"
+      RET=1
+    fi
+  fi
+done
+
+if [ $RET = 1 ];
+then
+  echo "Run"
+  echo "uncrustify --no-backup -c uncrustify.cfg ${crustified}"
+  echo "before commiting."
+fi
+exit $RET
diff --git a/src/examples/authorization_example.c 
b/src/examples/authorization_example.c
index d8a88203..c07d7827 100644
--- a/src/examples/authorization_example.c
+++ b/src/examples/authorization_example.c
@@ -32,9 +32,11 @@
 #include <windows.h>
 #endif
 
-#define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd 
demo</body></html>"
 
-#define DENIED "<html><head><title>Access denied</title></head><body>Access 
denied</body></html>"
+#define DENIED \
+  "<html><head><title>Access denied</title></head><body>Access 
denied</body></html>"
 
 
 
@@ -53,19 +55,19 @@ ahc_echo (void *cls,
   char *user;
   char *pass;
   int fail;
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
 
   /* require: "Aladdin" with password "open sesame" */
@@ -77,18 +79,18 @@ ahc_echo (void *cls,
            (0 != strcmp (pass, "open sesame") ) );
   if (fail)
   {
-      response = MHD_create_response_from_buffer (strlen (DENIED),
-                                                 (void *) DENIED,
-                                                 MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_basic_auth_fail_response 
(connection,"TestRealm",response);
-    }
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                (void *) DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_basic_auth_fail_response (connection,"TestRealm",response);
+  }
   else
-    {
-      response = MHD_create_response_from_buffer (strlen (me),
-                                                 (void *) me,
-                                                 MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-    }
+  {
+    response = MHD_create_response_from_buffer (strlen (me),
+                                                (void *) me,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+  }
   if (NULL != user)
     MHD_free (user);
   if (NULL != pass)
@@ -107,13 +109,14 @@ main (int argc, char *const *argv)
   if ( (argc != 2) ||
        (1 != sscanf (argv[1], "%u", &port)) ||
        (UINT16_MAX < port) )
-    {
-      fprintf (stderr,
-              "%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    fprintf (stderr,
+             "%s PORT\n", argv[0]);
+    return 1;
+  }
 
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, PAGE, MHD_OPTION_END);
   if (d == NULL)
diff --git a/src/examples/benchmark.c b/src/examples/benchmark.c
index 9512b9bf..2a8fb179 100644
--- a/src/examples/benchmark.c
+++ b/src/examples/benchmark.c
@@ -25,14 +25,15 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
-#define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd 
demo</body></html>"
 
 
 #define SMALL (1024 * 128)
@@ -62,16 +63,16 @@ static struct MHD_Response *response;
  */
 static void
 completed_callback (void *cls,
-                   struct MHD_Connection *connection,
-                   void **con_cls,
-                   enum MHD_RequestTerminationCode toe)
+                    struct MHD_Connection *connection,
+                    void **con_cls,
+                    enum MHD_RequestTerminationCode toe)
 {
   struct timeval *tv = *con_cls;
   struct timeval tve;
   uint64_t delta;
-  (void)cls;         /* Unused. Silent compiler warning. */
-  (void)connection;  /* Unused. Silent compiler warning. */
-  (void)toe;         /* Unused. Silent compiler warning. */
+  (void) cls;         /* Unused. Silent compiler warning. */
+  (void) connection;  /* Unused. Silent compiler warning. */
+  (void) toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == tv)
     return;
@@ -80,10 +81,10 @@ completed_callback (void *cls,
   delta = 0;
   if (tve.tv_usec >= tv->tv_usec)
     delta += (tve.tv_sec - tv->tv_sec) * 1000000LL
-      + (tve.tv_usec - tv->tv_usec);
+             + (tve.tv_usec - tv->tv_usec);
   else
     delta += (tve.tv_sec - tv->tv_sec) * 1000000LL
-      - tv->tv_usec + tve.tv_usec;
+             - tv->tv_usec + tve.tv_usec;
   if (delta < SMALL)
     small_deltas[delta]++;
   else
@@ -94,11 +95,11 @@ completed_callback (void *cls,
 
 static void *
 uri_logger_cb (void *cls,
-              const char *uri)
+               const char *uri)
 {
   struct timeval *tv = malloc (sizeof (struct timeval));
-  (void)cls; /* Unused. Silent compiler warning. */
-  (void)uri; /* Unused. Silent compiler warning. */
+  (void) cls; /* Unused. Silent compiler warning. */
+  (void) uri; /* Unused. Silent compiler warning. */
 
   if (NULL != tv)
     gettimeofday (tv, NULL);
@@ -114,12 +115,12 @@ ahc_echo (void *cls,
           const char *version,
           const char *upload_data, size_t *upload_data_size, void **ptr)
 {
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
-  (void)ptr;               /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) ptr;               /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
@@ -134,37 +135,39 @@ main (int argc, char *const *argv)
   unsigned int i;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   response = MHD_create_response_from_buffer (strlen (PAGE),
-                                             (void *) PAGE,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) PAGE,
+                                              MHD_RESPMEM_PERSISTENT);
 #if 0
   (void) MHD_add_response_header (response,
-                                 MHD_HTTP_HEADER_CONNECTION,
-                                 "close");
+                                  MHD_HTTP_HEADER_CONNECTION,
+                                  "close");
 #endif
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_SUPPRESS_DATE_NO_CLOCK
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
+                        | MHD_USE_SUPPRESS_DATE_NO_CLOCK
 #ifdef EPOLL_SUPPORT
-                       | MHD_USE_EPOLL | MHD_USE_TURBO
+                        | MHD_USE_EPOLL | MHD_USE_TURBO
 #endif
-                       ,
+                        ,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
-                       MHD_OPTION_THREAD_POOL_SIZE, (unsigned int) 
NUMBER_OF_THREADS,
-                       MHD_OPTION_URI_LOG_CALLBACK, &uri_logger_cb, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_callback, NULL,
-                       MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 1000,
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
+                        MHD_OPTION_THREAD_POOL_SIZE, (unsigned
+                                                      int) NUMBER_OF_THREADS,
+                        MHD_OPTION_URI_LOG_CALLBACK, &uri_logger_cb, NULL,
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_callback, NULL,
+                        MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 1000,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   (void) getc (stdin);
   MHD_stop_daemon (d);
   MHD_destroy_response (response);
-  for (i=0;i<SMALL;i++)
+  for (i = 0; i<SMALL; i++)
     if (0 != small_deltas[i])
       fprintf (stdout, "D: %d %u\n", i, small_deltas[i]);
   return 0;
diff --git a/src/examples/benchmark_https.c b/src/examples/benchmark_https.c
index 64eb11b7..9506e562 100644
--- a/src/examples/benchmark_https.c
+++ b/src/examples/benchmark_https.c
@@ -25,14 +25,15 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
-#define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd 
demo</body></html>"
 
 
 #define SMALL (1024 * 128)
@@ -62,16 +63,16 @@ static struct MHD_Response *response;
  */
 static void
 completed_callback (void *cls,
-                   struct MHD_Connection *connection,
-                   void **con_cls,
-                   enum MHD_RequestTerminationCode toe)
+                    struct MHD_Connection *connection,
+                    void **con_cls,
+                    enum MHD_RequestTerminationCode toe)
 {
   struct timeval *tv = *con_cls;
   struct timeval tve;
   uint64_t delta;
-  (void)cls;         /* Unused. Silent compiler warning. */
-  (void)connection;  /* Unused. Silent compiler warning. */
-  (void)toe;         /* Unused. Silent compiler warning. */
+  (void) cls;         /* Unused. Silent compiler warning. */
+  (void) connection;  /* Unused. Silent compiler warning. */
+  (void) toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == tv)
     return;
@@ -80,10 +81,10 @@ completed_callback (void *cls,
   delta = 0;
   if (tve.tv_usec >= tv->tv_usec)
     delta += (tve.tv_sec - tv->tv_sec) * 1000000LL
-      + (tve.tv_usec - tv->tv_usec);
+             + (tve.tv_usec - tv->tv_usec);
   else
     delta += (tve.tv_sec - tv->tv_sec) * 1000000LL
-      - tv->tv_usec + tve.tv_usec;
+             - tv->tv_usec + tve.tv_usec;
   if (delta < SMALL)
     small_deltas[delta]++;
   else
@@ -94,11 +95,11 @@ completed_callback (void *cls,
 
 static void *
 uri_logger_cb (void *cls,
-              const char *uri)
+               const char *uri)
 {
   struct timeval *tv = malloc (sizeof (struct timeval));
-  (void)cls; /* Unused. Silent compiler warning. */
-  (void)uri; /* Unused. Silent compiler warning. */
+  (void) cls; /* Unused. Silent compiler warning. */
+  (void) uri; /* Unused. Silent compiler warning. */
 
   if (NULL != tv)
     gettimeofday (tv, NULL);
@@ -114,12 +115,12 @@ ahc_echo (void *cls,
           const char *version,
           const char *upload_data, size_t *upload_data_size, void **ptr)
 {
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
-  (void)ptr;               /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) ptr;               /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
@@ -129,53 +130,53 @@ ahc_echo (void *cls,
 
 /* test server key */
 const char srv_signed_key_pem[] = "-----BEGIN RSA PRIVATE KEY-----\n"
-  "MIIEowIBAAKCAQEAvfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW\n"
-  "+K03KwEku55QvnUndwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8IL\n"
-  "q4sw32vo0fbMu5BZF49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ0\n"
-  "20Q5EAAEseD1YtWCIpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6\n"
-  "QYGGh1QmHRPAy3CBII6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6x\n"
-  "yoOl204xuekZOaG9RUPId74Rtmwfi1TLbBzo2wIDAQABAoIBADu09WSICNq5cMe4\n"
-  "+NKCLlgAT1NiQpLls1gKRbDhKiHU9j8QWNvWWkJWrCya4QdUfLCfeddCMeiQmv3K\n"
-  "lJMvDs+5OjJSHFoOsGiuW2Ias7IjnIojaJalfBml6frhJ84G27IXmdz6gzOiTIer\n"
-  "DjeAgcwBaKH5WwIay2TxIaScl7AwHBauQkrLcyb4hTmZuQh6ArVIN6+pzoVuORXM\n"
-  "bpeNWl2l/HSN3VtUN6aCAKbN/X3o0GavCCMn5Fa85uJFsab4ss/uP+2PusU71+zP\n"
-  "sBm6p/2IbGvF5k3VPDA7X5YX61sukRjRBihY8xSnNYx1UcoOsX6AiPnbhifD8+xQ\n"
-  "Tlf8oJUCgYEA0BTfzqNpr9Wxw5/QXaSdw7S/0eP5a0C/nwURvmfSzuTD4equzbEN\n"
-  "d+dI/s2JMxrdj/I4uoAfUXRGaabevQIjFzC9uyE3LaOyR2zhuvAzX+vVcs6bSXeU\n"
-  "pKpCAcN+3Z3evMaX2f+z/nfSUAl2i4J2R+/LQAWJW4KwRky/m+cxpfUCgYEA6bN1\n"
-  "b73bMgM8wpNt6+fcmS+5n0iZihygQ2U2DEud8nZJL4Nrm1dwTnfZfJBnkGj6+0Q0\n"
-  "cOwj2KS0/wcEdJBP0jucU4v60VMhp75AQeHqidIde0bTViSRo3HWKXHBIFGYoU3T\n"
-  "LyPyKndbqsOObnsFXHn56Nwhr2HLf6nw4taGQY8CgYBoSW36FLCNbd6QGvLFXBGt\n"
-  "2lMhEM8az/K58kJ4WXSwOLtr6MD/WjNT2tkcy0puEJLm6BFCd6A6pLn9jaKou/92\n"
-  "SfltZjJPb3GUlp9zn5tAAeSSi7YMViBrfuFiHObij5LorefBXISLjuYbMwL03MgH\n"
-  "Ocl2JtA2ywMp2KFXs8GQWQKBgFyIVv5ogQrbZ0pvj31xr9HjqK6d01VxIi+tOmpB\n"
-  "4ocnOLEcaxX12BzprW55ytfOCVpF1jHD/imAhb3YrHXu0fwe6DXYXfZV4SSG2vB7\n"
-  "IB9z14KBN5qLHjNGFpMQXHSMek+b/ftTU0ZnPh9uEM5D3YqRLVd7GcdUhHvG8P8Q\n"
-  "C9aXAoGBAJtID6h8wOGMP0XYX5YYnhlC7dOLfk8UYrzlp3xhqVkzKthTQTj6wx9R\n"
-  "GtC4k7U1ki8oJsfcIlBNXd768fqDVWjYju5rzShMpo8OCTS6ipAblKjCxPPVhIpv\n"
-  "tWPlbSn1qj6wylstJ5/3Z+ZW5H4wIKp5jmLiioDhcP0L/Ex3Zx8O\n"
-  "-----END RSA PRIVATE KEY-----\n";
+                                  
"MIIEowIBAAKCAQEAvfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW\n"
+                                  
"+K03KwEku55QvnUndwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8IL\n"
+                                  
"q4sw32vo0fbMu5BZF49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ0\n"
+                                  
"20Q5EAAEseD1YtWCIpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6\n"
+                                  
"QYGGh1QmHRPAy3CBII6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6x\n"
+                                  
"yoOl204xuekZOaG9RUPId74Rtmwfi1TLbBzo2wIDAQABAoIBADu09WSICNq5cMe4\n"
+                                  
"+NKCLlgAT1NiQpLls1gKRbDhKiHU9j8QWNvWWkJWrCya4QdUfLCfeddCMeiQmv3K\n"
+                                  
"lJMvDs+5OjJSHFoOsGiuW2Ias7IjnIojaJalfBml6frhJ84G27IXmdz6gzOiTIer\n"
+                                  
"DjeAgcwBaKH5WwIay2TxIaScl7AwHBauQkrLcyb4hTmZuQh6ArVIN6+pzoVuORXM\n"
+                                  
"bpeNWl2l/HSN3VtUN6aCAKbN/X3o0GavCCMn5Fa85uJFsab4ss/uP+2PusU71+zP\n"
+                                  
"sBm6p/2IbGvF5k3VPDA7X5YX61sukRjRBihY8xSnNYx1UcoOsX6AiPnbhifD8+xQ\n"
+                                  
"Tlf8oJUCgYEA0BTfzqNpr9Wxw5/QXaSdw7S/0eP5a0C/nwURvmfSzuTD4equzbEN\n"
+                                  
"d+dI/s2JMxrdj/I4uoAfUXRGaabevQIjFzC9uyE3LaOyR2zhuvAzX+vVcs6bSXeU\n"
+                                  
"pKpCAcN+3Z3evMaX2f+z/nfSUAl2i4J2R+/LQAWJW4KwRky/m+cxpfUCgYEA6bN1\n"
+                                  
"b73bMgM8wpNt6+fcmS+5n0iZihygQ2U2DEud8nZJL4Nrm1dwTnfZfJBnkGj6+0Q0\n"
+                                  
"cOwj2KS0/wcEdJBP0jucU4v60VMhp75AQeHqidIde0bTViSRo3HWKXHBIFGYoU3T\n"
+                                  
"LyPyKndbqsOObnsFXHn56Nwhr2HLf6nw4taGQY8CgYBoSW36FLCNbd6QGvLFXBGt\n"
+                                  
"2lMhEM8az/K58kJ4WXSwOLtr6MD/WjNT2tkcy0puEJLm6BFCd6A6pLn9jaKou/92\n"
+                                  
"SfltZjJPb3GUlp9zn5tAAeSSi7YMViBrfuFiHObij5LorefBXISLjuYbMwL03MgH\n"
+                                  
"Ocl2JtA2ywMp2KFXs8GQWQKBgFyIVv5ogQrbZ0pvj31xr9HjqK6d01VxIi+tOmpB\n"
+                                  
"4ocnOLEcaxX12BzprW55ytfOCVpF1jHD/imAhb3YrHXu0fwe6DXYXfZV4SSG2vB7\n"
+                                  
"IB9z14KBN5qLHjNGFpMQXHSMek+b/ftTU0ZnPh9uEM5D3YqRLVd7GcdUhHvG8P8Q\n"
+                                  
"C9aXAoGBAJtID6h8wOGMP0XYX5YYnhlC7dOLfk8UYrzlp3xhqVkzKthTQTj6wx9R\n"
+                                  
"GtC4k7U1ki8oJsfcIlBNXd768fqDVWjYju5rzShMpo8OCTS6ipAblKjCxPPVhIpv\n"
+                                  
"tWPlbSn1qj6wylstJ5/3Z+ZW5H4wIKp5jmLiioDhcP0L/Ex3Zx8O\n"
+                                  "-----END RSA PRIVATE KEY-----\n";
 
 /* test server CA signed certificates */
 const char srv_signed_cert_pem[] = "-----BEGIN CERTIFICATE-----\n"
-  "MIIDGzCCAgWgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
-  "dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
-  "A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
-  "vfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW+K03KwEku55QvnUn\n"
-  "dwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8ILq4sw32vo0fbMu5BZ\n"
-  "F49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ020Q5EAAEseD1YtWC\n"
-  "IpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6QYGGh1QmHRPAy3CB\n"
-  "II6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6xyoOl204xuekZOaG9\n"
-  "RUPId74Rtmwfi1TLbBzo2wIDAQABo3YwdDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
-  "MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFOFi4ilKOP1d\n"
-  "XHlWCMwmVKr7mgy8MB8GA1UdIwQYMBaAFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsG\n"
-  "CSqGSIb3DQEBBQOCAQEAHVWPxazupbOkG7Did+dY9z2z6RjTzYvurTtEKQgzM2Vz\n"
-  "GQBA+3pZ3c5mS97fPIs9hZXfnQeelMeZ2XP1a+9vp35bJjZBBhVH+pqxjCgiUflg\n"
-  "A3Zqy0XwwVCgQLE2HyaU3DLUD/aeIFK5gJaOSdNTXZLv43K8kl4cqDbMeRpVTbkt\n"
-  "YmG4AyEOYRNKGTqMEJXJoxD5E3rBUNrVI/XyTjYrulxbNPcMWEHKNeeqWpKDYTFo\n"
-  "Bb01PCthGXiq/4A2RLAFosadzRa8SBpoSjPPfZ0b2w4MJpReHqKbR5+T2t6hzml6\n"
-  "4ToyOKPDmamiTuN5KzLN3cw7DQlvWMvqSOChPLnA3Q==\n"
-  "-----END CERTIFICATE-----\n";
+                                   
"MIIDGzCCAgWgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
+                                   
"dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
+                                   
"A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
+                                   
"vfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW+K03KwEku55QvnUn\n"
+                                   
"dwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8ILq4sw32vo0fbMu5BZ\n"
+                                   
"F49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ020Q5EAAEseD1YtWC\n"
+                                   
"IpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6QYGGh1QmHRPAy3CB\n"
+                                   
"II6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6xyoOl204xuekZOaG9\n"
+                                   
"RUPId74Rtmwfi1TLbBzo2wIDAQABo3YwdDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
+                                   
"MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFOFi4ilKOP1d\n"
+                                   
"XHlWCMwmVKr7mgy8MB8GA1UdIwQYMBaAFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsG\n"
+                                   
"CSqGSIb3DQEBBQOCAQEAHVWPxazupbOkG7Did+dY9z2z6RjTzYvurTtEKQgzM2Vz\n"
+                                   
"GQBA+3pZ3c5mS97fPIs9hZXfnQeelMeZ2XP1a+9vp35bJjZBBhVH+pqxjCgiUflg\n"
+                                   
"A3Zqy0XwwVCgQLE2HyaU3DLUD/aeIFK5gJaOSdNTXZLv43K8kl4cqDbMeRpVTbkt\n"
+                                   
"YmG4AyEOYRNKGTqMEJXJoxD5E3rBUNrVI/XyTjYrulxbNPcMWEHKNeeqWpKDYTFo\n"
+                                   
"Bb01PCthGXiq/4A2RLAFosadzRa8SBpoSjPPfZ0b2w4MJpReHqKbR5+T2t6hzml6\n"
+                                   
"4ToyOKPDmamiTuN5KzLN3cw7DQlvWMvqSOChPLnA3Q==\n"
+                                   "-----END CERTIFICATE-----\n";
 
 
 int
@@ -185,36 +186,37 @@ main (int argc, char *const *argv)
   unsigned int i;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   response = MHD_create_response_from_buffer (strlen (PAGE),
-                                             (void *) PAGE,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) PAGE,
+                                              MHD_RESPMEM_PERSISTENT);
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
 #ifdef EPOLL_SUPPORT
-                       | MHD_USE_EPOLL | MHD_USE_TURBO
+                        | MHD_USE_EPOLL | MHD_USE_TURBO
 #endif
-                       ,
+                        ,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
-                       MHD_OPTION_THREAD_POOL_SIZE, (unsigned int) 
NUMBER_OF_THREADS,
-                       MHD_OPTION_URI_LOG_CALLBACK, &uri_logger_cb, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_callback, NULL,
-                       MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 1000,
-                       /* Optionally, the gnutls_load_file() can be used to
-                          load the key and the certificate from file. */
-                       MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem,
-                       MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem,
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
+                        MHD_OPTION_THREAD_POOL_SIZE, (unsigned
+                                                      int) NUMBER_OF_THREADS,
+                        MHD_OPTION_URI_LOG_CALLBACK, &uri_logger_cb, NULL,
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_callback, NULL,
+                        MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 1000,
+                        /* Optionally, the gnutls_load_file() can be used to
+                           load the key and the certificate from file. */
+                        MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem,
+                        MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   (void) getc (stdin);
   MHD_stop_daemon (d);
   MHD_destroy_response (response);
-  for (i=0;i<SMALL;i++)
+  for (i = 0; i<SMALL; i++)
     if (0 != small_deltas[i])
       fprintf (stdout, "D: %d %u\n", i, small_deltas[i]);
   return 0;
diff --git a/src/examples/chunked_example.c b/src/examples/chunked_example.c
index 26dacd3b..cd6539ef 100644
--- a/src/examples/chunked_example.c
+++ b/src/examples/chunked_example.c
@@ -40,15 +40,15 @@ callback (void *cls,
           size_t buf_size)
 {
   size_t size_to_copy;
-  struct ResponseContentCallbackParam * const param =
-      (struct ResponseContentCallbackParam *)cls;
+  struct ResponseContentCallbackParam *const param =
+    (struct ResponseContentCallbackParam *) cls;
 
   /* Note: 'pos' will never exceed size of transmitted data. */
   /* You can use 'pos == param->response_size' in next check. */
   if (pos >= param->response_size)
-    { /* Whole response was sent. Signal end of response. */
-      return MHD_CONTENT_READER_END_OF_STREAM;
-    }
+  {   /* Whole response was sent. Signal end of response. */
+    return MHD_CONTENT_READER_END_OF_STREAM;
+  }
 
   /* Pseudo code.        *
   if (data_not_ready)
@@ -82,12 +82,13 @@ callback (void *cls,
 static void
 free_callback_param (void *cls)
 {
-  free(cls);
+  free (cls);
 }
 
 
-static const char simple_response_text[] = "<html><head><title>Simple 
response</title></head>"
-                                           "<body>Simple response 
text</body></html>";
+static const char simple_response_text[] =
+  "<html><head><title>Simple response</title></head>"
+  "<body>Simple response text</body></html>";
 
 
 static int
@@ -104,27 +105,28 @@ ahc_echo (void *cls,
   struct ResponseContentCallbackParam *callback_param;
   struct MHD_Response *response;
   int ret;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
 
   callback_param = malloc (sizeof(struct ResponseContentCallbackParam));
   if (NULL == callback_param)
     return MHD_NO; /* Not enough memory. */
 
   callback_param->response_data = simple_response_text;
-  callback_param->response_size = (sizeof(simple_response_text)/sizeof(char)) 
- 1;
+  callback_param->response_size = (sizeof(simple_response_text)
+                                   / sizeof(char)) - 1;
 
   *ptr = NULL;                  /* reset when done */
   response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
@@ -150,28 +152,28 @@ main (int argc, char *const *argv)
   int port;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   port = atoi (argv[1]);
   if ( (1 > port) ||
        (port > UINT16_MAX) )
-    {
-      fprintf (stderr,
-               "Port must be a number between 1 and 65535\n");
-      return 1;
-    }
+  {
+    fprintf (stderr,
+             "Port must be a number between 1 and 65535\n");
+    return 1;
+  }
   d = MHD_start_daemon (/* MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG, */
-                        MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG,
-                        /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 
| MHD_USE_POLL, */
-                       /* MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */
-                       /* MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */
-                        (uint16_t) port,
-                        NULL, NULL,
-                        &ahc_echo, NULL,
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
-                       MHD_OPTION_END);
+    MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+    /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */
+    /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG | MHD_USE_POLL, */
+    /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG, */
+    (uint16_t) port,
+    NULL, NULL,
+    &ahc_echo, NULL,
+    MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
+    MHD_OPTION_END);
   if (NULL == d)
     return 1;
   (void) getc (stdin);
diff --git a/src/examples/connection_close.c b/src/examples/connection_close.c
index 88222cbf..43ee379f 100644
--- a/src/examples/connection_close.c
+++ b/src/examples/connection_close.c
@@ -25,7 +25,8 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-#define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd 
demo</body></html>"
 
 static int
 ahc_echo (void *cls,
@@ -39,23 +40,23 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
   response = MHD_create_response_from_buffer (strlen (me),
-                                             (void *) me,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) me,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -65,27 +66,27 @@ ahc_echo (void *cls,
 
 static void
 request_completed (void *cls,
-                  struct MHD_Connection *connection,
-                  void **con_cls,
-                  enum MHD_RequestTerminationCode toe)
+                   struct MHD_Connection *connection,
+                   void **con_cls,
+                   enum MHD_RequestTerminationCode toe)
 {
   fprintf (stderr,
-          "%llu - RC: %d\n",
-          (unsigned long long) __rdtsc(),
-          toe);
+           "%llu - RC: %d\n",
+           (unsigned long long) __rdtsc (),
+           toe);
 }
 
 
 static void
 connection_completed (void *cls,
-                     struct MHD_Connection *connection,
-                     void **socket_context,
-                     enum MHD_ConnectionNotificationCode toe)
+                      struct MHD_Connection *connection,
+                      void **socket_context,
+                      enum MHD_ConnectionNotificationCode toe)
 {
   fprintf (stderr,
-          "%llu - CC: %d\n",
-          (unsigned long long) __rdtsc(),
-          toe);
+           "%llu - CC: %d\n",
+           (unsigned long long) __rdtsc (),
+           toe);
 }
 
 
@@ -95,22 +96,23 @@ main (int argc, char *const *argv)
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   d = MHD_start_daemon (/* MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG, */
                         /* MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG, */
                         /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 
| MHD_USE_POLL, */
-                       MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, // | 
MHD_USE_ITC, 
-                        /* MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */
-                        atoi (argv[1]),
-                        NULL, NULL, &ahc_echo, PAGE,
-                       MHD_OPTION_NOTIFY_COMPLETED, &request_completed, NULL,
-                       MHD_OPTION_NOTIFY_CONNECTION, &connection_completed, 
NULL,
-                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
-                        MHD_OPTION_STRICT_FOR_CLIENT, (int) 1,
-                        MHD_OPTION_END);
+    MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD
+    | MHD_USE_ERROR_LOG | MHD_USE_POLL,                                        
                           // | MHD_USE_ITC,
+    /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG, */
+    atoi (argv[1]),
+    NULL, NULL, &ahc_echo, PAGE,
+    MHD_OPTION_NOTIFY_COMPLETED, &request_completed, NULL,
+    MHD_OPTION_NOTIFY_CONNECTION, &connection_completed, NULL,
+    MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
+    MHD_OPTION_STRICT_FOR_CLIENT, (int) 1,
+    MHD_OPTION_END);
   if (d == NULL)
     return 1;
   (void) getc (stdin);
diff --git a/src/examples/demo.c b/src/examples/demo.c
index e93fb34b..375f2a63 100644
--- a/src/examples/demo.c
+++ b/src/examples/demo.c
@@ -41,10 +41,10 @@
 #include <limits.h>
 #include <ctype.h>
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -73,46 +73,50 @@
 /**
  * Page returned for file-not-found.
  */
-#define FILE_NOT_FOUND_PAGE "<html><head><title>File not 
found</title></head><body>File not found</body></html>"
+#define FILE_NOT_FOUND_PAGE \
+  "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
 
 /**
  * Page returned for internal errors.
  */
-#define INTERNAL_ERROR_PAGE "<html><head><title>Internal 
error</title></head><body>Internal error</body></html>"
+#define INTERNAL_ERROR_PAGE \
+  "<html><head><title>Internal error</title></head><body>Internal 
error</body></html>"
 
 
 /**
  * Page returned for refused requests.
  */
-#define REQUEST_REFUSED_PAGE "<html><head><title>Request 
refused</title></head><body>Request refused (file exists?)</body></html>"
+#define REQUEST_REFUSED_PAGE \
+  "<html><head><title>Request refused</title></head><body>Request refused 
(file exists?)</body></html>"
 
 
 /**
  * Head of index page.
  */
-#define INDEX_PAGE_HEADER 
"<html>\n<head><title>Welcome</title></head>\n<body>\n"\
-   "<h1>Upload</h1>\n"\
-   "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"/\">\n"\
-   "<dl><dt>Content type:</dt><dd>"\
-   "<input type=\"radio\" name=\"category\" value=\"books\">Book</input>"\
-   "<input type=\"radio\" name=\"category\" value=\"images\">Image</input>"\
-   "<input type=\"radio\" name=\"category\" value=\"music\">Music</input>"\
-   "<input type=\"radio\" name=\"category\" 
value=\"software\">Software</input>"\
-   "<input type=\"radio\" name=\"category\" value=\"videos\">Videos</input>\n"\
-   "<input type=\"radio\" name=\"category\" value=\"other\" 
checked>Other</input></dd>"\
-   "<dt>Language:</dt><dd>"\
-   "<input type=\"radio\" name=\"language\" value=\"no-lang\" 
checked>none</input>"\
-   "<input type=\"radio\" name=\"language\" value=\"en\">English</input>"\
-   "<input type=\"radio\" name=\"language\" value=\"de\">German</input>"\
-   "<input type=\"radio\" name=\"language\" value=\"fr\">French</input>"\
-   "<input type=\"radio\" name=\"language\" 
value=\"es\">Spanish</input></dd>\n"\
-   "<dt>File:</dt><dd>"\
-   "<input type=\"file\" name=\"upload\"/></dd></dl>"\
-   "<input type=\"submit\" value=\"Send!\"/>\n"\
-   "</form>\n"\
-   "<h1>Download</h1>\n"\
-   "<ol>\n"
+#define INDEX_PAGE_HEADER \
+  "<html>\n<head><title>Welcome</title></head>\n<body>\n" \
+  "<h1>Upload</h1>\n" \
+  "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"/\">\n" \
+  "<dl><dt>Content type:</dt><dd>" \
+  "<input type=\"radio\" name=\"category\" value=\"books\">Book</input>" \
+  "<input type=\"radio\" name=\"category\" value=\"images\">Image</input>" \
+  "<input type=\"radio\" name=\"category\" value=\"music\">Music</input>" \
+  "<input type=\"radio\" name=\"category\" 
value=\"software\">Software</input>" \
+  "<input type=\"radio\" name=\"category\" value=\"videos\">Videos</input>\n" \
+  "<input type=\"radio\" name=\"category\" value=\"other\" 
checked>Other</input></dd>" \
+  "<dt>Language:</dt><dd>" \
+  "<input type=\"radio\" name=\"language\" value=\"no-lang\" 
checked>none</input>" \
+  "<input type=\"radio\" name=\"language\" value=\"en\">English</input>" \
+  "<input type=\"radio\" name=\"language\" value=\"de\">German</input>" \
+  "<input type=\"radio\" name=\"language\" value=\"fr\">French</input>" \
+  "<input type=\"radio\" name=\"language\" 
value=\"es\">Spanish</input></dd>\n" \
+  "<dt>File:</dt><dd>" \
+  "<input type=\"file\" name=\"upload\"/></dd></dl>" \
+  "<input type=\"submit\" value=\"Send!\"/>\n" \
+  "</form>\n" \
+  "<h1>Download</h1>\n" \
+  "<ol>\n"
 
 /**
  * Footer of index page.
@@ -124,16 +128,15 @@
  * NULL-terminated array of supported upload categories.  Should match HTML
  * in the form.
  */
-static const char * const categories[] =
-  {
-    "books",
-    "images",
-    "music",
-    "software",
-    "videos",
-    "other",
-    NULL,
-  };
+static const char *const categories[] = {
+  "books",
+  "images",
+  "music",
+  "software",
+  "videos",
+  "other",
+  NULL,
+};
 
 
 /**
@@ -157,15 +160,14 @@ struct Language
  * NULL-terminated array of supported upload categories.  Should match HTML
  * in the form.
  */
-static const struct Language languages[] =
-  {
-    { "no-lang", "No language specified" },
-    { "en", "English" },
-    { "de", "German" },
-    { "fr", "French" },
-    { "es", "Spanish" },
-    { NULL, NULL },
-  };
+static const struct Language languages[] = {
+  { "no-lang", "No language specified" },
+  { "en", "English" },
+  { "de", "German" },
+  { "fr", "French" },
+  { "es", "Spanish" },
+  { NULL, NULL },
+};
 
 
 /**
@@ -210,8 +212,8 @@ static void
 mark_as_html (struct MHD_Response *response)
 {
   (void) MHD_add_response_header (response,
-                                 MHD_HTTP_HEADER_CONTENT_TYPE,
-                                 "text/html");
+                                  MHD_HTTP_HEADER_CONTENT_TYPE,
+                                  "text/html");
 }
 
 
@@ -264,7 +266,7 @@ struct ResponseDataContext
  */
 static int
 list_directory (struct ResponseDataContext *rdc,
-               const char *dirname)
+                const char *dirname)
 {
   char fullname[PATH_MAX];
   struct stat sbuf;
@@ -274,35 +276,35 @@ list_directory (struct ResponseDataContext *rdc,
   if (NULL == (dir = opendir (dirname)))
     return MHD_NO;
   while (NULL != (de = readdir (dir)))
+  {
+    if ('.' == de->d_name[0])
+      continue;
+    if (sizeof (fullname) <= (unsigned int)
+        snprintf (fullname, sizeof (fullname),
+                  "%s/%s",
+                  dirname, de->d_name))
+      continue; /* ugh, file too long? how can this be!? */
+    if (0 != stat (fullname, &sbuf))
+      continue; /* ugh, failed to 'stat' */
+    if (! S_ISREG (sbuf.st_mode))
+      continue; /* not a regular file, skip */
+    if (rdc->off + 1024 > rdc->buf_len)
     {
-      if ('.' == de->d_name[0])
-       continue;
-      if (sizeof (fullname) <= (unsigned int)
-         snprintf (fullname, sizeof (fullname),
-                   "%s/%s",
-                   dirname, de->d_name))
-       continue; /* ugh, file too long? how can this be!? */
-      if (0 != stat (fullname, &sbuf))
-       continue; /* ugh, failed to 'stat' */
-      if (! S_ISREG (sbuf.st_mode))
-       continue; /* not a regular file, skip */
-      if (rdc->off + 1024 > rdc->buf_len)
-       {
-         void *r;
-
-         if ( (2 * rdc->buf_len + 1024) < rdc->buf_len)
-           break; /* more than SIZE_T _index_ size? Too big for us */
-         rdc->buf_len = 2 * rdc->buf_len + 1024;
-         if (NULL == (r = realloc (rdc->buf, rdc->buf_len)))
-           break; /* out of memory */
-         rdc->buf = r;
-       }
-      rdc->off += snprintf (&rdc->buf[rdc->off],
-                           rdc->buf_len - rdc->off,
-                           "<li><a href=\"/%s\">%s</a></li>\n",
-                           fullname,
-                           de->d_name);
+      void *r;
+
+      if ( (2 * rdc->buf_len + 1024) < rdc->buf_len)
+        break; /* more than SIZE_T _index_ size? Too big for us */
+      rdc->buf_len = 2 * rdc->buf_len + 1024;
+      if (NULL == (r = realloc (rdc->buf, rdc->buf_len)))
+        break; /* out of memory */
+      rdc->buf = r;
     }
+    rdc->off += snprintf (&rdc->buf[rdc->off],
+                          rdc->buf_len - rdc->off,
+                          "<li><a href=\"/%s\">%s</a></li>\n",
+                          fullname,
+                          de->d_name);
+  }
   (void) closedir (dir);
   return MHD_YES;
 }
@@ -326,65 +328,66 @@ update_directory ()
 
   rdc.buf_len = initial_allocation;
   if (NULL == (rdc.buf = malloc (rdc.buf_len)))
-    {
-      update_cached_response (NULL);
-      return;
-    }
+  {
+    update_cached_response (NULL);
+    return;
+  }
   rdc.off = snprintf (rdc.buf, rdc.buf_len,
-                     "%s",
-                     INDEX_PAGE_HEADER);
-  for (language_idx = 0; NULL != languages[language_idx].dirname; 
language_idx++)
+                      "%s",
+                      INDEX_PAGE_HEADER);
+  for (language_idx = 0; NULL != languages[language_idx].dirname;
+       language_idx++)
+  {
+    language = &languages[language_idx];
+
+    if (0 != stat (language->dirname, &sbuf))
+      continue; /* empty */
+    /* we ensured always +1k room, filenames are ~256 bytes,
+ so there is always still enough space for the header
+ without need for an additional reallocation check. */
+    rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
+                         "<h2>%s</h2>\n",
+                         language->longname);
+    for (category_idx = 0; NULL != categories[category_idx]; category_idx++)
     {
-      language = &languages[language_idx];
+      category = categories[category_idx];
+      snprintf (dir_name, sizeof (dir_name),
+                "%s/%s",
+                language->dirname,
+                category);
+      if (0 != stat (dir_name, &sbuf))
+        continue; /* empty */
 
-      if (0 != stat (language->dirname, &sbuf))
-       continue; /* empty */
       /* we ensured always +1k room, filenames are ~256 bytes,
-        so there is always still enough space for the header
-        without need for an additional reallocation check. */
+         so there is always still enough space for the header
+         without need for an additional reallocation check. */
       rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
-                          "<h2>%s</h2>\n",
-                          language->longname);
-      for (category_idx = 0; NULL != categories[category_idx]; category_idx++)
-       {
-         category = categories[category_idx];
-         snprintf (dir_name, sizeof (dir_name),
-                   "%s/%s",
-                   language->dirname,
-                   category);
-         if (0 != stat (dir_name, &sbuf))
-           continue; /* empty */
-
-         /* we ensured always +1k room, filenames are ~256 bytes,
-            so there is always still enough space for the header
-            without need for an additional reallocation check. */
-         rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
-                              "<h3>%s</h3>\n",
-                              category);
-
-         if (MHD_NO == list_directory (&rdc, dir_name))
-           {
-             free (rdc.buf);
-             update_cached_response (NULL);
-             return;
-           }
-       }
+                           "<h3>%s</h3>\n",
+                           category);
+
+      if (MHD_NO == list_directory (&rdc, dir_name))
+      {
+        free (rdc.buf);
+        update_cached_response (NULL);
+        return;
+      }
     }
+  }
   /* we ensured always +1k room, filenames are ~256 bytes,
      so there is always still enough space for the footer
      without need for a final reallocation check. */
   rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
-                      "%s",
-                      INDEX_PAGE_FOOTER);
+                       "%s",
+                       INDEX_PAGE_FOOTER);
   initial_allocation = rdc.buf_len; /* remember for next time */
   response = MHD_create_response_from_buffer (rdc.off,
-                                             rdc.buf,
-                                             MHD_RESPMEM_MUST_FREE);
+                                              rdc.buf,
+                                              MHD_RESPMEM_MUST_FREE);
   mark_as_html (response);
 #if FORCE_CLOSE
   (void) MHD_add_response_header (response,
-                                 MHD_HTTP_HEADER_CONNECTION,
-                                 "close");
+                                  MHD_HTTP_HEADER_CONNECTION,
+                                  "close");
 #endif
   update_cached_response (response);
 }
@@ -443,8 +446,8 @@ struct UploadContext
  */
 static int
 do_append (char **ret,
-          const char *data,
-          size_t size)
+           const char *data,
+           size_t size)
 {
   char *buf;
   size_t old_len;
@@ -456,15 +459,15 @@ do_append (char **ret,
   if (NULL == (buf = malloc (old_len + size + 1)))
     return MHD_NO;
   if (NULL != *ret)
-    {
-      memcpy (buf,
-             *ret,
-             old_len);
-      free (*ret);
-    }
+  {
+    memcpy (buf,
+            *ret,
+            old_len);
+    free (*ret);
+  }
   memcpy (&buf[old_len],
-         data,
-         size);
+          data,
+          size);
   buf[old_len + size] = '\0';
   *ret = buf;
   return MHD_YES;
@@ -492,119 +495,119 @@ do_append (char **ret,
  */
 static int
 process_upload_data (void *cls,
-                    enum MHD_ValueKind kind,
-                    const char *key,
-                    const char *filename,
-                    const char *content_type,
-                    const char *transfer_encoding,
-                    const char *data,
-                    uint64_t off,
-                    size_t size)
+                     enum MHD_ValueKind kind,
+                     const char *key,
+                     const char *filename,
+                     const char *content_type,
+                     const char *transfer_encoding,
+                     const char *data,
+                     uint64_t off,
+                     size_t size)
 {
   struct UploadContext *uc = cls;
   int i;
-  (void)kind;              /* Unused. Silent compiler warning. */
-  (void)content_type;      /* Unused. Silent compiler warning. */
-  (void)transfer_encoding; /* Unused. Silent compiler warning. */
-  (void)off;               /* Unused. Silent compiler warning. */
+  (void) kind;              /* Unused. Silent compiler warning. */
+  (void) content_type;      /* Unused. Silent compiler warning. */
+  (void) transfer_encoding; /* Unused. Silent compiler warning. */
+  (void) off;               /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "category"))
     return do_append (&uc->category, data, size);
   if (0 == strcmp (key, "language"))
     return do_append (&uc->language, data, size);
   if (0 != strcmp (key, "upload"))
-    {
-      fprintf (stderr,
-              "Ignoring unexpected form value `%s'\n",
-              key);
-      return MHD_YES; /* ignore */
-    }
+  {
+    fprintf (stderr,
+             "Ignoring unexpected form value `%s'\n",
+             key);
+    return MHD_YES;   /* ignore */
+  }
   if (NULL == filename)
-    {
-      fprintf (stderr, "No filename, aborting upload\n");
-      return MHD_NO; /* no filename, error */
-    }
+  {
+    fprintf (stderr, "No filename, aborting upload\n");
+    return MHD_NO;   /* no filename, error */
+  }
   if ( (NULL == uc->category) ||
        (NULL == uc->language) )
+  {
+    fprintf (stderr,
+             "Missing form data for upload `%s'\n",
+             filename);
+    uc->response = request_refused_response;
+    return MHD_NO;
+  }
+  if (-1 == uc->fd)
+  {
+    char fn[PATH_MAX];
+
+    if ( (NULL != strstr (filename, "..")) ||
+         (NULL != strchr (filename, '/')) ||
+         (NULL != strchr (filename, '\\')) )
     {
-      fprintf (stderr,
-              "Missing form data for upload `%s'\n",
-              filename);
       uc->response = request_refused_response;
       return MHD_NO;
     }
-  if (-1 == uc->fd)
-    {
-      char fn[PATH_MAX];
-
-      if ( (NULL != strstr (filename, "..")) ||
-          (NULL != strchr (filename, '/')) ||
-          (NULL != strchr (filename, '\\')) )
-       {
-         uc->response = request_refused_response;
-         return MHD_NO;
-       }
-      /* create directories -- if they don't exist already */
+    /* create directories -- if they don't exist already */
 #ifdef WINDOWS
-      (void) mkdir (uc->language);
+    (void) mkdir (uc->language);
 #else
-      (void) mkdir (uc->language, S_IRWXU);
+    (void) mkdir (uc->language, S_IRWXU);
 #endif
-      snprintf (fn, sizeof (fn),
-               "%s/%s",
-               uc->language,
-               uc->category);
+    snprintf (fn, sizeof (fn),
+              "%s/%s",
+              uc->language,
+              uc->category);
 #ifdef WINDOWS
-      (void) mkdir (fn);
+    (void) mkdir (fn);
 #else
-      (void) mkdir (fn, S_IRWXU);
+    (void) mkdir (fn, S_IRWXU);
 #endif
-      /* open file */
-      snprintf (fn, sizeof (fn),
-               "%s/%s/%s",
-               uc->language,
-               uc->category,
-               filename);
-      for (i=strlen (fn)-1;i>=0;i--)
-       if (! isprint ((unsigned char) fn[i]))
-         fn[i] = '_';
-      uc->fd = open (fn,
-                    O_CREAT | O_EXCL
+    /* open file */
+    snprintf (fn, sizeof (fn),
+              "%s/%s/%s",
+              uc->language,
+              uc->category,
+              filename);
+    for (i = strlen (fn) - 1; i>=0; i--)
+      if (! isprint ((unsigned char) fn[i]))
+        fn[i] = '_';
+    uc->fd = open (fn,
+                   O_CREAT | O_EXCL
 #if O_LARGEFILE
-                    | O_LARGEFILE
+                   | O_LARGEFILE
 #endif
-                    | O_WRONLY,
-                    S_IRUSR | S_IWUSR);
-      if (-1 == uc->fd)
-       {
-         fprintf (stderr,
-                  "Error opening file `%s' for upload: %s\n",
-                  fn,
-                  strerror (errno));
-         uc->response = request_refused_response;
-         return MHD_NO;
-       }
-      uc->filename = strdup (fn);
+                   | O_WRONLY,
+                   S_IRUSR | S_IWUSR);
+    if (-1 == uc->fd)
+    {
+      fprintf (stderr,
+               "Error opening file `%s' for upload: %s\n",
+               fn,
+               strerror (errno));
+      uc->response = request_refused_response;
+      return MHD_NO;
     }
+    uc->filename = strdup (fn);
+  }
   if ( (0 != size) &&
        (size != (size_t) write (uc->fd, data, size)) )
+  {
+    /* write failed; likely: disk full */
+    fprintf (stderr,
+             "Error writing to file `%s': %s\n",
+             uc->filename,
+             strerror (errno));
+    uc->response = internal_error_response;
+    (void) close (uc->fd);
+    uc->fd = -1;
+    if (NULL != uc->filename)
     {
-      /* write failed; likely: disk full */
-      fprintf (stderr,
-              "Error writing to file `%s': %s\n",
-              uc->filename,
-              strerror (errno));
-      uc->response = internal_error_response;
-      (void) close (uc->fd);
-      uc->fd = -1;
-      if (NULL != uc->filename)
-       {
-         unlink (uc->filename);
-         free (uc->filename);
-         uc->filename = NULL;
-       }
-      return MHD_NO;
+      unlink (uc->filename);
+      free (uc->filename);
+      uc->filename = NULL;
     }
+    return MHD_NO;
+  }
   return MHD_YES;
 }
 
@@ -622,32 +625,32 @@ process_upload_data (void *cls,
  */
 static void
 response_completed_callback (void *cls,
-                            struct MHD_Connection *connection,
-                            void **con_cls,
-                            enum MHD_RequestTerminationCode toe)
+                             struct MHD_Connection *connection,
+                             void **con_cls,
+                             enum MHD_RequestTerminationCode toe)
 {
   struct UploadContext *uc = *con_cls;
-  (void)cls;         /* Unused. Silent compiler warning. */
-  (void)connection;  /* Unused. Silent compiler warning. */
-  (void)toe;         /* Unused. Silent compiler warning. */
+  (void) cls;         /* Unused. Silent compiler warning. */
+  (void) connection;  /* Unused. Silent compiler warning. */
+  (void) toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == uc)
     return; /* this request wasn't an upload request */
   if (NULL != uc->pp)
-    {
-      MHD_destroy_post_processor (uc->pp);
-      uc->pp = NULL;
-    }
+  {
+    MHD_destroy_post_processor (uc->pp);
+    uc->pp = NULL;
+  }
   if (-1 != uc->fd)
   {
     (void) close (uc->fd);
     if (NULL != uc->filename)
-      {
-       fprintf (stderr,
-                "Upload of file `%s' failed (incomplete or aborted), removing 
file.\n",
-                uc->filename);
-       (void) unlink (uc->filename);
-      }
+    {
+      fprintf (stderr,
+               "Upload of file `%s' failed (incomplete or aborted), removing 
file.\n",
+               uc->filename);
+      (void) unlink (uc->filename);
+    }
   }
   if (NULL != uc->filename)
     free (uc->filename);
@@ -669,12 +672,12 @@ return_directory_response (struct MHD_Connection 
*connection)
   (void) pthread_mutex_lock (&mutex);
   if (NULL == cached_directory_response)
     ret = MHD_queue_response (connection,
-                             MHD_HTTP_INTERNAL_SERVER_ERROR,
-                             internal_error_response);
+                              MHD_HTTP_INTERNAL_SERVER_ERROR,
+                              internal_error_response);
   else
     ret = MHD_queue_response (connection,
-                             MHD_HTTP_OK,
-                             cached_directory_response);
+                              MHD_HTTP_OK,
+                              cached_directory_response);
   (void) pthread_mutex_unlock (&mutex);
   return ret;
 }
@@ -695,12 +698,12 @@ return_directory_response (struct MHD_Connection 
*connection)
  */
 static int
 generate_page (void *cls,
-              struct MHD_Connection *connection,
-              const char *url,
-              const char *method,
-              const char *version,
-              const char *upload_data,
-              size_t *upload_data_size, void **ptr)
+               struct MHD_Connection *connection,
+               const char *url,
+               const char *method,
+               const char *version,
+               const char *upload_data,
+               size_t *upload_data_size, void **ptr)
 {
   struct MHD_Response *response;
   int ret;
@@ -710,117 +713,117 @@ generate_page (void *cls,
   (void) version;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (url, "/"))
-    {
-      /* should be file download */
+  {
+    /* should be file download */
 #ifdef MHD_HAVE_LIBMAGIC
-      char file_data[MAGIC_HEADER_SIZE];
-      ssize_t got;
+    char file_data[MAGIC_HEADER_SIZE];
+    ssize_t got;
 #endif /* MHD_HAVE_LIBMAGIC */
-      const char *mime;
-
-      if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) &&
-           (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) )
-        return MHD_NO;  /* unexpected method (we're not polite...) */
-      fd = -1;
-      if ( (NULL == strstr (&url[1], "..")) &&
-          ('/' != url[1]) )
-        {
-          fd = open (&url[1], O_RDONLY);
-          if ( (-1 != fd) &&
-               ( (0 != fstat (fd, &buf)) ||
-                 (! S_ISREG (buf.st_mode)) ) )
-            {
-              (void) close (fd);
-              fd = -1;
-            }
-        }
-      if (-1 == fd)
-       return MHD_queue_response (connection,
-                                  MHD_HTTP_NOT_FOUND,
-                                  file_not_found_response);
+    const char *mime;
+
+    if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) &&
+         (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) )
+      return MHD_NO;    /* unexpected method (we're not polite...) */
+    fd = -1;
+    if ( (NULL == strstr (&url[1], "..")) &&
+         ('/' != url[1]) )
+    {
+      fd = open (&url[1], O_RDONLY);
+      if ( (-1 != fd) &&
+           ( (0 != fstat (fd, &buf)) ||
+             (! S_ISREG (buf.st_mode)) ) )
+      {
+        (void) close (fd);
+        fd = -1;
+      }
+    }
+    if (-1 == fd)
+      return MHD_queue_response (connection,
+                                 MHD_HTTP_NOT_FOUND,
+                                 file_not_found_response);
 #ifdef MHD_HAVE_LIBMAGIC
-      /* read beginning of the file to determine mime type  */
-      got = read (fd, file_data, sizeof (file_data));
-      (void) lseek (fd, 0, SEEK_SET);
-      if (-1 != got)
-       mime = magic_buffer (magic, file_data, got);
-      else
+    /* read beginning of the file to determine mime type  */
+    got = read (fd, file_data, sizeof (file_data));
+    (void) lseek (fd, 0, SEEK_SET);
+    if (-1 != got)
+      mime = magic_buffer (magic, file_data, got);
+    else
 #endif /* MHD_HAVE_LIBMAGIC */
-       mime = NULL;
-
-      if (NULL == (response = MHD_create_response_from_fd (buf.st_size,
-                                                          fd)))
-       {
-         /* internal error (i.e. out of memory) */
-         (void) close (fd);
-         return MHD_NO;
-       }
-
-      /* add mime type if we had one */
-      if (NULL != mime)
-       (void) MHD_add_response_header (response,
-                                       MHD_HTTP_HEADER_CONTENT_TYPE,
-                                       mime);
-      ret = MHD_queue_response (connection,
-                               MHD_HTTP_OK,
-                               response);
-      MHD_destroy_response (response);
-      return ret;
+    mime = NULL;
+
+    if (NULL == (response = MHD_create_response_from_fd (buf.st_size,
+                                                         fd)))
+    {
+      /* internal error (i.e. out of memory) */
+      (void) close (fd);
+      return MHD_NO;
     }
 
+    /* add mime type if we had one */
+    if (NULL != mime)
+      (void) MHD_add_response_header (response,
+                                      MHD_HTTP_HEADER_CONTENT_TYPE,
+                                      mime);
+    ret = MHD_queue_response (connection,
+                              MHD_HTTP_OK,
+                              response);
+    MHD_destroy_response (response);
+    return ret;
+  }
+
   if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
+  {
+    /* upload! */
+    struct UploadContext *uc = *ptr;
+
+    if (NULL == uc)
+    {
+      if (NULL == (uc = malloc (sizeof (struct UploadContext))))
+        return MHD_NO; /* out of memory, close connection */
+      memset (uc, 0, sizeof (struct UploadContext));
+      uc->fd = -1;
+      uc->connection = connection;
+      uc->pp = MHD_create_post_processor (connection,
+                                          64 * 1024 /* buffer size */,
+                                          &process_upload_data, uc);
+      if (NULL == uc->pp)
+      {
+        /* out of memory, close connection */
+        free (uc);
+        return MHD_NO;
+      }
+      *ptr = uc;
+      return MHD_YES;
+    }
+    if (0 != *upload_data_size)
+    {
+      if (NULL == uc->response)
+        (void) MHD_post_process (uc->pp,
+                                 upload_data,
+                                 *upload_data_size);
+      *upload_data_size = 0;
+      return MHD_YES;
+    }
+    /* end of upload, finish it! */
+    MHD_destroy_post_processor (uc->pp);
+    uc->pp = NULL;
+    if (-1 != uc->fd)
+    {
+      close (uc->fd);
+      uc->fd = -1;
+    }
+    if (NULL != uc->response)
+    {
+      return MHD_queue_response (connection,
+                                 MHD_HTTP_FORBIDDEN,
+                                 uc->response);
+    }
+    else
     {
-      /* upload! */
-      struct UploadContext *uc = *ptr;
-
-      if (NULL == uc)
-       {
-         if (NULL == (uc = malloc (sizeof (struct UploadContext))))
-           return MHD_NO; /* out of memory, close connection */
-         memset (uc, 0, sizeof (struct UploadContext));
-          uc->fd = -1;
-         uc->connection = connection;
-         uc->pp = MHD_create_post_processor (connection,
-                                             64 * 1024 /* buffer size */,
-                                             &process_upload_data, uc);
-         if (NULL == uc->pp)
-           {
-             /* out of memory, close connection */
-             free (uc);
-             return MHD_NO;
-           }
-         *ptr = uc;
-         return MHD_YES;
-       }
-      if (0 != *upload_data_size)
-       {
-         if (NULL == uc->response)
-           (void) MHD_post_process (uc->pp,
-                                    upload_data,
-                                    *upload_data_size);
-         *upload_data_size = 0;
-         return MHD_YES;
-       }
-      /* end of upload, finish it! */
-      MHD_destroy_post_processor (uc->pp);
-      uc->pp = NULL;
-      if (-1 != uc->fd)
-       {
-         close (uc->fd);
-         uc->fd = -1;
-       }
-      if (NULL != uc->response)
-       {
-         return MHD_queue_response (connection,
-                                    MHD_HTTP_FORBIDDEN,
-                                    uc->response);
-       }
-      else
-       {
-         update_directory ();
-         return return_directory_response (connection);
-       }
+      update_directory ();
+      return return_directory_response (connection);
     }
+  }
   if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) ||
        (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) )
   {
@@ -829,8 +832,8 @@ generate_page (void *cls,
 
   /* unexpected request, refuse */
   return MHD_queue_response (connection,
-                            MHD_HTTP_FORBIDDEN,
-                            request_refused_response);
+                             MHD_HTTP_FORBIDDEN,
+                             request_refused_response);
 }
 
 
@@ -843,7 +846,7 @@ generate_page (void *cls,
 static void
 catcher (int sig)
 {
-  (void)sig;   /* Unused. Silent compiler warning. */
+  (void) sig;  /* Unused. Silent compiler warning. */
   /* do nothing */
 }
 
@@ -889,11 +892,11 @@ main (int argc, char *const *argv)
   if ( (argc != 2) ||
        (1 != sscanf (argv[1], "%u", &port)) ||
        (UINT16_MAX < port) )
-    {
-      fprintf (stderr,
-              "%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    fprintf (stderr,
+             "%s PORT\n", argv[0]);
+    return 1;
+  }
 #ifndef MINGW
   ignore_sigpipe ();
 #endif
@@ -903,31 +906,42 @@ main (int argc, char *const *argv)
 #endif /* MHD_HAVE_LIBMAGIC */
 
   (void) pthread_mutex_init (&mutex, NULL);
-  file_not_found_response = MHD_create_response_from_buffer (strlen 
(FILE_NOT_FOUND_PAGE),
-                                                            (void *) 
FILE_NOT_FOUND_PAGE,
-                                                            
MHD_RESPMEM_PERSISTENT);
+  file_not_found_response = MHD_create_response_from_buffer (strlen (
+                                                               
FILE_NOT_FOUND_PAGE),
+                                                             (void *)
+                                                             
FILE_NOT_FOUND_PAGE,
+                                                             
MHD_RESPMEM_PERSISTENT);
   mark_as_html (file_not_found_response);
-  request_refused_response = MHD_create_response_from_buffer (strlen 
(REQUEST_REFUSED_PAGE),
-                                                            (void *) 
REQUEST_REFUSED_PAGE,
-                                                            
MHD_RESPMEM_PERSISTENT);
+  request_refused_response = MHD_create_response_from_buffer (strlen (
+                                                                
REQUEST_REFUSED_PAGE),
+                                                              (void *)
+                                                              
REQUEST_REFUSED_PAGE,
+                                                              
MHD_RESPMEM_PERSISTENT);
   mark_as_html (request_refused_response);
-  internal_error_response = MHD_create_response_from_buffer (strlen 
(INTERNAL_ERROR_PAGE),
-                                                            (void *) 
INTERNAL_ERROR_PAGE,
-                                                            
MHD_RESPMEM_PERSISTENT);
+  internal_error_response = MHD_create_response_from_buffer (strlen (
+                                                               
INTERNAL_ERROR_PAGE),
+                                                             (void *)
+                                                             
INTERNAL_ERROR_PAGE,
+                                                             
MHD_RESPMEM_PERSISTENT);
   mark_as_html (internal_error_response);
   update_directory ();
-  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD
+                        | MHD_USE_ERROR_LOG,
                         port,
                         NULL, NULL,
-                       &generate_page, NULL,
-                       MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (256 * 
1024),
+                        &generate_page, NULL,
+                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (256
+                                                                      * 1024),
 #if PRODUCTION
-                       MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) (64),
+                        MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 
(64),
 #endif
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) (120 /* 
seconds */),
-                       MHD_OPTION_THREAD_POOL_SIZE, (unsigned int) 
NUMBER_OF_THREADS,
-                       MHD_OPTION_NOTIFY_COMPLETED, 
&response_completed_callback, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned
+                                                        int) (120 /* seconds 
*/),
+                        MHD_OPTION_THREAD_POOL_SIZE, (unsigned
+                                                      int) NUMBER_OF_THREADS,
+                        MHD_OPTION_NOTIFY_COMPLETED,
+                        &response_completed_callback, NULL,
+                        MHD_OPTION_END);
   if (NULL == d)
     return 1;
   fprintf (stderr, "HTTP server running. Press ENTER to stop the server\n");
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c
index f2230b16..7f7eb3a5 100644
--- a/src/examples/demo_https.c
+++ b/src/examples/demo_https.c
@@ -44,10 +44,10 @@
 #include <limits.h>
 #include <ctype.h>
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -76,46 +76,50 @@
 /**
  * Page returned for file-not-found.
  */
-#define FILE_NOT_FOUND_PAGE "<html><head><title>File not 
found</title></head><body>File not found</body></html>"
+#define FILE_NOT_FOUND_PAGE \
+  "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
 
 /**
  * Page returned for internal errors.
  */
-#define INTERNAL_ERROR_PAGE "<html><head><title>Internal 
error</title></head><body>Internal error</body></html>"
+#define INTERNAL_ERROR_PAGE \
+  "<html><head><title>Internal error</title></head><body>Internal 
error</body></html>"
 
 
 /**
  * Page returned for refused requests.
  */
-#define REQUEST_REFUSED_PAGE "<html><head><title>Request 
refused</title></head><body>Request refused (file exists?)</body></html>"
+#define REQUEST_REFUSED_PAGE \
+  "<html><head><title>Request refused</title></head><body>Request refused 
(file exists?)</body></html>"
 
 
 /**
  * Head of index page.
  */
-#define INDEX_PAGE_HEADER 
"<html>\n<head><title>Welcome</title></head>\n<body>\n"\
-   "<h1>Upload</h1>\n"\
-   "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"/\">\n"\
-   "<dl><dt>Content type:</dt><dd>"\
-   "<input type=\"radio\" name=\"category\" value=\"books\">Book</input>"\
-   "<input type=\"radio\" name=\"category\" value=\"images\">Image</input>"\
-   "<input type=\"radio\" name=\"category\" value=\"music\">Music</input>"\
-   "<input type=\"radio\" name=\"category\" 
value=\"software\">Software</input>"\
-   "<input type=\"radio\" name=\"category\" value=\"videos\">Videos</input>\n"\
-   "<input type=\"radio\" name=\"category\" value=\"other\" 
checked>Other</input></dd>"\
-   "<dt>Language:</dt><dd>"\
-   "<input type=\"radio\" name=\"language\" value=\"no-lang\" 
checked>none</input>"\
-   "<input type=\"radio\" name=\"language\" value=\"en\">English</input>"\
-   "<input type=\"radio\" name=\"language\" value=\"de\">German</input>"\
-   "<input type=\"radio\" name=\"language\" value=\"fr\">French</input>"\
-   "<input type=\"radio\" name=\"language\" 
value=\"es\">Spanish</input></dd>\n"\
-   "<dt>File:</dt><dd>"\
-   "<input type=\"file\" name=\"upload\"/></dd></dl>"\
-   "<input type=\"submit\" value=\"Send!\"/>\n"\
-   "</form>\n"\
-   "<h1>Download</h1>\n"\
-   "<ol>\n"
+#define INDEX_PAGE_HEADER \
+  "<html>\n<head><title>Welcome</title></head>\n<body>\n" \
+  "<h1>Upload</h1>\n" \
+  "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"/\">\n" \
+  "<dl><dt>Content type:</dt><dd>" \
+  "<input type=\"radio\" name=\"category\" value=\"books\">Book</input>" \
+  "<input type=\"radio\" name=\"category\" value=\"images\">Image</input>" \
+  "<input type=\"radio\" name=\"category\" value=\"music\">Music</input>" \
+  "<input type=\"radio\" name=\"category\" 
value=\"software\">Software</input>" \
+  "<input type=\"radio\" name=\"category\" value=\"videos\">Videos</input>\n" \
+  "<input type=\"radio\" name=\"category\" value=\"other\" 
checked>Other</input></dd>" \
+  "<dt>Language:</dt><dd>" \
+  "<input type=\"radio\" name=\"language\" value=\"no-lang\" 
checked>none</input>" \
+  "<input type=\"radio\" name=\"language\" value=\"en\">English</input>" \
+  "<input type=\"radio\" name=\"language\" value=\"de\">German</input>" \
+  "<input type=\"radio\" name=\"language\" value=\"fr\">French</input>" \
+  "<input type=\"radio\" name=\"language\" 
value=\"es\">Spanish</input></dd>\n" \
+  "<dt>File:</dt><dd>" \
+  "<input type=\"file\" name=\"upload\"/></dd></dl>" \
+  "<input type=\"submit\" value=\"Send!\"/>\n" \
+  "</form>\n" \
+  "<h1>Download</h1>\n" \
+  "<ol>\n"
 
 /**
  * Footer of index page.
@@ -127,16 +131,15 @@
  * NULL-terminated array of supported upload categories.  Should match HTML
  * in the form.
  */
-static const char * const categories[] =
-  {
-    "books",
-    "images",
-    "music",
-    "software",
-    "videos",
-    "other",
-    NULL,
-  };
+static const char *const categories[] = {
+  "books",
+  "images",
+  "music",
+  "software",
+  "videos",
+  "other",
+  NULL,
+};
 
 
 /**
@@ -160,15 +163,14 @@ struct Language
  * NULL-terminated array of supported upload categories.  Should match HTML
  * in the form.
  */
-static const struct Language languages[] =
-  {
-    { "no-lang", "No language specified" },
-    { "en", "English" },
-    { "de", "German" },
-    { "fr", "French" },
-    { "es", "Spanish" },
-    { NULL, NULL },
-  };
+static const struct Language languages[] = {
+  { "no-lang", "No language specified" },
+  { "en", "English" },
+  { "de", "German" },
+  { "fr", "French" },
+  { "es", "Spanish" },
+  { NULL, NULL },
+};
 
 
 /**
@@ -213,8 +215,8 @@ static void
 mark_as_html (struct MHD_Response *response)
 {
   (void) MHD_add_response_header (response,
-                                 MHD_HTTP_HEADER_CONTENT_TYPE,
-                                 "text/html");
+                                  MHD_HTTP_HEADER_CONTENT_TYPE,
+                                  "text/html");
 }
 
 
@@ -267,7 +269,7 @@ struct ResponseDataContext
  */
 static int
 list_directory (struct ResponseDataContext *rdc,
-               const char *dirname)
+                const char *dirname)
 {
   char fullname[PATH_MAX];
   struct stat sbuf;
@@ -277,35 +279,35 @@ list_directory (struct ResponseDataContext *rdc,
   if (NULL == (dir = opendir (dirname)))
     return MHD_NO;
   while (NULL != (de = readdir (dir)))
+  {
+    if ('.' == de->d_name[0])
+      continue;
+    if (sizeof (fullname) <= (size_t)
+        snprintf (fullname, sizeof (fullname),
+                  "%s/%s",
+                  dirname, de->d_name))
+      continue; /* ugh, file too long? how can this be!? */
+    if (0 != stat (fullname, &sbuf))
+      continue; /* ugh, failed to 'stat' */
+    if (! S_ISREG (sbuf.st_mode))
+      continue; /* not a regular file, skip */
+    if (rdc->off + 1024 > rdc->buf_len)
     {
-      if ('.' == de->d_name[0])
-       continue;
-      if (sizeof (fullname) <= (size_t)
-         snprintf (fullname, sizeof (fullname),
-                   "%s/%s",
-                   dirname, de->d_name))
-       continue; /* ugh, file too long? how can this be!? */
-      if (0 != stat (fullname, &sbuf))
-       continue; /* ugh, failed to 'stat' */
-      if (! S_ISREG (sbuf.st_mode))
-       continue; /* not a regular file, skip */
-      if (rdc->off + 1024 > rdc->buf_len)
-       {
-         void *r;
-
-         if ( (2 * rdc->buf_len + 1024) < rdc->buf_len)
-           break; /* more than SIZE_T _index_ size? Too big for us */
-         rdc->buf_len = 2 * rdc->buf_len + 1024;
-         if (NULL == (r = realloc (rdc->buf, rdc->buf_len)))
-           break; /* out of memory */
-         rdc->buf = r;
-       }
-      rdc->off += snprintf (&rdc->buf[rdc->off],
-                           rdc->buf_len - rdc->off,
-                           "<li><a href=\"/%s\">%s</a></li>\n",
-                           fullname,
-                           de->d_name);
+      void *r;
+
+      if ( (2 * rdc->buf_len + 1024) < rdc->buf_len)
+        break; /* more than SIZE_T _index_ size? Too big for us */
+      rdc->buf_len = 2 * rdc->buf_len + 1024;
+      if (NULL == (r = realloc (rdc->buf, rdc->buf_len)))
+        break; /* out of memory */
+      rdc->buf = r;
     }
+    rdc->off += snprintf (&rdc->buf[rdc->off],
+                          rdc->buf_len - rdc->off,
+                          "<li><a href=\"/%s\">%s</a></li>\n",
+                          fullname,
+                          de->d_name);
+  }
   (void) closedir (dir);
   return MHD_YES;
 }
@@ -329,65 +331,66 @@ update_directory ()
 
   rdc.buf_len = initial_allocation;
   if (NULL == (rdc.buf = malloc (rdc.buf_len)))
-    {
-      update_cached_response (NULL);
-      return;
-    }
+  {
+    update_cached_response (NULL);
+    return;
+  }
   rdc.off = snprintf (rdc.buf, rdc.buf_len,
-                     "%s",
-                     INDEX_PAGE_HEADER);
-  for (language_idx = 0; NULL != languages[language_idx].dirname; 
language_idx++)
+                      "%s",
+                      INDEX_PAGE_HEADER);
+  for (language_idx = 0; NULL != languages[language_idx].dirname;
+       language_idx++)
+  {
+    language = &languages[language_idx];
+
+    if (0 != stat (language->dirname, &sbuf))
+      continue; /* empty */
+    /* we ensured always +1k room, filenames are ~256 bytes,
+ so there is always still enough space for the header
+ without need for an additional reallocation check. */
+    rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
+                         "<h2>%s</h2>\n",
+                         language->longname);
+    for (category_idx = 0; NULL != categories[category_idx]; category_idx++)
     {
-      language = &languages[language_idx];
+      category = categories[category_idx];
+      snprintf (dir_name, sizeof (dir_name),
+                "%s/%s",
+                language->dirname,
+                category);
+      if (0 != stat (dir_name, &sbuf))
+        continue; /* empty */
 
-      if (0 != stat (language->dirname, &sbuf))
-       continue; /* empty */
       /* we ensured always +1k room, filenames are ~256 bytes,
-        so there is always still enough space for the header
-        without need for an additional reallocation check. */
+         so there is always still enough space for the header
+         without need for an additional reallocation check. */
       rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
-                          "<h2>%s</h2>\n",
-                          language->longname);
-      for (category_idx = 0; NULL != categories[category_idx]; category_idx++)
-       {
-         category = categories[category_idx];
-         snprintf (dir_name, sizeof (dir_name),
-                   "%s/%s",
-                   language->dirname,
-                   category);
-         if (0 != stat (dir_name, &sbuf))
-           continue; /* empty */
-
-         /* we ensured always +1k room, filenames are ~256 bytes,
-            so there is always still enough space for the header
-            without need for an additional reallocation check. */
-         rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
-                              "<h3>%s</h3>\n",
-                              category);
-
-         if (MHD_NO == list_directory (&rdc, dir_name))
-           {
-             free (rdc.buf);
-             update_cached_response (NULL);
-             return;
-           }
-       }
+                           "<h3>%s</h3>\n",
+                           category);
+
+      if (MHD_NO == list_directory (&rdc, dir_name))
+      {
+        free (rdc.buf);
+        update_cached_response (NULL);
+        return;
+      }
     }
+  }
   /* we ensured always +1k room, filenames are ~256 bytes,
      so there is always still enough space for the footer
      without need for a final reallocation check. */
   rdc.off += snprintf (&rdc.buf[rdc.off], rdc.buf_len - rdc.off,
-                      "%s",
-                      INDEX_PAGE_FOOTER);
+                       "%s",
+                       INDEX_PAGE_FOOTER);
   initial_allocation = rdc.buf_len; /* remember for next time */
   response = MHD_create_response_from_buffer (rdc.off,
-                                             rdc.buf,
-                                             MHD_RESPMEM_MUST_FREE);
+                                              rdc.buf,
+                                              MHD_RESPMEM_MUST_FREE);
   mark_as_html (response);
 #if FORCE_CLOSE
   (void) MHD_add_response_header (response,
-                                 MHD_HTTP_HEADER_CONNECTION,
-                                 "close");
+                                  MHD_HTTP_HEADER_CONNECTION,
+                                  "close");
 #endif
   update_cached_response (response);
 }
@@ -446,8 +449,8 @@ struct UploadContext
  */
 static int
 do_append (char **ret,
-          const char *data,
-          size_t size)
+           const char *data,
+           size_t size)
 {
   char *buf;
   size_t old_len;
@@ -459,15 +462,15 @@ do_append (char **ret,
   if (NULL == (buf = malloc (old_len + size + 1)))
     return MHD_NO;
   if (NULL != *ret)
-    {
-      memcpy (buf,
-             *ret,
-             old_len);
-      free (*ret);
-    }
+  {
+    memcpy (buf,
+            *ret,
+            old_len);
+    free (*ret);
+  }
   memcpy (&buf[old_len],
-         data,
-         size);
+          data,
+          size);
   buf[old_len + size] = '\0';
   *ret = buf;
   return MHD_YES;
@@ -495,119 +498,119 @@ do_append (char **ret,
  */
 static int
 process_upload_data (void *cls,
-                    enum MHD_ValueKind kind,
-                    const char *key,
-                    const char *filename,
-                    const char *content_type,
-                    const char *transfer_encoding,
-                    const char *data,
-                    uint64_t off,
-                    size_t size)
+                     enum MHD_ValueKind kind,
+                     const char *key,
+                     const char *filename,
+                     const char *content_type,
+                     const char *transfer_encoding,
+                     const char *data,
+                     uint64_t off,
+                     size_t size)
 {
   struct UploadContext *uc = cls;
   int i;
-  (void)kind;              /* Unused. Silent compiler warning. */
-  (void)content_type;      /* Unused. Silent compiler warning. */
-  (void)transfer_encoding; /* Unused. Silent compiler warning. */
-  (void)off;               /* Unused. Silent compiler warning. */
+  (void) kind;              /* Unused. Silent compiler warning. */
+  (void) content_type;      /* Unused. Silent compiler warning. */
+  (void) transfer_encoding; /* Unused. Silent compiler warning. */
+  (void) off;               /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "category"))
     return do_append (&uc->category, data, size);
   if (0 == strcmp (key, "language"))
     return do_append (&uc->language, data, size);
   if (0 != strcmp (key, "upload"))
-    {
-      fprintf (stderr,
-              "Ignoring unexpected form value `%s'\n",
-              key);
-      return MHD_YES; /* ignore */
-    }
+  {
+    fprintf (stderr,
+             "Ignoring unexpected form value `%s'\n",
+             key);
+    return MHD_YES;   /* ignore */
+  }
   if (NULL == filename)
-    {
-      fprintf (stderr, "No filename, aborting upload\n");
-      return MHD_NO; /* no filename, error */
-    }
+  {
+    fprintf (stderr, "No filename, aborting upload\n");
+    return MHD_NO;   /* no filename, error */
+  }
   if ( (NULL == uc->category) ||
        (NULL == uc->language) )
+  {
+    fprintf (stderr,
+             "Missing form data for upload `%s'\n",
+             filename);
+    uc->response = request_refused_response;
+    return MHD_NO;
+  }
+  if (-1 == uc->fd)
+  {
+    char fn[PATH_MAX];
+
+    if ( (NULL != strstr (filename, "..")) ||
+         (NULL != strchr (filename, '/')) ||
+         (NULL != strchr (filename, '\\')) )
     {
-      fprintf (stderr,
-              "Missing form data for upload `%s'\n",
-              filename);
       uc->response = request_refused_response;
       return MHD_NO;
     }
-  if (-1 == uc->fd)
-    {
-      char fn[PATH_MAX];
-
-      if ( (NULL != strstr (filename, "..")) ||
-          (NULL != strchr (filename, '/')) ||
-          (NULL != strchr (filename, '\\')) )
-       {
-         uc->response = request_refused_response;
-         return MHD_NO;
-       }
-      /* create directories -- if they don't exist already */
+    /* create directories -- if they don't exist already */
 #ifdef WINDOWS
-      (void) mkdir (uc->language);
+    (void) mkdir (uc->language);
 #else
-      (void) mkdir (uc->language, S_IRWXU);
+    (void) mkdir (uc->language, S_IRWXU);
 #endif
-      snprintf (fn, sizeof (fn),
-               "%s/%s",
-               uc->language,
-               uc->category);
+    snprintf (fn, sizeof (fn),
+              "%s/%s",
+              uc->language,
+              uc->category);
 #ifdef WINDOWS
-      (void) mkdir (fn);
+    (void) mkdir (fn);
 #else
-      (void) mkdir (fn, S_IRWXU);
+    (void) mkdir (fn, S_IRWXU);
 #endif
-      /* open file */
-      snprintf (fn, sizeof (fn),
-               "%s/%s/%s",
-               uc->language,
-               uc->category,
-               filename);
-      for (i=strlen (fn)-1;i>=0;i--)
-       if (! isprint ((unsigned char) fn[i]))
-         fn[i] = '_';
-      uc->fd = open (fn,
-                    O_CREAT | O_EXCL
+    /* open file */
+    snprintf (fn, sizeof (fn),
+              "%s/%s/%s",
+              uc->language,
+              uc->category,
+              filename);
+    for (i = strlen (fn) - 1; i>=0; i--)
+      if (! isprint ((unsigned char) fn[i]))
+        fn[i] = '_';
+    uc->fd = open (fn,
+                   O_CREAT | O_EXCL
 #if O_LARGEFILE
-                    | O_LARGEFILE
+                   | O_LARGEFILE
 #endif
-                    | O_WRONLY,
-                    S_IRUSR | S_IWUSR);
-      if (-1 == uc->fd)
-       {
-         fprintf (stderr,
-                  "Error opening file `%s' for upload: %s\n",
-                  fn,
-                  strerror (errno));
-         uc->response = request_refused_response;
-         return MHD_NO;
-       }
-      uc->filename = strdup (fn);
+                   | O_WRONLY,
+                   S_IRUSR | S_IWUSR);
+    if (-1 == uc->fd)
+    {
+      fprintf (stderr,
+               "Error opening file `%s' for upload: %s\n",
+               fn,
+               strerror (errno));
+      uc->response = request_refused_response;
+      return MHD_NO;
     }
+    uc->filename = strdup (fn);
+  }
   if ( (0 != size) &&
        (size != (size_t) write (uc->fd, data, size)) )
+  {
+    /* write failed; likely: disk full */
+    fprintf (stderr,
+             "Error writing to file `%s': %s\n",
+             uc->filename,
+             strerror (errno));
+    uc->response = internal_error_response;
+    close (uc->fd);
+    uc->fd = -1;
+    if (NULL != uc->filename)
     {
-      /* write failed; likely: disk full */
-      fprintf (stderr,
-              "Error writing to file `%s': %s\n",
-              uc->filename,
-              strerror (errno));
-      uc->response = internal_error_response;
-      close (uc->fd);
-      uc->fd = -1;
-      if (NULL != uc->filename)
-       {
-         unlink (uc->filename);
-         free (uc->filename);
-         uc->filename = NULL;
-       }
-      return MHD_NO;
+      unlink (uc->filename);
+      free (uc->filename);
+      uc->filename = NULL;
     }
+    return MHD_NO;
+  }
   return MHD_YES;
 }
 
@@ -625,32 +628,32 @@ process_upload_data (void *cls,
  */
 static void
 response_completed_callback (void *cls,
-                            struct MHD_Connection *connection,
-                            void **con_cls,
-                            enum MHD_RequestTerminationCode toe)
+                             struct MHD_Connection *connection,
+                             void **con_cls,
+                             enum MHD_RequestTerminationCode toe)
 {
   struct UploadContext *uc = *con_cls;
-  (void)cls;         /* Unused. Silent compiler warning. */
-  (void)connection;  /* Unused. Silent compiler warning. */
-  (void)toe;         /* Unused. Silent compiler warning. */
+  (void) cls;         /* Unused. Silent compiler warning. */
+  (void) connection;  /* Unused. Silent compiler warning. */
+  (void) toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == uc)
     return; /* this request wasn't an upload request */
   if (NULL != uc->pp)
-    {
-      MHD_destroy_post_processor (uc->pp);
-      uc->pp = NULL;
-    }
+  {
+    MHD_destroy_post_processor (uc->pp);
+    uc->pp = NULL;
+  }
   if (-1 != uc->fd)
   {
     (void) close (uc->fd);
     if (NULL != uc->filename)
-      {
-       fprintf (stderr,
-                "Upload of file `%s' failed (incomplete or aborted), removing 
file.\n",
-                uc->filename);
-       (void) unlink (uc->filename);
-      }
+    {
+      fprintf (stderr,
+               "Upload of file `%s' failed (incomplete or aborted), removing 
file.\n",
+               uc->filename);
+      (void) unlink (uc->filename);
+    }
   }
   if (NULL != uc->filename)
     free (uc->filename);
@@ -672,12 +675,12 @@ return_directory_response (struct MHD_Connection 
*connection)
   (void) pthread_mutex_lock (&mutex);
   if (NULL == cached_directory_response)
     ret = MHD_queue_response (connection,
-                             MHD_HTTP_INTERNAL_SERVER_ERROR,
-                             internal_error_response);
+                              MHD_HTTP_INTERNAL_SERVER_ERROR,
+                              internal_error_response);
   else
     ret = MHD_queue_response (connection,
-                             MHD_HTTP_OK,
-                             cached_directory_response);
+                              MHD_HTTP_OK,
+                              cached_directory_response);
   (void) pthread_mutex_unlock (&mutex);
   return ret;
 }
@@ -698,131 +701,131 @@ return_directory_response (struct MHD_Connection 
*connection)
  */
 static int
 generate_page (void *cls,
-              struct MHD_Connection *connection,
-              const char *url,
-              const char *method,
-              const char *version,
-              const char *upload_data,
-              size_t *upload_data_size, void **ptr)
+               struct MHD_Connection *connection,
+               const char *url,
+               const char *method,
+               const char *version,
+               const char *upload_data,
+               size_t *upload_data_size, void **ptr)
 {
   struct MHD_Response *response;
   int ret;
   int fd;
   struct stat buf;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (url, "/"))
-    {
-      /* should be file download */
+  {
+    /* should be file download */
 #ifdef MHD_HAVE_LIBMAGIC
-      char file_data[MAGIC_HEADER_SIZE];
-      ssize_t got;
+    char file_data[MAGIC_HEADER_SIZE];
+    ssize_t got;
 #endif /* MHD_HAVE_LIBMAGIC */
-      const char *mime;
-
-      if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
-       return MHD_NO;  /* unexpected method (we're not polite...) */
-      fd = -1;
-      if ( (NULL == strstr (&url[1], "..")) &&
-          ('/' != url[1]) )
-        {
-          fd = open (&url[1], O_RDONLY);
-          if ( (-1 != fd) &&
-               ( (0 != fstat (fd, &buf)) ||
-                 (! S_ISREG (buf.st_mode)) ) )
-            {
-              (void) close (fd);
-              fd = -1;
-            }
-        }
-      if (-1 == fd)
-       return MHD_queue_response (connection,
-                                  MHD_HTTP_NOT_FOUND,
-                                  file_not_found_response);
+    const char *mime;
+
+    if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
+      return MHD_NO; /* unexpected method (we're not polite...) */
+    fd = -1;
+    if ( (NULL == strstr (&url[1], "..")) &&
+         ('/' != url[1]) )
+    {
+      fd = open (&url[1], O_RDONLY);
+      if ( (-1 != fd) &&
+           ( (0 != fstat (fd, &buf)) ||
+             (! S_ISREG (buf.st_mode)) ) )
+      {
+        (void) close (fd);
+        fd = -1;
+      }
+    }
+    if (-1 == fd)
+      return MHD_queue_response (connection,
+                                 MHD_HTTP_NOT_FOUND,
+                                 file_not_found_response);
 #ifdef MHD_HAVE_LIBMAGIC
-      /* read beginning of the file to determine mime type  */
-      got = read (fd, file_data, sizeof (file_data));
-      (void) lseek (fd, 0, SEEK_SET);
-      if (-1 != got)
-       mime = magic_buffer (magic, file_data, got);
-      else
+    /* read beginning of the file to determine mime type  */
+    got = read (fd, file_data, sizeof (file_data));
+    (void) lseek (fd, 0, SEEK_SET);
+    if (-1 != got)
+      mime = magic_buffer (magic, file_data, got);
+    else
 #endif /* MHD_HAVE_LIBMAGIC */
-       mime = NULL;
-
-      if (NULL == (response = MHD_create_response_from_fd (buf.st_size,
-                                                          fd)))
-       {
-         /* internal error (i.e. out of memory) */
-         (void) close (fd);
-         return MHD_NO;
-       }
-
-      /* add mime type if we had one */
-      if (NULL != mime)
-       (void) MHD_add_response_header (response,
-                                       MHD_HTTP_HEADER_CONTENT_TYPE,
-                                       mime);
-      ret = MHD_queue_response (connection,
-                               MHD_HTTP_OK,
-                               response);
-      MHD_destroy_response (response);
-      return ret;
+    mime = NULL;
+
+    if (NULL == (response = MHD_create_response_from_fd (buf.st_size,
+                                                         fd)))
+    {
+      /* internal error (i.e. out of memory) */
+      (void) close (fd);
+      return MHD_NO;
     }
 
+    /* add mime type if we had one */
+    if (NULL != mime)
+      (void) MHD_add_response_header (response,
+                                      MHD_HTTP_HEADER_CONTENT_TYPE,
+                                      mime);
+    ret = MHD_queue_response (connection,
+                              MHD_HTTP_OK,
+                              response);
+    MHD_destroy_response (response);
+    return ret;
+  }
+
   if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
+  {
+    /* upload! */
+    struct UploadContext *uc = *ptr;
+
+    if (NULL == uc)
+    {
+      if (NULL == (uc = malloc (sizeof (struct UploadContext))))
+        return MHD_NO; /* out of memory, close connection */
+      memset (uc, 0, sizeof (struct UploadContext));
+      uc->fd = -1;
+      uc->connection = connection;
+      uc->pp = MHD_create_post_processor (connection,
+                                          64 * 1024 /* buffer size */,
+                                          &process_upload_data, uc);
+      if (NULL == uc->pp)
+      {
+        /* out of memory, close connection */
+        free (uc);
+        return MHD_NO;
+      }
+      *ptr = uc;
+      return MHD_YES;
+    }
+    if (0 != *upload_data_size)
+    {
+      if (NULL == uc->response)
+        (void) MHD_post_process (uc->pp,
+                                 upload_data,
+                                 *upload_data_size);
+      *upload_data_size = 0;
+      return MHD_YES;
+    }
+    /* end of upload, finish it! */
+    MHD_destroy_post_processor (uc->pp);
+    uc->pp = NULL;
+    if (-1 != uc->fd)
+    {
+      close (uc->fd);
+      uc->fd = -1;
+    }
+    if (NULL != uc->response)
+    {
+      return MHD_queue_response (connection,
+                                 MHD_HTTP_FORBIDDEN,
+                                 uc->response);
+    }
+    else
     {
-      /* upload! */
-      struct UploadContext *uc = *ptr;
-
-      if (NULL == uc)
-       {
-         if (NULL == (uc = malloc (sizeof (struct UploadContext))))
-           return MHD_NO; /* out of memory, close connection */
-         memset (uc, 0, sizeof (struct UploadContext));
-          uc->fd = -1;
-         uc->connection = connection;
-         uc->pp = MHD_create_post_processor (connection,
-                                             64 * 1024 /* buffer size */,
-                                             &process_upload_data, uc);
-         if (NULL == uc->pp)
-           {
-             /* out of memory, close connection */
-             free (uc);
-             return MHD_NO;
-           }
-         *ptr = uc;
-         return MHD_YES;
-       }
-      if (0 != *upload_data_size)
-       {
-         if (NULL == uc->response)
-           (void) MHD_post_process (uc->pp,
-                                    upload_data,
-                                    *upload_data_size);
-         *upload_data_size = 0;
-         return MHD_YES;
-       }
-      /* end of upload, finish it! */
-      MHD_destroy_post_processor (uc->pp);
-      uc->pp = NULL;
-      if (-1 != uc->fd)
-       {
-         close (uc->fd);
-         uc->fd = -1;
-       }
-      if (NULL != uc->response)
-       {
-         return MHD_queue_response (connection,
-                                    MHD_HTTP_FORBIDDEN,
-                                    uc->response);
-       }
-      else
-       {
-         update_directory ();
-         return return_directory_response (connection);
-       }
+      update_directory ();
+      return return_directory_response (connection);
     }
+  }
   if (0 == strcmp (method, MHD_HTTP_METHOD_GET))
   {
     return return_directory_response (connection);
@@ -830,8 +833,8 @@ generate_page (void *cls,
 
   /* unexpected request, refuse */
   return MHD_queue_response (connection,
-                            MHD_HTTP_FORBIDDEN,
-                            request_refused_response);
+                             MHD_HTTP_FORBIDDEN,
+                             request_refused_response);
 }
 
 
@@ -844,7 +847,7 @@ generate_page (void *cls,
 static void
 catcher (int sig)
 {
-  (void)sig;   /* Unused. Silent compiler warning. */
+  (void) sig;  /* Unused. Silent compiler warning. */
   /* do nothing */
 }
 
@@ -873,53 +876,53 @@ ignore_sigpipe (void)
 
 /* test server key */
 const char srv_signed_key_pem[] = "-----BEGIN RSA PRIVATE KEY-----\n"
-  "MIIEowIBAAKCAQEAvfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW\n"
-  "+K03KwEku55QvnUndwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8IL\n"
-  "q4sw32vo0fbMu5BZF49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ0\n"
-  "20Q5EAAEseD1YtWCIpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6\n"
-  "QYGGh1QmHRPAy3CBII6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6x\n"
-  "yoOl204xuekZOaG9RUPId74Rtmwfi1TLbBzo2wIDAQABAoIBADu09WSICNq5cMe4\n"
-  "+NKCLlgAT1NiQpLls1gKRbDhKiHU9j8QWNvWWkJWrCya4QdUfLCfeddCMeiQmv3K\n"
-  "lJMvDs+5OjJSHFoOsGiuW2Ias7IjnIojaJalfBml6frhJ84G27IXmdz6gzOiTIer\n"
-  "DjeAgcwBaKH5WwIay2TxIaScl7AwHBauQkrLcyb4hTmZuQh6ArVIN6+pzoVuORXM\n"
-  "bpeNWl2l/HSN3VtUN6aCAKbN/X3o0GavCCMn5Fa85uJFsab4ss/uP+2PusU71+zP\n"
-  "sBm6p/2IbGvF5k3VPDA7X5YX61sukRjRBihY8xSnNYx1UcoOsX6AiPnbhifD8+xQ\n"
-  "Tlf8oJUCgYEA0BTfzqNpr9Wxw5/QXaSdw7S/0eP5a0C/nwURvmfSzuTD4equzbEN\n"
-  "d+dI/s2JMxrdj/I4uoAfUXRGaabevQIjFzC9uyE3LaOyR2zhuvAzX+vVcs6bSXeU\n"
-  "pKpCAcN+3Z3evMaX2f+z/nfSUAl2i4J2R+/LQAWJW4KwRky/m+cxpfUCgYEA6bN1\n"
-  "b73bMgM8wpNt6+fcmS+5n0iZihygQ2U2DEud8nZJL4Nrm1dwTnfZfJBnkGj6+0Q0\n"
-  "cOwj2KS0/wcEdJBP0jucU4v60VMhp75AQeHqidIde0bTViSRo3HWKXHBIFGYoU3T\n"
-  "LyPyKndbqsOObnsFXHn56Nwhr2HLf6nw4taGQY8CgYBoSW36FLCNbd6QGvLFXBGt\n"
-  "2lMhEM8az/K58kJ4WXSwOLtr6MD/WjNT2tkcy0puEJLm6BFCd6A6pLn9jaKou/92\n"
-  "SfltZjJPb3GUlp9zn5tAAeSSi7YMViBrfuFiHObij5LorefBXISLjuYbMwL03MgH\n"
-  "Ocl2JtA2ywMp2KFXs8GQWQKBgFyIVv5ogQrbZ0pvj31xr9HjqK6d01VxIi+tOmpB\n"
-  "4ocnOLEcaxX12BzprW55ytfOCVpF1jHD/imAhb3YrHXu0fwe6DXYXfZV4SSG2vB7\n"
-  "IB9z14KBN5qLHjNGFpMQXHSMek+b/ftTU0ZnPh9uEM5D3YqRLVd7GcdUhHvG8P8Q\n"
-  "C9aXAoGBAJtID6h8wOGMP0XYX5YYnhlC7dOLfk8UYrzlp3xhqVkzKthTQTj6wx9R\n"
-  "GtC4k7U1ki8oJsfcIlBNXd768fqDVWjYju5rzShMpo8OCTS6ipAblKjCxPPVhIpv\n"
-  "tWPlbSn1qj6wylstJ5/3Z+ZW5H4wIKp5jmLiioDhcP0L/Ex3Zx8O\n"
-  "-----END RSA PRIVATE KEY-----\n";
+                                  
"MIIEowIBAAKCAQEAvfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW\n"
+                                  
"+K03KwEku55QvnUndwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8IL\n"
+                                  
"q4sw32vo0fbMu5BZF49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ0\n"
+                                  
"20Q5EAAEseD1YtWCIpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6\n"
+                                  
"QYGGh1QmHRPAy3CBII6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6x\n"
+                                  
"yoOl204xuekZOaG9RUPId74Rtmwfi1TLbBzo2wIDAQABAoIBADu09WSICNq5cMe4\n"
+                                  
"+NKCLlgAT1NiQpLls1gKRbDhKiHU9j8QWNvWWkJWrCya4QdUfLCfeddCMeiQmv3K\n"
+                                  
"lJMvDs+5OjJSHFoOsGiuW2Ias7IjnIojaJalfBml6frhJ84G27IXmdz6gzOiTIer\n"
+                                  
"DjeAgcwBaKH5WwIay2TxIaScl7AwHBauQkrLcyb4hTmZuQh6ArVIN6+pzoVuORXM\n"
+                                  
"bpeNWl2l/HSN3VtUN6aCAKbN/X3o0GavCCMn5Fa85uJFsab4ss/uP+2PusU71+zP\n"
+                                  
"sBm6p/2IbGvF5k3VPDA7X5YX61sukRjRBihY8xSnNYx1UcoOsX6AiPnbhifD8+xQ\n"
+                                  
"Tlf8oJUCgYEA0BTfzqNpr9Wxw5/QXaSdw7S/0eP5a0C/nwURvmfSzuTD4equzbEN\n"
+                                  
"d+dI/s2JMxrdj/I4uoAfUXRGaabevQIjFzC9uyE3LaOyR2zhuvAzX+vVcs6bSXeU\n"
+                                  
"pKpCAcN+3Z3evMaX2f+z/nfSUAl2i4J2R+/LQAWJW4KwRky/m+cxpfUCgYEA6bN1\n"
+                                  
"b73bMgM8wpNt6+fcmS+5n0iZihygQ2U2DEud8nZJL4Nrm1dwTnfZfJBnkGj6+0Q0\n"
+                                  
"cOwj2KS0/wcEdJBP0jucU4v60VMhp75AQeHqidIde0bTViSRo3HWKXHBIFGYoU3T\n"
+                                  
"LyPyKndbqsOObnsFXHn56Nwhr2HLf6nw4taGQY8CgYBoSW36FLCNbd6QGvLFXBGt\n"
+                                  
"2lMhEM8az/K58kJ4WXSwOLtr6MD/WjNT2tkcy0puEJLm6BFCd6A6pLn9jaKou/92\n"
+                                  
"SfltZjJPb3GUlp9zn5tAAeSSi7YMViBrfuFiHObij5LorefBXISLjuYbMwL03MgH\n"
+                                  
"Ocl2JtA2ywMp2KFXs8GQWQKBgFyIVv5ogQrbZ0pvj31xr9HjqK6d01VxIi+tOmpB\n"
+                                  
"4ocnOLEcaxX12BzprW55ytfOCVpF1jHD/imAhb3YrHXu0fwe6DXYXfZV4SSG2vB7\n"
+                                  
"IB9z14KBN5qLHjNGFpMQXHSMek+b/ftTU0ZnPh9uEM5D3YqRLVd7GcdUhHvG8P8Q\n"
+                                  
"C9aXAoGBAJtID6h8wOGMP0XYX5YYnhlC7dOLfk8UYrzlp3xhqVkzKthTQTj6wx9R\n"
+                                  
"GtC4k7U1ki8oJsfcIlBNXd768fqDVWjYju5rzShMpo8OCTS6ipAblKjCxPPVhIpv\n"
+                                  
"tWPlbSn1qj6wylstJ5/3Z+ZW5H4wIKp5jmLiioDhcP0L/Ex3Zx8O\n"
+                                  "-----END RSA PRIVATE KEY-----\n";
 
 /* test server CA signed certificates */
 const char srv_signed_cert_pem[] = "-----BEGIN CERTIFICATE-----\n"
-  "MIIDGzCCAgWgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
-  "dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
-  "A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
-  "vfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW+K03KwEku55QvnUn\n"
-  "dwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8ILq4sw32vo0fbMu5BZ\n"
-  "F49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ020Q5EAAEseD1YtWC\n"
-  "IpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6QYGGh1QmHRPAy3CB\n"
-  "II6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6xyoOl204xuekZOaG9\n"
-  "RUPId74Rtmwfi1TLbBzo2wIDAQABo3YwdDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
-  "MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFOFi4ilKOP1d\n"
-  "XHlWCMwmVKr7mgy8MB8GA1UdIwQYMBaAFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsG\n"
-  "CSqGSIb3DQEBBQOCAQEAHVWPxazupbOkG7Did+dY9z2z6RjTzYvurTtEKQgzM2Vz\n"
-  "GQBA+3pZ3c5mS97fPIs9hZXfnQeelMeZ2XP1a+9vp35bJjZBBhVH+pqxjCgiUflg\n"
-  "A3Zqy0XwwVCgQLE2HyaU3DLUD/aeIFK5gJaOSdNTXZLv43K8kl4cqDbMeRpVTbkt\n"
-  "YmG4AyEOYRNKGTqMEJXJoxD5E3rBUNrVI/XyTjYrulxbNPcMWEHKNeeqWpKDYTFo\n"
-  "Bb01PCthGXiq/4A2RLAFosadzRa8SBpoSjPPfZ0b2w4MJpReHqKbR5+T2t6hzml6\n"
-  "4ToyOKPDmamiTuN5KzLN3cw7DQlvWMvqSOChPLnA3Q==\n"
-  "-----END CERTIFICATE-----\n";
+                                   
"MIIDGzCCAgWgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
+                                   
"dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
+                                   
"A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
+                                   
"vfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW+K03KwEku55QvnUn\n"
+                                   
"dwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8ILq4sw32vo0fbMu5BZ\n"
+                                   
"F49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ020Q5EAAEseD1YtWC\n"
+                                   
"IpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6QYGGh1QmHRPAy3CB\n"
+                                   
"II6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6xyoOl204xuekZOaG9\n"
+                                   
"RUPId74Rtmwfi1TLbBzo2wIDAQABo3YwdDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
+                                   
"MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFOFi4ilKOP1d\n"
+                                   
"XHlWCMwmVKr7mgy8MB8GA1UdIwQYMBaAFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsG\n"
+                                   
"CSqGSIb3DQEBBQOCAQEAHVWPxazupbOkG7Did+dY9z2z6RjTzYvurTtEKQgzM2Vz\n"
+                                   
"GQBA+3pZ3c5mS97fPIs9hZXfnQeelMeZ2XP1a+9vp35bJjZBBhVH+pqxjCgiUflg\n"
+                                   
"A3Zqy0XwwVCgQLE2HyaU3DLUD/aeIFK5gJaOSdNTXZLv43K8kl4cqDbMeRpVTbkt\n"
+                                   
"YmG4AyEOYRNKGTqMEJXJoxD5E3rBUNrVI/XyTjYrulxbNPcMWEHKNeeqWpKDYTFo\n"
+                                   
"Bb01PCthGXiq/4A2RLAFosadzRa8SBpoSjPPfZ0b2w4MJpReHqKbR5+T2t6hzml6\n"
+                                   
"4ToyOKPDmamiTuN5KzLN3cw7DQlvWMvqSOChPLnA3Q==\n"
+                                   "-----END CERTIFICATE-----\n";
 
 
 /**
@@ -940,11 +943,11 @@ main (int argc, char *const *argv)
   if ( (argc != 2) ||
        (1 != sscanf (argv[1], "%u", &port)) ||
        (UINT16_MAX < port) )
-    {
-      fprintf (stderr,
-              "%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    fprintf (stderr,
+             "%s PORT\n", argv[0]);
+    return 1;
+  }
   #ifndef MINGW
   ignore_sigpipe ();
   #endif
@@ -954,35 +957,46 @@ main (int argc, char *const *argv)
 #endif /* MHD_HAVE_LIBMAGIC */
 
   (void) pthread_mutex_init (&mutex, NULL);
-  file_not_found_response = MHD_create_response_from_buffer (strlen 
(FILE_NOT_FOUND_PAGE),
-                                                            (void *) 
FILE_NOT_FOUND_PAGE,
-                                                            
MHD_RESPMEM_PERSISTENT);
+  file_not_found_response = MHD_create_response_from_buffer (strlen (
+                                                               
FILE_NOT_FOUND_PAGE),
+                                                             (void *)
+                                                             
FILE_NOT_FOUND_PAGE,
+                                                             
MHD_RESPMEM_PERSISTENT);
   mark_as_html (file_not_found_response);
-  request_refused_response = MHD_create_response_from_buffer (strlen 
(REQUEST_REFUSED_PAGE),
-                                                            (void *) 
REQUEST_REFUSED_PAGE,
-                                                            
MHD_RESPMEM_PERSISTENT);
+  request_refused_response = MHD_create_response_from_buffer (strlen (
+                                                                
REQUEST_REFUSED_PAGE),
+                                                              (void *)
+                                                              
REQUEST_REFUSED_PAGE,
+                                                              
MHD_RESPMEM_PERSISTENT);
   mark_as_html (request_refused_response);
-  internal_error_response = MHD_create_response_from_buffer (strlen 
(INTERNAL_ERROR_PAGE),
-                                                            (void *) 
INTERNAL_ERROR_PAGE,
-                                                            
MHD_RESPMEM_PERSISTENT);
+  internal_error_response = MHD_create_response_from_buffer (strlen (
+                                                               
INTERNAL_ERROR_PAGE),
+                                                             (void *)
+                                                             
INTERNAL_ERROR_PAGE,
+                                                             
MHD_RESPMEM_PERSISTENT);
   mark_as_html (internal_error_response);
   update_directory ();
-  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG | MHD_USE_TLS,
+  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD
+                        | MHD_USE_ERROR_LOG | MHD_USE_TLS,
                         port,
                         NULL, NULL,
-                       &generate_page, NULL,
-                       MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (256 * 
1024),
+                        &generate_page, NULL,
+                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (256
+                                                                      * 1024),
 #if PRODUCTION
-                       MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) (64),
+                        MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 
(64),
 #endif
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) (120 /* 
seconds */),
-                       MHD_OPTION_THREAD_POOL_SIZE, (unsigned int) 
NUMBER_OF_THREADS,
-                       MHD_OPTION_NOTIFY_COMPLETED, 
&response_completed_callback, NULL,
-                       /* Optionally, the gnutls_load_file() can be used to
-                          load the key and the certificate from file. */
-                       MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem,
-                       MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem,
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned
+                                                        int) (120 /* seconds 
*/),
+                        MHD_OPTION_THREAD_POOL_SIZE, (unsigned
+                                                      int) NUMBER_OF_THREADS,
+                        MHD_OPTION_NOTIFY_COMPLETED,
+                        &response_completed_callback, NULL,
+                        /* Optionally, the gnutls_load_file() can be used to
+                           load the key and the certificate from file. */
+                        MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem,
+                        MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem,
+                        MHD_OPTION_END);
   if (NULL == d)
     return 1;
   fprintf (stderr, "HTTP server running. Press ENTER to stop the server\n");
diff --git a/src/examples/digest_auth_example.c 
b/src/examples/digest_auth_example.c
index 889967fb..720576cd 100644
--- a/src/examples/digest_auth_example.c
+++ b/src/examples/digest_auth_example.c
@@ -26,9 +26,11 @@
 #include <microhttpd.h>
 #include <stdlib.h>
 
-#define PAGE "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
 
-#define DENIED "<html><head><title>libmicrohttpd 
demo</title></head><body>Access denied</body></html>"
+#define DENIED \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
denied</body></html>"
 
 #define MY_OPAQUE_STR "11733b200778ce33060f31c9af70a870ba96ddd4"
 
@@ -45,51 +47,52 @@ ahc_echo (void *cls,
   const char *password = "testpass";
   const char *realm = "address@hidden";
   int ret;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)method;            /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
-  (void)ptr;               /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) method;            /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) ptr;               /* Unused. Silent compiler warning. */
 
-  username = MHD_digest_auth_get_username(connection);
+  username = MHD_digest_auth_get_username (connection);
   if (NULL == username)
-    {
-      response = MHD_create_response_from_buffer(strlen (DENIED),
-                                                DENIED,
-                                                MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_auth_fail_response(connection, realm,
-                                        MY_OPAQUE_STR,
-                                        response,
-                                        MHD_NO);
-      MHD_destroy_response(response);
-      return ret;
-    }
-  ret = MHD_digest_auth_check(connection, realm,
-                             username,
-                             password,
-                             300);
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_auth_fail_response (connection, realm,
+                                        MY_OPAQUE_STR,
+                                        response,
+                                        MHD_NO);
+    MHD_destroy_response (response);
+    return ret;
+  }
+  ret = MHD_digest_auth_check (connection, realm,
+                               username,
+                               password,
+                               300);
   MHD_free (username);
   if ( (ret == MHD_INVALID_NONCE) ||
        (ret == MHD_NO) )
-    {
-      response = MHD_create_response_from_buffer(strlen (DENIED),
-                                                DENIED,
-                                                MHD_RESPMEM_PERSISTENT);
-      if (NULL == response)
-       return MHD_NO;
-      ret = MHD_queue_auth_fail_response(connection, realm,
-                                        MY_OPAQUE_STR,
-                                        response,
-                                        (ret == MHD_INVALID_NONCE) ? MHD_YES : 
MHD_NO);
-      MHD_destroy_response(response);
-      return ret;
-    }
-  response = MHD_create_response_from_buffer(strlen(PAGE), PAGE,
-                                            MHD_RESPMEM_PERSISTENT);
-  ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
-  MHD_destroy_response(response);
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    if (NULL == response)
+      return MHD_NO;
+    ret = MHD_queue_auth_fail_response (connection, realm,
+                                        MY_OPAQUE_STR,
+                                        response,
+                                        (ret == MHD_INVALID_NONCE) ? MHD_YES :
+                                        MHD_NO);
+    MHD_destroy_response (response);
+    return ret;
+  }
+  response = MHD_create_response_from_buffer (strlen (PAGE), PAGE,
+                                              MHD_RESPMEM_PERSISTENT);
+  ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+  MHD_destroy_response (response);
   return ret;
 }
 
@@ -104,40 +107,41 @@ main (int argc, char *const *argv)
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  fd = open("/dev/urandom", O_RDONLY);
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  fd = open ("/dev/urandom", O_RDONLY);
   if (-1 == fd)
-    {
-      fprintf (stderr, "Failed to open `%s': %s\n",
-              "/dev/urandom",
-              strerror (errno));
-      return 1;
-    }
+  {
+    fprintf (stderr, "Failed to open `%s': %s\n",
+             "/dev/urandom",
+             strerror (errno));
+    return 1;
+  }
   off = 0;
   while (off < 8)
+  {
+    len = read (fd, rnd, 8);
+    if (len == -1)
     {
-      len = read(fd, rnd, 8);
-      if (len == -1)
-       {
-         fprintf (stderr, "Failed to read `%s': %s\n",
-                  "/dev/urandom",
-                  strerror (errno));
-         (void) close (fd);
-         return 1;
-       }
-      off += len;
+      fprintf (stderr, "Failed to read `%s': %s\n",
+               "/dev/urandom",
+               strerror (errno));
+      (void) close (fd);
+      return 1;
     }
-  (void) close(fd);
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+    off += len;
+  }
+  (void) close (fd);
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, PAGE,
-                       MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof(rnd), rnd,
-                       MHD_OPTION_NONCE_NC_SIZE, 300,
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
-                       MHD_OPTION_END);
+                        MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof(rnd), rnd,
+                        MHD_OPTION_NONCE_NC_SIZE, 300,
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   (void) getc (stdin);
diff --git a/src/examples/dual_stack_example.c 
b/src/examples/dual_stack_example.c
index 31b25438..ffacec4a 100644
--- a/src/examples/dual_stack_example.c
+++ b/src/examples/dual_stack_example.c
@@ -25,7 +25,8 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-#define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd 
demo</body></html>"
 
 static int
 ahc_echo (void *cls,
@@ -39,23 +40,23 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
   response = MHD_create_response_from_buffer (strlen (me),
-                                             (void *) me,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) me,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -68,15 +69,16 @@ main (int argc, char *const *argv)
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
MHD_USE_DUAL_STACK,
-                       atoi (argv[1]),
-                       NULL, NULL, &ahc_echo, PAGE,
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
-                       MHD_OPTION_END);
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | MHD_USE_DUAL_STACK,
+                        atoi (argv[1]),
+                        NULL, NULL, &ahc_echo, PAGE,
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
+                        MHD_OPTION_END);
   (void) getc (stdin);
   MHD_stop_daemon (d);
   return 0;
diff --git a/src/examples/fileserver_example_dirs.c 
b/src/examples/fileserver_example_dirs.c
index 8c37f219..2b544b69 100644
--- a/src/examples/fileserver_example_dirs.c
+++ b/src/examples/fileserver_example_dirs.c
@@ -28,7 +28,8 @@
 #include <microhttpd.h>
 #include <unistd.h>
 
-#define PAGE "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
+#define PAGE \
+  "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
 
 static ssize_t
@@ -66,17 +67,17 @@ dir_reader (void *cls, uint64_t pos, char *buf, size_t max)
 
   if (max < 512)
     return 0;
-  (void)pos; /* 'pos' is ignored as function return next one single entry per 
call. */
+  (void) pos; /* 'pos' is ignored as function return next one single entry per 
call. */
   do
-    {
-      e = readdir (dir);
-      if (e == NULL)
-        return MHD_CONTENT_READER_END_OF_STREAM;
+  {
+    e = readdir (dir);
+    if (e == NULL)
+      return MHD_CONTENT_READER_END_OF_STREAM;
   } while (e->d_name[0] == '.');
   return snprintf (buf, max,
-                  "<a href=\"/%s\">%s</a><br>",
-                  e->d_name,
-                  e->d_name);
+                   "<a href=\"/%s\">%s</a><br>",
+                   e->d_name,
+                   e->d_name);
 }
 
 
@@ -87,7 +88,7 @@ ahc_echo (void *cls,
           const char *method,
           const char *version,
           const char *upload_data,
-         size_t *upload_data_size, void **ptr)
+          size_t *upload_data_size, void **ptr)
 {
   static int aptr;
   struct MHD_Response *response;
@@ -97,90 +98,90 @@ ahc_echo (void *cls,
   DIR *dir;
   struct stat buf;
   char emsg[1024];
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
 
   file = fopen (&url[1], "rb");
   if (NULL != file)
+  {
+    fd = fileno (file);
+    if (-1 == fd)
     {
-      fd = fileno (file);
-      if (-1 == fd)
-        {
-          (void) fclose (file);
-          return MHD_NO; /* internal error */
-        }
-      if ( (0 != fstat (fd, &buf)) ||
-           (! S_ISREG (buf.st_mode)) )
-        {
-          /* not a regular file, refuse to serve */
-          fclose (file);
-          file = NULL;
-        }
+      (void) fclose (file);
+      return MHD_NO;     /* internal error */
     }
+    if ( (0 != fstat (fd, &buf)) ||
+         (! S_ISREG (buf.st_mode)) )
+    {
+      /* not a regular file, refuse to serve */
+      fclose (file);
+      file = NULL;
+    }
+  }
 
   if (NULL == file)
+  {
+    dir = opendir (".");
+    if (NULL == dir)
     {
-      dir = opendir (".");
-      if (NULL == dir)
-       {
-         /* most likely cause: more concurrent requests than
-            available file descriptors / 2 */
-         snprintf (emsg,
-                   sizeof (emsg),
-                   "Failed to open directory `.': %s\n",
-                   strerror (errno));
-         response = MHD_create_response_from_buffer (strlen (emsg),
-                                                     emsg,
-                                                     MHD_RESPMEM_MUST_COPY);
-         if (NULL == response)
-           return MHD_NO;
-         ret = MHD_queue_response (connection,
-                                    MHD_HTTP_SERVICE_UNAVAILABLE,
-                                    response);
-         MHD_destroy_response (response);
-       }
-      else
-       {
-         response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
-                                                       32 * 1024,
-                                                       &dir_reader,
-                                                       dir,
-                                                       &dir_free_callback);
-         if (NULL == response)
-           {
-             closedir (dir);
-             return MHD_NO;
-           }
-         ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-         MHD_destroy_response (response);
-       }
+      /* most likely cause: more concurrent requests than
+         available file descriptors / 2 */
+      snprintf (emsg,
+                sizeof (emsg),
+                "Failed to open directory `.': %s\n",
+                strerror (errno));
+      response = MHD_create_response_from_buffer (strlen (emsg),
+                                                  emsg,
+                                                  MHD_RESPMEM_MUST_COPY);
+      if (NULL == response)
+        return MHD_NO;
+      ret = MHD_queue_response (connection,
+                                MHD_HTTP_SERVICE_UNAVAILABLE,
+                                response);
+      MHD_destroy_response (response);
     }
-  else
+    else
     {
-      response = MHD_create_response_from_callback (buf.st_size, 32 * 1024,    
 /* 32k page size */
-                                                    &file_reader,
-                                                    file,
-                                                    &file_free_callback);
+      response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
+                                                    32 * 1024,
+                                                    &dir_reader,
+                                                    dir,
+                                                    &dir_free_callback);
       if (NULL == response)
-       {
-         fclose (file);
-         return MHD_NO;
-       }
+      {
+        closedir (dir);
+        return MHD_NO;
+      }
       ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
       MHD_destroy_response (response);
     }
+  }
+  else
+  {
+    response = MHD_create_response_from_callback (buf.st_size, 32 * 1024,      
 /* 32k page size */
+                                                  &file_reader,
+                                                  file,
+                                                  &file_free_callback);
+    if (NULL == response)
+    {
+      fclose (file);
+      return MHD_NO;
+    }
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+  }
   return ret;
 }
 
@@ -191,11 +192,12 @@ main (int argc, char *const *argv)
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, PAGE, MHD_OPTION_END);
   if (NULL == d)
diff --git a/src/examples/fileserver_example_external_select.c 
b/src/examples/fileserver_example_external_select.c
index 6aea6dbf..187cdf7e 100644
--- a/src/examples/fileserver_example_external_select.c
+++ b/src/examples/fileserver_example_external_select.c
@@ -27,7 +27,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#define PAGE "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
+#define PAGE \
+  "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
 static ssize_t
 file_reader (void *cls, uint64_t pos, char *buf, size_t max)
@@ -54,7 +55,7 @@ ahc_echo (void *cls,
           const char *method,
           const char *version,
           const char *upload_data,
-         size_t *upload_data_size, void **ptr)
+          size_t *upload_data_size, void **ptr)
 {
   static int aptr;
   struct MHD_Response *response;
@@ -62,61 +63,61 @@ ahc_echo (void *cls,
   FILE *file;
   int fd;
   struct stat buf;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
 
   file = fopen (&url[1], "rb");
   if (NULL != file)
+  {
+    fd = fileno (file);
+    if (-1 == fd)
     {
-      fd = fileno (file);
-      if (-1 == fd)
-        {
-          (void) fclose (file);
-          return MHD_NO; /* internal error */
-        }
-      if ( (0 != fstat (fd, &buf)) ||
-           (! S_ISREG (buf.st_mode)) )
-        {
-          /* not a regular file, refuse to serve */
-          fclose (file);
-          file = NULL;
-        }
+      (void) fclose (file);
+      return MHD_NO;     /* internal error */
     }
-
-  if (NULL == file)
+    if ( (0 != fstat (fd, &buf)) ||
+         (! S_ISREG (buf.st_mode)) )
     {
-      response = MHD_create_response_from_buffer (strlen (PAGE),
-                                                 (void *) PAGE,
-                                                 MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_response (connection, MHD_HTTP_NOT_FOUND, response);
-      MHD_destroy_response (response);
+      /* not a regular file, refuse to serve */
+      fclose (file);
+      file = NULL;
     }
+  }
+
+  if (NULL == file)
+  {
+    response = MHD_create_response_from_buffer (strlen (PAGE),
+                                                (void *) PAGE,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_response (connection, MHD_HTTP_NOT_FOUND, response);
+    MHD_destroy_response (response);
+  }
   else
+  {
+    response = MHD_create_response_from_callback (buf.st_size, 32 * 1024,      
 /* 32k page size */
+                                                  &file_reader,
+                                                  file,
+                                                  &free_callback);
+    if (NULL == response)
     {
-      response = MHD_create_response_from_callback (buf.st_size, 32 * 1024,    
 /* 32k page size */
-                                                    &file_reader,
-                                                    file,
-                                                    &free_callback);
-      if (NULL == response)
-       {
-         fclose (file);
-         return MHD_NO;
-       }
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-      MHD_destroy_response (response);
+      fclose (file);
+      return MHD_NO;
     }
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+  }
   return ret;
 }
 
@@ -135,10 +136,10 @@ main (int argc, char *const *argv)
   MHD_UNSIGNED_LONG_LONG mhd_timeout;
 
   if (argc != 3)
-    {
-      printf ("%s PORT SECONDS-TO-RUN\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT SECONDS-TO-RUN\n", argv[0]);
+    return 1;
+  }
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, PAGE, MHD_OPTION_END);
@@ -146,30 +147,30 @@ main (int argc, char *const *argv)
     return 1;
   end = time (NULL) + atoi (argv[2]);
   while ((t = time (NULL)) < end)
+  {
+    tv.tv_sec = end - t;
+    tv.tv_usec = 0;
+    max = 0;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      break; /* fatal internal error */
+    if (MHD_get_timeout (d, &mhd_timeout) == MHD_YES)
+    {
+      if (((MHD_UNSIGNED_LONG_LONG) tv.tv_sec) < mhd_timeout / 1000LL)
+      {
+        tv.tv_sec = mhd_timeout / 1000LL;
+        tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000LL)) * 1000LL;
+      }
+    }
+    if (-1 == select (max + 1, &rs, &ws, &es, &tv))
     {
-      tv.tv_sec = end - t;
-      tv.tv_usec = 0;
-      max = 0;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-       break; /* fatal internal error */
-      if (MHD_get_timeout (d, &mhd_timeout) == MHD_YES)
-        {
-          if (((MHD_UNSIGNED_LONG_LONG)tv.tv_sec) < mhd_timeout / 1000LL)
-            {
-              tv.tv_sec = mhd_timeout / 1000LL;
-              tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000LL)) * 1000LL;
-            }
-        }
-      if (-1 == select (max + 1, &rs, &ws, &es, &tv))
-        {
-          if (EINTR != errno)
-            abort ();
-        }
-      MHD_run (d);
+      if (EINTR != errno)
+        abort ();
     }
+    MHD_run (d);
+  }
   MHD_stop_daemon (d);
   return 0;
 }
diff --git a/src/examples/http_chunked_compression.c 
b/src/examples/http_chunked_compression.c
index 9c3f629f..461f4d3a 100644
--- a/src/examples/http_chunked_compression.c
+++ b/src/examples/http_chunked_compression.c
@@ -38,20 +38,22 @@
 #elif defined(INTPTR_MAX)
 #define SSIZE_MAX INTPTR_MAX
 #else
-#define SSIZE_MAX ((ssize_t)(((size_t)-1)>>1))
+#define SSIZE_MAX ((ssize_t) (((size_t) -1) >> 1))
 #endif
 #endif /* ! SSIZE_MAX */
 
 #define CHUNK 16384
 
-struct Holder {
-    FILE *file;
-    z_stream stream;
-    void *buf;
+struct Holder
+{
+  FILE *file;
+  z_stream stream;
+  void *buf;
 };
 
 static int
-compress_buf (z_stream *strm, const void *src, size_t src_size, size_t 
*offset, void **dest, size_t *dest_size,
+compress_buf (z_stream *strm, const void *src, size_t src_size, size_t *offset,
+              void **dest, size_t *dest_size,
               void *tmp)
 {
   unsigned int have;
@@ -61,39 +63,39 @@ compress_buf (z_stream *strm, const void *src, size_t 
src_size, size_t *offset,
   *dest = NULL;
   *dest_size = 0;
   do
+  {
+    if (src_size > CHUNK)
     {
-      if (src_size > CHUNK)
-        {
-          strm->avail_in = CHUNK;
-          src_size -= CHUNK;
-          flush = Z_NO_FLUSH;
-        }
-      else
-        {
-          strm->avail_in = (uInt) src_size;
-          flush = Z_SYNC_FLUSH;
-        }
-      *offset += strm->avail_in;
-      strm->next_in = (Bytef *) src;
-      do
-        {
-          strm->avail_out = CHUNK;
-          strm->next_out = tmp;
-          ret = deflate (strm, flush);
-          have = CHUNK - strm->avail_out;
-          *dest_size += have;
-          tmp_dest = realloc (*dest, *dest_size);
-          if (NULL == tmp_dest)
-            {
-              free (*dest);
-              *dest = NULL;
-              return MHD_NO;
-            }
-          *dest = tmp_dest;
-          memcpy ((*dest) + ((*dest_size) - have), tmp, have);
-        }
-      while (0 == strm->avail_out);
+      strm->avail_in = CHUNK;
+      src_size -= CHUNK;
+      flush = Z_NO_FLUSH;
     }
+    else
+    {
+      strm->avail_in = (uInt) src_size;
+      flush = Z_SYNC_FLUSH;
+    }
+    *offset += strm->avail_in;
+    strm->next_in = (Bytef *) src;
+    do
+    {
+      strm->avail_out = CHUNK;
+      strm->next_out = tmp;
+      ret = deflate (strm, flush);
+      have = CHUNK - strm->avail_out;
+      *dest_size += have;
+      tmp_dest = realloc (*dest, *dest_size);
+      if (NULL == tmp_dest)
+      {
+        free (*dest);
+        *dest = NULL;
+        return MHD_NO;
+      }
+      *dest = tmp_dest;
+      memcpy ((*dest) + ((*dest_size) - have), tmp, have);
+    }
+    while (0 == strm->avail_out);
+  }
   while (flush != Z_SYNC_FLUSH);
   return (Z_OK == ret) ? MHD_YES : MHD_NO;
 }
@@ -114,22 +116,23 @@ read_cb (void *cls, uint64_t pos, char *mem, size_t size)
     return MHD_CONTENT_READER_END_WITH_ERROR;
   ret = fread (src, 1, size, holder->file);
   if (ret < 0)
-    {
-      ret = MHD_CONTENT_READER_END_WITH_ERROR;
-      goto done;
-    }
+  {
+    ret = MHD_CONTENT_READER_END_WITH_ERROR;
+    goto done;
+  }
   if (0 == size)
-    {
-      ret = MHD_CONTENT_READER_END_OF_STREAM;
-      goto done;
-    }
-  if (MHD_YES != compress_buf (&holder->stream, src, ret, &offset, &buf, 
&size, holder->buf))
+  {
+    ret = MHD_CONTENT_READER_END_OF_STREAM;
+    goto done;
+  }
+  if (MHD_YES != compress_buf (&holder->stream, src, ret, &offset, &buf, &size,
+                               holder->buf))
     ret = MHD_CONTENT_READER_END_WITH_ERROR;
   else
-    {
-      memcpy (mem, buf, size);
-      ret = size;
-    }
+  {
+    memcpy (mem, buf, size);
+    ret = size;
+  }
   free (buf); /* Buf may be set even on error return. */
 done:
   free (src);
@@ -147,7 +150,8 @@ free_cb (void *cls)
 }
 
 static int
-ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const char 
*method, const char *version,
+ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const
+          char *method, const char *version,
           const char *upload_data, size_t *upload_size, void **ptr)
 {
   struct Holder *holder;
@@ -160,27 +164,29 @@ ahc_echo (void *cls, struct MHD_Connection *con, const 
char *url, const char *me
   (void) upload_data;
   (void) upload_size;
   if (NULL == *ptr)
-    {
-      *ptr = (void *) 1;
-      return MHD_YES;
-    }
+  {
+    *ptr = (void *) 1;
+    return MHD_YES;
+  }
   *ptr = NULL;
   holder = calloc (1, sizeof (struct Holder));
-  if (!holder)
+  if (! holder)
     return MHD_NO;
   holder->file = fopen (__FILE__, "rb");
   if (NULL == holder->file)
     goto file_error;
-  ret = deflateInit(&holder->stream, Z_BEST_COMPRESSION);
+  ret = deflateInit (&holder->stream, Z_BEST_COMPRESSION);
   if (ret != Z_OK)
     goto stream_error;
   holder->buf = malloc (CHUNK);
   if (NULL == holder->buf)
     goto buf_error;
-  res = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 1024, &read_cb, 
holder, &free_cb);
+  res = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 1024, &read_cb,
+                                           holder, &free_cb);
   if (NULL == res)
     goto error;
-  ret = MHD_add_response_header (res, MHD_HTTP_HEADER_CONTENT_ENCODING, 
"deflate");
+  ret = MHD_add_response_header (res, MHD_HTTP_HEADER_CONTENT_ENCODING,
+                                 "deflate");
   if (MHD_YES != ret)
     goto res_error;
   ret = MHD_add_response_header (res, MHD_HTTP_HEADER_CONTENT_TYPE, 
"text/x-c");
@@ -209,18 +215,21 @@ main (int argc, char *const *argv)
   if ((argc != 2) ||
       (1 != sscanf (argv[1], "%u", &port)) ||
       (UINT16_MAX < port))
-    {
-      fprintf (stderr, "%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, 
(uint16_t) port, NULL, NULL,
+  {
+    fprintf (stderr, "%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD,
+                        (uint16_t) port, NULL, NULL,
                         &ahc_echo, NULL,
                         MHD_OPTION_END);
   if (NULL == d)
     return 1;
   if (0 == port)
     MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT, &port);
-  fprintf (stdout, "HTTP server running at http://localhost:%u\n\nPress ENTER 
to stop the server ...\n", port);
+  fprintf (stdout,
+           "HTTP server running at http://localhost:%u\n\nPress ENTER to stop 
the server ...\n",
+           port);
   (void) getc (stdin);
   MHD_stop_daemon (d);
   return 0;
diff --git a/src/examples/http_compression.c b/src/examples/http_compression.c
index 1324fa4d..af153f6e 100644
--- a/src/examples/http_compression.c
+++ b/src/examples/http_compression.c
@@ -77,11 +77,11 @@ body_compress (void **buf,
                   *buf_size);
   if ((Z_OK != ret) ||
       (cbuf_size >= *buf_size))
-    {
-      /* compression failed */
-      free (cbuf);
-      return MHD_NO;
-    }
+  {
+    /* compression failed */
+    free (cbuf);
+    return MHD_NO;
+  }
   free (*buf);
   *buf = (void *) cbuf;
   *buf_size = (size_t) cbuf_size;
@@ -109,18 +109,18 @@ ahc_echo (void *cls,
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO; /* unexpected method */
-  if (!*ptr)
-    {
-      *ptr = (void *) 1;
-      return MHD_YES;
-    }
+  if (! *ptr)
+  {
+    *ptr = (void *) 1;
+    return MHD_YES;
+  }
   *ptr = NULL;
 
   body_str = strdup (PAGE);
   if (NULL == body_str)
-    {
-      return MHD_NO;
-    }
+  {
+    return MHD_NO;
+  }
   body_len = strlen (body_str);
   /* try to compress the body */
   comp = MHD_NO;
@@ -132,23 +132,23 @@ ahc_echo (void *cls,
                                               body_str,
                                               MHD_RESPMEM_MUST_FREE);
   if (NULL == response)
-    {
-      free (body_str);
-      return MHD_NO;
-    }
+  {
+    free (body_str);
+    return MHD_NO;
+  }
 
   if (MHD_YES == comp)
+  {
+    /* Need to indicate to client that body is compressed */
+    if (MHD_NO ==
+        MHD_add_response_header (response,
+                                 MHD_HTTP_HEADER_CONTENT_ENCODING,
+                                 "deflate"))
     {
-      /* Need to indicate to client that body is compressed */
-      if (MHD_NO ==
-          MHD_add_response_header (response,
-                                   MHD_HTTP_HEADER_CONTENT_ENCODING,
-                                   "deflate"))
-        {
-          MHD_destroy_response (response);
-          return MHD_NO;
-        }
+      MHD_destroy_response (response);
+      return MHD_NO;
     }
+  }
   ret = MHD_queue_response (connection,
                             200,
                             response);
@@ -162,11 +162,12 @@ main (int argc, char *const *argv)
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG,
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD
+                        | MHD_USE_ERROR_LOG,
                         atoi (argv[1]), NULL, NULL,
                         &ahc_echo, NULL,
                         MHD_OPTION_END);
diff --git a/src/examples/https_fileserver_example.c 
b/src/examples/https_fileserver_example.c
index 7e3e6d43..cd7aa355 100644
--- a/src/examples/https_fileserver_example.c
+++ b/src/examples/https_fileserver_example.c
@@ -43,7 +43,8 @@
 #define CAFILE "ca.pem"
 #define CRLFILE "crl.pem"
 
-#define EMPTY_PAGE "<html><head><title>File not found</title></head><body>File 
not found</body></html>"
+#define EMPTY_PAGE \
+  "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
 /* Test Certificate */
 const char cert_pem[] =
@@ -117,7 +118,7 @@ http_ahc (void *cls,
           const char *method,
           const char *version,
           const char *upload_data,
-         size_t *upload_data_size, void **ptr)
+          size_t *upload_data_size, void **ptr)
 {
   static int aptr;
   struct MHD_Response *response;
@@ -125,60 +126,60 @@ http_ahc (void *cls,
   FILE *file;
   int fd;
   struct stat buf;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
 
   file = fopen (&url[1], "rb");
   if (NULL != file)
+  {
+    fd = fileno (file);
+    if (-1 == fd)
     {
-      fd = fileno (file);
-      if (-1 == fd)
-        {
-          (void) fclose (file);
-          return MHD_NO; /* internal error */
-        }
-      if ( (0 != fstat (fd, &buf)) ||
-           (! S_ISREG (buf.st_mode)) )
-        {
-          /* not a regular file, refuse to serve */
-          fclose (file);
-          file = NULL;
-        }
+      (void) fclose (file);
+      return MHD_NO;     /* internal error */
     }
-
-  if (NULL == file)
+    if ( (0 != fstat (fd, &buf)) ||
+         (! S_ISREG (buf.st_mode)) )
     {
-      response = MHD_create_response_from_buffer (strlen (EMPTY_PAGE),
-                                                 (void *) EMPTY_PAGE,
-                                                 MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_response (connection, MHD_HTTP_NOT_FOUND, response);
-      MHD_destroy_response (response);
+      /* not a regular file, refuse to serve */
+      fclose (file);
+      file = NULL;
     }
+  }
+
+  if (NULL == file)
+  {
+    response = MHD_create_response_from_buffer (strlen (EMPTY_PAGE),
+                                                (void *) EMPTY_PAGE,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_response (connection, MHD_HTTP_NOT_FOUND, response);
+    MHD_destroy_response (response);
+  }
   else
+  {
+    response = MHD_create_response_from_callback (buf.st_size, 32 * 1024,      
 /* 32k PAGE_NOT_FOUND size */
+                                                  &file_reader, file,
+                                                  &file_free_callback);
+    if (NULL == response)
     {
-      response = MHD_create_response_from_callback (buf.st_size, 32 * 1024,    
 /* 32k PAGE_NOT_FOUND size */
-                                                    &file_reader, file,
-                                                    &file_free_callback);
-      if (NULL == response)
-       {
-         fclose (file);
-         return MHD_NO;
-       }
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-      MHD_destroy_response (response);
+      fclose (file);
+      return MHD_NO;
     }
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+  }
   return ret;
 }
 
@@ -190,22 +191,23 @@ main (int argc, char *const *argv)
   int port;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   port = atoi (argv[1]);
   if ( (1 > port) ||
        (port > UINT16_MAX) )
-    {
-      fprintf (stderr,
-               "Port must be a number between 1 and 65535\n");
-      return 1;
-    }
+  {
+    fprintf (stderr,
+             "Port must be a number between 1 and 65535\n");
+    return 1;
+  }
 
   TLS_daemon =
-    MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
-                      MHD_USE_TLS,
+    MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                      | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                      | MHD_USE_TLS,
                       (uint16_t) port,
                       NULL, NULL,
                       &http_ahc, NULL,
@@ -214,10 +216,10 @@ main (int argc, char *const *argv)
                       MHD_OPTION_HTTPS_MEM_CERT, cert_pem,
                       MHD_OPTION_END);
   if (NULL == TLS_daemon)
-    {
-      fprintf (stderr, "Error: failed to start TLS_daemon\n");
-      return 1;
-    }
+  {
+    fprintf (stderr, "Error: failed to start TLS_daemon\n");
+    return 1;
+  }
   printf ("MHD daemon listening on port %u\n",
           (unsigned int) port);
 
diff --git a/src/examples/minimal_example_comet.c 
b/src/examples/minimal_example_comet.c
index c4a3395d..53f8f666 100644
--- a/src/examples/minimal_example_comet.c
+++ b/src/examples/minimal_example_comet.c
@@ -28,8 +28,8 @@
 static ssize_t
 data_generator (void *cls, uint64_t pos, char *buf, size_t max)
 {
-  (void)cls; /* Unused. Silent compiler warning. */
-  (void)pos; /* Unused. Silent compiler warning. */
+  (void) cls; /* Unused. Silent compiler warning. */
+  (void) pos; /* Unused. Silent compiler warning. */
   if (max < 80)
     return 0;
   memset (buf, 'A', max - 1);
@@ -48,20 +48,20 @@ ahc_echo (void *cls,
   static int aptr;
   struct MHD_Response *response;
   int ret;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
   response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
                                                 80,
@@ -77,11 +77,12 @@ main (int argc, char *const *argv)
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
diff --git a/src/examples/msgs_i18n.c b/src/examples/msgs_i18n.c
index 2d8eb566..e5f92bb5 100644
--- a/src/examples/msgs_i18n.c
+++ b/src/examples/msgs_i18n.c
@@ -45,29 +45,29 @@
 
 static int
 ahc_echo (void *cls,
-         struct MHD_Connection *cnc,
-         const char *url,
-         const char *mt,
-         const char *ver,
-         const char *upd,
-         size_t *upsz,
-         void **ptr)
-{  
+          struct MHD_Connection *cnc,
+          const char *url,
+          const char *mt,
+          const char *ver,
+          const char *upd,
+          size_t *upsz,
+          void **ptr)
+{
   return MHD_NO;
 }
 
 
 static void
 error_handler (void *cls,
-              const char *fm,
-              va_list ap)
+               const char *fm,
+               va_list ap)
 {
   /* Here we do the translation using GNU gettext.
      As the error message is from libmicrohttpd, we specify
      "libmicrohttpd" as the translation domain here. */
   vprintf (dgettext ("libmicrohttpd",
-                    fm),
-         ap);
+                     fm),
+           ap);
 }
 
 
@@ -75,21 +75,22 @@ int
 main (int argc,
       char **argv)
 {
-  setlocale(LC_ALL, "");
+  setlocale (LC_ALL, "");
 
-  /* The example uses PO files in the directory 
+  /* The example uses PO files in the directory
      "libmicrohttpd/src/examples/locale".  This
      needs to be adapted to match
      where the MHD PO files are installed. */
   bindtextdomain ("libmicrohttpd",
-                 "locale");
-  MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_FEATURE_MESSAGES | 
MHD_USE_ERROR_LOG,
-                   8080,
-                   NULL, NULL,
-                   &ahc_echo, NULL,
-                   MHD_OPTION_EXTERNAL_LOGGER, &error_handler, NULL,
-                   99999 /* invalid option, to raise the error 
-                            "Invalid option ..." which we are going 
-                            to translate */);
+                  "locale");
+  MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_FEATURE_MESSAGES
+                    | MHD_USE_ERROR_LOG,
+                    8080,
+                    NULL, NULL,
+                    &ahc_echo, NULL,
+                    MHD_OPTION_EXTERNAL_LOGGER, &error_handler, NULL,
+                    99999 /* invalid option, to raise the error
+           "Invalid option ..." which we are going
+           to translate */);
   return 1; /* This program won't "succeed"... */
 }
diff --git a/src/examples/post_example.c b/src/examples/post_example.c
index 6c9a3f4b..311bf6c2 100644
--- a/src/examples/post_example.c
+++ b/src/examples/post_example.c
@@ -32,32 +32,38 @@
 /**
  * Invalid method page.
  */
-#define METHOD_ERROR "<html><head><title>Illegal 
request</title></head><body>Go away.</body></html>"
+#define METHOD_ERROR \
+  "<html><head><title>Illegal request</title></head><body>Go 
away.</body></html>"
 
 /**
  * Invalid URL page.
  */
-#define NOT_FOUND_ERROR "<html><head><title>Not found</title></head><body>Go 
away.</body></html>"
+#define NOT_FOUND_ERROR \
+  "<html><head><title>Not found</title></head><body>Go away.</body></html>"
 
 /**
  * Front page. (/)
  */
-#define MAIN_PAGE "<html><head><title>Welcome</title></head><body><form 
action=\"/2\" method=\"post\">What is your name? <input type=\"text\" 
name=\"v1\" value=\"%s\" /><input type=\"submit\" value=\"Next\" 
/></body></html>"
+#define MAIN_PAGE \
+  "<html><head><title>Welcome</title></head><body><form action=\"/2\" 
method=\"post\">What is your name? <input type=\"text\" name=\"v1\" 
value=\"%s\" /><input type=\"submit\" value=\"Next\" /></body></html>"
 
 /**
  * Second page. (/2)
  */
-#define SECOND_PAGE "<html><head><title>Tell me more</title></head><body><a 
href=\"/\">previous</a> <form action=\"/S\" method=\"post\">%s, what is your 
job? <input type=\"text\" name=\"v2\" value=\"%s\" /><input type=\"submit\" 
value=\"Next\" /></body></html>"
+#define SECOND_PAGE \
+  "<html><head><title>Tell me more</title></head><body><a 
href=\"/\">previous</a> <form action=\"/S\" method=\"post\">%s, what is your 
job? <input type=\"text\" name=\"v2\" value=\"%s\" /><input type=\"submit\" 
value=\"Next\" /></body></html>"
 
 /**
  * Second page (/S)
  */
-#define SUBMIT_PAGE "<html><head><title>Ready to 
submit?</title></head><body><form action=\"/F\" method=\"post\"><a 
href=\"/2\">previous </a> <input type=\"hidden\" name=\"DONE\" value=\"yes\" 
/><input type=\"submit\" value=\"Submit\" /></body></html>"
+#define SUBMIT_PAGE \
+  "<html><head><title>Ready to submit?</title></head><body><form action=\"/F\" 
method=\"post\"><a href=\"/2\">previous </a> <input type=\"hidden\" 
name=\"DONE\" value=\"yes\" /><input type=\"submit\" value=\"Submit\" 
/></body></html>"
 
 /**
  * Last page.
  */
-#define LAST_PAGE "<html><head><title>Thank you</title></head><body>Thank 
you.</body></html>"
+#define LAST_PAGE \
+  "<html><head><title>Thank you</title></head><body>Thank you.</body></html>"
 
 /**
  * Name of our cookie.
@@ -150,40 +156,40 @@ get_session (struct MHD_Connection *connection)
   const char *cookie;
 
   cookie = MHD_lookup_connection_value (connection,
-                                       MHD_COOKIE_KIND,
-                                       COOKIE_NAME);
+                                        MHD_COOKIE_KIND,
+                                        COOKIE_NAME);
   if (cookie != NULL)
+  {
+    /* find existing session */
+    ret = sessions;
+    while (NULL != ret)
+    {
+      if (0 == strcmp (cookie, ret->sid))
+        break;
+      ret = ret->next;
+    }
+    if (NULL != ret)
     {
-      /* find existing session */
-      ret = sessions;
-      while (NULL != ret)
-       {
-         if (0 == strcmp (cookie, ret->sid))
-           break;
-         ret = ret->next;
-       }
-      if (NULL != ret)
-       {
-         ret->rc++;
-         return ret;
-       }
+      ret->rc++;
+      return ret;
     }
+  }
   /* create fresh session */
   ret = calloc (1, sizeof (struct Session));
   if (NULL == ret)
-    {
-      fprintf (stderr, "calloc error: %s\n", strerror (errno));
-      return NULL;
-    }
+  {
+    fprintf (stderr, "calloc error: %s\n", strerror (errno));
+    return NULL;
+  }
   /* not a super-secure way to generate a random session ID,
      but should do for a simple example... */
   snprintf (ret->sid,
-           sizeof (ret->sid),
-           "%X%X%X%X",
-           (unsigned int) rand (),
-           (unsigned int) rand (),
-           (unsigned int) rand (),
-           (unsigned int) rand ());
+            sizeof (ret->sid),
+            "%X%X%X%X",
+            (unsigned int) rand (),
+            (unsigned int) rand (),
+            (unsigned int) rand (),
+            (unsigned int) rand ());
   ret->rc++;
   ret->start = time (NULL);
   ret->next = sessions;
@@ -202,9 +208,9 @@ get_session (struct MHD_Connection *connection)
  * @param MHD_YES on success, MHD_NO on failure
  */
 typedef int (*PageHandler)(const void *cls,
-                          const char *mime,
-                          struct Session *session,
-                          struct MHD_Connection *connection);
+                           const char *mime,
+                           struct Session *session,
+                           struct MHD_Connection *connection);
 
 
 /**
@@ -242,22 +248,22 @@ struct Page
  */
 static void
 add_session_cookie (struct Session *session,
-                   struct MHD_Response *response)
+                    struct MHD_Response *response)
 {
   char cstr[256];
   snprintf (cstr,
-           sizeof (cstr),
-           "%s=%s",
-           COOKIE_NAME,
-           session->sid);
+            sizeof (cstr),
+            "%s=%s",
+            COOKIE_NAME,
+            session->sid);
   if (MHD_NO ==
       MHD_add_response_header (response,
-                              MHD_HTTP_HEADER_SET_COOKIE,
-                              cstr))
-    {
-      fprintf (stderr,
-              "Failed to set session cookie header!\n");
-    }
+                               MHD_HTTP_HEADER_SET_COOKIE,
+                               cstr))
+  {
+    fprintf (stderr,
+             "Failed to set session cookie header!\n");
+  }
 }
 
 
@@ -272,9 +278,9 @@ add_session_cookie (struct Session *session,
  */
 static int
 serve_simple_form (const void *cls,
-                  const char *mime,
-                  struct Session *session,
-                  struct MHD_Connection *connection)
+                   const char *mime,
+                   struct Session *session,
+                   struct MHD_Connection *connection)
 {
   int ret;
   const char *form = cls;
@@ -282,17 +288,17 @@ serve_simple_form (const void *cls,
 
   /* return static form */
   response = MHD_create_response_from_buffer (strlen (form),
-                                             (void *) form,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) form,
+                                              MHD_RESPMEM_PERSISTENT);
   if (NULL == response)
     return MHD_NO;
   add_session_cookie (session, response);
   MHD_add_response_header (response,
-                          MHD_HTTP_HEADER_CONTENT_ENCODING,
-                          mime);
+                           MHD_HTTP_HEADER_CONTENT_ENCODING,
+                           mime);
   ret = MHD_queue_response (connection,
-                           MHD_HTTP_OK,
-                           response);
+                            MHD_HTTP_OK,
+                            response);
   MHD_destroy_response (response);
   return ret;
 }
@@ -308,28 +314,28 @@ serve_simple_form (const void *cls,
  */
 static int
 fill_v1_form (const void *cls,
-             const char *mime,
-             struct Session *session,
-             struct MHD_Connection *connection)
+              const char *mime,
+              struct Session *session,
+              struct MHD_Connection *connection)
 {
   int ret;
   size_t slen;
   char *reply;
   struct MHD_Response *response;
-  (void)cls; /* Unused. Silent compiler warning. */
+  (void) cls; /* Unused. Silent compiler warning. */
 
   slen = strlen (MAIN_PAGE) + strlen (session->value_1);
   reply = malloc (slen + 1);
   if (NULL == reply)
     return MHD_NO;
   snprintf (reply,
-           slen + 1,
-           MAIN_PAGE,
-           session->value_1);
+            slen + 1,
+            MAIN_PAGE,
+            session->value_1);
   /* return static form */
   response = MHD_create_response_from_buffer (slen,
-                                             (void *) reply,
-                                             MHD_RESPMEM_MUST_FREE);
+                                              (void *) reply,
+                                              MHD_RESPMEM_MUST_FREE);
   if (NULL == response)
   {
     free (reply);
@@ -337,11 +343,11 @@ fill_v1_form (const void *cls,
   }
   add_session_cookie (session, response);
   MHD_add_response_header (response,
-                          MHD_HTTP_HEADER_CONTENT_ENCODING,
-                          mime);
+                           MHD_HTTP_HEADER_CONTENT_ENCODING,
+                           mime);
   ret = MHD_queue_response (connection,
-                           MHD_HTTP_OK,
-                           response);
+                            MHD_HTTP_OK,
+                            response);
   MHD_destroy_response (response);
   return ret;
 }
@@ -357,29 +363,30 @@ fill_v1_form (const void *cls,
  */
 static int
 fill_v1_v2_form (const void *cls,
-                const char *mime,
-                struct Session *session,
-                struct MHD_Connection *connection)
+                 const char *mime,
+                 struct Session *session,
+                 struct MHD_Connection *connection)
 {
   int ret;
   char *reply;
   struct MHD_Response *response;
   size_t slen;
-  (void)cls; /* Unused. Silent compiler warning. */
+  (void) cls; /* Unused. Silent compiler warning. */
 
-  slen = strlen (SECOND_PAGE) + strlen (session->value_1) + strlen 
(session->value_2);
+  slen = strlen (SECOND_PAGE) + strlen (session->value_1) + strlen (
+    session->value_2);
   reply = malloc (slen + 1);
   if (NULL == reply)
     return MHD_NO;
   snprintf (reply,
-           slen + 1,
-           SECOND_PAGE,
-           session->value_1,
+            slen + 1,
+            SECOND_PAGE,
+            session->value_1,
             session->value_2);
   /* return static form */
   response = MHD_create_response_from_buffer (slen,
-                                             (void *) reply,
-                                             MHD_RESPMEM_MUST_FREE);
+                                              (void *) reply,
+                                              MHD_RESPMEM_MUST_FREE);
   if (NULL == response)
   {
     free (reply);
@@ -387,11 +394,11 @@ fill_v1_v2_form (const void *cls,
   }
   add_session_cookie (session, response);
   MHD_add_response_header (response,
-                          MHD_HTTP_HEADER_CONTENT_ENCODING,
-                          mime);
+                           MHD_HTTP_HEADER_CONTENT_ENCODING,
+                           mime);
   ret = MHD_queue_response (connection,
-                           MHD_HTTP_OK,
-                           response);
+                            MHD_HTTP_OK,
+                            response);
   MHD_destroy_response (response);
   return ret;
 }
@@ -407,27 +414,27 @@ fill_v1_v2_form (const void *cls,
  */
 static int
 not_found_page (const void *cls,
-               const char *mime,
-               struct Session *session,
-               struct MHD_Connection *connection)
+                const char *mime,
+                struct Session *session,
+                struct MHD_Connection *connection)
 {
   int ret;
   struct MHD_Response *response;
-  (void)cls;     /* Unused. Silent compiler warning. */
-  (void)session; /* Unused. Silent compiler warning. */
+  (void) cls;     /* Unused. Silent compiler warning. */
+  (void) session; /* Unused. Silent compiler warning. */
 
   /* unsupported HTTP method */
   response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR),
-                                             (void *) NOT_FOUND_ERROR,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) NOT_FOUND_ERROR,
+                                              MHD_RESPMEM_PERSISTENT);
   if (NULL == response)
     return MHD_NO;
   ret = MHD_queue_response (connection,
-                           MHD_HTTP_NOT_FOUND,
-                           response);
+                            MHD_HTTP_NOT_FOUND,
+                            response);
   MHD_add_response_header (response,
-                          MHD_HTTP_HEADER_CONTENT_ENCODING,
-                          mime);
+                           MHD_HTTP_HEADER_CONTENT_ENCODING,
+                           mime);
   MHD_destroy_response (response);
   return ret;
 }
@@ -436,14 +443,13 @@ not_found_page (const void *cls,
 /**
  * List of all pages served by this HTTP server.
  */
-static struct Page pages[] =
-  {
-    { "/", "text/html",  &fill_v1_form, NULL },
-    { "/2", "text/html", &fill_v1_v2_form, NULL },
-    { "/S", "text/html", &serve_simple_form, SUBMIT_PAGE },
-    { "/F", "text/html", &serve_simple_form, LAST_PAGE },
-    { NULL, NULL, &not_found_page, NULL } /* 404 */
-  };
+static struct Page pages[] = {
+  { "/", "text/html",  &fill_v1_form, NULL },
+  { "/2", "text/html", &fill_v1_v2_form, NULL },
+  { "/S", "text/html", &serve_simple_form, SUBMIT_PAGE },
+  { "/F", "text/html", &serve_simple_form, LAST_PAGE },
+  { NULL, NULL, &not_found_page, NULL }   /* 404 */
+};
 
 
 
@@ -468,49 +474,49 @@ static struct Page pages[] =
  */
 static int
 post_iterator (void *cls,
-              enum MHD_ValueKind kind,
-              const char *key,
-              const char *filename,
-              const char *content_type,
-              const char *transfer_encoding,
-              const char *data, uint64_t off, size_t size)
+               enum MHD_ValueKind kind,
+               const char *key,
+               const char *filename,
+               const char *content_type,
+               const char *transfer_encoding,
+               const char *data, uint64_t off, size_t size)
 {
   struct Request *request = cls;
   struct Session *session = request->session;
-  (void)kind;              /* Unused. Silent compiler warning. */
-  (void)filename;          /* Unused. Silent compiler warning. */
-  (void)content_type;      /* Unused. Silent compiler warning. */
-  (void)transfer_encoding; /* Unused. Silent compiler warning. */
+  (void) kind;              /* Unused. Silent compiler warning. */
+  (void) filename;          /* Unused. Silent compiler warning. */
+  (void) content_type;      /* Unused. Silent compiler warning. */
+  (void) transfer_encoding; /* Unused. Silent compiler warning. */
 
   if (0 == strcmp ("DONE", key))
-    {
-      fprintf (stdout,
-              "Session `%s' submitted `%s', `%s'\n",
-              session->sid,
-              session->value_1,
-              session->value_2);
-      return MHD_YES;
-    }
+  {
+    fprintf (stdout,
+             "Session `%s' submitted `%s', `%s'\n",
+             session->sid,
+             session->value_1,
+             session->value_2);
+    return MHD_YES;
+  }
   if (0 == strcmp ("v1", key))
-    {
-      if (size + off >= sizeof(session->value_1))
-       size = sizeof (session->value_1) - off - 1;
-      memcpy (&session->value_1[off],
-             data,
-             size);
-      session->value_1[size+off] = '\0';
-      return MHD_YES;
-    }
+  {
+    if (size + off >= sizeof(session->value_1))
+      size = sizeof (session->value_1) - off - 1;
+    memcpy (&session->value_1[off],
+            data,
+            size);
+    session->value_1[size + off] = '\0';
+    return MHD_YES;
+  }
   if (0 == strcmp ("v2", key))
-    {
-      if (size + off >= sizeof(session->value_2))
-       size = sizeof (session->value_2) - off - 1;
-      memcpy (&session->value_2[off],
-             data,
-             size);
-      session->value_2[size+off] = '\0';
-      return MHD_YES;
-    }
+  {
+    if (size + off >= sizeof(session->value_2))
+      size = sizeof (session->value_2) - off - 1;
+    memcpy (&session->value_2[off],
+            data,
+            size);
+    session->value_2[size + off] = '\0';
+    return MHD_YES;
+  }
   fprintf (stderr,
            "Unsupported form value `%s'\n",
            key);
@@ -553,99 +559,99 @@ post_iterator (void *cls,
  */
 static int
 create_response (void *cls,
-                struct MHD_Connection *connection,
-                const char *url,
-                const char *method,
-                const char *version,
-                const char *upload_data,
-                size_t *upload_data_size,
-                void **ptr)
+                 struct MHD_Connection *connection,
+                 const char *url,
+                 const char *method,
+                 const char *version,
+                 const char *upload_data,
+                 size_t *upload_data_size,
+                 void **ptr)
 {
   struct MHD_Response *response;
   struct Request *request;
   struct Session *session;
   int ret;
   unsigned int i;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
 
   request = *ptr;
   if (NULL == request)
+  {
+    request = calloc (1, sizeof (struct Request));
+    if (NULL == request)
     {
-      request = calloc (1, sizeof (struct Request));
-      if (NULL == request)
-       {
-         fprintf (stderr, "calloc error: %s\n", strerror (errno));
-         return MHD_NO;
-       }
-      *ptr = request;
-      if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
-       {
-         request->pp = MHD_create_post_processor (connection, 1024,
-                                                  &post_iterator, request);
-         if (NULL == request->pp)
-           {
-             fprintf (stderr, "Failed to setup post processor for `%s'\n",
-                      url);
-             return MHD_NO; /* internal error */
-           }
-       }
-      return MHD_YES;
+      fprintf (stderr, "calloc error: %s\n", strerror (errno));
+      return MHD_NO;
     }
+    *ptr = request;
+    if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
+    {
+      request->pp = MHD_create_post_processor (connection, 1024,
+                                               &post_iterator, request);
+      if (NULL == request->pp)
+      {
+        fprintf (stderr, "Failed to setup post processor for `%s'\n",
+                 url);
+        return MHD_NO; /* internal error */
+      }
+    }
+    return MHD_YES;
+  }
   if (NULL == request->session)
+  {
+    request->session = get_session (connection);
+    if (NULL == request->session)
     {
-      request->session = get_session (connection);
-      if (NULL == request->session)
-       {
-         fprintf (stderr, "Failed to setup session for `%s'\n",
-                  url);
-         return MHD_NO; /* internal error */
-       }
+      fprintf (stderr, "Failed to setup session for `%s'\n",
+               url);
+      return MHD_NO; /* internal error */
     }
+  }
   session = request->session;
   session->start = time (NULL);
   if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
+  {
+    /* evaluate POST data */
+    MHD_post_process (request->pp,
+                      upload_data,
+                      *upload_data_size);
+    if (0 != *upload_data_size)
     {
-      /* evaluate POST data */
-      MHD_post_process (request->pp,
-                       upload_data,
-                       *upload_data_size);
-      if (0 != *upload_data_size)
-       {
-         *upload_data_size = 0;
-         return MHD_YES;
-       }
-      /* done with POST data, serve response */
-      MHD_destroy_post_processor (request->pp);
-      request->pp = NULL;
-      method = MHD_HTTP_METHOD_GET; /* fake 'GET' */
-      if (NULL != request->post_url)
-       url = request->post_url;
+      *upload_data_size = 0;
+      return MHD_YES;
     }
+    /* done with POST data, serve response */
+    MHD_destroy_post_processor (request->pp);
+    request->pp = NULL;
+    method = MHD_HTTP_METHOD_GET;   /* fake 'GET' */
+    if (NULL != request->post_url)
+      url = request->post_url;
+  }
 
   if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) ||
        (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) )
-    {
-      /* find out which page to serve */
-      i=0;
-      while ( (pages[i].url != NULL) &&
-             (0 != strcmp (pages[i].url, url)) )
-       i++;
-      ret = pages[i].handler (pages[i].handler_cls,
-                             pages[i].mime,
-                             session, connection);
-      if (ret != MHD_YES)
-       fprintf (stderr, "Failed to create page for `%s'\n",
-                url);
-      return ret;
-    }
+  {
+    /* find out which page to serve */
+    i = 0;
+    while ( (pages[i].url != NULL) &&
+            (0 != strcmp (pages[i].url, url)) )
+      i++;
+    ret = pages[i].handler (pages[i].handler_cls,
+                            pages[i].mime,
+                            session, connection);
+    if (ret != MHD_YES)
+      fprintf (stderr, "Failed to create page for `%s'\n",
+               url);
+    return ret;
+  }
   /* unsupported HTTP method */
   response = MHD_create_response_from_buffer (strlen (METHOD_ERROR),
-                                             (void *) METHOD_ERROR,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) METHOD_ERROR,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection,
-                           MHD_HTTP_NOT_ACCEPTABLE,
-                           response);
+                            MHD_HTTP_NOT_ACCEPTABLE,
+                            response);
   MHD_destroy_response (response);
   return ret;
 }
@@ -662,14 +668,14 @@ create_response (void *cls,
  */
 static void
 request_completed_callback (void *cls,
-                           struct MHD_Connection *connection,
-                           void **con_cls,
-                           enum MHD_RequestTerminationCode toe)
+                            struct MHD_Connection *connection,
+                            void **con_cls,
+                            enum MHD_RequestTerminationCode toe)
 {
   struct Request *request = *con_cls;
-  (void)cls;         /* Unused. Silent compiler warning. */
-  (void)connection;  /* Unused. Silent compiler warning. */
-  (void)toe;         /* Unused. Silent compiler warning. */
+  (void) cls;         /* Unused. Silent compiler warning. */
+  (void) connection;  /* Unused. Silent compiler warning. */
+  (void) toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == request)
     return;
@@ -697,21 +703,21 @@ expire_sessions ()
   prev = NULL;
   pos = sessions;
   while (NULL != pos)
+  {
+    next = pos->next;
+    if (now - pos->start > 60 * 60)
     {
-      next = pos->next;
-      if (now - pos->start > 60 * 60)
-       {
-         /* expire sessions after 1h */
-         if (NULL == prev)
-           sessions = pos->next;
-         else
-           prev->next = next;
-         free (pos);
-       }
+      /* expire sessions after 1h */
+      if (NULL == prev)
+        sessions = pos->next;
       else
-        prev = pos;
-      pos = next;
+        prev->next = next;
+      free (pos);
     }
+    else
+      prev = pos;
+    pos = next;
+  }
 }
 
 
@@ -732,45 +738,46 @@ main (int argc, char *const *argv)
   MHD_UNSIGNED_LONG_LONG mhd_timeout;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   /* initialize PRNG */
   srand ((unsigned int) time (NULL));
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL,
-                       &create_response, NULL,
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 15,
-                       MHD_OPTION_NOTIFY_COMPLETED, 
&request_completed_callback, NULL,
-                       MHD_OPTION_END);
+                        &create_response, NULL,
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 15,
+                        MHD_OPTION_NOTIFY_COMPLETED,
+                        &request_completed_callback, NULL,
+                        MHD_OPTION_END);
   if (NULL == d)
     return 1;
   while (1)
+  {
+    expire_sessions ();
+    max = 0;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      break; /* fatal internal error */
+    if (MHD_get_timeout (d, &mhd_timeout) == MHD_YES)
     {
-      expire_sessions ();
-      max = 0;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-       break; /* fatal internal error */
-      if (MHD_get_timeout (d, &mhd_timeout) == MHD_YES)
-       {
-         tv.tv_sec = mhd_timeout / 1000;
-         tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000)) * 1000;
-         tvp = &tv;
-       }
-      else
-       tvp = NULL;
-      if (-1 == select (max + 1, &rs, &ws, &es, tvp))
-        {
-          if (EINTR != errno)
-            abort ();
-        }
-      MHD_run (d);
+      tv.tv_sec = mhd_timeout / 1000;
+      tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000)) * 1000;
+      tvp = &tv;
     }
+    else
+      tvp = NULL;
+    if (-1 == select (max + 1, &rs, &ws, &es, tvp))
+    {
+      if (EINTR != errno)
+        abort ();
+    }
+    MHD_run (d);
+  }
   MHD_stop_daemon (d);
   return 0;
 }
diff --git a/src/examples/querystring_example.c 
b/src/examples/querystring_example.c
index db0d6f1a..a8f0f572 100644
--- a/src/examples/querystring_example.c
+++ b/src/examples/querystring_example.c
@@ -26,7 +26,8 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-#define PAGE "<html><head><title>libmicrohttpd demo</title></head><body>Query 
string for &quot;%s&quot; was &quot;%s&quot;</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Query string for 
&quot;%s&quot; was &quot;%s&quot;</body></html>"
 
 static int
 ahc_echo (void *cls,
@@ -42,19 +43,19 @@ ahc_echo (void *cls,
   char *me;
   struct MHD_Response *response;
   int ret;
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
   val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q");
   me = malloc (snprintf (NULL, 0, fmt, "q", val) + 1);
@@ -62,12 +63,12 @@ ahc_echo (void *cls,
     return MHD_NO;
   sprintf (me, fmt, "q", val);
   response = MHD_create_response_from_buffer (strlen (me), me,
-                                             MHD_RESPMEM_MUST_FREE);
+                                              MHD_RESPMEM_MUST_FREE);
   if (response == NULL)
-    {
-      free (me);
-      return MHD_NO;
-    }
+  {
+    free (me);
+    return MHD_NO;
+  }
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -80,18 +81,19 @@ main (int argc, char *const *argv)
   int port;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   port = atoi (argv[1]);
   if ( (port < 0) ||
        (port > UINT16_MAX) )
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         (uint16_t) port,
                         NULL, NULL, &ahc_echo, PAGE, MHD_OPTION_END);
   if (NULL == d)
diff --git a/src/examples/refuse_post_example.c 
b/src/examples/refuse_post_example.c
index dad3beb1..9241ce43 100644
--- a/src/examples/refuse_post_example.c
+++ b/src/examples/refuse_post_example.c
@@ -24,14 +24,16 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-const char *askpage = "<html><body>\n\
+const char *askpage =
+  "<html><body>\n\
                        Upload a file, please!<br>\n\
                        <form action=\"/filepost\" method=\"post\" 
enctype=\"multipart/form-data\">\n\
                        <input name=\"file\" type=\"file\">\n\
                        <input type=\"submit\" value=\" Send \"></form>\n\
                        </body></html>";
 
-#define BUSYPAGE "<html><head><title>Webserver busy</title></head><body>We are 
too busy to process POSTs right now.</body></html>"
+#define BUSYPAGE \
+  "<html><head><title>Webserver busy</title></head><body>We are too busy to 
process POSTs right now.</body></html>"
 
 static int
 ahc_echo (void *cls,
@@ -45,37 +47,37 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST")))
     return MHD_NO;              /* unexpected method */
 
   if (&aptr != *ptr)
-    {
-      *ptr = &aptr;
+  {
+    *ptr = &aptr;
 
-      /* always to busy for POST requests */
-      if (0 == strcmp (method, "POST"))
-        {
-          response = MHD_create_response_from_buffer (strlen (BUSYPAGE),
-                                                     (void *) BUSYPAGE, 
-                                                     MHD_RESPMEM_PERSISTENT);
-          ret =
-            MHD_queue_response (connection, MHD_HTTP_SERVICE_UNAVAILABLE,
-                                response);
-          MHD_destroy_response (response);
-          return ret;
-        }
+    /* always to busy for POST requests */
+    if (0 == strcmp (method, "POST"))
+    {
+      response = MHD_create_response_from_buffer (strlen (BUSYPAGE),
+                                                  (void *) BUSYPAGE,
+                                                  MHD_RESPMEM_PERSISTENT);
+      ret =
+        MHD_queue_response (connection, MHD_HTTP_SERVICE_UNAVAILABLE,
+                            response);
+      MHD_destroy_response (response);
+      return ret;
     }
+  }
 
   *ptr = NULL;                  /* reset when done */
   response = MHD_create_response_from_buffer (strlen (me),
-                                             (void *) me,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) me,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -87,11 +89,12 @@ main (int argc, char *const *argv)
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, (void *) askpage,
                         MHD_OPTION_END);
diff --git a/src/examples/suspend_resume_epoll.c 
b/src/examples/suspend_resume_epoll.c
index 3e0be24c..a69fdc4a 100644
--- a/src/examples/suspend_resume_epoll.c
+++ b/src/examples/suspend_resume_epoll.c
@@ -31,7 +31,8 @@
 
 #define TIMEOUT_INFINITE -1
 
-struct Request {
+struct Request
+{
   struct MHD_Connection *connection;
   int timerfd;
 };
@@ -52,7 +53,7 @@ ahc_echo (void *cls,
 {
   struct MHD_Response *response;
   int ret;
-  struct Request* req;
+  struct Request*req;
   struct itimerspec ts;
 
   (void) cls;
@@ -89,29 +90,29 @@ ahc_echo (void *cls,
     return ret;
   }
   /* create timer and suspend connection */
-  req->timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
+  req->timerfd = timerfd_create (CLOCK_MONOTONIC, TFD_NONBLOCK);
   if (-1 == req->timerfd)
-    {
-      printf("timerfd_create: %s", strerror(errno));
-      return MHD_NO;
-    }
+  {
+    printf ("timerfd_create: %s", strerror (errno));
+    return MHD_NO;
+  }
   evt.events = EPOLLIN;
   evt.data.ptr = req;
-  if (-1 == epoll_ctl(epfd, EPOLL_CTL_ADD, req->timerfd, &evt))
-    {
-      printf("epoll_ctl: %s", strerror(errno));
-      return MHD_NO;
-    }
+  if (-1 == epoll_ctl (epfd, EPOLL_CTL_ADD, req->timerfd, &evt))
+  {
+    printf ("epoll_ctl: %s", strerror (errno));
+    return MHD_NO;
+  }
   ts.it_value.tv_sec = 1;
   ts.it_value.tv_nsec = 0;
   ts.it_interval.tv_sec = 0;
   ts.it_interval.tv_nsec = 0;
-  if (-1 == timerfd_settime(req->timerfd, 0, &ts, NULL))
-    {
-      printf("timerfd_settime: %s", strerror(errno));
-      return MHD_NO;
-    }
-  MHD_suspend_connection(connection);
+  if (-1 == timerfd_settime (req->timerfd, 0, &ts, NULL))
+  {
+    printf ("timerfd_settime: %s", strerror (errno));
+    return MHD_NO;
+  }
+  MHD_suspend_connection (connection);
   return MHD_YES;
 }
 
@@ -130,7 +131,7 @@ connection_done (void *cls,
   if (-1 != req->timerfd)
     if (0 != close (req->timerfd))
       abort ();
-  free(req);
+  free (req);
 }
 
 
@@ -139,17 +140,17 @@ main (int argc,
       char *const *argv)
 {
   struct MHD_Daemon *d;
-  const union MHD_DaemonInfo * info;
+  const union MHD_DaemonInfo *info;
   int current_event_count;
   struct epoll_event events_list[1];
   struct Request *req;
   uint64_t timer_expirations;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
   d = MHD_start_daemon (MHD_USE_EPOLL | MHD_ALLOW_SUSPEND_RESUME,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, NULL,
@@ -158,17 +159,17 @@ main (int argc,
   if (d == NULL)
     return 1;
 
-  info = MHD_get_daemon_info(d, MHD_DAEMON_INFO_EPOLL_FD);
+  info = MHD_get_daemon_info (d, MHD_DAEMON_INFO_EPOLL_FD);
   if (info == NULL)
     return 1;
 
-  epfd = epoll_create1(EPOLL_CLOEXEC);
+  epfd = epoll_create1 (EPOLL_CLOEXEC);
   if (-1 == epfd)
     return 1;
 
   evt.events = EPOLLIN;
   evt.data.ptr = NULL;
-  if (-1 == epoll_ctl(epfd, EPOLL_CTL_ADD, info->epoll_fd, &evt))
+  if (-1 == epoll_ctl (epfd, EPOLL_CTL_ADD, info->epoll_fd, &evt))
     return 1;
 
   while (1)
@@ -182,7 +183,7 @@ main (int argc,
       timeout = TIMEOUT_INFINITE;
     else
       timeout = (to < INT_MAX - 1) ? (int) to : (INT_MAX - 1);
-    current_event_count = epoll_wait(epfd, events_list, 1, timeout);
+    current_event_count = epoll_wait (epfd, events_list, 1, timeout);
 
     if (1 == current_event_count)
     {
@@ -191,12 +192,13 @@ main (int argc,
         /*  A timer has timed out */
         req = events_list[0].data.ptr;
         /* read from the fd so the system knows we heard the notice */
-        if (-1 == read(req->timerfd, &timer_expirations, 
sizeof(timer_expirations)))
+        if (-1 == read (req->timerfd, &timer_expirations,
+                        sizeof(timer_expirations)))
         {
           return 1;
         }
         /*  Now resume the connection */
-        MHD_resume_connection(req->connection);
+        MHD_resume_connection (req->connection);
       }
     }
     else if (0 == current_event_count)
@@ -208,7 +210,7 @@ main (int argc,
       /* error */
       return 1;
     }
-    if (! MHD_run(d))
+    if (! MHD_run (d))
       return 1;
   }
 
diff --git a/src/examples/timeout.c b/src/examples/timeout.c
index 91de1599..cfb66950 100644
--- a/src/examples/timeout.c
+++ b/src/examples/timeout.c
@@ -30,27 +30,27 @@
 #define PORT 8080
 
 static int
-answer_to_connection(void *cls,
-                     struct MHD_Connection *connection,
-                     const char *url,
-                     const char *method,
-                     const char *version,
-                     const char *upload_data,
-                     size_t *upload_data_size,
-                     void **con_cls)
+answer_to_connection (void *cls,
+                      struct MHD_Connection *connection,
+                      const char *url,
+                      const char *method,
+                      const char *version,
+                      const char *upload_data,
+                      size_t *upload_data_size,
+                      void **con_cls)
 {
   const char *page = "<html><body>Hello timeout!</body></html>";
   struct MHD_Response *response;
   int ret;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)method;            /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
-  (void)con_cls;           /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) method;            /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) con_cls;           /* Unused. Silent compiler warning. */
 
-  response = MHD_create_response_from_buffer (strlen(page),
+  response = MHD_create_response_from_buffer (strlen (page),
                                               (void *) page,
                                               MHD_RESPMEM_PERSISTENT);
   MHD_add_response_header (response,
@@ -59,7 +59,7 @@ answer_to_connection(void *cls,
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
                             response);
-  MHD_destroy_response(response);
+  MHD_destroy_response (response);
   return ret;
 }
 
@@ -69,7 +69,8 @@ main (void)
 {
   struct MHD_Daemon *daemon;
 
-  daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD,
+  daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                             | MHD_USE_INTERNAL_POLLING_THREAD,
                              PORT,
                              NULL, NULL,
                              &answer_to_connection, NULL,
@@ -78,7 +79,7 @@ main (void)
                              MHD_OPTION_END);
   if (NULL == daemon)
     return 1;
-  (void) getchar();
+  (void) getchar ();
   MHD_stop_daemon (daemon);
   return 0;
 }
diff --git a/src/examples/upgrade_example.c b/src/examples/upgrade_example.c
index 35761c97..98675e09 100644
--- a/src/examples/upgrade_example.c
+++ b/src/examples/upgrade_example.c
@@ -32,7 +32,8 @@
 #include <microhttpd.h>
 #include <pthread.h>
 
-#define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd 
demo</body></html>"
 
 
 /**
@@ -72,23 +73,23 @@ send_all (MHD_socket sock,
 
   make_blocking (sock);
   for (off = 0; off < len; off += ret)
+  {
+    ret = send (sock,
+                &buf[off],
+                len - off,
+                0);
+    if (0 > ret)
     {
-      ret = send (sock,
-                  &buf[off],
-                  len - off,
-                  0);
-      if (0 > ret)
-        {
-          if (EAGAIN == errno)
-            {
-              ret = 0;
-              continue;
-            }
-          break;
-        }
-      if (0 == ret)
-        break;
+      if (EAGAIN == errno)
+      {
+        ret = 0;
+        continue;
+      }
+      break;
     }
+    if (0 == ret)
+      break;
+  }
 }
 
 
@@ -118,25 +119,25 @@ run_usock (void *cls)
   make_blocking (md->sock);
   /* start by sending extra data MHD may have already read, if any */
   if (0 != md->extra_in_size)
-    {
-      send_all (md->sock,
-                md->extra_in,
-                md->extra_in_size);
-      free (md->extra_in);
-    }
+  {
+    send_all (md->sock,
+              md->extra_in,
+              md->extra_in_size);
+    free (md->extra_in);
+  }
   /* now echo in a loop */
   while (1)
-    {
-      got = recv (md->sock,
-                  buf,
-                  sizeof (buf),
-                  0);
-      if (0 >= got)
-        break;
-      send_all (md->sock,
+  {
+    got = recv (md->sock,
                 buf,
-                got);
-    }
+                sizeof (buf),
+                0);
+    if (0 >= got)
+      break;
+    send_all (md->sock,
+              buf,
+              got);
+  }
   free (md);
   MHD_upgrade_action (urh,
                       MHD_UPGRADE_ACTION_CLOSE);
@@ -202,23 +203,23 @@ uh_cb (void *cls,
 {
   struct MyData *md;
   pthread_t pt;
-  (void)cls;         /* Unused. Silent compiler warning. */
-  (void)connection;  /* Unused. Silent compiler warning. */
-  (void)con_cls;     /* Unused. Silent compiler warning. */
+  (void) cls;         /* Unused. Silent compiler warning. */
+  (void) connection;  /* Unused. Silent compiler warning. */
+  (void) con_cls;     /* Unused. Silent compiler warning. */
 
   md = malloc (sizeof (struct MyData));
   if (NULL == md)
     abort ();
   memset (md, 0, sizeof (struct MyData));
   if (0 != extra_in_size)
-    {
-      md->extra_in = malloc (extra_in_size);
-      if (NULL == md->extra_in)
-        abort ();
-      memcpy (md->extra_in,
-              extra_in,
-              extra_in_size);
-    }
+  {
+    md->extra_in = malloc (extra_in_size);
+    if (NULL == md->extra_in)
+      abort ();
+    memcpy (md->extra_in,
+            extra_in,
+            extra_in_size);
+  }
   md->extra_in_size = extra_in_size;
   md->sock = sock;
   md->urh = urh;
@@ -252,20 +253,20 @@ ahc_echo (void *cls,
   static int aptr;
   struct MHD_Response *response;
   int ret;
-  (void)cls;               /* Unused. Silent compiler warning. */
-  (void)url;               /* Unused. Silent compiler warning. */
-  (void)version;           /* Unused. Silent compiler warning. */
-  (void)upload_data;       /* Unused. Silent compiler warning. */
-  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void) cls;               /* Unused. Silent compiler warning. */
+  (void) url;               /* Unused. Silent compiler warning. */
+  (void) version;           /* Unused. Silent compiler warning. */
+  (void) upload_data;       /* Unused. Silent compiler warning. */
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
   response = MHD_create_response_for_upgrade (&uh_cb,
                                               NULL);
@@ -288,11 +289,12 @@ main (int argc,
   struct MHD_Daemon *d;
 
   if (argc != 2)
-    {
-      printf ("%s PORT\n", argv[0]);
-      return 1;
-    }
-  d = MHD_start_daemon (MHD_ALLOW_UPGRADE | MHD_USE_AUTO | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  {
+    printf ("%s PORT\n", argv[0]);
+    return 1;
+  }
+  d = MHD_start_daemon (MHD_ALLOW_UPGRADE | MHD_USE_AUTO
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         atoi (argv[1]),
                         NULL, NULL,
                         &ahc_echo, NULL,
diff --git a/src/gnutls/check_record_pending.c 
b/src/gnutls/check_record_pending.c
index e688f2b7..2069ca0a 100644
--- a/src/gnutls/check_record_pending.c
+++ b/src/gnutls/check_record_pending.c
@@ -1,6 +1,6 @@
-  enum MHD_Bool
-  (*check_record_pending)(void *cls,
-                         struct MHD_TLS_ConnectionState *cs);
+enum MHD_Bool
+(*check_record_pending)(void *cls,
+                        struct MHD_TLS_ConnectionState *cs);
 
-see: 
+see:
 gnutls_record_check_pending (connection->tls_session)
diff --git a/src/gnutls/handshake.c b/src/gnutls/handshake.c
index 259056df..8970ad8a 100644
--- a/src/gnutls/handshake.c
+++ b/src/gnutls/handshake.c
@@ -1,15 +1,15 @@
-  enum MHD_Bool
-  (*handshake)(void *cls,
-              struct MHD_TLS_ConnectionState *cs):
+enum MHD_Bool
+(*handshake)(void *cls,
+             struct MHD_TLS_ConnectionState *cs) :
 
 
 
-    if (MHD_TLS_CONN_NO_TLS != connection->tls_state)
-    { /* HTTPS connection. */
-      if (MHD_TLS_CONN_CONNECTED > connection->tls_state)
-        {
-          if (! MHD_run_tls_handshake_ (connection))
-            return MHD_FALSE;
-        }
-    }
-    return MHD_TRUE;
+  if (MHD_TLS_CONN_NO_TLS != connection->tls_state)
+{     /* HTTPS connection. */
+  if (MHD_TLS_CONN_CONNECTED > connection->tls_state)
+  {
+    if (! MHD_run_tls_handshake_ (connection))
+      return MHD_FALSE;
+  }
+}
+return MHD_TRUE;
diff --git a/src/gnutls/idle_ready.c b/src/gnutls/idle_ready.c
index 0e315950..ddc471a9 100644
--- a/src/gnutls/idle_ready.c
+++ b/src/gnutls/idle_ready.c
@@ -1,12 +1,12 @@
-  enum MHD_Bool
-  (*idle_ready)(void *cls,
-               struct MHD_TLS_ConnectionState *cs);
+enum MHD_Bool
+(*idle_ready)(void *cls,
+              struct MHD_TLS_ConnectionState *cs);
 
 
-      if (MHD_TLS_CONN_NO_TLS != connection->tls_state)
-        { /* HTTPS connection. */
-          if ((MHD_TLS_CONN_INIT <= connection->tls_state) &&
-              (MHD_TLS_CONN_CONNECTED > connection->tls_state))
-            return false;
-        }
+if (MHD_TLS_CONN_NO_TLS != connection->tls_state)
+{         /* HTTPS connection. */
+  if ((MHD_TLS_CONN_INIT <= connection->tls_state) &&
+      (MHD_TLS_CONN_CONNECTED > connection->tls_state))
+    return false;
+}
 return true;
diff --git a/src/gnutls/init.c b/src/gnutls/init.c
index 3dd656b1..321e7e6a 100644
--- a/src/gnutls/init.c
+++ b/src/gnutls/init.c
@@ -40,12 +40,12 @@ gcry_w32_mutex_init (void **ppmtx)
 
   if (NULL == *ppmtx)
     return ENOMEM;
-  if (! MHD_mutex_init_ ((MHD_mutex_*)*ppmtx))
-    {
-      free (*ppmtx);
-      *ppmtx = NULL;
-      return EPERM;
-    }
+  if (! MHD_mutex_init_ ((MHD_mutex_*) *ppmtx))
+  {
+    free (*ppmtx);
+    *ppmtx = NULL;
+    return EPERM;
+  }
   return 0;
 }
 
@@ -53,7 +53,7 @@ gcry_w32_mutex_init (void **ppmtx)
 static int
 gcry_w32_mutex_destroy (void **ppmtx)
 {
-  int res = (MHD_mutex_destroy_ ((MHD_mutex_*)*ppmtx)) ? 0 : EINVAL;
+  int res = (MHD_mutex_destroy_ ((MHD_mutex_*) *ppmtx)) ? 0 : EINVAL;
   free (*ppmtx);
   return res;
 }
@@ -62,14 +62,14 @@ gcry_w32_mutex_destroy (void **ppmtx)
 static int
 gcry_w32_mutex_lock (void **ppmtx)
 {
-  return MHD_mutex_lock_ ((MHD_mutex_*)*ppmtx) ? 0 : EINVAL;
+  return MHD_mutex_lock_ ((MHD_mutex_*) *ppmtx) ? 0 : EINVAL;
 }
 
 
 static int
 gcry_w32_mutex_unlock (void **ppmtx)
 {
-  return MHD_mutex_unlock_ ((MHD_mutex_*)*ppmtx) ? 0 : EINVAL;
+  return MHD_mutex_unlock_ ((MHD_mutex_*) *ppmtx) ? 0 : EINVAL;
 }
 
 
@@ -77,7 +77,8 @@ static struct gcry_thread_cbs gcry_threads_w32 = {
   (GCRY_THREAD_OPTION_USER | (GCRY_THREAD_OPTION_VERSION << 8)),
   NULL, gcry_w32_mutex_init, gcry_w32_mutex_destroy,
   gcry_w32_mutex_lock, gcry_w32_mutex_unlock,
-  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
 
 #endif /* defined(MHD_W32_MUTEX_) */
 #endif /* HTTPS_SUPPORT && GCRYPT_VERSION_NUMBER < 0x010600 */
@@ -94,7 +95,7 @@ volatile int global_init_count = 0;
 /**
  * Global initialisation mutex
  */
-MHD_MUTEX_STATIC_DEFN_INIT_(global_init_mutex_);
+MHD_MUTEX_STATIC_DEFN_INIT_ (global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
 
 #endif
@@ -108,12 +109,12 @@ void
 MHD_TLS_check_global_init_ (void)
 {
 #ifdef MHD_MUTEX_STATIC_DEFN_INIT_
-  MHD_mutex_lock_chk_(&global_init_mutex_);
+  MHD_mutex_lock_chk_ (&global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
   if (0 == global_init_count++)
     MHD_init ();
 #ifdef MHD_MUTEX_STATIC_DEFN_INIT_
-  MHD_mutex_unlock_chk_(&global_init_mutex_);
+  MHD_mutex_unlock_chk_ (&global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
 }
 
@@ -133,16 +134,17 @@ MHD_TLS_init (void)
 #if defined(MHD_USE_POSIX_THREADS)
   if (0 != gcry_control (GCRYCTL_SET_THREAD_CBS,
                          &gcry_threads_pthread))
-    MHD_PANIC (_("Failed to initialise multithreading in libgcrypt\n"));
+    MHD_PANIC (_ ("Failed to initialise multithreading in libgcrypt\n"));
 #elif defined(MHD_W32_MUTEX_)
   if (0 != gcry_control (GCRYCTL_SET_THREAD_CBS,
                          &gcry_threads_w32))
-    MHD_PANIC (_("Failed to initialise multithreading in libgcrypt\n"));
+    MHD_PANIC (_ ("Failed to initialise multithreading in libgcrypt\n"));
 #endif /* defined(MHD_W32_MUTEX_) */
   gcry_check_version (NULL);
 #else
   if (NULL == gcry_check_version ("1.6.0"))
-    MHD_PANIC (_("libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 
or newer\n"));
+    MHD_PANIC (_ (
+                 "libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 
or newer\n"));
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
   gnutls_global_init ();
@@ -150,11 +152,11 @@ MHD_TLS_init (void)
 
 
 void
-MHD_TLS_fini(void)
+MHD_TLS_fini (void)
 {
   gnutls_global_deinit ();
 }
 
 #ifdef _AUTOINIT_FUNCS_ARE_SUPPORTED
-_SET_INIT_AND_DEINIT_FUNCS(MHD_TLS_init, MHD_TLS_fini);
+_SET_INIT_AND_DEINIT_FUNCS (MHD_TLS_init, MHD_TLS_fini);
 #endif /* _AUTOINIT_FUNCS_ARE_SUPPORTED */
diff --git a/src/gnutls/init.h b/src/gnutls/init.h
index 03d19412..ea5fc261 100644
--- a/src/gnutls/init.h
+++ b/src/gnutls/init.h
@@ -31,7 +31,7 @@
  * Do nothing - global initialisation is
  * performed by library constructor.
  */
-#define MHD_TLS_check_global_init_() (void)0
+#define MHD_TLS_check_global_init_() (void) 0
 #else  /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */
 /**
  * Check whether global initialisation was performed
diff --git a/src/gnutls/recv.c b/src/gnutls/recv.c
index cfa9dc4b..9c58cb62 100644
--- a/src/gnutls/recv.c
+++ b/src/gnutls/recv.c
@@ -1,5 +1,5 @@
-recv:
+recv :
 
 res = gnutls_record_recv (connection->tls_session,
-                                &urh->in_buffer[urh->in_buffer_used],
-                                buf_size);
+                          &urh->in_buffer[urh->in_buffer_used],
+                          buf_size);
diff --git a/src/gnutls/send.c b/src/gnutls/send.c
index 65cdba77..3fad99fb 100644
--- a/src/gnutls/send.c
+++ b/src/gnutls/send.c
@@ -1,11 +1,11 @@
-  ssize_t
-  (*send)(void *cls,
-         struct MHD_TLS_ConnectionState *cs,
-         const void *buf,
-         size_t buf_size);
+ssize_t
+(*send)(void *cls,
+        struct MHD_TLS_ConnectionState *cs,
+        const void *buf,
+        size_t buf_size);
 
 
 see:
-      res = gnutls_record_send (connection->tls_session,
-                                urh->out_buffer,
-                                data_size);
+res = gnutls_record_send (connection->tls_session,
+                          urh->out_buffer,
+                          data_size);
diff --git a/src/gnutls/setup_connection.c b/src/gnutls/setup_connection.c
index c789613d..64082952 100644
--- a/src/gnutls/setup_connection.c
+++ b/src/gnutls/setup_connection.c
@@ -1,57 +1,58 @@
-
-
 setup_connection ()
 {
-        connection->tls_state = MHD_TLS_CONN_INIT;
-      MHD_set_https_callbacks (connection);
-      gnutls_init (&connection->tls_session,
-                   GNUTLS_SERVER
-#if (GNUTLS_VERSION_NUMBER+0 >= 0x030402)
-                   | GNUTLS_NO_SIGNAL
+  connection->tls_state = MHD_TLS_CONN_INIT;
+  MHD_set_https_callbacks (connection);
+  gnutls_init (&connection->tls_session,
+               GNUTLS_SERVER
+#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030402)
+               | GNUTLS_NO_SIGNAL
 #endif /* GNUTLS_VERSION_NUMBER >= 0x030402 */
 #if GNUTLS_VERSION_MAJOR >= 3
-                   | GNUTLS_NONBLOCK
+               | GNUTLS_NONBLOCK
 #endif /* GNUTLS_VERSION_MAJOR >= 3*/
-                  );
-      gnutls_priority_set (connection->tls_session,
-                          daemon->priority_cache);
-      switch (daemon->cred_type)
-        {
-          /* set needed credentials for certificate authentication. */
-        case GNUTLS_CRD_CERTIFICATE:
-          gnutls_credentials_set (connection->tls_session,
-                                 GNUTLS_CRD_CERTIFICATE,
-                                 daemon->x509_cred);
-          break;
-        default:
+               );
+  gnutls_priority_set (connection->tls_session,
+                       daemon->priority_cache);
+  switch (daemon->cred_type)
+  {
+  /* set needed credentials for certificate authentication. */
+  case GNUTLS_CRD_CERTIFICATE:
+    gnutls_credentials_set (connection->tls_session,
+                            GNUTLS_CRD_CERTIFICATE,
+                            daemon->x509_cred);
+    break;
+  default:
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (connection->daemon,
-                    _("Failed to setup TLS credentials: unknown credential 
type %d\n"),
-                    daemon->cred_type);
+    MHD_DLOG (connection->daemon,
+              _ (
+                "Failed to setup TLS credentials: unknown credential type 
%d\n"),
+              daemon->cred_type);
 #endif
-          MHD_socket_close_chk_ (client_socket);
-          MHD_ip_limit_del (daemon,
-                            addr,
-                            addrlen);
-          free (connection);
-          MHD_PANIC (_("Unknown credential type"));
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
+    free (connection);
+    MHD_PANIC (_ ("Unknown credential type"));
 #if EINVAL
-         errno = EINVAL;
+    errno = EINVAL;
 #endif
-         return MHD_NO;
-        }
-#if (GNUTLS_VERSION_NUMBER+0 >= 0x030109) && !defined(_WIN64)
-      gnutls_transport_set_int (connection->tls_session, (int)(client_socket));
+    return MHD_NO;
+  }
+#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030109) && ! defined(_WIN64)
+  gnutls_transport_set_int (connection->tls_session, (int) (client_socket));
 #else  /* GnuTLS before 3.1.9 or Win x64 */
-      gnutls_transport_set_ptr (connection->tls_session, 
(gnutls_transport_ptr_t)(intptr_t)(client_socket));
+  gnutls_transport_set_ptr (connection->tls_session,
+                            (gnutls_transport_ptr_t) (intptr_t) 
(client_socket));
 #endif /* GnuTLS before 3.1.9 */
 #ifdef MHD_TLSLIB_NEED_PUSH_FUNC
-      gnutls_transport_set_push_function (connection->tls_session, 
MHD_tls_push_func_);
+  gnutls_transport_set_push_function (connection->tls_session,
+                                      MHD_tls_push_func_);
 #endif /* MHD_TLSLIB_NEED_PUSH_FUNC */
-      if (daemon->https_mem_trust)
-         gnutls_certificate_server_set_request (connection->tls_session,
-                                                GNUTLS_CERT_REQUEST);
+  if (daemon->https_mem_trust)
+    gnutls_certificate_server_set_request (connection->tls_session,
+                                           GNUTLS_CERT_REQUEST);
 #else  /* ! HTTPS_SUPPORT */
-      return NULL;
+  return NULL;
 
 }
diff --git a/src/gnutls/shutdown_connection.c b/src/gnutls/shutdown_connection.c
index be1e0bde..48db358a 100644
--- a/src/gnutls/shutdown_connection.c
+++ b/src/gnutls/shutdown_connection.c
@@ -1,5 +1,5 @@
-  enum MHD_Bool
-  (*shutdown_connection) (void *cls,
-                         struct MHD_TLS_ConnectionState *cs);
+enum MHD_Bool
+(*shutdown_connection)(void *cls,
+                       struct MHD_TLS_ConnectionState *cs);
 
-see: MHD_tls_connection_shutdown()
+see: MHD_tls_connection_shutdown ()
diff --git a/src/gnutls/strerror.c b/src/gnutls/strerror.c
index b6606661..a2333651 100644
--- a/src/gnutls/strerror.c
+++ b/src/gnutls/strerror.c
@@ -1,6 +1,6 @@
-  const char *
-  (*strerror)(void *cls,
-             int ec);
+const char *
+(*strerror)(void *cls,
+            int ec);
 
 see:
 gnutls_strerror (ec));
diff --git a/src/gnutls/update_event_loop_info.c 
b/src/gnutls/update_event_loop_info.c
index 327b20e4..3b7bc628 100644
--- a/src/gnutls/update_event_loop_info.c
+++ b/src/gnutls/update_event_loop_info.c
@@ -1,20 +1,20 @@
-  enum MHD_Bool
-  (*update_event_loop_info)(void *cls,
-                           struct MHD_TLS_ConnectionState *cs,
-                           enum MHD_RequestEventLoopInfo *eli);
+enum MHD_Bool
+(*update_event_loop_info)(void *cls,
+                          struct MHD_TLS_ConnectionState *cs,
+                          enum MHD_RequestEventLoopInfo *eli);
 
 
-      switch (connection->tls_state)
-        {
-          case MHD_TLS_CONN_INIT:
-            *eli = MHD_EVENT_LOOP_INFO_READ;
-            return true;
-          case MHD_TLS_CONN_HANDSHAKING:
-            if (0 == gnutls_record_get_direction (connection->tls_session))
-              *eli = MHD_EVENT_LOOP_INFO_READ;
-            else
-              *eli = MHD_EVENT_LOOP_INFO_WRITE;
-            return true;
-          default:
-            return false;
-        }
+switch (connection->tls_state)
+{
+case MHD_TLS_CONN_INIT:
+  *eli = MHD_EVENT_LOOP_INFO_READ;
+  return true;
+case MHD_TLS_CONN_HANDSHAKING:
+  if (0 == gnutls_record_get_direction (connection->tls_session))
+    *eli = MHD_EVENT_LOOP_INFO_READ;
+  else
+    *eli = MHD_EVENT_LOOP_INFO_WRITE;
+  return true;
+default:
+  return false;
+}
diff --git a/src/include/autoinit_funcs.h b/src/include/autoinit_funcs.h
index d925c7be..c4f3d014 100644
--- a/src/include/autoinit_funcs.h
+++ b/src/include/autoinit_funcs.h
@@ -20,7 +20,7 @@
 /*
    General usage is simple: include this header, declare or define two
    functions with zero parameters (void) and any return type: one for
-   initialization and one for deinitialization, add 
+   initialization and one for deinitialization, add
    _SET_INIT_AND_DEINIT_FUNCS(FuncInitName, FuncDeInitName) to the code
    and functions will be automatically called during application startup
    and shutdown.
@@ -70,9 +70,9 @@
 #define AUTOINIT_FUNCS_VERSION 0x01000100
 
 #if defined(__GNUC__)
- /* if possible - check for supported attribute */
+/* if possible - check for supported attribute */
 #ifdef __has_attribute
-#if !__has_attribute(constructor) || !__has_attribute(destructor)
+#if ! __has_attribute (constructor) || ! __has_attribute (destructor)
 #define _GNUC_ATTR_CONSTR_NOT_SUPPORTED 1
 #endif /* !__has_attribute(constructor) || !__has_attribute(destructor) */
 #endif /* __has_attribute */
@@ -80,20 +80,20 @@
 
 /* "_attribute__ ((constructor))" is supported by GCC, clang and
    Sun/Oracle compiler starting from version 12.1. */
-#if (defined(__GNUC__) && !defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)) || \
-    (defined(__SUNPRO_C) && __SUNPRO_C+0 >= 0x5100)
+#if (defined(__GNUC__) && ! defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)) || \
+  (defined(__SUNPRO_C) && __SUNPRO_C + 0 >= 0x5100)
 
 #define GNUC_SET_INIT_AND_DEINIT(FI,FD) \
-  void __attribute__ ((constructor)) _GNUC_init_helper_##FI(void) \
-    { (void)(FI)(); } \
-  void __attribute__ ((destructor)) _GNUC_deinit_helper_##FD(void) \
-    { (void)(FD)(); } \
-  struct _GNUC_dummy_str_##FI{int i;}
+  void __attribute__ ((constructor)) _GNUC_init_helper_ ## FI (void) \
+  { (void) (FI) (); } \
+  void __attribute__ ((destructor)) _GNUC_deinit_helper_ ## FD (void) \
+  { (void) (FD) (); } \
+  struct _GNUC_dummy_str_ ## FI {int i;}
 
-#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) GNUC_SET_INIT_AND_DEINIT(FI,FD)
+#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) GNUC_SET_INIT_AND_DEINIT (FI,FD)
 #define _AUTOINIT_FUNCS_ARE_SUPPORTED 1
 
-#elif defined (_MSC_FULL_VER) && _MSC_VER+0 >= 1600
+#elif defined (_MSC_FULL_VER) && _MSC_VER + 0 >= 1600
 
 /* Make sure that your project/sources define:
    _LIB if building a static library (_LIB is ignored if _CONSOLE is defined);
@@ -107,9 +107,9 @@
 
 /* Stringify macros */
 #define _INSTRMACRO(a) #a
-#define _STRMACRO(a) _INSTRMACRO(a)
+#define _STRMACRO(a) _INSTRMACRO (a)
 
-#if !defined(_USRDLL) || defined(AUTOINIT_FUNCS_DECLARE_STATIC_REG)
+#if ! defined(_USRDLL) || defined(AUTOINIT_FUNCS_DECLARE_STATIC_REG)
 
 /* required for atexit() */
 #include <stdlib.h>
@@ -128,15 +128,16 @@
 #define W32_VARDECORPEFIXSTR ""
 #elif defined(_M_IX86) || defined(_X86_)
 #define W32_VARDECORPREFIX _
-#define W32_DECORVARNAME(v) _##v
+#define W32_DECORVARNAME(v) _ ## v
 #define W32_VARDECORPEFIXSTR "_"
 #else
 #error Do not know how to decorate symbols for this architecture
 #endif
 
 /* Internal variable prefix (can be any) */
-#define W32_INITHELPERVARNAME(f) _initHelperDummy_##f
-#define W32_INITHELPERVARNAMEDECORSTR(f) W32_VARDECORPEFIXSTR 
_STRMACRO(W32_INITHELPERVARNAME(f))
+#define W32_INITHELPERVARNAME(f) _initHelperDummy_ ## f
+#define W32_INITHELPERVARNAMEDECORSTR(f) W32_VARDECORPEFIXSTR _STRMACRO ( \
+    W32_INITHELPERVARNAME (f))
 
 /* Declare section (segment), put variable pointing to init function to chosen 
segment,
    force linker to include variable to avoid omitting by optimizer */
@@ -145,9 +146,10 @@
 /* Return value is ignored for C++ initializers */
 /* For C initializers: startup process is aborted if initializer return 
non-zero */
 #define W32_FPTR_IN_SEG(S,F) \
-  __pragma(section(S,long,read)) \
-  __pragma(comment(linker, "/INCLUDE:" W32_INITHELPERVARNAMEDECORSTR(F))) \
-  W32_INITVARDECL __declspec(allocate(S)) int(__cdecl 
*W32_INITHELPERVARNAME(F))(void) = &F
+  __pragma (section (S,long,read)) \
+  __pragma (comment (linker, "/INCLUDE:" W32_INITHELPERVARNAMEDECORSTR (F))) \
+  W32_INITVARDECL __declspec(allocate (S))int (__cdecl * W32_INITHELPERVARNAME 
( \
+                                                 F))(void) = &F
 
 /* Section (segment) names for pointers to initializers */
 #define W32_SEG_INIT_C_USER   ".CRT$XCU"
@@ -161,10 +163,10 @@
    during application startup */
 /* "lib" initializers are called before "user" initializers */
 /* "C" initializers are called before "C++" initializers */
-#define W32_REG_INIT_C_USER(F) W32_FPTR_IN_SEG(W32_SEG_INIT_C_USER,F)
-#define W32_REG_INIT_C_LIB(F) W32_FPTR_IN_SEG(W32_SEG_INIT_C_LIB,F)
-#define W32_REG_INIT_CXX_USER(F) W32_FPTR_IN_SEG(W32_SEG_INIT_CXX_USER,F)
-#define W32_REG_INIT_CXX_LIB(F) W32_FPTR_IN_SEG(W32_SEG_INIT_CXX_LIB,F)
+#define W32_REG_INIT_C_USER(F) W32_FPTR_IN_SEG (W32_SEG_INIT_C_USER,F)
+#define W32_REG_INIT_C_LIB(F) W32_FPTR_IN_SEG (W32_SEG_INIT_C_LIB,F)
+#define W32_REG_INIT_CXX_USER(F) W32_FPTR_IN_SEG (W32_SEG_INIT_CXX_USER,F)
+#define W32_REG_INIT_CXX_LIB(F) W32_FPTR_IN_SEG (W32_SEG_INIT_CXX_LIB,F)
 
 /* Choose main register macro based on language and program type */
 /* Assuming that _LIB or _USRDLL is defined for static or DLL-library */
@@ -174,16 +176,18 @@
 /* Define AUTOINIT_FUNCS_FORCE_USER_LVL_INIT to register initializers
    at user level even if building library */
 #ifdef __cplusplus
-#if ((defined(_LIB) && !defined(_CONSOLE)) || defined(_USRDLL)) && 
!defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT)
-#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_LIB(F)
+#if ((defined(_LIB) && ! defined(_CONSOLE)) || defined(_USRDLL)) && \
+  ! defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT)
+#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_LIB (F)
 #else  /* ! _LIB && ! _DLL */
-#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_USER(F)
+#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_USER (F)
 #endif /* ! _LIB && ! _DLL */
 #else  /* !__cplusplus*/
-#if ((defined(_LIB) && !defined(_CONSOLE)) || defined(_USRDLL)) && 
!defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT)
-#define W32_REGISTER_INIT(F) W32_REG_INIT_C_LIB(F)
+#if ((defined(_LIB) && ! defined(_CONSOLE)) || defined(_USRDLL)) && \
+  ! defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT)
+#define W32_REGISTER_INIT(F) W32_REG_INIT_C_LIB (F)
 #else  /* ! _LIB && ! _DLL */
-#define W32_REGISTER_INIT(F) W32_REG_INIT_C_USER(F)
+#define W32_REGISTER_INIT(F) W32_REG_INIT_C_USER (F)
 #endif /* ! _LIB && ! _DLL */
 #endif /* !__cplusplus*/
 
@@ -197,36 +201,36 @@
 #endif /* _USRDLL */
 
 
-#if !defined(_USRDLL) || defined(AUTOINIT_FUNCS_FORCE_STATIC_REG)
+#if ! defined(_USRDLL) || defined(AUTOINIT_FUNCS_FORCE_STATIC_REG)
 #define W32_SET_INIT_AND_DEINIT(FI,FD) \
-  void __cdecl _W32_deinit_helper_##FD(void) \
-   { (void)(FD)(); } \
-  int __cdecl _W32_init_helper_##FI(void) \
-   { (void)(FI)(); atexit(_W32_deinit_helper_##FD); return 0; } \
-  W32_REGISTER_INIT(_W32_init_helper_##FI)
+  void __cdecl _W32_deinit_helper_ ## FD (void) \
+  { (void) (FD) (); } \
+  int __cdecl _W32_init_helper_ ## FI (void) \
+  { (void) (FI) (); atexit (_W32_deinit_helper_ ## FD); return 0; } \
+  W32_REGISTER_INIT (_W32_init_helper_ ## FI)
 #else  /* _USRDLL */
 
-/* If DllMain is already present in code, define 
AUTOINIT_FUNCS_CALL_USR_DLLMAIN 
+/* If DllMain is already present in code, define 
AUTOINIT_FUNCS_CALL_USR_DLLMAIN
    and rename DllMain to usr_DllMain */
 #ifndef AUTOINIT_FUNCS_CALL_USR_DLLMAIN
 #define W32_SET_INIT_AND_DEINIT(FI,FD) \
-  BOOL WINAPI DllMain(HINSTANCE hinst,DWORD reason,LPVOID unused) \
-    { if(DLL_PROCESS_ATTACH==reason) {(void)(FI)();} \
-      else if(DLL_PROCESS_DETACH==reason) {(void)(FD)();} \
-      return TRUE; \
-    } struct _W32_dummy_strc_##FI{int i;}
+  BOOL WINAPI DllMain (HINSTANCE hinst,DWORD reason,LPVOID unused) \
+  { if (DLL_PROCESS_ATTACH==reason) {(void) (FI) ();} \
+    else if (DLL_PROCESS_DETACH==reason) {(void) (FD) ();} \
+    return TRUE; \
+  } struct _W32_dummy_strc_ ## FI {int i;}
 #else  /* AUTOINIT_FUNCS_CALL_USR_DLLMAIN */
 #define W32_SET_INIT_AND_DEINIT(FI,FD) \
-  BOOL WINAPI usr_DllMain(HINSTANCE hinst,DWORD reason,LPVOID unused); \
-  BOOL WINAPI DllMain(HINSTANCE hinst,DWORD reason,LPVOID unused) \
-    { if(DLL_PROCESS_ATTACH==reason) {(void)(FI)();} \
-      else if(DLL_PROCESS_DETACH==reason) {(void)(FD)();} \
-      return usr_DllMain(hinst,reason,unused); \
-    } struct _W32_dummy_strc_##FI{int i;}
+  BOOL WINAPI usr_DllMain (HINSTANCE hinst,DWORD reason,LPVOID unused); \
+  BOOL WINAPI DllMain (HINSTANCE hinst,DWORD reason,LPVOID unused) \
+  { if (DLL_PROCESS_ATTACH==reason) {(void) (FI) ();} \
+    else if (DLL_PROCESS_DETACH==reason) {(void) (FD) ();} \
+    return usr_DllMain (hinst,reason,unused); \
+  } struct _W32_dummy_strc_ ## FI {int i;}
 #endif /* AUTOINIT_FUNCS_CALL_USR_DLLMAIN */
 #endif /* _USRDLL */
 
-#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) W32_SET_INIT_AND_DEINIT(FI,FD)
+#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) W32_SET_INIT_AND_DEINIT (FI,FD)
 /* Indicate that automatic initializers/deinitializers are supported */
 #define _AUTOINIT_FUNCS_ARE_SUPPORTED 1
 
@@ -235,7 +239,8 @@
 /* Define EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED before inclusion of 
header to
    abort compilation if automatic initializers/deinitializers are not 
supported */
 #ifdef EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED
-#error Compiler/platform don not support automatic calls of user-defined 
initializer and deinitializer
+#error \
+  Compiler/platform don not support automatic calls of user-defined 
initializer and deinitializer
 #endif /* EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED */
 
 /* Do nothing */
diff --git a/src/include/mhd_options.h b/src/include/mhd_options.h
index 47b7ce0e..26ab49e1 100644
--- a/src/include/mhd_options.h
+++ b/src/include/mhd_options.h
@@ -45,7 +45,7 @@
 
 #ifndef _MHD_EXTERN
 #if defined(BUILDING_MHD_LIB) && defined(_WIN32) && \
-    (defined(DLL_EXPORT) || defined(MHD_W32DLL))
+  (defined(DLL_EXPORT) || defined(MHD_W32DLL))
 #define _MHD_EXTERN __declspec(dllexport) extern
 #else   /* !BUILDING_MHD_LIB || !_WIN32 || (!DLL_EXPORT && !MHD_W32DLL) */
 #define _MHD_EXTERN extern
@@ -66,7 +66,7 @@
 #endif /* !FD_SETSIZE && !W32 */
 
 #if defined(HAVE_LINUX_SENDFILE) || defined(HAVE_FREEBSD_SENDFILE) || \
-    defined(HAVE_DARWIN_SENDFILE) || defined(HAVE_SOLARIS_SENDFILE)
+  defined(HAVE_DARWIN_SENDFILE) || defined(HAVE_SOLARIS_SENDFILE)
 /* Have any supported sendfile() function. */
 #define _MHD_HAVE_SENDFILE
 #endif /* HAVE_LINUX_SENDFILE || HAVE_FREEBSD_SENDFILE ||
@@ -104,7 +104,8 @@
 #define RESTRICT __restrict__
 #endif /* __VXWORKS__ || __vxworks || OS_VXWORKS */
 
-#if LINUX+0 && (defined(HAVE_SENDFILE64) || defined(HAVE_LSEEK64)) && ! 
defined(_LARGEFILE64_SOURCE)
+#if LINUX + 0 && (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
 #endif
@@ -115,12 +116,13 @@
 #endif /* HAVE_C11_GMTIME_S */
 
 #if defined(MHD_FAVOR_FAST_CODE) && defined(MHD_FAVOR_SMALL_CODE)
-#error MHD_FAVOR_FAST_CODE and MHD_FAVOR_SMALL_CODE are both defined. Cannot 
favor speed and size at the same time.
+#error \
+  MHD_FAVOR_FAST_CODE and MHD_FAVOR_SMALL_CODE are both defined. Cannot favor 
speed and size at the same time.
 #endif /* MHD_FAVOR_FAST_CODE && MHD_FAVOR_SMALL_CODE */
 
 /* Define MHD_FAVOR_FAST_CODE to force fast code path or
    define MHD_FAVOR_SMALL_CODE to choose compact code path */
-#if !defined(MHD_FAVOR_FAST_CODE) && !defined(MHD_FAVOR_SMALL_CODE)
+#if ! defined(MHD_FAVOR_FAST_CODE) && ! defined(MHD_FAVOR_SMALL_CODE)
 /* Try to detect user preferences */
 /* Defined by GCC and many compatible compilers */
 #if defined(__OPTIMIZE_SIZE__)
@@ -130,7 +132,7 @@
 #endif /* __OPTIMIZE__ */
 #endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */
 
-#if !defined(MHD_FAVOR_FAST_CODE) && !defined(MHD_FAVOR_SMALL_CODE)
+#if ! defined(MHD_FAVOR_FAST_CODE) && ! defined(MHD_FAVOR_SMALL_CODE)
 /* Use faster code by default */
 #define MHD_FAVOR_FAST_CODE 1
 #endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index a678f399..4f8f685a 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -108,7 +108,7 @@ extern "C"
 #include <stdarg.h>
 #include <stdint.h>
 #include <sys/types.h>
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
 #include <unistd.h>
 #include <sys/time.h>
 #include <sys/socket.h>
@@ -116,14 +116,14 @@ extern "C"
 /* Declare POSIX-compatible names */
 #define _CRT_DECLARE_NONSTDC_NAMES 1
 #include <ws2tcpip.h>
-#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
+#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
 #define _SSIZE_T_DEFINED
 typedef intptr_t ssize_t;
 #endif /* !_SSIZE_T_DEFINED */
 #endif /* _WIN32 && ! __CYGWIN__ */
 #endif
 
-#if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET)
+#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET)
 /* Do not define __USE_W32_SOCKETS under Cygwin! */
 #error Cygwin with winsock fd_set is not supported
 #endif
@@ -182,7 +182,7 @@ typedef intptr_t ssize_t;
 /**
  * MHD_socket is type for socket FDs
  */
-#if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
+#if ! defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
 #define MHD_POSIX_SOCKETS 1
 typedef int MHD_socket;
 #define MHD_INVALID_SOCKET (-1)
@@ -207,30 +207,35 @@ typedef SOCKET MHD_socket;
 #endif /* MHD_NO_DEPRECATION */
 
 #ifndef _MHD_DEPR_MACRO
-#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500
+#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1500
 /* VS 2008 or later */
 /* Stringify macros */
 #define _MHD_INSTRMACRO(a) #a
-#define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a)
+#define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a)
 /* deprecation message */
-#define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" 
_MHD_STRMACRO(__LINE__)"): warning: " msg))
-#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
+#define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \
+                                                  __LINE__) "): warning: " 
msg))
+#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
 #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
 /* clang or GCC since 3.0 */
 #define _MHD_GCC_PRAG(x) _Pragma (#x)
-#if (defined(__clang__) && (__clang_major__+0 >= 5 ||                  \
-                           (!defined(__apple_build_version__) && 
(__clang_major__+0  > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) 
|| \
-  __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8)
+#if (defined(__clang__) && (__clang_major__ + 0 >= 5 ||     \
+                            (! defined(__apple_build_version__) && \
+  (__clang_major__ + 0  > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= 
\
+                                3))))) || \
+  __GNUC__ + 0 > 4 || (__GNUC__ + 0 == 4 && __GNUC_MINOR__ + 0 >= 8)
 /* clang >= 3.3 (or XCode's clang >= 5.0) or
    GCC >= 4.8 */
-#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg)
-#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
+#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (GCC warning msg)
+#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
 #else /* older clang or GCC */
 /* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
-#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg)
-#if (defined(__clang__) && (__clang_major__+0  > 2 || (__clang_major__+0 == 2 
&& __clang_minor__ >= 9))) /* FIXME: clang >= 2.9, earlier versions not tested 
*/
+#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (message msg)
+#if (defined(__clang__) && (__clang_major__ + 0  > 2 || (__clang_major__ + 0 
== \
+                                                         2 && __clang_minor__ 
>= \
+                                                         9)))                  
                          /* FIXME: clang >= 2.9, earlier versions not tested */
 /* clang handles inline pragmas better than GCC */
-#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
+#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
 #endif /* clang >= 2.9 */
 #endif  /* older clang or GCC */
 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if 
required */
@@ -247,17 +252,19 @@ typedef SOCKET MHD_socket;
 #endif /* !_MHD_DEPR_IN_MACRO */
 
 #ifndef _MHD_DEPR_FUNC
-#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400
+#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1400
 /* VS 2005 or later */
-#define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg))
-#elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310
+#define _MHD_DEPR_FUNC(msg) __declspec(deprecated (msg))
+#elif defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1310
 /* VS .NET 2003 deprecation do not support custom messages */
 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
-#elif (__GNUC__+0 >= 5) || (defined (__clang__) && \
-  (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) 
 /* FIXME: earlier versions not tested */
+#elif (__GNUC__ + 0 >= 5) || (defined (__clang__) && \
+  (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == 2 && __clang_minor__ >= \
+                               9)))                                            
 /* FIXME: earlier versions not tested */
 /* GCC >= 5.0 or clang >= 2.9 */
-#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg)))
-#elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && 
__GNUC_MINOR__+0 >= 1)
+#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated (msg)))
+#elif defined (__clang__) || __GNUC__ + 0 > 3 || (__GNUC__ + 0 == 3 && \
+                                                  __GNUC_MINOR__ + 0 >= 1)
 /* 3.1 <= GCC < 5.0 or clang < 2.9 */
 /* old GCC-style deprecation do not support custom messages */
 #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
@@ -282,7 +289,8 @@ typedef SOCKET MHD_socket;
 #define MHD_LONG_LONG long long
 #define MHD_UNSIGNED_LONG_LONG unsigned long long
 #else /* MHD_LONG_LONG */
-_MHD_DEPR_MACRO("Macro MHD_LONG_LONG is deprecated, use 
MHD_UNSIGNED_LONG_LONG")
+_MHD_DEPR_MACRO (
+  "Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
 #endif
 /**
  * Format string for printing a variable of type #MHD_LONG_LONG.
@@ -295,14 +303,15 @@ _MHD_DEPR_MACRO("Macro MHD_LONG_LONG is deprecated, use 
MHD_UNSIGNED_LONG_LONG")
 #define MHD_LONG_LONG_PRINTF "ll"
 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
 #else /* MHD_LONG_LONG_PRINTF */
-_MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is deprecated, use 
MHD_UNSIGNED_LONG_LONG_PRINTF")
+_MHD_DEPR_MACRO (
+  "Macro MHD_LONG_LONG_PRINTF is deprecated, use 
MHD_UNSIGNED_LONG_LONG_PRINTF")
 #endif
 
 
 /**
  * Length of the binary output of the MD5 hash function.
  */
-#define         MHD_MD5_DIGEST_SIZE 16
+#define  MHD_MD5_DIGEST_SIZE 16
 
 
 /**
@@ -463,27 +472,39 @@ _MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is 
deprecated, use MHD_UNSIGNED_LONG
 /* Deprecated codes */
 /** @deprecated */
 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use 
MHD_HTTP_NOT_ACCEPTABLE") 406
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use 
MHD_HTTP_NOT_ACCEPTABLE") \
+  406
 
 /** @deprecated */
 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, 
use MHD_HTTP_PAYLOAD_TOO_LARGE") 413
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use 
MHD_HTTP_PAYLOAD_TOO_LARGE") \
+  413
 
 /** @deprecated */
 #define MHD_HTTP_REQUEST_URI_TOO_LONG \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use 
MHD_HTTP_URI_TOO_LONG") 414
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use 
MHD_HTTP_URI_TOO_LONG") \
+  414
 
 /** @deprecated */
 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is 
deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") 416
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use 
MHD_HTTP_RANGE_NOT_SATISFIABLE") \
+  416
 
 /** @deprecated */
 #define MHD_HTTP_UNORDERED_COLLECTION \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it 
was removed from RFC") 425
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from 
RFC") \
+  425
 
 /** @deprecated */
 #define MHD_HTTP_NO_RESPONSE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx 
internal code for logs only") 444
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx internal code for 
logs only") \
+  444
 
 
 /** @} */ /* end of group httpcode */
@@ -504,7 +525,7 @@ MHD_get_reason_phrase_for (unsigned int code);
  * with the SHOUTcast "ICY" line instad of "HTTP".
  * @ingroup specialized
  */
-#define MHD_ICY_FLAG ((uint32_t)(((uint32_t)1) << 31))
+#define MHD_ICY_FLAG ((uint32_t) (((uint32_t) 1) << 31))
 
 /**
  * @defgroup headers HTTP headers
@@ -712,7 +733,8 @@ MHD_get_reason_phrase_for (unsigned int code);
 /* Standard.      RFC6638 */
 #define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
 /* Standard.      RFC8473 */
-#define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID 
"Include-Referred-Token-Binding-ID"
+#define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID \
+  "Include-Referred-Token-Binding-ID"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
 /* No category.   RFC4229 */
@@ -776,7 +798,8 @@ MHD_get_reason_phrase_for (unsigned int code);
 /* Standard.      RFC7469 */
 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
 /* Standard.      RFC7469 */
-#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY 
"Public-Key-Pins-Report-Only"
+#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY \
+  "Public-Key-Pins-Report-Only"
 /* No category.   RFC4437 */
 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
 /* Standard.      RFC8555, Section 6.5.1 */
@@ -843,7 +866,8 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
 
 /* Some provisional headers. */
-#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN 
"Access-Control-Allow-Origin"
+#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN \
+  "Access-Control-Allow-Origin"
 /** @} */ /* end of group headers */
 
 /**
@@ -954,7 +978,8 @@ MHD_get_reason_phrase_for (unsigned int code);
  * See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
  * @{
  */
-#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED 
"application/x-www-form-urlencoded"
+#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED \
+  "application/x-www-form-urlencoded"
 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
 
 /** @} */ /* end of group postenc */
@@ -1031,7 +1056,7 @@ enum MHD_FLAG
 #if 0
   /* let's do this later once versions that define MHD_USE_TLS a more widely 
deployed. */
 #define MHD_USE_SSL \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
+  _MHD_DEPR_IN_MACRO ("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
   MHD_USE_TLS
 #endif
 
@@ -1056,7 +1081,8 @@ enum MHD_FLAG
   MHD_USE_SELECT_INTERNALLY = 8,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_SELECT_INTERNALLY \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_SELECT_INTERNALLY is deprecated, use 
MHD_USE_INTERNAL_POLLING_THREAD instead") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_SELECT_INTERNALLY is deprecated, use 
MHD_USE_INTERNAL_POLLING_THREAD instead") \
   MHD_USE_INTERNAL_POLLING_THREAD
 #endif /* 0 */
 
@@ -1081,7 +1107,8 @@ enum MHD_FLAG
   MHD_USE_PEDANTIC_CHECKS = 32,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_PEDANTIC_CHECKS \
-  _MHD_DEPR_IN_MACRO("Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option 
MHD_OPTION_STRICT_FOR_CLIENT instead") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option 
MHD_OPTION_STRICT_FOR_CLIENT instead") \
   32
 #endif /* 0 */
 
@@ -1105,7 +1132,8 @@ enum MHD_FLAG
   MHD_USE_POLL_INTERNALLY = MHD_USE_POLL | MHD_USE_INTERNAL_POLLING_THREAD,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_POLL_INTERNALLY \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_POLL_INTERNALLY is deprecated, use 
MHD_USE_POLL_INTERNAL_THREAD instead") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_POLL_INTERNALLY is deprecated, use 
MHD_USE_POLL_INTERNAL_THREAD instead") \
   MHD_USE_POLL_INTERNAL_THREAD
 #endif /* 0 */
 
@@ -1121,7 +1149,8 @@ enum MHD_FLAG
   MHD_SUPPRESS_DATE_NO_CLOCK = 128,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_SUPPRESS_DATE_NO_CLOCK \
-  _MHD_DEPR_IN_MACRO("Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use 
MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use 
MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \
   MHD_USE_SUPPRESS_DATE_NO_CLOCK
 #endif /* 0 */
 
@@ -1147,7 +1176,8 @@ enum MHD_FLAG
   MHD_USE_EPOLL_LINUX_ONLY = 512,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_EPOLL_LINUX_ONLY \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use 
MHD_USE_EPOLL") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \
   MHD_USE_EPOLL
 #endif /* 0 */
 
@@ -1157,19 +1187,23 @@ enum MHD_FLAG
    * platform without `epoll` support will cause #MHD_start_daemon to fail.
    * @sa ::MHD_FEATURE_EPOLL, #MHD_USE_EPOLL, #MHD_USE_INTERNAL_POLLING_THREAD
    */
-  MHD_USE_EPOLL_INTERNAL_THREAD = MHD_USE_EPOLL | 
MHD_USE_INTERNAL_POLLING_THREAD,
+  MHD_USE_EPOLL_INTERNAL_THREAD = MHD_USE_EPOLL
+                                  | MHD_USE_INTERNAL_POLLING_THREAD,
 
   /** @deprecated */
   MHD_USE_EPOLL_INTERNALLY = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD,
   /** @deprecated */
-  MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY = MHD_USE_EPOLL | 
MHD_USE_INTERNAL_POLLING_THREAD,
+  MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY = MHD_USE_EPOLL
+                                        | MHD_USE_INTERNAL_POLLING_THREAD,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_EPOLL_INTERNALLY \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY is deprecated, use 
MHD_USE_EPOLL_INTERNAL_THREAD") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_EPOLL_INTERNALLY is deprecated, use 
MHD_USE_EPOLL_INTERNAL_THREAD") \
   MHD_USE_EPOLL_INTERNAL_THREAD
   /** @deprecated */
 #define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, 
use MHD_USE_EPOLL_INTERNAL_THREAD") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use 
MHD_USE_EPOLL_INTERNAL_THREAD") \
   MHD_USE_EPOLL_INTERNAL_THREAD
 #endif /* 0 */
 
@@ -1191,7 +1225,8 @@ enum MHD_FLAG
   MHD_USE_PIPE_FOR_SHUTDOWN = 1024,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_PIPE_FOR_SHUTDOWN \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use 
MHD_USE_ITC") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \
   MHD_USE_ITC
 #endif /* 0 */
 
@@ -1212,7 +1247,8 @@ enum MHD_FLAG
   MHD_USE_EPOLL_TURBO = 4096,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_EPOLL_TURBO \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_TURBO is deprecated, use 
MHD_USE_TURBO") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
   MHD_USE_TURBO
 #endif /* 0 */
 
@@ -1226,7 +1262,8 @@ enum MHD_FLAG
   MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_ITC,
 #if 0 /* Will be marked for real deprecation later. */
 #define MHD_USE_SUSPEND_RESUME \
-  _MHD_DEPR_IN_MACRO("Value MHD_USE_SUSPEND_RESUME is deprecated, use 
MHD_ALLOW_SUSPEND_RESUME instead") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME 
instead") \
   MHD_ALLOW_SUSPEND_RESUME
 #endif /* 0 */
 
@@ -1269,13 +1306,13 @@ enum MHD_FLAG
    * Flag set to enable post-handshake client authentication
    * (only useful in combination with #MHD_USE_TLS).
    */
-  MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT = 1U <<17,
+  MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT = 1U << 17,
 
   /**
    * Flag set to enable TLS 1.3 early data.  This has
    * security implications, be VERY careful when using this.
    */
-  MHD_USE_INSECURE_TLS_EARLY_DATA = 1U <<18
+  MHD_USE_INSECURE_TLS_EARLY_DATA = 1U << 18
 
 };
 
@@ -1308,10 +1345,10 @@ typedef void
  */
 typedef int
 (*MHD_PskServerCredentialsCallback)(void *cls,
-                                   const struct MHD_Connection *connection,
-                                   const char *username,
-                                   void **psk,
-                                   size_t *psk_size);
+                                    const struct MHD_Connection *connection,
+                                    const char *username,
+                                    void **psk,
+                                    size_t *psk_size);
 
 /**
  * @brief MHD options.
@@ -1654,7 +1691,7 @@ enum MHD_OPTION
    * followed by a argument of type `gnutls_certificate_retrieve_function3 *`.
    * This option provides an
    * alternative/extension to #MHD_OPTION_HTTPS_CERT_CALLBACK.
-       * You must use this version if you want to use OCSP stapling.
+  * You must use this version if you want to use OCSP stapling.
    * Using this option requires GnuTLS 3.6.3 or higher.
    */
   MHD_OPTION_HTTPS_CERT_CALLBACK2 = 31
@@ -1701,7 +1738,8 @@ enum MHD_ValueKind
    */
   MHD_RESPONSE_HEADER_KIND = 0,
 #define MHD_RESPONSE_HEADER_KIND \
-  _MHD_DEPR_IN_MACRO("Value MHD_RESPONSE_HEADER_KIND is deprecated and not 
used") \
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
   MHD_RESPONSE_HEADER_KIND
 
   /**
@@ -2197,11 +2235,11 @@ typedef int
  */
 typedef int
 (*MHD_KeyValueIteratorN) (void *cls,
-                         enum MHD_ValueKind kind,
-                         const char *key,
-                         size_t key_size,
-                         const char *value,
-                         size_t value_size);
+                          enum MHD_ValueKind kind,
+                          const char *key,
+                          size_t key_size,
+                          const char *value,
+                          size_t value_size);
 
 
 /**
@@ -2323,10 +2361,10 @@ typedef int
  */
 _MHD_EXTERN struct MHD_Daemon *
 MHD_start_daemon_va (unsigned int flags,
-                    uint16_t port,
-                    MHD_AcceptPolicyCallback apc, void *apc_cls,
-                    MHD_AccessHandlerCallback dh, void *dh_cls,
-                    va_list ap);
+                     uint16_t port,
+                     MHD_AcceptPolicyCallback apc, void *apc_cls,
+                     MHD_AccessHandlerCallback dh, void *dh_cls,
+                     va_list ap);
 
 
 /**
@@ -2351,10 +2389,10 @@ MHD_start_daemon_va (unsigned int flags,
  */
 _MHD_EXTERN struct MHD_Daemon *
 MHD_start_daemon (unsigned int flags,
-                 uint16_t port,
-                 MHD_AcceptPolicyCallback apc, void *apc_cls,
-                 MHD_AccessHandlerCallback dh, void *dh_cls,
-                 ...);
+                  uint16_t port,
+                  MHD_AcceptPolicyCallback apc, void *apc_cls,
+                  MHD_AccessHandlerCallback dh, void *dh_cls,
+                  ...);
 
 
 /**
@@ -2419,9 +2457,9 @@ MHD_stop_daemon (struct MHD_Daemon *daemon);
  */
 _MHD_EXTERN int
 MHD_add_connection (struct MHD_Daemon *daemon,
-                   MHD_socket client_socket,
-                   const struct sockaddr *addr,
-                   socklen_t addrlen);
+                    MHD_socket client_socket,
+                    const struct sockaddr *addr,
+                    socklen_t addrlen);
 
 
 /**
@@ -2457,8 +2495,8 @@ _MHD_EXTERN int
 MHD_get_fdset (struct MHD_Daemon *daemon,
                fd_set *read_fd_set,
                fd_set *write_fd_set,
-              fd_set *except_fd_set,
-              MHD_socket *max_fd);
+               fd_set *except_fd_set,
+               MHD_socket *max_fd);
 
 
 /**
@@ -2495,11 +2533,11 @@ MHD_get_fdset (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN int
 MHD_get_fdset2 (struct MHD_Daemon *daemon,
-               fd_set *read_fd_set,
-               fd_set *write_fd_set,
-               fd_set *except_fd_set,
-               MHD_socket *max_fd,
-               unsigned int fd_setsize);
+                fd_set *read_fd_set,
+                fd_set *write_fd_set,
+                fd_set *except_fd_set,
+                MHD_socket *max_fd,
+                unsigned int fd_setsize);
 
 
 /**
@@ -2527,7 +2565,8 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon,
  * @ingroup event
  */
 #define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
-  
MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE)
+  MHD_get_fdset2 ((daemon),(read_fd_set),(write_fd_set),(except_fd_set), \
+                  (max_fd),FD_SETSIZE)
 
 
 /**
@@ -2550,7 +2589,7 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN int
 MHD_get_timeout (struct MHD_Daemon *daemon,
-                MHD_UNSIGNED_LONG_LONG *timeout);
+                 MHD_UNSIGNED_LONG_LONG *timeout);
 
 
 /**
@@ -2601,9 +2640,9 @@ MHD_run (struct MHD_Daemon *daemon);
  */
 _MHD_EXTERN int
 MHD_run_from_select (struct MHD_Daemon *daemon,
-                    const fd_set *read_fd_set,
-                    const fd_set *write_fd_set,
-                    const fd_set *except_fd_set);
+                     const fd_set *read_fd_set,
+                     const fd_set *write_fd_set,
+                     const fd_set *except_fd_set);
 
 
 
@@ -2678,7 +2717,7 @@ _MHD_EXTERN int
 MHD_set_connection_value (struct MHD_Connection *connection,
                           enum MHD_ValueKind kind,
                           const char *key,
-                         const char *value);
+                          const char *value);
 
 
 /**
@@ -2708,11 +2747,11 @@ MHD_set_connection_value (struct MHD_Connection 
*connection,
  */
 int
 MHD_set_connection_value_n (struct MHD_Connection *connection,
-                           enum MHD_ValueKind kind,
-                           const char *key,
+                            enum MHD_ValueKind kind,
+                            const char *key,
                             size_t key_size,
-                           const char *value,
-                           size_t value_size);
+                            const char *value,
+                            size_t value_size);
 
 
 /**
@@ -2760,8 +2799,8 @@ MHD_http_unescape (char *val);
  */
 _MHD_EXTERN const char *
 MHD_lookup_connection_value (struct MHD_Connection *connection,
-                            enum MHD_ValueKind kind,
-                            const char *key);
+                             enum MHD_ValueKind kind,
+                             const char *key);
 
 
 /**
@@ -2806,7 +2845,7 @@ MHD_lookup_connection_value_n (struct MHD_Connection 
*connection,
 _MHD_EXTERN int
 MHD_queue_response (struct MHD_Connection *connection,
                     unsigned int status_code,
-                   struct MHD_Response *response);
+                    struct MHD_Response *response);
 
 
 /**
@@ -2934,9 +2973,9 @@ MHD_set_response_options (struct MHD_Response *response,
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_create_response_from_callback (uint64_t size,
-                                  size_t block_size,
-                                  MHD_ContentReaderCallback crc, void *crc_cls,
-                                  MHD_ContentReaderFreeCallback crfc);
+                                   size_t block_size,
+                                   MHD_ContentReaderCallback crc, void 
*crc_cls,
+                                   MHD_ContentReaderFreeCallback crfc);
 
 
 /**
@@ -2953,12 +2992,13 @@ MHD_create_response_from_callback (uint64_t size,
  * @deprecated use #MHD_create_response_from_buffer instead
  * @ingroup response
  */
-_MHD_DEPR_FUNC("MHD_create_response_from_data() is deprecated, use 
MHD_create_response_from_buffer()") \
-_MHD_EXTERN struct MHD_Response *
+_MHD_DEPR_FUNC (
+  "MHD_create_response_from_data() is deprecated, use 
MHD_create_response_from_buffer()") \
+  _MHD_EXTERN struct MHD_Response *
 MHD_create_response_from_data (size_t size,
-                              void *data,
-                              int must_free,
-                              int must_copy);
+                               void *data,
+                               int must_free,
+                               int must_copy);
 
 
 /**
@@ -3009,8 +3049,8 @@ enum MHD_ResponseMemoryMode
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_create_response_from_buffer (size_t size,
-                                void *buffer,
-                                enum MHD_ResponseMemoryMode mode);
+                                 void *buffer,
+                                 enum MHD_ResponseMemoryMode mode);
 
 
 
@@ -3027,8 +3067,9 @@ MHD_create_response_from_buffer (size_t size,
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_create_response_from_buffer_with_free_callback (size_t size,
-                                                   void *buffer,
-                                                   
MHD_ContentReaderFreeCallback crfc);
+                                                    void *buffer,
+                                                    
MHD_ContentReaderFreeCallback
+                                                    crfc);
 
 
 /**
@@ -3044,7 +3085,7 @@ MHD_create_response_from_buffer_with_free_callback 
(size_t size,
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_create_response_from_fd (size_t size,
-                               int fd);
+                             int fd);
 
 
 /**
@@ -3081,18 +3122,20 @@ MHD_create_response_from_fd64 (uint64_t size,
  * @return NULL on error (i.e. invalid arguments, out of memory)
  * @ingroup response
  */
-_MHD_DEPR_FUNC("Function MHD_create_response_from_fd_at_offset() is 
deprecated, use MHD_create_response_from_fd_at_offset64()") \
-_MHD_EXTERN struct MHD_Response *
+_MHD_DEPR_FUNC (
+  "Function MHD_create_response_from_fd_at_offset() is deprecated, use 
MHD_create_response_from_fd_at_offset64()") \
+  _MHD_EXTERN struct MHD_Response *
 MHD_create_response_from_fd_at_offset (size_t size,
                                        int fd,
                                        off_t offset);
 
-#if !defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
+#if ! defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
 /* Substitute MHD_create_response_from_fd_at_offset64() instead of 
MHD_create_response_from_fd_at_offset()
    to minimize potential problems with different off_t sizes */
 #define MHD_create_response_from_fd_at_offset(size,fd,offset) \
-  _MHD_DEPR_IN_MACRO("Usage of MHD_create_response_from_fd_at_offset() is 
deprecated, use MHD_create_response_from_fd_at_offset64()") \
-  MHD_create_response_from_fd_at_offset64((size),(fd),(offset))
+  _MHD_DEPR_IN_MACRO ( \
+    "Usage of MHD_create_response_from_fd_at_offset() is deprecated, use 
MHD_create_response_from_fd_at_offset64()") \
+  MHD_create_response_from_fd_at_offset64 ((size),(fd),(offset))
 #endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
 
 
@@ -3261,7 +3304,7 @@ typedef void
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
-                                void *upgrade_handler_cls);
+                                 void *upgrade_handler_cls);
 
 
 /**
@@ -3290,7 +3333,7 @@ MHD_destroy_response (struct MHD_Response *response);
 _MHD_EXTERN int
 MHD_add_response_header (struct MHD_Response *response,
                          const char *header,
-                        const char *content);
+                         const char *content);
 
 
 /**
@@ -3305,7 +3348,7 @@ MHD_add_response_header (struct MHD_Response *response,
 _MHD_EXTERN int
 MHD_add_response_footer (struct MHD_Response *response,
                          const char *footer,
-                        const char *content);
+                         const char *content);
 
 
 /**
@@ -3320,7 +3363,7 @@ MHD_add_response_footer (struct MHD_Response *response,
 _MHD_EXTERN int
 MHD_del_response_header (struct MHD_Response *response,
                          const char *header,
-                        const char *content);
+                         const char *content);
 
 
 /**
@@ -3336,7 +3379,7 @@ MHD_del_response_header (struct MHD_Response *response,
 _MHD_EXTERN int
 MHD_get_response_headers (struct MHD_Response *response,
                           MHD_KeyValueIterator iterator,
-                         void *iterator_cls);
+                          void *iterator_cls);
 
 
 /**
@@ -3349,7 +3392,7 @@ MHD_get_response_headers (struct MHD_Response *response,
  */
 _MHD_EXTERN const char *
 MHD_get_response_header (struct MHD_Response *response,
-                        const char *key);
+                         const char *key);
 
 
 /* ********************** PostProcessor functions ********************** */
@@ -3381,8 +3424,8 @@ MHD_get_response_header (struct MHD_Response *response,
  */
 _MHD_EXTERN struct MHD_PostProcessor *
 MHD_create_post_processor (struct MHD_Connection *connection,
-                          size_t buffer_size,
-                          MHD_PostDataIterator iter, void *iter_cls);
+                           size_t buffer_size,
+                           MHD_PostDataIterator iter, void *iter_cls);
 
 
 /**
@@ -3433,7 +3476,7 @@ MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
  *
  * @param connection The MHD connection structure
  * @return NULL if no username could be found, a pointer
- *                     to the username if found, free using #MHD_free().
+ *      to the username if found, free using #MHD_free().
  * @ingroup authentication
  */
 _MHD_EXTERN char *
@@ -3455,7 +3498,8 @@ MHD_free (void *ptr);
 /**
  * Which digest algorithm should MHD use for HTTP digest authentication?
  */
-enum MHD_DigestAuthAlgorithm {
+enum MHD_DigestAuthAlgorithm
+{
 
   /**
    * MHD should pick (currently defaults to SHA-256).
@@ -3483,19 +3527,19 @@ enum MHD_DigestAuthAlgorithm {
  * @param username The username needs to be authenticated
  * @param password The password used in the authentication
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @param algo digest algorithms allowed for verification
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  */
 _MHD_EXTERN int
 MHD_digest_auth_check2 (struct MHD_Connection *connection,
-                       const char *realm,
-                       const char *username,
-                       const char *password,
-                       unsigned int nonce_timeout,
-                       enum MHD_DigestAuthAlgorithm algo);
+                        const char *realm,
+                        const char *username,
+                        const char *password,
+                        unsigned int nonce_timeout,
+                        enum MHD_DigestAuthAlgorithm algo);
 
 
 /**
@@ -3510,18 +3554,18 @@ MHD_digest_auth_check2 (struct MHD_Connection 
*connection,
  * @param username The username needs to be authenticated
  * @param password The password used in the authentication
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  * @deprecated use MHD_digest_auth_check2()
  */
 _MHD_EXTERN int
 MHD_digest_auth_check (struct MHD_Connection *connection,
-                      const char *realm,
-                      const char *username,
-                      const char *password,
-                      unsigned int nonce_timeout);
+                       const char *realm,
+                       const char *username,
+                       const char *password,
+                       unsigned int nonce_timeout);
 
 
 /**
@@ -3531,24 +3575,24 @@ MHD_digest_auth_check (struct MHD_Connection 
*connection,
  * @param realm The realm presented to the client
  * @param username The username needs to be authenticated
  * @param digest An `unsigned char *' pointer to the binary MD5 sum
- *                     for the precalculated hash value 
"username:realm:password"
- *                     of @a digest_size bytes
+ *      for the precalculated hash value "username:realm:password"
+ *      of @a digest_size bytes
  * @param digest_size number of bytes in @a digest (size must match @a algo!)
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @param algo digest algorithms allowed for verification
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  */
 _MHD_EXTERN int
 MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
-                              const char *realm,
-                              const char *username,
-                              const uint8_t *digest,
+                               const char *realm,
+                               const char *username,
+                               const uint8_t *digest,
                                size_t digest_size,
-                              unsigned int nonce_timeout,
-                              enum MHD_DigestAuthAlgorithm algo);
+                               unsigned int nonce_timeout,
+                               enum MHD_DigestAuthAlgorithm algo);
 
 
 /**
@@ -3560,21 +3604,21 @@ MHD_digest_auth_check_digest2 (struct MHD_Connection 
*connection,
  * @param realm The realm presented to the client
  * @param username The username needs to be authenticated
  * @param digest An `unsigned char *' pointer to the binary hash
- *             for the precalculated hash value "username:realm:password";
- *             length must be #MHD_MD5_DIGEST_SIZE bytes
+ *    for the precalculated hash value "username:realm:password";
+ *    length must be #MHD_MD5_DIGEST_SIZE bytes
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  * @deprecated use #MHD_digest_auth_check_digest2()
  */
 _MHD_EXTERN int
 MHD_digest_auth_check_digest (struct MHD_Connection *connection,
-                             const char *realm,
-                             const char *username,
-                             const uint8_t digest[MHD_MD5_DIGEST_SIZE],
-                             unsigned int nonce_timeout);
+                              const char *realm,
+                              const char *username,
+                              const uint8_t digest[MHD_MD5_DIGEST_SIZE],
+                              unsigned int nonce_timeout);
 
 
 /**
@@ -3587,18 +3631,18 @@ MHD_digest_auth_check_digest (struct MHD_Connection 
*connection,
  *        body; note that this function will set the "WWW Authenticate"
  *        header and that the caller should not do this
  * @param signal_stale #MHD_YES if the nonce is invalid to add
- *                     'stale=true' to the authentication header
+ *      'stale=true' to the authentication header
  * @param algo digest algorithm to use
  * @return #MHD_YES on success, #MHD_NO otherwise
  * @ingroup authentication
  */
 _MHD_EXTERN int
 MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
-                              const char *realm,
-                              const char *opaque,
-                              struct MHD_Response *response,
-                              int signal_stale,
-                              enum MHD_DigestAuthAlgorithm algo);
+                               const char *realm,
+                               const char *opaque,
+                               struct MHD_Response *response,
+                               int signal_stale,
+                               enum MHD_DigestAuthAlgorithm algo);
 
 
 /**
@@ -3613,17 +3657,17 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection 
*connection,
  *        body; note that this function will set the "WWW Authenticate"
  *        header and that the caller should not do this
  * @param signal_stale #MHD_YES if the nonce is invalid to add
- *                     'stale=true' to the authentication header
+ *      'stale=true' to the authentication header
  * @return #MHD_YES on success, #MHD_NO otherwise
  * @ingroup authentication
  * @deprecated use MHD_queue_auth_fail_response2()
  */
 _MHD_EXTERN int
 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
-                             const char *realm,
-                             const char *opaque,
-                             struct MHD_Response *response,
-                             int signal_stale);
+                              const char *realm,
+                              const char *opaque,
+                              struct MHD_Response *response,
+                              int signal_stale);
 
 
 /**
@@ -3632,12 +3676,12 @@ MHD_queue_auth_fail_response (struct MHD_Connection 
*connection,
  * @param connection The MHD connection structure
  * @param[out] password a pointer for the password, free using #MHD_free().
  * @return NULL if no username could be found, a pointer
- *                     to the username if found, free using #MHD_free().
+ *      to the username if found, free using #MHD_free().
  * @ingroup authentication
  */
 _MHD_EXTERN char *
 MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
-                                     char** password);
+                                      char**password);
 
 
 /**
@@ -3654,8 +3698,8 @@ MHD_basic_auth_get_username_password (struct 
MHD_Connection *connection,
  */
 _MHD_EXTERN int
 MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection,
-                                   const char *realm,
-                                   struct MHD_Response *response);
+                                    const char *realm,
+                                    struct MHD_Response *response);
 
 /* ********************** generic query functions ********************** */
 
@@ -3672,8 +3716,8 @@ MHD_queue_basic_auth_fail_response (struct MHD_Connection 
*connection,
  */
 _MHD_EXTERN const union MHD_ConnectionInfo *
 MHD_get_connection_info (struct MHD_Connection *connection,
-                        enum MHD_ConnectionInfoType info_type,
-                        ...);
+                         enum MHD_ConnectionInfoType info_type,
+                         ...);
 
 
 /**
@@ -3706,8 +3750,8 @@ enum MHD_CONNECTION_OPTION
  */
 _MHD_EXTERN int
 MHD_set_connection_option (struct MHD_Connection *connection,
-                          enum MHD_CONNECTION_OPTION option,
-                          ...);
+                           enum MHD_CONNECTION_OPTION option,
+                           ...);
 
 
 /**
@@ -3770,8 +3814,8 @@ union MHD_DaemonInfo
  */
 _MHD_EXTERN const union MHD_DaemonInfo *
 MHD_get_daemon_info (struct MHD_Daemon *daemon,
-                    enum MHD_DaemonInfoType info_type,
-                    ...);
+                     enum MHD_DaemonInfoType info_type,
+                     ...);
 
 
 /**
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
index 710115d1..9716573c 100644
--- a/src/include/microhttpd2.h
+++ b/src/include/microhttpd2.h
@@ -99,9 +99,9 @@ extern "C"
 #include <stdarg.h>
 #include <stdint.h>
 #include <sys/types.h>
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 #include <ws2tcpip.h>
-#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
+#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
 #define _SSIZE_T_DEFINED
 typedef intptr_t ssize_t;
 #endif /* !_SSIZE_T_DEFINED */
@@ -112,7 +112,7 @@ typedef intptr_t ssize_t;
 #endif
 #endif
 
-#if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET)
+#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET)
 /* Do not define __USE_W32_SOCKETS under Cygwin! */
 #error Cygwin with winsock fd_set is not supported
 #endif
@@ -179,7 +179,7 @@ enum MHD_Bool
 /**
  * MHD_socket is type for socket FDs
  */
-#if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
+#if ! defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
 #define MHD_POSIX_SOCKETS 1
 typedef int MHD_socket;
 #define MHD_INVALID_SOCKET (-1)
@@ -204,30 +204,35 @@ typedef SOCKET MHD_socket;
 #endif /* MHD_NO_DEPRECATION */
 
 #ifndef _MHD_DEPR_MACRO
-#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500
+#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1500
 /* VS 2008 or later */
 /* Stringify macros */
 #define _MHD_INSTRMACRO(a) #a
-#define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a)
+#define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a)
 /* deprecation message */
-#define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" 
_MHD_STRMACRO(__LINE__)"): warning: " msg))
-#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
+#define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \
+                                                  __LINE__) "): warning: " 
msg))
+#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
 #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
 /* clang or GCC since 3.0 */
 #define _MHD_GCC_PRAG(x) _Pragma (#x)
-#if (defined(__clang__) && (__clang_major__+0 >= 5 ||                  \
-                           (!defined(__apple_build_version__) && 
(__clang_major__+0  > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) 
|| \
-  __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8)
+#if (defined(__clang__) && (__clang_major__ + 0 >= 5 ||     \
+                            (! defined(__apple_build_version__) && \
+  (__clang_major__ + 0  > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= 
\
+                                3))))) || \
+  __GNUC__ + 0 > 4 || (__GNUC__ + 0 == 4 && __GNUC_MINOR__ + 0 >= 8)
 /* clang >= 3.3 (or XCode's clang >= 5.0) or
    GCC >= 4.8 */
-#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg)
-#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
+#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (GCC warning msg)
+#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
 #else /* older clang or GCC */
 /* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
-#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg)
-#if (defined(__clang__) && (__clang_major__+0  > 2 || (__clang_major__+0 == 2 
&& __clang_minor__ >= 9))) /* FIXME: clang >= 2.9, earlier versions not tested 
*/
+#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (message msg)
+#if (defined(__clang__) && (__clang_major__ + 0  > 2 || (__clang_major__ + 0 
== \
+                                                         2 && __clang_minor__ 
>= \
+                                                         9)))                  
                          /* FIXME: clang >= 2.9, earlier versions not tested */
 /* clang handles inline pragmas better than GCC */
-#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
+#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
 #endif /* clang >= 2.9 */
 #endif  /* older clang or GCC */
 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if 
required */
@@ -244,17 +249,19 @@ typedef SOCKET MHD_socket;
 #endif /* !_MHD_DEPR_IN_MACRO */
 
 #ifndef _MHD_DEPR_FUNC
-#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400
+#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1400
 /* VS 2005 or later */
-#define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg))
-#elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310
+#define _MHD_DEPR_FUNC(msg) __declspec(deprecated (msg))
+#elif defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1310
 /* VS .NET 2003 deprecation do not support custom messages */
 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
-#elif (__GNUC__+0 >= 5) || (defined (__clang__) && \
-  (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) 
 /* FIXME: earlier versions not tested */
+#elif (__GNUC__ + 0 >= 5) || (defined (__clang__) && \
+  (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == 2 && __clang_minor__ >= \
+                               9)))                                            
 /* FIXME: earlier versions not tested */
 /* GCC >= 5.0 or clang >= 2.9 */
-#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg)))
-#elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && 
__GNUC_MINOR__+0 >= 1)
+#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated (msg)))
+#elif defined (__clang__) || __GNUC__ + 0 > 3 || (__GNUC__ + 0 == 3 && \
+                                                  __GNUC_MINOR__ + 0 >= 1)
 /* 3.1 <= GCC < 5.0 or clang < 2.9 */
 /* old GCC-style deprecation do not support custom messages */
 #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
@@ -277,7 +284,7 @@ typedef SOCKET MHD_socket;
 #if defined(__CYGWIN__) || defined(_WIN32) || defined(MHD_W32LIB)
 #define MHD_NONNULL(...) /* empty */
 #else
-#define MHD_NONNULL(...) __THROW __nonnull((__VA_ARGS__))
+#define MHD_NONNULL(...) __THROW __nonnull ((__VA_ARGS__))
 #endif
 
 /**
@@ -1110,8 +1117,8 @@ enum MHD_Method
    */
   MHD_METHOD_VERSION_CONTROL = 38
 
-  /* For more, check:
-     https://www.iana.org/assignments/http-methods/http-methods.xhtml */
+                               /* For more, check:
+                                  
https://www.iana.org/assignments/http-methods/http-methods.xhtml */
 
 };
 
@@ -1123,7 +1130,8 @@ enum MHD_Method
  * See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
  * @{
  */
-#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED 
"application/x-www-form-urlencoded"
+#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED \
+  "application/x-www-form-urlencoded"
 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
 
 /** @} */ /* end of group postenc */
@@ -1386,7 +1394,8 @@ enum MHD_Method
 /* Standard.      RFC7469 */
 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
 /* Standard.      RFC7469 */
-#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY 
"Public-Key-Pins-Report-Only"
+#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY \
+  "Public-Key-Pins-Report-Only"
 /* No category.   RFC4437 */
 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
 /* No category.   RFC4229 */
@@ -1445,7 +1454,8 @@ enum MHD_Method
 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
 
 /* Some provisional headers. */
-#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN 
"Access-Control-Allow-Origin"
+#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN \
+  "Access-Control-Allow-Origin"
 /** @} */ /* end of group headers */
 
 
@@ -1468,9 +1478,9 @@ enum MHD_Method
  */
 typedef const struct MHD_Action *
 (*MHD_RequestCallback) (void *cls,
-                       struct MHD_Request *request,
-                       const char *url,
-                       enum MHD_Method method);
+                        struct MHD_Request *request,
+                        const char *url,
+                        enum MHD_Method method);
 
 
 /**
@@ -1484,8 +1494,8 @@ typedef const struct MHD_Action *
  */
 _MHD_EXTERN struct MHD_Daemon *
 MHD_daemon_create (MHD_RequestCallback cb,
-                  void *cb_cls)
-  MHD_NONNULL(1);
+                   void *cb_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -1498,7 +1508,7 @@ MHD_daemon_create (MHD_RequestCallback cb,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_start (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1523,7 +1533,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
  */
 _MHD_EXTERN MHD_socket
 MHD_daemon_quiesce (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1534,7 +1544,7 @@ MHD_daemon_quiesce (struct MHD_Daemon *daemon)
  */
 _MHD_EXTERN void
 MHD_daemon_destroy (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1564,10 +1574,10 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_add_connection (struct MHD_Daemon *daemon,
-                          MHD_socket client_socket,
-                          const struct sockaddr *addr,
-                          socklen_t addrlen)
-  MHD_NONNULL(1);
+                           MHD_socket client_socket,
+                           const struct sockaddr *addr,
+                           socklen_t addrlen)
+MHD_NONNULL (1);
 
 
 /**
@@ -1596,11 +1606,11 @@ MHD_daemon_add_connection (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_get_fdset (struct MHD_Daemon *daemon,
-                     fd_set *read_fd_set,
-                     fd_set *write_fd_set,
-                     fd_set *except_fd_set,
-                     MHD_socket *max_fd)
-  MHD_NONNULL(1,2,3,4);
+                      fd_set *read_fd_set,
+                      fd_set *write_fd_set,
+                      fd_set *except_fd_set,
+                      MHD_socket *max_fd)
+MHD_NONNULL (1,2,3,4);
 
 
 /**
@@ -1632,12 +1642,12 @@ MHD_daemon_get_fdset (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
-                      fd_set *read_fd_set,
-                      fd_set *write_fd_set,
-                      fd_set *except_fd_set,
-                      MHD_socket *max_fd,
-                      unsigned int fd_setsize)
-  MHD_NONNULL(1,2,3,4);
+                       fd_set *read_fd_set,
+                       fd_set *write_fd_set,
+                       fd_set *except_fd_set,
+                       MHD_socket *max_fd,
+                       unsigned int fd_setsize)
+MHD_NONNULL (1,2,3,4);
 
 
 /**
@@ -1662,8 +1672,10 @@ MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
  *         fit fd_set.
  * @ingroup event
  */
-#define 
MHD_daemon_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
-  
MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE)
+#define MHD_daemon_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set, \
+                             max_fd) \
+  MHD_get_fdset2 ((daemon),(read_fd_set),(write_fd_set),(except_fd_set), \
+                  (max_fd),FD_SETSIZE)
 
 
 /**
@@ -1687,8 +1699,8 @@ MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_get_timeout (struct MHD_Daemon *daemon,
-                       MHD_UNSIGNED_LONG_LONG *timeout)
-  MHD_NONNULL(1,2);
+                        MHD_UNSIGNED_LONG_LONG *timeout)
+MHD_NONNULL (1,2);
 
 
 /**
@@ -1711,7 +1723,7 @@ MHD_daemon_get_timeout (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_run (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1738,10 +1750,10 @@ MHD_daemon_run (struct MHD_Daemon *daemon)
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_run_from_select (struct MHD_Daemon *daemon,
-                           const fd_set *read_fd_set,
-                           const fd_set *write_fd_set,
-                           const fd_set *except_fd_set)
-  MHD_NONNULL(1,2,3,4);
+                            const fd_set *read_fd_set,
+                            const fd_set *write_fd_set,
+                            const fd_set *except_fd_set)
+MHD_NONNULL (1,2,3,4);
 
 
 /* ********************* daemon options ************** */
@@ -1758,9 +1770,9 @@ MHD_daemon_run_from_select (struct MHD_Daemon *daemon,
  */
 typedef void
 (*MHD_LoggingCallback)(void *cls,
-                      enum MHD_StatusCode sc,
-                      const char *fm,
-                      va_list ap);
+                       enum MHD_StatusCode sc,
+                       const char *fm,
+                       va_list ap);
 
 
 /**
@@ -1774,9 +1786,9 @@ typedef void
  */
 _MHD_EXTERN void
 MHD_daemon_set_logger (struct MHD_Daemon *daemon,
-                      MHD_LoggingCallback logger,
-                      void *logger_cls)
-  MHD_NONNULL(1);
+                       MHD_LoggingCallback logger,
+                       void *logger_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -1784,7 +1796,8 @@ MHD_daemon_set_logger (struct MHD_Daemon *daemon,
  *
  * @param daemon which instance to disable logging for
  */
-#define MHD_daemon_disable_logging(daemon) MHD_daemon_set_logger (daemon, 
NULL, NULL)
+#define MHD_daemon_disable_logging(daemon) MHD_daemon_set_logger (daemon, 
NULL, \
+                                                                  NULL)
 
 
 /**
@@ -1794,7 +1807,7 @@ MHD_daemon_set_logger (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_suppress_date_no_clock (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1816,7 +1829,7 @@ MHD_daemon_suppress_date_no_clock (struct MHD_Daemon 
*daemon)
  */
 _MHD_EXTERN void
 MHD_daemon_disable_itc (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1829,7 +1842,7 @@ MHD_daemon_disable_itc (struct MHD_Daemon *daemon)
  */
 _MHD_EXTERN void
 MHD_daemon_enable_turbo (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1843,7 +1856,7 @@ MHD_daemon_enable_turbo (struct MHD_Daemon *daemon)
  */
 _MHD_EXTERN void
 MHD_daemon_disallow_suspend_resume (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1859,7 +1872,7 @@ MHD_daemon_disallow_suspend_resume (struct MHD_Daemon 
*daemon)
  */
 _MHD_EXTERN void
 MHD_daemon_disallow_upgrade (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -1904,9 +1917,9 @@ enum MHD_FastOpenMethod
  */
 _MHD_EXTERN enum MHD_Bool
 MHD_daemon_tcp_fastopen (struct MHD_Daemon *daemon,
-                        enum MHD_FastOpenMethod fom,
-                        unsigned int queue_length)
-  MHD_NONNULL(1);
+                         enum MHD_FastOpenMethod fom,
+                         unsigned int queue_length)
+MHD_NONNULL (1);
 
 
 /**
@@ -1958,9 +1971,9 @@ enum MHD_AddressFamily
  */
 _MHD_EXTERN void
 MHD_daemon_bind_port (struct MHD_Daemon *daemon,
-                     enum MHD_AddressFamily af,
-                     uint16_t port)
-  MHD_NONNULL(1);
+                      enum MHD_AddressFamily af,
+                      uint16_t port)
+MHD_NONNULL (1);
 
 
 /**
@@ -1974,9 +1987,9 @@ MHD_daemon_bind_port (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_bind_socket_address (struct MHD_Daemon *daemon,
-                               const struct sockaddr *sa,
-                               size_t sa_len)
-  MHD_NONNULL(1);
+                                const struct sockaddr *sa,
+                                size_t sa_len)
+MHD_NONNULL (1);
 
 
 /**
@@ -1988,8 +2001,8 @@ MHD_daemon_bind_socket_address (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_listen_backlog (struct MHD_Daemon *daemon,
-                          int listen_backlog)
-  MHD_NONNULL(1);
+                           int listen_backlog)
+MHD_NONNULL (1);
 
 
 /**
@@ -2004,7 +2017,7 @@ MHD_daemon_listen_backlog (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_listen_allow_address_reuse (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -2023,8 +2036,8 @@ MHD_daemon_listen_allow_address_reuse (struct MHD_Daemon 
*daemon)
  */
 _MHD_EXTERN void
 MHD_daemon_listen_socket (struct MHD_Daemon *daemon,
-                         MHD_socket listen_socket)
-  MHD_NONNULL(1);
+                          MHD_socket listen_socket)
+MHD_NONNULL (1);
 
 
 /**
@@ -2064,8 +2077,8 @@ enum MHD_EventLoopSyscall
  */
 _MHD_EXTERN enum MHD_Bool
 MHD_daemon_event_loop (struct MHD_Daemon *daemon,
-                      enum MHD_EventLoopSyscall els)
-  MHD_NONNULL(1);
+                       enum MHD_EventLoopSyscall els)
+MHD_NONNULL (1);
 
 
 /**
@@ -2109,8 +2122,8 @@ enum MHD_ProtocolStrictLevel
  */
 _MHD_EXTERN void
 MHD_daemon_protocol_strict_level (struct MHD_Daemon *daemon,
-                                 enum MHD_ProtocolStrictLevel sl)
-  MHD_NONNULL(1);
+                                  enum MHD_ProtocolStrictLevel sl)
+MHD_NONNULL (1);
 
 
 /**
@@ -2121,7 +2134,7 @@ MHD_daemon_protocol_strict_level (struct MHD_Daemon 
*daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_enable_shoutcast (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -2141,9 +2154,9 @@ MHD_daemon_enable_shoutcast (struct MHD_Daemon *daemon)
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
-                           const char *tls_backend,
-                           const char *ciphers)
-  MHD_NONNULL(1);
+                            const char *tls_backend,
+                            const char *ciphers)
+MHD_NONNULL (1);
 
 
 /**
@@ -2160,10 +2173,10 @@ MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon,
-                                        const char *mem_key,
-                                        const char *mem_cert,
-                                        const char *pass)
-  MHD_NONNULL(1,2,3);
+                                         const char *mem_key,
+                                         const char *mem_cert,
+                                         const char *pass)
+MHD_NONNULL (1,2,3);
 
 
 /**
@@ -2176,8 +2189,8 @@ MHD_daemon_tls_key_and_cert_from_memory (struct 
MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
-                            const char *dh)
-  MHD_NONNULL(1);
+                             const char *dh)
+MHD_NONNULL (1);
 
 
 /**
@@ -2190,14 +2203,14 @@ MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
  * @param[out] psk to be set to the pre-shared-key; should be allocated with 
malloc(),
  *                 will be freed by MHD
  * @param[out] psk_size to be set to the number of bytes in @a psk
- * @return 0 on success, -1 on errors 
+ * @return 0 on success, -1 on errors
  */
 typedef int
 (*MHD_PskServerCredentialsCallback)(void *cls,
-                                   const struct MHD_Connection *connection,
-                                   const char *username,
-                                   void **psk,
-                                   size_t *psk_size);
+                                    const struct MHD_Connection *connection,
+                                    const char *username,
+                                    void **psk,
+                                    size_t *psk_size);
 
 
 /**
@@ -2210,9 +2223,9 @@ typedef int
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_set_tls_psk_callback (struct MHD_Daemon *daemon,
-                                MHD_PskServerCredentialsCallback psk_cb,
-                                void *psk_cb_cls)
-  MHD_NONNULL(1);
+                                 MHD_PskServerCredentialsCallback psk_cb,
+                                 void *psk_cb_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -2225,8 +2238,8 @@ MHD_daemon_set_tls_psk_callback (struct MHD_Daemon 
*daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
-                         const char *mem_trust)
-  MHD_NONNULL(1);
+                          const char *mem_trust)
+MHD_NONNULL (1);
 
 
 /**
@@ -2238,8 +2251,8 @@ MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon,
-                              int gnutls_credentials)
-  MHD_NONNULL(1);
+                               int gnutls_credentials)
+MHD_NONNULL (1);
 
 
 /**
@@ -2261,8 +2274,8 @@ MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_gnutls_key_and_cert_from_callback (struct MHD_Daemon *daemon,
-                                             void *cb)
-  MHD_NONNULL(1);
+                                              void *cb)
+MHD_NONNULL (1);
 
 
 /**
@@ -2308,7 +2321,7 @@ enum MHD_ThreadingMode
  *
  * @return an `enum MHD_ThreadingMode` for a thread pool of size @a n
  */
-#define MHD_TM_THREAD_POOL(n) ((enum MHD_ThreadingMode)(n))
+#define MHD_TM_THREAD_POOL(n) ((enum MHD_ThreadingMode) (n))
 
 
 /**
@@ -2320,8 +2333,8 @@ enum MHD_ThreadingMode
  */
 _MHD_EXTERN void
 MHD_daemon_threading_mode (struct MHD_Daemon *daemon,
-                           enum MHD_ThreadingMode tm)
-  MHD_NONNULL(1);
+                           enum MHD_ThreadingMode tm)
+MHD_NONNULL (1);
 
 
 /**
@@ -2334,9 +2347,9 @@ MHD_daemon_threading_mode (struct MHD_Daemon *daemon,
  * @return #MHD_YES if connection is allowed, #MHD_NO if not
  */
 typedef enum MHD_Bool
-(*MHD_AcceptPolicyCallback) (void *cls,
-                             const struct sockaddr *addr,
-                             size_t addrlen);
+(*MHD_AcceptPolicyCallback)(void *cls,
+                            const struct sockaddr *addr,
+                            size_t addrlen);
 
 
 /**
@@ -2350,9 +2363,9 @@ typedef enum MHD_Bool
  */
 _MHD_EXTERN void
 MHD_daemon_accept_policy (struct MHD_Daemon *daemon,
-                         MHD_AcceptPolicyCallback apc,
-                         void *apc_cls)
-  MHD_NONNULL(1);
+                          MHD_AcceptPolicyCallback apc,
+                          void *apc_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -2367,8 +2380,8 @@ MHD_daemon_accept_policy (struct MHD_Daemon *daemon,
  */
 typedef void *
 (*MHD_EarlyUriLogCallback)(void *cls,
-                          const char *uri,
-                          struct MHD_Request *request);
+                           const char *uri,
+                           struct MHD_Request *request);
 
 
 /**
@@ -2382,9 +2395,9 @@ typedef void *
  */
 _MHD_EXTERN void
 MHD_daemon_set_early_uri_logger (struct MHD_Daemon *daemon,
-                                MHD_EarlyUriLogCallback cb,
-                                void *cb_cls)
-  MHD_NONNULL(1);
+                                 MHD_EarlyUriLogCallback cb,
+                                 void *cb_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -2431,8 +2444,8 @@ enum MHD_ConnectionNotificationCode
  */
 typedef void
 (*MHD_NotifyConnectionCallback) (void *cls,
-                                struct MHD_Connection *connection,
-                                enum MHD_ConnectionNotificationCode toe);
+                                 struct MHD_Connection *connection,
+                                 enum MHD_ConnectionNotificationCode toe);
 
 
 /**
@@ -2445,9 +2458,9 @@ typedef void
  */
 _MHD_EXTERN void
 MHD_daemon_set_notify_connection (struct MHD_Daemon *daemon,
-                                 MHD_NotifyConnectionCallback ncc,
-                                 void *ncc_cls)
-  MHD_NONNULL(1);
+                                  MHD_NotifyConnectionCallback ncc,
+                                  void *ncc_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -2463,9 +2476,9 @@ MHD_daemon_set_notify_connection (struct MHD_Daemon 
*daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_connection_memory_limit (struct MHD_Daemon *daemon,
-                                   size_t memory_limit_b,
-                                   size_t memory_increment_b)
-  MHD_NONNULL(1);
+                                    size_t memory_limit_b,
+                                    size_t memory_increment_b)
+MHD_NONNULL (1);
 
 
 /**
@@ -2478,8 +2491,8 @@ MHD_daemon_connection_memory_limit (struct MHD_Daemon 
*daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_thread_stack_size (struct MHD_Daemon *daemon,
-                             size_t stack_limit_b)
-  MHD_NONNULL(1);
+                              size_t stack_limit_b)
+MHD_NONNULL (1);
 
 
 /**
@@ -2499,9 +2512,9 @@ MHD_daemon_thread_stack_size (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_connection_limits (struct MHD_Daemon *daemon,
-                             unsigned int global_connection_limit,
-                             unsigned int ip_connection_limit)
-  MHD_NONNULL(1);
+                              unsigned int global_connection_limit,
+                              unsigned int ip_connection_limit)
+MHD_NONNULL (1);
 
 
 /**
@@ -2514,8 +2527,8 @@ MHD_daemon_connection_limits (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_connection_default_timeout (struct MHD_Daemon *daemon,
-                                      unsigned int timeout_s)
-  MHD_NONNULL(1);
+                                       unsigned int timeout_s)
+MHD_NONNULL (1);
 
 
 /**
@@ -2532,8 +2545,8 @@ MHD_daemon_connection_default_timeout (struct MHD_Daemon 
*daemon,
  */
 typedef size_t
 (*MHD_UnescapeCallback) (void *cls,
-                        struct MHD_Request *req,
-                        char *s);
+                         struct MHD_Request *req,
+                         char *s);
 
 
 /**
@@ -2549,9 +2562,9 @@ typedef size_t
  */
 _MHD_EXTERN void
 MHD_daemon_unescape_cb (struct MHD_Daemon *daemon,
-                       MHD_UnescapeCallback unescape_cb,
-                       void *unescape_cb_cls)
-  MHD_NONNULL(1);
+                        MHD_UnescapeCallback unescape_cb,
+                        void *unescape_cb_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -2565,9 +2578,9 @@ MHD_daemon_unescape_cb (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN void
 MHD_daemon_digest_auth_random (struct MHD_Daemon *daemon,
-                              size_t buf_size,
-                              const void *buf)
-  MHD_NONNULL(1,3);
+                               size_t buf_size,
+                               const void *buf)
+MHD_NONNULL (1,3);
 
 
 /**
@@ -2579,8 +2592,8 @@ MHD_daemon_digest_auth_random (struct MHD_Daemon *daemon,
  */
 _MHD_EXTERN enum MHD_StatusCode
 MHD_daemon_digest_auth_nc_length (struct MHD_Daemon *daemon,
-                                 size_t nc_length)
-  MHD_NONNULL(1);
+                                  size_t nc_length)
+MHD_NONNULL (1);
 
 
 /* ********************* connection options ************** */
@@ -2596,8 +2609,8 @@ MHD_daemon_digest_auth_nc_length (struct MHD_Daemon 
*daemon,
  */
 _MHD_EXTERN void
 MHD_connection_set_timeout (struct MHD_Connection *connection,
-                           unsigned int timeout_s)
-  MHD_NONNULL(1);
+                            unsigned int timeout_s)
+MHD_NONNULL (1);
 
 
 /* **************** Request handling functions ***************** */
@@ -2678,10 +2691,10 @@ typedef int
  */
 _MHD_EXTERN unsigned int
 MHD_request_get_values (struct MHD_Request *request,
-                       enum MHD_ValueKind kind,
-                       MHD_KeyValueIterator iterator,
-                       void *iterator_cls)
-  MHD_NONNULL(1);
+                        enum MHD_ValueKind kind,
+                        MHD_KeyValueIterator iterator,
+                        void *iterator_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -2711,10 +2724,10 @@ MHD_request_get_values (struct MHD_Request *request,
  */
 _MHD_EXTERN enum MHD_Bool
 MHD_request_set_value (struct MHD_Request *request,
-                      enum MHD_ValueKind kind,
-                      const char *key,
-                      const char *value)
-  MHD_NONNULL(1,3,4);
+                       enum MHD_ValueKind kind,
+                       const char *key,
+                       const char *value)
+MHD_NONNULL (1,3,4);
 
 
 /**
@@ -2729,9 +2742,9 @@ MHD_request_set_value (struct MHD_Request *request,
  */
 _MHD_EXTERN const char *
 MHD_request_lookup_value (struct MHD_Request *request,
-                         enum MHD_ValueKind kind,
-                         const char *key)
-  MHD_NONNULL(1);
+                          enum MHD_ValueKind kind,
+                          const char *key)
+MHD_NONNULL (1);
 
 
 
@@ -2741,7 +2754,8 @@ MHD_request_lookup_value (struct MHD_Request *request,
  * @{
  */
 /* See 
http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml */
-enum MHD_HTTP_StatusCode {
+enum MHD_HTTP_StatusCode
+{
   MHD_HTTP_CONTINUE = 100,
   MHD_HTTP_SWITCHING_PROTOCOLS = 101,
   MHD_HTTP_PROCESSING = 102,
@@ -2777,7 +2791,9 @@ enum MHD_HTTP_StatusCode {
   MHD_HTTP_NOT_ACCEPTABLE = 406,
 /** @deprecated */
 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use 
MHD_HTTP_NOT_ACCEPTABLE") MHD_HTTP_NOT_ACCEPTABLE
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use 
MHD_HTTP_NOT_ACCEPTABLE") \
+  MHD_HTTP_NOT_ACCEPTABLE
   MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED = 407,
   MHD_HTTP_REQUEST_TIMEOUT = 408,
   MHD_HTTP_CONFLICT = 409,
@@ -2787,16 +2803,22 @@ enum MHD_HTTP_StatusCode {
   MHD_HTTP_PAYLOAD_TOO_LARGE = 413,
 /** @deprecated */
 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, 
use MHD_HTTP_PAYLOAD_TOO_LARGE") MHD_HTTP_PAYLOAD_TOO_LARGE
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use 
MHD_HTTP_PAYLOAD_TOO_LARGE") \
+  MHD_HTTP_PAYLOAD_TOO_LARGE
   MHD_HTTP_URI_TOO_LONG = 414,
 /** @deprecated */
 #define MHD_HTTP_REQUEST_URI_TOO_LONG \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use 
MHD_HTTP_URI_TOO_LONG") MHD_HTTP_URI_TOO_LONG
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use 
MHD_HTTP_URI_TOO_LONG") \
+  MHD_HTTP_URI_TOO_LONG
   MHD_HTTP_UNSUPPORTED_MEDIA_TYPE = 415,
   MHD_HTTP_RANGE_NOT_SATISFIABLE = 416,
 /** @deprecated */
 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is 
deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") MHD_HTTP_RANGE_NOT_SATISFIABLE
+  _MHD_DEPR_IN_MACRO ( \
+    "Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use 
MHD_HTTP_RANGE_NOT_SATISFIABLE") \
+  MHD_HTTP_RANGE_NOT_SATISFIABLE
   MHD_HTTP_EXPECTATION_FAILED = 417,
 
   MHD_HTTP_MISDIRECTED_REQUEST = 421,
@@ -2903,7 +2925,7 @@ MHD_action_suspend (void);
  */
 _MHD_EXTERN void
 MHD_request_resume (struct MHD_Request *request)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /* **************** Response manipulation functions ***************** */
@@ -2936,8 +2958,8 @@ struct MHD_Response;
  */
 _MHD_EXTERN const struct MHD_Action *
 MHD_action_from_response (struct MHD_Response *response,
-                         enum MHD_Bool destroy_after_use)
-  MHD_NONNULL(1);
+                          enum MHD_Bool destroy_after_use)
+MHD_NONNULL (1);
 
 
 /**
@@ -2949,7 +2971,7 @@ MHD_action_from_response (struct MHD_Response *response,
  */
 _MHD_EXTERN void
 MHD_response_option_v10_only (struct MHD_Response *response)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -3023,8 +3045,8 @@ enum MHD_RequestTerminationCode
  */
 typedef void
 (*MHD_RequestTerminationCallback) (void *cls,
-                                  enum MHD_RequestTerminationCode toe,
-                                  void *request_context);
+                                   enum MHD_RequestTerminationCode toe,
+                                   void *request_context);
 
 
 /**
@@ -3037,9 +3059,10 @@ typedef void
  */
 _MHD_EXTERN void
 MHD_response_option_termination_callback (struct MHD_Response *response,
-                                         MHD_RequestTerminationCallback 
termination_cb,
-                                         void *termination_cb_cls)
-  MHD_NONNULL(1);
+                                          MHD_RequestTerminationCallback
+                                          termination_cb,
+                                          void *termination_cb_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -3124,11 +3147,11 @@ typedef void
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_response_from_callback (enum MHD_HTTP_StatusCode sc,
-                           uint64_t size,
-                           size_t block_size,
-                           MHD_ContentReaderCallback crc,
-                           void *crc_cls,
-                           MHD_ContentReaderFreeCallback crfc);
+                            uint64_t size,
+                            size_t block_size,
+                            MHD_ContentReaderCallback crc,
+                            void *crc_cls,
+                            MHD_ContentReaderFreeCallback crfc);
 
 
 /**
@@ -3181,9 +3204,9 @@ enum MHD_ResponseMemoryMode
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_response_from_buffer (enum MHD_HTTP_StatusCode sc,
-                         size_t size,
-                         void *buffer,
-                         enum MHD_ResponseMemoryMode mode);
+                          size_t size,
+                          void *buffer,
+                          enum MHD_ResponseMemoryMode mode);
 
 
 /**
@@ -3206,9 +3229,9 @@ MHD_response_from_buffer (enum MHD_HTTP_StatusCode sc,
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_response_from_fd (enum MHD_HTTP_StatusCode sc,
-                     int fd,
-                     uint64_t offset,
-                     uint64_t size);
+                      int fd,
+                      uint64_t offset,
+                      uint64_t size);
 
 
 /**
@@ -3255,9 +3278,9 @@ struct MHD_UpgradeResponseHandle;
  */
 _MHD_EXTERN enum MHD_Bool
 MHD_upgrade_operation (struct MHD_UpgradeResponseHandle *urh,
-                      enum MHD_UpgradeOperation operation,
-                      ...)
-  MHD_NONNULL(1);
+                       enum MHD_UpgradeOperation operation,
+                       ...)
+MHD_NONNULL (1);
 
 
 /**
@@ -3349,8 +3372,8 @@ typedef void
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
-                         void *upgrade_handler_cls)
-  MHD_NONNULL(1);
+                          void *upgrade_handler_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -3364,7 +3387,7 @@ MHD_response_for_upgrade (MHD_UpgradeHandler 
upgrade_handler,
  */
 _MHD_EXTERN void
 MHD_response_queue_for_destroy (struct MHD_Response *response)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
@@ -3380,8 +3403,8 @@ MHD_response_queue_for_destroy (struct MHD_Response 
*response)
 _MHD_EXTERN enum MHD_Bool
 MHD_response_add_header (struct MHD_Response *response,
                          const char *header,
-                        const char *content)
-  MHD_NONNULL(1,2,3);
+                         const char *content)
+MHD_NONNULL (1,2,3);
 
 
 /**
@@ -3398,7 +3421,7 @@ _MHD_EXTERN enum MHD_Bool
 MHD_response_add_trailer (struct MHD_Response *response,
                           const char *footer,
                           const char *content)
-  MHD_NONNULL(1,2,3);
+MHD_NONNULL (1,2,3);
 
 
 /**
@@ -3413,8 +3436,8 @@ MHD_response_add_trailer (struct MHD_Response *response,
 _MHD_EXTERN enum MHD_Bool
 MHD_response_del_header (struct MHD_Response *response,
                          const char *header,
-                        const char *content)
-  MHD_NONNULL(1,2,3);
+                         const char *content)
+MHD_NONNULL (1,2,3);
 
 
 /**
@@ -3430,8 +3453,8 @@ MHD_response_del_header (struct MHD_Response *response,
 _MHD_EXTERN unsigned int
 MHD_response_get_headers (struct MHD_Response *response,
                           MHD_KeyValueIterator iterator,
-                         void *iterator_cls)
-  MHD_NONNULL(1);
+                          void *iterator_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -3444,8 +3467,8 @@ MHD_response_get_headers (struct MHD_Response *response,
  */
 _MHD_EXTERN const char *
 MHD_response_get_header (struct MHD_Response *response,
-                        const char *key)
-  MHD_NONNULL(1,2);
+                         const char *key)
+MHD_NONNULL (1,2);
 
 
 /* ************Upload and PostProcessor functions ********************** */
@@ -3480,8 +3503,8 @@ MHD_action_continue (void);
  */
 typedef const struct MHD_Action *
 (*MHD_UploadCallback) (void *cls,
-                      const char *upload_data,
-                      size_t *upload_data_size);
+                       const char *upload_data,
+                       size_t *upload_data_size);
 
 
 /**
@@ -3494,8 +3517,8 @@ typedef const struct MHD_Action *
  */
 _MHD_EXTERN const struct MHD_Action *
 MHD_action_process_upload (MHD_UploadCallback uc,
-                          void *uc_cls)
-  MHD_NONNULL(1);
+                           void *uc_cls)
+MHD_NONNULL (1);
 
 
 /**
@@ -3559,9 +3582,9 @@ typedef const struct MHD_Action *
  */
 _MHD_EXTERN const struct MHD_Action *
 MHD_action_parse_post (size_t buffer_size,
-                      MHD_PostDataIterator iter,
-                      void *iter_cls)
-  MHD_NONNULL(2);
+                       MHD_PostDataIterator iter,
+                       void *iter_cls)
+MHD_NONNULL (2);
 
 
 
@@ -3730,10 +3753,10 @@ union MHD_ConnectionInformation
  */
 _MHD_EXTERN enum MHD_Bool
 MHD_connection_get_information_sz (struct MHD_Connection *connection,
-                                  enum MHD_ConnectionInformationType info_type,
-                                  union MHD_ConnectionInformation 
*return_value,
-                                  size_t return_value_size)
-  MHD_NONNULL(1,3);
+                                   enum MHD_ConnectionInformationType 
info_type,
+                                   union MHD_ConnectionInformation 
*return_value,
+                                   size_t return_value_size)
+MHD_NONNULL (1,3);
 
 
 /**
@@ -3750,7 +3773,8 @@ MHD_connection_get_information_sz (struct MHD_Connection 
*connection,
 #define MHD_connection_get_information(connection,   \
                                        info_type,    \
                                        return_value) \
-        MHD_connection_get_information_sz 
((connection),(info_type),(return_value),sizeof(union 
MHD_ConnectionInformation))
+  MHD_connection_get_information_sz ((connection),(info_type),(return_value), \
+                                     sizeof(union MHD_ConnectionInformation))
 
 
 /**
@@ -3843,10 +3867,10 @@ enum MHD_RequestInformationType
  */
 _MHD_EXTERN enum MHD_Bool
 MHD_request_get_information_sz (struct MHD_Request *request,
-                               enum MHD_RequestInformationType info_type,
-                               union MHD_RequestInformation *return_value,
-                               size_t return_value_size)
-  MHD_NONNULL(1,3);
+                                enum MHD_RequestInformationType info_type,
+                                union MHD_RequestInformation *return_value,
+                                size_t return_value_size)
+MHD_NONNULL (1,3);
 
 
 /**
@@ -3863,7 +3887,8 @@ MHD_request_get_information_sz (struct MHD_Request 
*request,
 #define MHD_request_get_information (request,      \
                                      info_type,    \
                                      return_value) \
-        MHD_request_get_information_sz ((request), (info_type), 
(return_value), sizeof(union MHD_RequestInformation))
+  MHD_request_get_information_sz ((request), (info_type), (return_value), \
+                                  sizeof(union MHD_RequestInformation))
 
 
 /**
@@ -3950,10 +3975,10 @@ union MHD_DaemonInformation
  */
 _MHD_EXTERN enum MHD_Bool
 MHD_daemon_get_information_sz (struct MHD_Daemon *daemon,
-                              enum MHD_DaemonInformationType info_type,
-                              union MHD_DaemonInformation *return_value,
-                              size_t return_value_size)
-  MHD_NONNULL(1,3);
+                               enum MHD_DaemonInformationType info_type,
+                               union MHD_DaemonInformation *return_value,
+                               size_t return_value_size)
+MHD_NONNULL (1,3);
 
 /**
  * Obtain information about the given daemon.
@@ -3969,7 +3994,8 @@ MHD_daemon_get_information_sz (struct MHD_Daemon *daemon,
 #define MHD_daemon_get_information(daemon,       \
                                    info_type,    \
                                    return_value) \
-       MHD_daemon_get_information_sz((daemon), (info_type), (return_value), 
sizeof(union MHD_DaemonInformation));
+  MHD_daemon_get_information_sz ((daemon), (info_type), (return_value), \
+                                 sizeof(union MHD_DaemonInformation));
 
 
 /**
@@ -4007,7 +4033,7 @@ typedef void
  */
 _MHD_EXTERN void
 MHD_set_panic_func (MHD_PanicCallback cb,
-                   void *cls);
+                    void *cls);
 
 
 /**
@@ -4021,7 +4047,7 @@ MHD_set_panic_func (MHD_PanicCallback cb,
  */
 _MHD_EXTERN size_t
 MHD_http_unescape (char *val)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 /**
diff --git a/src/include/microhttpd_tls.h b/src/include/microhttpd_tls.h
index f5b48522..7bd7d477 100644
--- a/src/include/microhttpd_tls.h
+++ b/src/include/microhttpd_tls.h
@@ -54,9 +54,9 @@ struct MHD_TLS_Plugin
 {
   /**
    * Closure with plugin's internal state, opaque to MHD.
-   */ 
+   */
   void *cls;
-  
+
   /**
    * Destroy the plugin, we are done with it.
    */
@@ -77,9 +77,9 @@ struct MHD_TLS_Plugin
    */
   enum MHD_StatusCode
   (*init_kcp)(void *cls,
-             const char *mem_key,
-             const char *mem_cert,
-             const char *pass);
+              const char *mem_key,
+              const char *mem_cert,
+              const char *pass);
 
 
   /**
@@ -91,7 +91,7 @@ struct MHD_TLS_Plugin
    */
   enum MHD_StatusCode
   (*init_dhparams)(void *cls,
-                  const char *dh);
+                   const char *dh);
 
 
   /**
@@ -103,7 +103,7 @@ struct MHD_TLS_Plugin
    */
   enum MHD_StatusCode
   (*init_mem_trust)(void *cls,
-                   const char *mem_trust);
+                    const char *mem_trust);
 
 
   /**
@@ -116,59 +116,59 @@ struct MHD_TLS_Plugin
    */
   struct MHD_TLS_ConnectionState *
   (*setup_connection)(void *cls,
-                     ...);
+                      ...);
 
 
   enum MHD_Bool
   (*handshake)(void *cls,
-              struct MHD_TLS_ConnectionState *cs);
+               struct MHD_TLS_ConnectionState *cs);
 
 
   enum MHD_Bool
   (*idle_ready)(void *cls,
-               struct MHD_TLS_ConnectionState *cs);
+                struct MHD_TLS_ConnectionState *cs);
 
 
   enum MHD_Bool
   (*update_event_loop_info)(void *cls,
-                           struct MHD_TLS_ConnectionState *cs,
-                           enum MHD_RequestEventLoopInfo *eli);
-  
+                            struct MHD_TLS_ConnectionState *cs,
+                            enum MHD_RequestEventLoopInfo *eli);
+
   ssize_t
   (*send)(void *cls,
-         struct MHD_TLS_ConnectionState *cs,
-         const void *buf,
-         size_t buf_size);
+          struct MHD_TLS_ConnectionState *cs,
+          const void *buf,
+          size_t buf_size);
 
 
   ssize_t
   (*recv)(void *cls,
-         struct MHD_TLS_ConnectionState *cs,
-         void *buf,
-         size_t buf_size);
+          struct MHD_TLS_ConnectionState *cs,
+          void *buf,
+          size_t buf_size);
 
 
   const char *
   (*strerror)(void *cls,
-             int ec);
+              int ec);
 
   enum MHD_Bool
   (*check_record_pending)(void *cls,
-                         struct MHD_TLS_ConnectionState *cs);
+                          struct MHD_TLS_ConnectionState *cs);
 
   enum MHD_Bool
-  (*shutdown_connection) (void *cls,
-                         struct MHD_TLS_ConnectionState *cs);
+  (*shutdown_connection)(void *cls,
+                         struct MHD_TLS_ConnectionState *cs);
+
 
-  
   void
   (*teardown_connection)(void *cls,
-                        struct MHD_TLS_ConnectionState *cs);
-  
+                         struct MHD_TLS_ConnectionState *cs);
+
   /**
    * TODO: More functions here....
    */
-  
+
 };
 
 
@@ -191,7 +191,7 @@ typedef struct MHD_TLS_Plugin *
  */
 #define MHD_TLS_INIT(body) \
   struct MHD_TLS_Plugin * \
-  MHD_TLS_init_ ## MHD_TLS_ABI_VERSION (const char *ciphers) \\
+    MHD_TLS_init_ ## MHD_TLS_ABI_VERSION (const char *ciphers) \ \
   {  body  }
 
 #endif
diff --git a/src/include/platform.h b/src/include/platform.h
index 20d4df52..05fe1cd4 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -94,7 +94,7 @@
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 #ifndef WIN32_LEAN_AND_MEAN
 /* Do not include unneeded parts of W32 headers. */
 #define WIN32_LEAN_AND_MEAN 1
@@ -103,28 +103,28 @@
 #include <ws2tcpip.h>
 #endif /* _WIN32 && !__CYGWIN__ */
 
-#if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET)
+#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET)
 /* Do not define __USE_W32_SOCKETS under Cygwin! */
 #error Cygwin with winsock fd_set is not supported
 #endif
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define sleep(seconds) ((SleepEx((seconds)*1000, 1)==0)?0:(seconds))
-#define usleep(useconds) ((SleepEx((useconds)/1000, 1)==0)?0:-1)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
+#define sleep(seconds) ((SleepEx ((seconds) * 1000, 1)==0) ? 0 : (seconds))
+#define usleep(useconds) ((SleepEx ((useconds) / 1000, 1)==0) ? 0 : -1)
 #endif
 
-#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
+#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
 #define _SSIZE_T_DEFINED
 typedef intptr_t ssize_t;
 #endif /* !_SSIZE_T_DEFINED */
 
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
 typedef time_t _MHD_TIMEVAL_TV_SEC_TYPE;
 #else  /* _WIN32 && ! __CYGWIN__ */
 typedef long _MHD_TIMEVAL_TV_SEC_TYPE;
 #endif /* _WIN32 && ! __CYGWIN__ */
 
-#if !defined(IPPROTO_IPV6) && defined(_MSC_FULL_VER) && _WIN32_WINNT >= 0x0501
+#if ! defined(IPPROTO_IPV6) && defined(_MSC_FULL_VER) && _WIN32_WINNT >= 0x0501
 /* VC use IPPROTO_IPV6 as part of enum */
 #define IPPROTO_IPV6 IPPROTO_IPV6
 #endif
diff --git a/src/lib/action_continue.c b/src/lib/action_continue.c
index 20c351ad..9d98940b 100644
--- a/src/lib/action_continue.c
+++ b/src/lib/action_continue.c
@@ -35,11 +35,11 @@
  */
 static enum MHD_StatusCode
 cont_action (void *cls,
-            struct MHD_Request *request)
+             struct MHD_Request *request)
 {
   (void) cls;
   (void) request;
-  /* not sure yet, but this function body may 
+  /* not sure yet, but this function body may
      just legitimately stay empty... */
   return MHD_SC_OK;
 }
diff --git a/src/lib/action_from_response.c b/src/lib/action_from_response.c
index 43f33cb5..6253fb22 100644
--- a/src/lib/action_from_response.c
+++ b/src/lib/action_from_response.c
@@ -36,7 +36,7 @@
  */
 static enum MHD_StatusCode
 response_action (void *cls,
-                struct MHD_Request *request)
+                 struct MHD_Request *request)
 {
   struct MHD_Response *response = cls;
   struct MHD_Daemon *daemon = request->daemon;
@@ -49,14 +49,15 @@ response_action (void *cls,
 #ifdef UPGRADE_SUPPORT
   if ( (NULL != response->upgrade_handler) &&
        daemon->disallow_upgrade )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_UPGRADE_ON_DAEMON_WITH_UPGRADE_DISALLOWED,
-                _("Attempted 'upgrade' connection on daemon without 
MHD_ALLOW_UPGRADE option!\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_UPGRADE_ON_DAEMON_WITH_UPGRADE_DISALLOWED,
+              _ (
+                "Attempted 'upgrade' connection on daemon without 
MHD_ALLOW_UPGRADE option!\n"));
 #endif
-      return MHD_SC_UPGRADE_ON_DAEMON_WITH_UPGRADE_DISALLOWED;
-    }
+    return MHD_SC_UPGRADE_ON_DAEMON_WITH_UPGRADE_DISALLOWED;
+  }
 #endif /* UPGRADE_SUPPORT */
   request->response = response;
 #if defined(_MHD_HAVE_SENDFILE)
@@ -74,21 +75,21 @@ response_action (void *cls,
        (MHD_HTTP_OK > response->status_code) ||
        (MHD_HTTP_NO_CONTENT == response->status_code) ||
        (MHD_HTTP_NOT_MODIFIED == response->status_code) )
-    {
-      /* if this is a "HEAD" request, or a status code for
-         which a body is not allowed, pretend that we
-         have already sent the full message body. */
-      request->response_write_position = response->total_size;
-    }
+  {
+    /* if this is a "HEAD" request, or a status code for
+       which a body is not allowed, pretend that we
+       have already sent the full message body. */
+    request->response_write_position = response->total_size;
+  }
   if ( (MHD_REQUEST_HEADERS_PROCESSED == request->state) &&
        ( (MHD_METHOD_POST == request->method) ||
-        (MHD_METHOD_PUT == request->method) ) )
-    {
-      /* response was queued "early", refuse to read body / footers or
-         further requests! */
-      request->connection->read_closed = true;
-      request->state = MHD_REQUEST_FOOTERS_RECEIVED;
-    }
+         (MHD_METHOD_PUT == request->method) ) )
+  {
+    /* response was queued "early", refuse to read body / footers or
+       further requests! */
+    request->connection->read_closed = true;
+    request->state = MHD_REQUEST_FOOTERS_RECEIVED;
+  }
   if (! request->in_idle)
     (void) MHD_request_handle_idle_ (request);
   return MHD_SC_OK;
@@ -114,16 +115,16 @@ response_action (void *cls,
  */
 _MHD_EXTERN const struct MHD_Action *
 MHD_action_from_response (struct MHD_Response *response,
-                         enum MHD_Bool destroy_after_use)
+                          enum MHD_Bool destroy_after_use)
 {
   response->action.action = &response_action;
   response->action.action_cls = response;
   if (! destroy_after_use)
-    {
-      MHD_mutex_lock_chk_ (&response->mutex);
-      response->reference_count++;
-      MHD_mutex_unlock_chk_ (&response->mutex);
-    }
+  {
+    MHD_mutex_lock_chk_ (&response->mutex);
+    response->reference_count++;
+    MHD_mutex_unlock_chk_ (&response->mutex);
+  }
   return &response->action;
 }
 
diff --git a/src/lib/action_parse_post.c b/src/lib/action_parse_post.c
index c60e793d..53757933 100644
--- a/src/lib/action_parse_post.c
+++ b/src/lib/action_parse_post.c
@@ -52,8 +52,8 @@
  */
 const struct MHD_Action *
 MHD_action_parse_post (size_t buffer_size,
-                      MHD_PostDataIterator iter,
-                      void *iter_cls)
+                       MHD_PostDataIterator iter,
+                       void *iter_cls)
 {
   return NULL; /* not yet implemented */
 }
diff --git a/src/lib/action_process_upload.c b/src/lib/action_process_upload.c
index cafd5d3c..0e9722cd 100644
--- a/src/lib/action_process_upload.c
+++ b/src/lib/action_process_upload.c
@@ -49,13 +49,13 @@ struct UploadAction
  *
  * @param cls the `struct UploadAction` with the
  *    function we are to call for upload data
- * @param request the request for which we are to process 
+ * @param request the request for which we are to process
  *    upload data
  * @return #MHD_SC_OK on success
  */
 static enum MHD_StatusCode
 upload_action (void *cls,
-              struct MHD_Request *request)
+               struct MHD_Request *request)
 {
   struct UploadAction *ua = cls;
 
@@ -75,7 +75,7 @@ upload_action (void *cls,
  */
 const struct MHD_Action *
 MHD_action_process_upload (MHD_UploadCallback uc,
-                          void *uc_cls)
+                           void *uc_cls)
 {
   struct UploadAction *ua;
 
@@ -90,5 +90,3 @@ MHD_action_process_upload (MHD_UploadCallback uc,
 
 
 /* end of action_process_upload.c */
-
-
diff --git a/src/lib/action_suspend.c b/src/lib/action_suspend.c
index bf5adc34..c176e494 100644
--- a/src/lib/action_suspend.c
+++ b/src/lib/action_suspend.c
@@ -35,7 +35,7 @@
  */
 static enum MHD_StatusCode
 suspend_action (void *cls,
-               struct MHD_Request *request)
+                struct MHD_Request *request)
 {
   (void) cls;
   struct MHD_Connection *connection = request->connection;
@@ -43,24 +43,24 @@ suspend_action (void *cls,
 
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   if (connection->resuming)
-    {
-      /* suspending again while we didn't even complete resuming yet */
-      connection->resuming = false;
-      MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-      return MHD_SC_OK;
-    }
+  {
+    /* suspending again while we didn't even complete resuming yet */
+    connection->resuming = false;
+    MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+    return MHD_SC_OK;
+  }
   if (daemon->threading_mode != MHD_TM_THREAD_PER_CONNECTION)
-    {
-      if (connection->connection_timeout ==
-         daemon->connection_default_timeout)
-        XDLL_remove (daemon->normal_timeout_head,
-                     daemon->normal_timeout_tail,
-                     connection);
-      else
-        XDLL_remove (daemon->manual_timeout_head,
-                     daemon->manual_timeout_tail,
-                     connection);
-    }
+  {
+    if (connection->connection_timeout ==
+        daemon->connection_default_timeout)
+      XDLL_remove (daemon->normal_timeout_head,
+                   daemon->normal_timeout_tail,
+                   connection);
+    else
+      XDLL_remove (daemon->manual_timeout_head,
+                   daemon->manual_timeout_tail,
+                   connection);
+  }
   DLL_remove (daemon->connections_head,
               daemon->connections_tail,
               connection);
@@ -71,25 +71,25 @@ suspend_action (void *cls,
   connection->suspended = true;
 #ifdef EPOLL_SUPPORT
   if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
+  {
+    if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
+    {
+      EDLL_remove (daemon->eready_head,
+                   daemon->eready_tail,
+                   connection);
+      connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
+    }
+    if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET))
     {
-      if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-        {
-          EDLL_remove (daemon->eready_head,
-                       daemon->eready_tail,
-                       connection);
-          connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
-        }
-      if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET))
-        {
-          if (0 != epoll_ctl (daemon->epoll_fd,
-                              EPOLL_CTL_DEL,
-                              connection->socket_fd,
-                              NULL))
-            MHD_PANIC (_("Failed to remove FD from epoll set\n"));
-          connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
-        }
-      connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED;
+      if (0 != epoll_ctl (daemon->epoll_fd,
+                          EPOLL_CTL_DEL,
+                          connection->socket_fd,
+                          NULL))
+        MHD_PANIC (_ ("Failed to remove FD from epoll set\n"));
+      connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
     }
+    connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED;
+  }
 #endif
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
   return MHD_SC_OK;
diff --git a/src/lib/base64.c b/src/lib/base64.c
index 3dc7a142..d7d1ec92 100644
--- a/src/lib/base64.c
+++ b/src/lib/base64.c
@@ -9,45 +9,46 @@
 #include "base64.h"
 
 static const char base64_digits[] =
-  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
-    0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
-    14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26,
-    27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
-    45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+  0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+  14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26,
+  27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+  45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
 
 char *
-BASE64Decode(const char* src)
+BASE64Decode (const char*src)
 {
   size_t in_len = strlen (src);
-  char* dest;
-  char* result;
+  char*dest;
+  char*result;
 
   if (in_len % 4)
-    {
-      /* Wrong base64 string length */
-      return NULL;
-    }
-  result = dest = malloc(in_len / 4 * 3 + 1);
+  {
+    /* Wrong base64 string length */
+    return NULL;
+  }
+  result = dest = malloc (in_len / 4 * 3 + 1);
   if (NULL == result)
     return NULL; /* out of memory */
-  while (*src) {
-    char a = base64_digits[(unsigned char)*(src++)];
-    char b = base64_digits[(unsigned char)*(src++)];
-    char c = base64_digits[(unsigned char)*(src++)];
-    char d = base64_digits[(unsigned char)*(src++)];
+  while (*src)
+  {
+    char a = base64_digits[(unsigned char) *(src++)];
+    char b = base64_digits[(unsigned char) *(src++)];
+    char c = base64_digits[(unsigned char) *(src++)];
+    char d = base64_digits[(unsigned char) *(src++)];
     *(dest++) = (a << 2) | ((b & 0x30) >> 4);
-    if (c == (char)-1)
+    if (c == (char) -1)
       break;
     *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2);
-    if (d == (char)-1)
+    if (d == (char) -1)
       break;
     *(dest++) = ((c & 0x03) << 6) | d;
   }
diff --git a/src/lib/base64.h b/src/lib/base64.h
index ba96ca0c..65042c0b 100644
--- a/src/lib/base64.h
+++ b/src/lib/base64.h
@@ -12,6 +12,6 @@
 #include "platform.h"
 
 char *
-BASE64Decode(const char* src);
+BASE64Decode (const char*src);
 
 #endif /* !BASE64_H */
diff --git a/src/lib/connection_add.c b/src/lib/connection_add.c
index cd933d06..aaf04712 100644
--- a/src/lib/connection_add.c
+++ b/src/lib/connection_add.c
@@ -53,14 +53,14 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
      with the socket; */
   if ( (NULL != daemon->tls_api) &&
        (MHD_ELS_POLL != daemon->event_loop_syscall) )
-    {
-      MHD_daemon_upgrade_connection_with_select_ (con);
-    }
+  {
+    MHD_daemon_upgrade_connection_with_select_ (con);
+  }
 #ifdef HAVE_POLL
   else if (NULL != daemon->tls_api)
-    {
-      MHD_daemon_upgrade_connection_with_poll_ (con);
-    }
+  {
+    MHD_daemon_upgrade_connection_with_poll_ (con);
+  }
 #endif
   /* end HTTPS */
 #endif /* HTTPS_SUPPORT */
@@ -111,342 +111,344 @@ thread_main_handle_connection (void *data)
 #endif /* ! HAVE_POLL */
   bool was_suspended = false;
 
-  MHD_thread_init_(&con->pid);
+  MHD_thread_init_ (&con->pid);
 
   while ( (! daemon->shutdown) &&
-         (MHD_REQUEST_CLOSED != con->request.state) )
-    {
-      const time_t timeout = daemon->connection_default_timeout;
+          (MHD_REQUEST_CLOSED != con->request.state) )
+  {
+    const time_t timeout = daemon->connection_default_timeout;
 #ifdef UPGRADE_SUPPORT
-      struct MHD_UpgradeResponseHandle * const urh = con->request.urh;
+    struct MHD_UpgradeResponseHandle *const urh = con->request.urh;
 #else  /* ! UPGRADE_SUPPORT */
-      static const void * const urh = NULL;
+    static const void *const urh = NULL;
 #endif /* ! UPGRADE_SUPPORT */
 
-      if ( (con->suspended) &&
-           (NULL == urh) )
+    if ( (con->suspended) &&
+         (NULL == urh) )
+    {
+      /* Connection was suspended, wait for resume. */
+      was_suspended = true;
+      if (! use_poll)
+      {
+        FD_ZERO (&rs);
+        if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
+                                  &rs,
+                                  NULL,
+                                  FD_SETSIZE))
         {
-          /* Connection was suspended, wait for resume. */
-          was_suspended = true;
-          if (! use_poll)
-            {
-              FD_ZERO (&rs);
-              if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
-                                        &rs,
-                                        NULL,
-                                        FD_SETSIZE))
-                {
   #ifdef HAVE_MESSAGES
-                  MHD_DLOG (con->daemon,
-                           MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
-                            _("Failed to add FD to fd_set\n"));
+          MHD_DLOG (con->daemon,
+                    MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
+                    _ ("Failed to add FD to fd_set\n"));
   #endif
-                  goto exit;
-                }
-              if (0 > MHD_SYS_select_ (MHD_itc_r_fd_ (daemon->itc) + 1,
-                                       &rs,
-                                       NULL,
-                                       NULL,
-                                       NULL))
-                {
-                  const int err = MHD_socket_get_error_();
+          goto exit;
+        }
+        if (0 > MHD_SYS_select_ (MHD_itc_r_fd_ (daemon->itc) + 1,
+                                 &rs,
+                                 NULL,
+                                 NULL,
+                                 NULL))
+        {
+          const int err = MHD_socket_get_error_ ();
 
-                  if (MHD_SCKT_ERR_IS_EINTR_(err))
-                    continue;
+          if (MHD_SCKT_ERR_IS_EINTR_ (err))
+            continue;
 #ifdef HAVE_MESSAGES
-                  MHD_DLOG (con->daemon,
-                           MHD_SC_UNEXPECTED_SELECT_ERROR,
-                            _("Error during select (%d): `%s'\n"),
-                            err,
-                            MHD_socket_strerr_ (err));
+          MHD_DLOG (con->daemon,
+                    MHD_SC_UNEXPECTED_SELECT_ERROR,
+                    _ ("Error during select (%d): `%s'\n"),
+                    err,
+                    MHD_socket_strerr_ (err));
 #endif
-                  break;
-                }
-            }
+          break;
+        }
+      }
 #ifdef HAVE_POLL
-          else /* use_poll */
-            {
-              p[0].events = POLLIN;
-              p[0].fd = MHD_itc_r_fd_ (daemon->itc);
-              p[0].revents = 0;
-              if (0 > MHD_sys_poll_ (p,
-                                     1,
-                                     -1))
-                {
-                  if (MHD_SCKT_LAST_ERR_IS_(MHD_SCKT_EINTR_))
-                    continue;
+      else     /* use_poll */
+      {
+        p[0].events = POLLIN;
+        p[0].fd = MHD_itc_r_fd_ (daemon->itc);
+        p[0].revents = 0;
+        if (0 > MHD_sys_poll_ (p,
+                               1,
+                               -1))
+        {
+          if (MHD_SCKT_LAST_ERR_IS_ (MHD_SCKT_EINTR_))
+            continue;
 #ifdef HAVE_MESSAGES
-                  MHD_DLOG (con->daemon,
-                           MHD_SC_UNEXPECTED_POLL_ERROR,
-                            _("Error during poll: `%s'\n"),
-                            MHD_socket_last_strerr_ ());
+          MHD_DLOG (con->daemon,
+                    MHD_SC_UNEXPECTED_POLL_ERROR,
+                    _ ("Error during poll: `%s'\n"),
+                    MHD_socket_last_strerr_ ());
 #endif
-                  break;
-                }
-            }
+          break;
+        }
+      }
 #endif /* HAVE_POLL */
-          MHD_itc_clear_ (daemon->itc);
-          continue; /* Check again for resume. */
-        } /* End of "suspended" branch. */
+      MHD_itc_clear_ (daemon->itc);
+      continue;     /* Check again for resume. */
+    }     /* End of "suspended" branch. */
 
-      if (was_suspended)
-        {
-          MHD_connection_update_last_activity_ (con); /* Reset timeout timer. 
*/
-          /* Process response queued during suspend and update states. */
-          MHD_request_handle_idle_ (&con->request);
-          was_suspended = false;
-        }
+    if (was_suspended)
+    {
+      MHD_connection_update_last_activity_ (con);     /* Reset timeout timer. 
*/
+      /* Process response queued during suspend and update states. */
+      MHD_request_handle_idle_ (&con->request);
+      was_suspended = false;
+    }
 
-      tvp = NULL;
+    tvp = NULL;
 
-      if ( (MHD_EVENT_LOOP_INFO_BLOCK == con->request.event_loop_info)
+    if ( (MHD_EVENT_LOOP_INFO_BLOCK == con->request.event_loop_info)
 #ifdef HTTPS_SUPPORT
-           || ( (con->tls_read_ready) &&
-                (MHD_EVENT_LOOP_INFO_READ == con->request.event_loop_info) )
+         || ( (con->tls_read_ready) &&
+              (MHD_EVENT_LOOP_INFO_READ == con->request.event_loop_info) )
 #endif /* HTTPS_SUPPORT */
          )
-       {
-         /* do not block: more data may be inside of TLS buffers waiting or
-          * application must provide response data */
-         tv.tv_sec = 0;
-         tv.tv_usec = 0;
-         tvp = &tv;
-       }
-      if ( (NULL == tvp) &&
-           (timeout > 0) )
-       {
-         now = MHD_monotonic_sec_counter();
-         if (now - con->last_activity > timeout)
-           tv.tv_sec = 0;
-          else
-            {
-              const time_t seconds_left = timeout - (now - con->last_activity);
-#if !defined(_WIN32) || defined(__CYGWIN__)
-              tv.tv_sec = seconds_left;
+    {
+      /* do not block: more data may be inside of TLS buffers waiting or
+       * application must provide response data */
+      tv.tv_sec = 0;
+      tv.tv_usec = 0;
+      tvp = &tv;
+    }
+    if ( (NULL == tvp) &&
+         (timeout > 0) )
+    {
+      now = MHD_monotonic_sec_counter ();
+      if (now - con->last_activity > timeout)
+        tv.tv_sec = 0;
+      else
+      {
+        const time_t seconds_left = timeout - (now - con->last_activity);
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+        tv.tv_sec = seconds_left;
 #else  /* _WIN32 && !__CYGWIN__ */
-              if (seconds_left > TIMEVAL_TV_SEC_MAX)
-                tv.tv_sec = TIMEVAL_TV_SEC_MAX;
-              else
-                tv.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) seconds_left;
+        if (seconds_left > TIMEVAL_TV_SEC_MAX)
+          tv.tv_sec = TIMEVAL_TV_SEC_MAX;
+        else
+          tv.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) seconds_left;
 #endif /* _WIN32 && ! __CYGWIN__  */
-            }
-         tv.tv_usec = 0;
-         tvp = &tv;
-       }
-      if (! use_poll)
-       {
-         /* use select */
-         bool err_state = false;
+      }
+      tv.tv_usec = 0;
+      tvp = &tv;
+    }
+    if (! use_poll)
+    {
+      /* use select */
+      bool err_state = false;
 
-         FD_ZERO (&rs);
-         FD_ZERO (&ws);
-          FD_ZERO (&es);
-         maxsock = MHD_INVALID_SOCKET;
-         switch (con->request.event_loop_info)
-           {
-           case MHD_EVENT_LOOP_INFO_READ:
-             if (! MHD_add_to_fd_set_ (con->socket_fd,
-                                        &rs,
-                                        &maxsock,
-                                        FD_SETSIZE))
-               err_state = true;
-             break;
-           case MHD_EVENT_LOOP_INFO_WRITE:
-             if (! MHD_add_to_fd_set_ (con->socket_fd,
-                                        &ws,
-                                        &maxsock,
-                                        FD_SETSIZE))
-                err_state = true;
-             break;
-           case MHD_EVENT_LOOP_INFO_BLOCK:
-             if (! MHD_add_to_fd_set_ (con->socket_fd,
-                                        &es,
-                                        &maxsock,
-                                        FD_SETSIZE))
-               err_state = true;
-             break;
-           case MHD_EVENT_LOOP_INFO_CLEANUP:
-             /* how did we get here!? */
-             goto exit;
-           }
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      maxsock = MHD_INVALID_SOCKET;
+      switch (con->request.event_loop_info)
+      {
+      case MHD_EVENT_LOOP_INFO_READ:
+        if (! MHD_add_to_fd_set_ (con->socket_fd,
+                                  &rs,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = true;
+        break;
+      case MHD_EVENT_LOOP_INFO_WRITE:
+        if (! MHD_add_to_fd_set_ (con->socket_fd,
+                                  &ws,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = true;
+        break;
+      case MHD_EVENT_LOOP_INFO_BLOCK:
+        if (! MHD_add_to_fd_set_ (con->socket_fd,
+                                  &es,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = true;
+        break;
+      case MHD_EVENT_LOOP_INFO_CLEANUP:
+        /* how did we get here!? */
+        goto exit;
+      }
 #if WINDOWS
-          if (MHD_ITC_IS_VALID_(daemon->itc) )
-            {
-              if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
-                                        &rs,
-                                        &maxsock,
-                                        FD_SETSIZE))
-                err_state = 1;
-            }
+      if (MHD_ITC_IS_VALID_ (daemon->itc) )
+      {
+        if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
+                                  &rs,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = 1;
+      }
 #endif
-            if (err_state)
-              {
+      if (err_state)
+      {
 #ifdef HAVE_MESSAGES
-                MHD_DLOG (con->daemon,
-                         MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
-                          _("Failed to add FD to fd_set\n"));
+        MHD_DLOG (con->daemon,
+                  MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
+                  _ ("Failed to add FD to fd_set\n"));
 #endif
-                goto exit;
-              }
+        goto exit;
+      }
 
-         num_ready = MHD_SYS_select_ (maxsock + 1,
-                                       &rs,
-                                       &ws,
-                                       &es,
-                                       tvp);
-         if (num_ready < 0)
-           {
-             const int err = MHD_socket_get_error_();
+      num_ready = MHD_SYS_select_ (maxsock + 1,
+                                   &rs,
+                                   &ws,
+                                   &es,
+                                   tvp);
+      if (num_ready < 0)
+      {
+        const int err = MHD_socket_get_error_ ();
 
-             if (MHD_SCKT_ERR_IS_EINTR_(err))
-               continue;
+        if (MHD_SCKT_ERR_IS_EINTR_ (err))
+          continue;
 #ifdef HAVE_MESSAGES
-             MHD_DLOG (con->daemon,
-                       MHD_SC_UNEXPECTED_SELECT_ERROR,
-                       _("Error during select (%d): `%s'\n"),
-                       err,
-                       MHD_socket_strerr_ (err));
+        MHD_DLOG (con->daemon,
+                  MHD_SC_UNEXPECTED_SELECT_ERROR,
+                  _ ("Error during select (%d): `%s'\n"),
+                  err,
+                  MHD_socket_strerr_ (err));
 #endif
-             break;
-           }
+        break;
+      }
 #if WINDOWS
-          /* Clear ITC before other processing so additional
-           * signals will trigger select() again */
-          if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
-               (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
-                          &rs)) )
-            MHD_itc_clear_ (daemon->itc);
+      /* Clear ITC before other processing so additional
+       * signals will trigger select() again */
+      if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
+           (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
+                      &rs)) )
+        MHD_itc_clear_ (daemon->itc);
 #endif
-          if (MHD_NO ==
-              MHD_connection_call_handlers_ (con,
-                                            FD_ISSET (con->socket_fd,
-                                                      &rs),
-                                            FD_ISSET (con->socket_fd,
-                                                      &ws),
-                                            FD_ISSET (con->socket_fd,
-                                                      &es)) )
-            goto exit;
-       }
+      if (MHD_NO ==
+          MHD_connection_call_handlers_ (con,
+                                         FD_ISSET (con->socket_fd,
+                                                   &rs),
+                                         FD_ISSET (con->socket_fd,
+                                                   &ws),
+                                         FD_ISSET (con->socket_fd,
+                                                   &es)) )
+        goto exit;
+    }
 #ifdef HAVE_POLL
-      else
-       {
-         /* use poll */
-         memset (&p,
-                  0,
-                  sizeof (p));
-         p[0].fd = con->socket_fd;
-         switch (con->request.event_loop_info)
-           {
-           case MHD_EVENT_LOOP_INFO_READ:
-             p[0].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
-             break;
-           case MHD_EVENT_LOOP_INFO_WRITE:
-             p[0].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
-             break;
-           case MHD_EVENT_LOOP_INFO_BLOCK:
-             p[0].events |= MHD_POLL_EVENTS_ERR_DISC;
-             break;
-           case MHD_EVENT_LOOP_INFO_CLEANUP:
-             /* how did we get here!? */
-             goto exit;
-           }
+    else
+    {
+      /* use poll */
+      memset (&p,
+              0,
+              sizeof (p));
+      p[0].fd = con->socket_fd;
+      switch (con->request.event_loop_info)
+      {
+      case MHD_EVENT_LOOP_INFO_READ:
+        p[0].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_WRITE:
+        p[0].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_BLOCK:
+        p[0].events |= MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_CLEANUP:
+        /* how did we get here!? */
+        goto exit;
+      }
 #if WINDOWS
-          extra_slot = 0;
-          if (MHD_ITC_IS_VALID_(daemon->itc))
-            {
-              p[1].events |= POLLIN;
-              p[1].fd = MHD_itc_r_fd_ (daemon->itc);
-              p[1].revents = 0;
-              extra_slot = 1;
-            }
+      extra_slot = 0;
+      if (MHD_ITC_IS_VALID_ (daemon->itc))
+      {
+        p[1].events |= POLLIN;
+        p[1].fd = MHD_itc_r_fd_ (daemon->itc);
+        p[1].revents = 0;
+        extra_slot = 1;
+      }
 #endif
-         if (MHD_sys_poll_ (p,
+      if (MHD_sys_poll_ (p,
 #if WINDOWS
-                             1 + extra_slot,
+                         1 + extra_slot,
 #else
-                             1,
+                         1,
 #endif
-                             (NULL == tvp) ? -1 : tv.tv_sec * 1000) < 0)
-           {
-             if (MHD_SCKT_LAST_ERR_IS_(MHD_SCKT_EINTR_))
-               continue;
+                         (NULL == tvp) ? -1 : tv.tv_sec * 1000) < 0)
+      {
+        if (MHD_SCKT_LAST_ERR_IS_ (MHD_SCKT_EINTR_))
+          continue;
 #ifdef HAVE_MESSAGES
-             MHD_DLOG (con->daemon,
-                       MHD_SC_UNEXPECTED_POLL_ERROR,
-                        _("Error during poll: `%s'\n"),
-                       MHD_socket_last_strerr_ ());
+        MHD_DLOG (con->daemon,
+                  MHD_SC_UNEXPECTED_POLL_ERROR,
+                  _ ("Error during poll: `%s'\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-             break;
-           }
+        break;
+      }
 #if WINDOWS
-          /* Clear ITC before other processing so additional
-           * signals will trigger poll() again */
-          if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
-               (0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
-            MHD_itc_clear_ (daemon->itc);
+      /* Clear ITC before other processing so additional
+       * signals will trigger poll() again */
+      if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
+           (0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
+        MHD_itc_clear_ (daemon->itc);
 #endif
-          if (MHD_NO ==
-              MHD_connection_call_handlers_ (con,
-                                            0 != (p[0].revents & POLLIN),
-                                            0 != (p[0].revents & POLLOUT),
-                                            0 != (p[0].revents & (POLLERR | 
MHD_POLL_REVENTS_ERR_DISC))))
-            goto exit;
-       }
+      if (MHD_NO ==
+          MHD_connection_call_handlers_ (con,
+                                         (0 != (p[0].revents & POLLIN)),
+                                         (0 != (p[0].revents & POLLOUT)),
+                                         (0 != (p[0].revents & (POLLERR
+                                                                |
+                                                                
MHD_POLL_REVENTS_ERR_DISC))) ))
+        goto exit;
+    }
 #endif
 #ifdef UPGRADE_SUPPORT
-      if (MHD_REQUEST_UPGRADE == con->request.state)
-        {
-          /* Normal HTTP processing is finished,
-           * notify application. */
-          if (NULL != con->request.response->termination_cb)
-            con->request.response->termination_cb
-             (con->request.response->termination_cb_cls,
-              MHD_REQUEST_TERMINATED_COMPLETED_OK,
-              con->request.client_context);
-          thread_main_connection_upgrade (con);
-          /* MHD_connection_finish_forward_() was called by 
thread_main_connection_upgrade(). */
+    if (MHD_REQUEST_UPGRADE == con->request.state)
+    {
+      /* Normal HTTP processing is finished,
+       * notify application. */
+      if (NULL != con->request.response->termination_cb)
+        con->request.response->termination_cb
+          (con->request.response->termination_cb_cls,
+          MHD_REQUEST_TERMINATED_COMPLETED_OK,
+          con->request.client_context);
+      thread_main_connection_upgrade (con);
+      /* MHD_connection_finish_forward_() was called by 
thread_main_connection_upgrade(). */
 
-          /* "Upgraded" data will not be used in this thread from this point. 
*/
-          con->request.urh->clean_ready = true;
-          /* If 'urh->was_closed' set to true, connection will be
-           * moved immediately to cleanup list. Otherwise connection
-           * will stay in suspended list until 'urh' will be marked
-           * with 'was_closed' by application. */
-          MHD_request_resume (&con->request);
+      /* "Upgraded" data will not be used in this thread from this point. */
+      con->request.urh->clean_ready = true;
+      /* If 'urh->was_closed' set to true, connection will be
+       * moved immediately to cleanup list. Otherwise connection
+       * will stay in suspended list until 'urh' will be marked
+       * with 'was_closed' by application. */
+      MHD_request_resume (&con->request);
 
-          /* skip usual clean up  */
-          return (MHD_THRD_RTRN_TYPE_) 0;
-        }
-#endif /* UPGRADE_SUPPORT */
+      /* skip usual clean up  */
+      return (MHD_THRD_RTRN_TYPE_) 0;
     }
+#endif /* UPGRADE_SUPPORT */
+  }
 #if DEBUG_CLOSE
 #ifdef HAVE_MESSAGES
   MHD_DLOG (con->daemon,
             MHD_SC_THREAD_TERMINATING,
-            _("Processing thread terminating. Closing connection\n"));
+            _ ("Processing thread terminating. Closing connection\n"));
 #endif
 #endif
   if (MHD_REQUEST_CLOSED != con->request.state)
     MHD_connection_close_ (con,
                            (daemon->shutdown) ?
-                           MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
+                           MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN :
                            MHD_REQUEST_TERMINATED_WITH_ERROR);
   MHD_request_handle_idle_ (&con->request);
 exit:
   if (NULL != con->request.response)
-    {
-      MHD_response_queue_for_destroy (con->request.response);
-      con->request.response = NULL;
-    }
+  {
+    MHD_response_queue_for_destroy (con->request.response);
+    con->request.response = NULL;
+  }
 
   if (MHD_INVALID_SOCKET != con->socket_fd)
-    {
-      shutdown (con->socket_fd,
-                SHUT_WR);
-      /* 'socket_fd' can be used in other thread to signal shutdown.
-       * To avoid data races, do not close socket here. Daemon will
-       * use more connections only after cleanup anyway. */
-    }
+  {
+    shutdown (con->socket_fd,
+              SHUT_WR);
+    /* 'socket_fd' can be used in other thread to signal shutdown.
+     * To avoid data races, do not close socket here. Daemon will
+     * use more connections only after cleanup anyway. */
+  }
   return (MHD_THRD_RTRN_TYPE_) 0;
 }
 
@@ -469,9 +471,9 @@ recv_param_adapter (struct MHD_Connection *connection,
 
   if ( (MHD_INVALID_SOCKET == connection->socket_fd) ||
        (MHD_REQUEST_CLOSED == connection->request.state) )
-    {
-      return MHD_ERR_NOTCONN_;
-    }
+  {
+    return MHD_ERR_NOTCONN_;
+  }
   if (i > MHD_SCKT_SEND_MAX_SIZE_)
     i = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
 
@@ -479,25 +481,25 @@ recv_param_adapter (struct MHD_Connection *connection,
                    other,
                    i);
   if (0 > ret)
+  {
+    const int err = MHD_socket_get_error_ ();
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
     {
-      const int err = MHD_socket_get_error_ ();
-      if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
-        {
 #ifdef EPOLL_SUPPORT
-          /* Got EAGAIN --- no longer read-ready */
-          connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
+      /* Got EAGAIN --- no longer read-ready */
+      connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
 #endif /* EPOLL_SUPPORT */
-          return MHD_ERR_AGAIN_;
-        }
-      if (MHD_SCKT_ERR_IS_EINTR_ (err))
-        return MHD_ERR_AGAIN_;
-      if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
-        return MHD_ERR_CONNRESET_;
-      /* Treat any other error as hard error. */
-      return MHD_ERR_NOTCONN_;
+      return MHD_ERR_AGAIN_;
     }
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return MHD_ERR_AGAIN_;
+    if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
+      return MHD_ERR_CONNRESET_;
+    /* Treat any other error as hard error. */
+    return MHD_ERR_NOTCONN_;
+  }
 #ifdef EPOLL_SUPPORT
-  else if (i > (size_t)ret)
+  else if (i > (size_t) ret)
     connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
 #endif /* EPOLL_SUPPORT */
   return ret;
@@ -522,9 +524,9 @@ send_param_adapter (struct MHD_Connection *connection,
 
   if ( (MHD_INVALID_SOCKET == connection->socket_fd) ||
        (MHD_REQUEST_CLOSED == connection->request.state) )
-    {
-      return MHD_ERR_NOTCONN_;
-    }
+  {
+    return MHD_ERR_NOTCONN_;
+  }
   if (i > MHD_SCKT_SEND_MAX_SIZE_)
     i = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
 
@@ -532,26 +534,26 @@ send_param_adapter (struct MHD_Connection *connection,
                    other,
                    i);
   if (0 > ret)
-    {
-      const int err = MHD_socket_get_error_();
+  {
+    const int err = MHD_socket_get_error_ ();
 
-      if (MHD_SCKT_ERR_IS_EAGAIN_(err))
-        {
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
+    {
 #ifdef EPOLL_SUPPORT
-          /* EAGAIN --- no longer write-ready */
-          connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
+      /* EAGAIN --- no longer write-ready */
+      connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
 #endif /* EPOLL_SUPPORT */
-          return MHD_ERR_AGAIN_;
-        }
-      if (MHD_SCKT_ERR_IS_EINTR_ (err))
-        return MHD_ERR_AGAIN_;
-      if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
-        return MHD_ERR_CONNRESET_;
-      /* Treat any other error as hard error. */
-      return MHD_ERR_NOTCONN_;
+      return MHD_ERR_AGAIN_;
     }
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return MHD_ERR_AGAIN_;
+    if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
+      return MHD_ERR_CONNRESET_;
+    /* Treat any other error as hard error. */
+    return MHD_ERR_NOTCONN_;
+  }
 #ifdef EPOLL_SUPPORT
-  else if (i > (size_t)ret)
+  else if (i > (size_t) ret)
     connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
 #endif /* EPOLL_SUPPORT */
   return ret;
@@ -582,11 +584,11 @@ send_param_adapter (struct MHD_Connection *connection,
  */
 static enum MHD_StatusCode
 internal_add_connection (struct MHD_Daemon *daemon,
-                        MHD_socket client_socket,
-                        const struct sockaddr *addr,
-                        socklen_t addrlen,
-                        bool external_add,
-                        bool non_blck)
+                         MHD_socket client_socket,
+                         const struct sockaddr *addr,
+                         socklen_t addrlen,
+                         bool external_add,
+                         bool non_blck)
 {
   enum MHD_StatusCode sc;
   struct MHD_Connection *connection;
@@ -594,78 +596,78 @@ internal_add_connection (struct MHD_Daemon *daemon,
 
   /* Direct add to master daemon could happen only with "external" add mode. */
   mhd_assert ( (NULL == daemon->worker_pool) ||
-              (external_add) );
+               (external_add) );
   if ( (external_add) &&
        (NULL != daemon->worker_pool) )
-    {
-      unsigned int i;
+  {
+    unsigned int i;
 
-      /* have a pool, try to find a pool with capacity; we use the
-        socket as the initial offset into the pool for load
-        balancing */
-      for (i = 0; i < daemon->worker_pool_size; ++i)
-        {
-          struct MHD_Daemon * const worker =
-                &daemon->worker_pool[(i + client_socket) % 
daemon->worker_pool_size];
-          if (worker->connections < worker->global_connection_limit)
-            return internal_add_connection (worker,
-                                            client_socket,
-                                            addr,
-                                            addrlen,
-                                            true,
-                                            non_blck);
-        }
-      /* all pools are at their connection limit, must refuse */
-      MHD_socket_close_chk_ (client_socket);
+    /* have a pool, try to find a pool with capacity; we use the
+ socket as the initial offset into the pool for load
+ balancing */
+    for (i = 0; i < daemon->worker_pool_size; ++i)
+    {
+      struct MHD_Daemon *const worker =
+        &daemon->worker_pool[(i + client_socket) % daemon->worker_pool_size];
+      if (worker->connections < worker->global_connection_limit)
+        return internal_add_connection (worker,
+                                        client_socket,
+                                        addr,
+                                        addrlen,
+                                        true,
+                                        non_blck);
+    }
+    /* all pools are at their connection limit, must refuse */
+    MHD_socket_close_chk_ (client_socket);
 #if ENFILE
-      errno = ENFILE;
+    errno = ENFILE;
 #endif
-      return MHD_SC_LIMIT_CONNECTIONS_REACHED;
-    }
+    return MHD_SC_LIMIT_CONNECTIONS_REACHED;
+  }
 
-  if ( (! MHD_SCKT_FD_FITS_FDSET_(client_socket,
-                                  NULL)) &&
+  if ( (! MHD_SCKT_FD_FITS_FDSET_ (client_socket,
+                                   NULL)) &&
        (MHD_ELS_SELECT == daemon->event_loop_syscall) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
-               _("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
-               (int) client_socket,
-               (int) FD_SETSIZE);
+    MHD_DLOG (daemon,
+              MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
+              _ ("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
+              (int) client_socket,
+              (int) FD_SETSIZE);
 #endif
-      MHD_socket_close_chk_ (client_socket);
+    MHD_socket_close_chk_ (client_socket);
 #if EINVAL
-      errno = EINVAL;
+    errno = EINVAL;
 #endif
-      return MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
-    }
+    return MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
+  }
 
 #ifdef MHD_socket_nosignal_
   if (! MHD_socket_nosignal_ (client_socket))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ACCEPT_CONFIGURE_NOSIGPIPE_FAILED,
-                _("Failed to set SO_NOSIGPIPE on accepted socket: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              MHD_SC_ACCEPT_CONFIGURE_NOSIGPIPE_FAILED,
+              _ ("Failed to set SO_NOSIGPIPE on accepted socket: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
 #ifndef MSG_NOSIGNAL
-      /* Cannot use socket as it can produce SIGPIPE. */
+    /* Cannot use socket as it can produce SIGPIPE. */
 #ifdef ENOTSOCK
-      errno = ENOTSOCK;
+    errno = ENOTSOCK;
 #endif /* ENOTSOCK */
-      return MHD_SC_ACCEPT_CONFIGURE_NOSIGPIPE_FAILED;
+    return MHD_SC_ACCEPT_CONFIGURE_NOSIGPIPE_FAILED;
 #endif /* ! MSG_NOSIGNAL */
-    }
+  }
 #endif /* MHD_socket_nosignal_ */
 
 
 #ifdef HAVE_MESSAGES
 #if DEBUG_CONNECT
   MHD_DLOG (daemon,
-           MHD_SC_CONNECTION_ACCEPTED,
-            _("Accepted connection on socket %d\n"),
+            MHD_SC_CONNECTION_ACCEPTED,
+            _ ("Accepted connection on socket %d\n"),
             client_socket);
 #endif
 #endif
@@ -673,82 +675,83 @@ internal_add_connection (struct MHD_Daemon *daemon,
        (MHD_NO == MHD_ip_limit_add (daemon,
                                     addr,
                                     addrlen)) )
-    {
-      /* above connection limit - reject */
+  {
+    /* above connection limit - reject */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LIMIT_CONNECTIONS_REACHED,
-                _("Server reached connection limit. Closing inbound 
connection.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_LIMIT_CONNECTIONS_REACHED,
+              _ (
+                "Server reached connection limit. Closing inbound 
connection.\n"));
 #endif
-      MHD_socket_close_chk_ (client_socket);
+    MHD_socket_close_chk_ (client_socket);
 #if ENFILE
-      errno = ENFILE;
+    errno = ENFILE;
 #endif
-      return MHD_SC_LIMIT_CONNECTIONS_REACHED;
-    }
+    return MHD_SC_LIMIT_CONNECTIONS_REACHED;
+  }
 
   /* apply connection acceptance policy if present */
   if ( (NULL != daemon->accept_policy_cb) &&
        (MHD_NO ==
-       daemon->accept_policy_cb (daemon->accept_policy_cb_cls,
-                                 addr,
-                                 addrlen)) )
-    {
+        daemon->accept_policy_cb (daemon->accept_policy_cb_cls,
+                                  addr,
+                                  addrlen)) )
+  {
 #if DEBUG_CLOSE
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ACCEPT_POLICY_REJECTED,
-                _("Connection rejected by application. Closing 
connection.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_ACCEPT_POLICY_REJECTED,
+              _ ("Connection rejected by application. Closing connection.\n"));
 #endif
 #endif
-      MHD_socket_close_chk_ (client_socket);
-      MHD_ip_limit_del (daemon,
-                        addr,
-                        addrlen);
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
 #if EACCESS
-      errno = EACCESS;
+    errno = EACCESS;
 #endif
-      return MHD_SC_ACCEPT_POLICY_REJECTED;
-    }
+    return MHD_SC_ACCEPT_POLICY_REJECTED;
+  }
 
   if (NULL ==
       (connection = MHD_calloc_ (1,
-                                sizeof (struct MHD_Connection))))
-    {
-      eno = errno;
+                                 sizeof (struct MHD_Connection))))
+  {
+    eno = errno;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_CONNECTION_MALLOC_FAILURE,
-               "Error allocating memory: %s\n",
-               MHD_strerror_ (errno));
+    MHD_DLOG (daemon,
+              MHD_SC_CONNECTION_MALLOC_FAILURE,
+              "Error allocating memory: %s\n",
+              MHD_strerror_ (errno));
 #endif
-      MHD_socket_close_chk_ (client_socket);
-      MHD_ip_limit_del (daemon,
-                        addr,
-                        addrlen);
-      errno = eno;
-      return MHD_SC_CONNECTION_MALLOC_FAILURE;
-    }
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
+    errno = eno;
+    return MHD_SC_CONNECTION_MALLOC_FAILURE;
+  }
   connection->pool
     = MHD_pool_create (daemon->connection_memory_limit_b);
   if (NULL == connection->pool)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_POOL_MALLOC_FAILURE,
-               _("Error allocating memory: %s\n"),
-               MHD_strerror_ (errno));
+    MHD_DLOG (daemon,
+              MHD_SC_POOL_MALLOC_FAILURE,
+              _ ("Error allocating memory: %s\n"),
+              MHD_strerror_ (errno));
 #endif
-      MHD_socket_close_chk_ (client_socket);
-      MHD_ip_limit_del (daemon,
-                        addr,
-                        addrlen);
-      free (connection);
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
+    free (connection);
 #if ENOMEM
-      errno = ENOMEM;
+    errno = ENOMEM;
 #endif
-      return MHD_SC_POOL_MALLOC_FAILURE;
-    }
+    return MHD_SC_POOL_MALLOC_FAILURE;
+  }
 
   connection->connection_timeout = daemon->connection_default_timeout;
   memcpy (&connection->addr,
@@ -758,148 +761,151 @@ internal_add_connection (struct MHD_Daemon *daemon,
   connection->socket_fd = client_socket;
   connection->sk_nonblck = non_blck;
   connection->daemon = daemon;
-  connection->last_activity = MHD_monotonic_sec_counter();
+  connection->last_activity = MHD_monotonic_sec_counter ();
 
 #ifdef HTTPS_SUPPORT
   if (NULL != daemon->tls_api)
+  {
+    connection->tls_cs
+      = daemon->tls_api->setup_connection (daemon->tls_api->cls,
+                                           NULL /* FIXME */);
+    if (NULL == connection->tls_cs)
     {
-      connection->tls_cs
-       = daemon->tls_api->setup_connection (daemon->tls_api->cls,
-                                            NULL /* FIXME */);
-      if (NULL == connection->tls_cs)
-       {
-         eno = EINVAL;
-         sc = -1; // FIXME!
-         goto cleanup;
-       }
+      eno = EINVAL;
+      sc = -1; // FIXME!
+      goto cleanup;
     }
+  }
   else
 #endif /* ! HTTPS_SUPPORT */
-    {
-      /* set default connection handlers  */
-      connection->recv_cls = &recv_param_adapter;
-      connection->send_cls = &send_param_adapter;
-    }
+  {
+    /* set default connection handlers  */
+    connection->recv_cls = &recv_param_adapter;
+    connection->send_cls = &send_param_adapter;
+  }
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   /* Firm check under lock. */
   if (daemon->connections >= daemon->global_connection_limit)
-    {
-      MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-      /* above connection limit - reject */
+  {
+    MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+    /* above connection limit - reject */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LIMIT_CONNECTIONS_REACHED,
-                _("Server reached connection limit. Closing inbound 
connection.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_LIMIT_CONNECTIONS_REACHED,
+              _ (
+                "Server reached connection limit. Closing inbound 
connection.\n"));
 #endif
 #if ENFILE
-      eno = ENFILE;
+    eno = ENFILE;
 #endif
-      sc = MHD_SC_LIMIT_CONNECTIONS_REACHED;
-      goto cleanup;
-    }
+    sc = MHD_SC_LIMIT_CONNECTIONS_REACHED;
+    goto cleanup;
+  }
   daemon->connections++;
   if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode)
-    {
-      XDLL_insert (daemon->normal_timeout_head,
-                   daemon->normal_timeout_tail,
-                   connection);
-    }
+  {
+    XDLL_insert (daemon->normal_timeout_head,
+                 daemon->normal_timeout_tail,
+                 connection);
+  }
   DLL_insert (daemon->connections_head,
-             daemon->connections_tail,
-             connection);
+              daemon->connections_tail,
+              connection);
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 
   if (NULL != daemon->notify_connection_cb)
     daemon->notify_connection_cb (daemon->notify_connection_cb_cls,
-                                 connection,
-                                 MHD_CONNECTION_NOTIFY_STARTED);
+                                  connection,
+                                  MHD_CONNECTION_NOTIFY_STARTED);
 
   /* attempt to create handler thread */
   if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
+  {
+    if (! MHD_create_named_thread_ (&connection->pid,
+                                    "MHD-connection",
+                                    daemon->thread_stack_limit_b,
+                                    &thread_main_handle_connection,
+                                    connection))
     {
-      if (! MHD_create_named_thread_ (&connection->pid,
-                                      "MHD-connection",
-                                      daemon->thread_stack_limit_b,
-                                      &thread_main_handle_connection,
-                                      connection))
-        {
-         eno = errno;
+      eno = errno;
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_THREAD_LAUNCH_FAILURE,
-                    "Failed to create a thread: %s\n",
-                    MHD_strerror_ (eno));
+      MHD_DLOG (daemon,
+                MHD_SC_THREAD_LAUNCH_FAILURE,
+                "Failed to create a thread: %s\n",
+                MHD_strerror_ (eno));
 #endif
-         sc = MHD_SC_THREAD_LAUNCH_FAILURE;
-         goto cleanup;
-        }
+      sc = MHD_SC_THREAD_LAUNCH_FAILURE;
+      goto cleanup;
     }
+  }
   else
-    {
-      connection->pid = daemon->pid;
-    }
+  {
+    connection->pid = daemon->pid;
+  }
 #ifdef EPOLL_SUPPORT
   if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
-    {
-      if ( (! daemon->enable_turbo) ||
-          (external_add))
-       { /* Do not manipulate EReady DL-list in 'external_add' mode. */
-         struct epoll_event event;
+  {
+    if ( (! daemon->enable_turbo) ||
+         (external_add))
+    { /* Do not manipulate EReady DL-list in 'external_add' mode. */
+      struct epoll_event event;
 
-         event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
-         event.data.ptr = connection;
-         if (0 != epoll_ctl (daemon->epoll_fd,
-                             EPOLL_CTL_ADD,
-                             client_socket,
-                             &event))
-           {
-             eno = errno;
+      event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
+      event.data.ptr = connection;
+      if (0 != epoll_ctl (daemon->epoll_fd,
+                          EPOLL_CTL_ADD,
+                          client_socket,
+                          &event))
+      {
+        eno = errno;
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                       MHD_SC_EPOLL_CTL_ADD_FAILED,
-                        _("Call to epoll_ctl failed: %s\n"),
-                        MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  MHD_SC_EPOLL_CTL_ADD_FAILED,
+                  _ ("Call to epoll_ctl failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-             sc = MHD_SC_EPOLL_CTL_ADD_FAILED;
-             goto cleanup;
-           }
-         connection->epoll_state |= MHD_EPOLL_STATE_IN_EPOLL_SET;
-       }
-      else
-       {
-         connection->epoll_state |= MHD_EPOLL_STATE_READ_READY | 
MHD_EPOLL_STATE_WRITE_READY
-           | MHD_EPOLL_STATE_IN_EREADY_EDLL;
-         EDLL_insert (daemon->eready_head,
-                      daemon->eready_tail,
-                      connection);
-       }
+        sc = MHD_SC_EPOLL_CTL_ADD_FAILED;
+        goto cleanup;
+      }
+      connection->epoll_state |= MHD_EPOLL_STATE_IN_EPOLL_SET;
+    }
+    else
+    {
+      connection->epoll_state |= MHD_EPOLL_STATE_READ_READY
+                                 | MHD_EPOLL_STATE_WRITE_READY
+                                 | MHD_EPOLL_STATE_IN_EREADY_EDLL;
+      EDLL_insert (daemon->eready_head,
+                   daemon->eready_tail,
+                   connection);
     }
+  }
   else /* This 'else' is combined with next 'if'. */
 #endif
   if ( (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode) &&
        (external_add) &&
-       (MHD_ITC_IS_VALID_(daemon->itc)) &&
+       (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_itc_activate_ (daemon->itc,
-                            "n")) )
-    {
+                             "n")) )
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ITC_USE_FAILED,
-                _("Failed to signal new connection via inter-thread 
communication channel (not necessarily fatal, continuing anyway)."));
+    MHD_DLOG (daemon,
+              MHD_SC_ITC_USE_FAILED,
+              _ (
+                "Failed to signal new connection via inter-thread 
communication channel (not necessarily fatal, continuing anyway)."));
 #endif
-    }
+  }
   return MHD_SC_OK;
 
- cleanup:
+cleanup:
   if (NULL != daemon->notify_connection_cb)
     daemon->notify_connection_cb (daemon->notify_connection_cb_cls,
-                                 connection,
-                                 MHD_CONNECTION_NOTIFY_CLOSED);
+                                  connection,
+                                  MHD_CONNECTION_NOTIFY_CLOSED);
 #ifdef HTTPS_SUPPORT
   if ( (NULL != daemon->tls_api) &&
        (NULL != connection->tls_cs) )
-   daemon->tls_api->teardown_connection (daemon->tls_api->cls,
-                                        connection->tls_cs);
+    daemon->tls_api->teardown_connection (daemon->tls_api->cls,
+                                          connection->tls_cs);
 #endif /* HTTPS_SUPPORT */
   MHD_socket_close_chk_ (client_socket);
   MHD_ip_limit_del (daemon,
@@ -907,14 +913,14 @@ internal_add_connection (struct MHD_Daemon *daemon,
                     addrlen);
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode)
-    {
-      XDLL_remove (daemon->normal_timeout_head,
-                   daemon->normal_timeout_tail,
-                   connection);
-    }
+  {
+    XDLL_remove (daemon->normal_timeout_head,
+                 daemon->normal_timeout_tail,
+                 connection);
+  }
   DLL_remove (daemon->connections_head,
-             daemon->connections_tail,
-             connection);
+              daemon->connections_tail,
+              connection);
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
   MHD_pool_destroy (connection->pool);
   free (connection);
@@ -954,42 +960,42 @@ internal_add_connection (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_add_connection (struct MHD_Daemon *daemon,
-                          MHD_socket client_socket,
-                          const struct sockaddr *addr,
-                          socklen_t addrlen)
+                           MHD_socket client_socket,
+                           const struct sockaddr *addr,
+                           socklen_t addrlen)
 {
   bool sk_nonbl;
 
   if (! MHD_socket_nonblocking_ (client_socket))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ACCEPT_CONFIGURE_NONBLOCKING_FAILED,
-                _("Failed to set nonblocking mode on new client socket: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              MHD_SC_ACCEPT_CONFIGURE_NONBLOCKING_FAILED,
+              _ ("Failed to set nonblocking mode on new client socket: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      sk_nonbl = false;
-    }
+    sk_nonbl = false;
+  }
   else
-    {
-      sk_nonbl = true;
-    }
+  {
+    sk_nonbl = true;
+  }
 
   if ( (daemon->enable_turbo) &&
        (! MHD_socket_noninheritable_ (client_socket)) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ACCEPT_CONFIGURE_NOINHERIT_FAILED,
-                _("Failed to set noninheritable mode on new client 
socket.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_ACCEPT_CONFIGURE_NOINHERIT_FAILED,
+              _ ("Failed to set noninheritable mode on new client socket.\n"));
 #endif
-    }
+  }
   return internal_add_connection (daemon,
-                                 client_socket,
-                                 addr,
+                                  client_socket,
+                                  addr,
                                   addrlen,
-                                 true,
-                                 sk_nonbl);
+                                  true,
+                                  sk_nonbl);
 }
 
 
@@ -1033,94 +1039,98 @@ MHD_accept_connection_ (struct MHD_Daemon *daemon)
 #endif /* ! USE_ACCEPT4 */
   if ( (MHD_INVALID_SOCKET == s) ||
        (addrlen <= 0) )
-    {
-      const int err = MHD_socket_get_error_ ();
+  {
+    const int err = MHD_socket_get_error_ ();
 
-      /* This could be a common occurance with multiple worker threads */
-      if (MHD_SCKT_ERR_IS_ (err,
-                            MHD_SCKT_EINVAL_))
-        return MHD_SC_DAEMON_ALREADY_SHUTDOWN; /* can happen during shutdown, 
let's hope this is the cause... */
-      if (MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err))
-        return MHD_SC_ACCEPT_FAST_DISCONNECT; /* do not print error if client 
just disconnected early */
-      if (MHD_SCKT_ERR_IS_EAGAIN_ (err) )
-       return MHD_SC_ACCEPT_FAILED_EAGAIN;
-      if (MHD_INVALID_SOCKET != s)
-        {
-          MHD_socket_close_chk_ (s);
-        }
-      if ( MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err) )
-        {
-          /* system/process out of resources */
-          if (0 == daemon->connections)
-            {
+    /* This could be a common occurance with multiple worker threads */
+    if (MHD_SCKT_ERR_IS_ (err,
+                          MHD_SCKT_EINVAL_))
+      return MHD_SC_DAEMON_ALREADY_SHUTDOWN;   /* can happen during shutdown, 
let's hope this is the cause... */
+    if (MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_ (err))
+      return MHD_SC_ACCEPT_FAST_DISCONNECT;   /* do not print error if client 
just disconnected early */
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err) )
+      return MHD_SC_ACCEPT_FAILED_EAGAIN;
+    if (MHD_INVALID_SOCKET != s)
+    {
+      MHD_socket_close_chk_ (s);
+    }
+    if ( MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err) )
+    {
+      /* system/process out of resources */
+      if (0 == daemon->connections)
+      {
 #ifdef HAVE_MESSAGES
-              /* Not setting 'at_limit' flag, as there is no way it
-                 would ever be cleared.  Instead trying to produce
-                 bit fat ugly warning. */
-              MHD_DLOG (daemon,
-                       MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED_INSTANTLY,
-                        _("Hit process or system resource limit at FIRST 
connection. This is really bad as there is no sane way to proceed. Will try 
busy waiting for system resources to become magically available.\n"));
+        /* Not setting 'at_limit' flag, as there is no way it
+           would ever be cleared.  Instead trying to produce
+           bit fat ugly warning. */
+        MHD_DLOG (daemon,
+                  MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED_INSTANTLY,
+                  _ (
+                    "Hit process or system resource limit at FIRST connection. 
This is really bad as there is no sane way to proceed. Will try busy waiting 
for system resources to become magically available.\n"));
 #endif
-             return MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED_INSTANTLY;
-            }
-          else
-            {
-              MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
-              daemon->at_limit = true;
-              MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+        return MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED_INSTANTLY;
+      }
+      else
+      {
+        MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+        daemon->at_limit = true;
+        MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                       MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED,
-                        _("Hit process or system resource limit at %u 
connections, temporarily suspending accept(). Consider setting a lower 
MHD_OPTION_CONNECTION_LIMIT.\n"),
-                        (unsigned int) daemon->connections);
+        MHD_DLOG (daemon,
+                  MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED,
+                  _ (
+                    "Hit process or system resource limit at %u connections, 
temporarily suspending accept(). Consider setting a lower 
MHD_OPTION_CONNECTION_LIMIT.\n"),
+                  (unsigned int) daemon->connections);
 #endif
-             return MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED;
-            }
-        }
+        return MHD_SC_ACCEPT_SYSTEM_LIMIT_REACHED;
+      }
+    }
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ACCEPT_FAILED_UNEXPECTEDLY,
-               _("Error accepting connection: %s\n"),
-               MHD_socket_strerr_(err));
+    MHD_DLOG (daemon,
+              MHD_SC_ACCEPT_FAILED_UNEXPECTEDLY,
+              _ ("Error accepting connection: %s\n"),
+              MHD_socket_strerr_ (err));
 #endif
-      return MHD_SC_ACCEPT_FAILED_UNEXPECTEDLY;
-    }
-#if !defined(USE_ACCEPT4) || !defined(HAVE_SOCK_NONBLOCK)
+    return MHD_SC_ACCEPT_FAILED_UNEXPECTEDLY;
+  }
+#if ! defined(USE_ACCEPT4) || ! defined(HAVE_SOCK_NONBLOCK)
   if (! MHD_socket_nonblocking_ (s))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ACCEPT_CONFIGURE_NONBLOCKING_FAILED,
-                _("Failed to set nonblocking mode on incoming connection 
socket: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              MHD_SC_ACCEPT_CONFIGURE_NONBLOCKING_FAILED,
+              _ (
+                "Failed to set nonblocking mode on incoming connection socket: 
%s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-    }
+  }
   else
     sk_nonbl = true;
 #endif /* !USE_ACCEPT4 || !HAVE_SOCK_NONBLOCK */
-#if !defined(USE_ACCEPT4) || !defined(SOCK_CLOEXEC)
+#if ! defined(USE_ACCEPT4) || ! defined(SOCK_CLOEXEC)
   if (! MHD_socket_noninheritable_ (s))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ACCEPT_CONFIGURE_NOINHERIT_FAILED,
-                _("Failed to set noninheritable mode on incoming connection 
socket.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_ACCEPT_CONFIGURE_NOINHERIT_FAILED,
+              _ (
+                "Failed to set noninheritable mode on incoming connection 
socket.\n"));
 #endif
-    }
+  }
 #endif /* !USE_ACCEPT4 || !SOCK_CLOEXEC */
 #ifdef HAVE_MESSAGES
 #if DEBUG_CONNECT
   MHD_DLOG (daemon,
-           MHD_SC_CONNECTION_ACCEPTED,
-            _("Accepted connection on socket %d\n"),
+            MHD_SC_CONNECTION_ACCEPTED,
+            _ ("Accepted connection on socket %d\n"),
             s);
 #endif
 #endif
   return internal_add_connection (daemon,
                                   s,
-                                 addr,
+                                  addr,
                                   addrlen,
-                                 false,
+                                  false,
                                   sk_nonbl);
 }
 
diff --git a/src/lib/connection_add.h b/src/lib/connection_add.h
index 6957fd77..de8abd9a 100644
--- a/src/lib/connection_add.h
+++ b/src/lib/connection_add.h
@@ -32,10 +32,10 @@
  * that process daemon's select()/poll()/etc.
  *
  * @param daemon handle with the listen socket
- * @return #MHD_SC_OK on success 
+ * @return #MHD_SC_OK on success
  */
 enum MHD_StatusCode
 MHD_accept_connection_ (struct MHD_Daemon *daemon)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
 
 #endif
diff --git a/src/lib/connection_call_handlers.c 
b/src/lib/connection_call_handlers.c
index af8860d6..c4fb448e 100644
--- a/src/lib/connection_call_handlers.c
+++ b/src/lib/connection_call_handlers.c
@@ -56,7 +56,8 @@
  * minimal.
  */
 #ifdef HAVE_MESSAGES
-#define REQUEST_TOO_BIG "<html><head><title>Request too 
big</title></head><body>Your HTTP header was too big for the memory constraints 
of this webserver.</body></html>"
+#define REQUEST_TOO_BIG \
+  "<html><head><title>Request too big</title></head><body>Your HTTP header was 
too big for the memory constraints of this webserver.</body></html>"
 #else
 #define REQUEST_TOO_BIG ""
 #endif
@@ -69,7 +70,8 @@
  * minimal.
  */
 #ifdef HAVE_MESSAGES
-#define REQUEST_LACKS_HOST "<html><head><title>&quot;Host:&quot; header 
required</title></head><body>In HTTP 1.1, requests must include a 
&quot;Host:&quot; header, and your HTTP 1.1 request lacked such a 
header.</body></html>"
+#define REQUEST_LACKS_HOST \
+  "<html><head><title>&quot;Host:&quot; header required</title></head><body>In 
HTTP 1.1, requests must include a &quot;Host:&quot; header, and your HTTP 1.1 
request lacked such a header.</body></html>"
 #else
 #define REQUEST_LACKS_HOST ""
 #endif
@@ -82,7 +84,8 @@
  * minimal.
  */
 #ifdef HAVE_MESSAGES
-#define REQUEST_MALFORMED "<html><head><title>Request 
malformed</title></head><body>Your HTTP request was syntactically 
incorrect.</body></html>"
+#define REQUEST_MALFORMED \
+  "<html><head><title>Request malformed</title></head><body>Your HTTP request 
was syntactically incorrect.</body></html>"
 #else
 #define REQUEST_MALFORMED ""
 #endif
@@ -94,7 +97,8 @@
  * minimal.
  */
 #ifdef HAVE_MESSAGES
-#define INTERNAL_ERROR "<html><head><title>Internal server 
error</title></head><body>Please ask the developer of this Web server to 
carefully read the GNU libmicrohttpd documentation about connection management 
and blocking.</body></html>"
+#define INTERNAL_ERROR \
+  "<html><head><title>Internal server error</title></head><body>Please ask the 
developer of this Web server to carefully read the GNU libmicrohttpd 
documentation about connection management and blocking.</body></html>"
 #else
 #define INTERNAL_ERROR ""
 #endif
@@ -128,17 +132,18 @@ MHD_conn_init_static_ (void)
 #ifdef SF_FLAGS
   long sys_page_size = sysconf (_SC_PAGESIZE);
   if (0 > sys_page_size)
-    { /* Failed to get page size. */
-      freebsd_sendfile_flags_ = SF_NODISKIO;
-      freebsd_sendfile_flags_thd_p_c_ = SF_NODISKIO;
-    }
+  {   /* Failed to get page size. */
+    freebsd_sendfile_flags_ = SF_NODISKIO;
+    freebsd_sendfile_flags_thd_p_c_ = SF_NODISKIO;
+  }
   else
-    {
-      freebsd_sendfile_flags_ =
-          SF_FLAGS((uint16_t)(MHD_SENFILE_CHUNK_ / sys_page_size), 
SF_NODISKIO);
-      freebsd_sendfile_flags_thd_p_c_ =
-          SF_FLAGS((uint16_t)(MHD_SENFILE_CHUNK_THR_P_C_ / sys_page_size), 
SF_NODISKIO);
-    }
+  {
+    freebsd_sendfile_flags_ =
+      SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_ / sys_page_size), SF_NODISKIO);
+    freebsd_sendfile_flags_thd_p_c_ =
+      SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_THR_P_C_ / sys_page_size),
+                SF_NODISKIO);
+  }
 #endif /* SF_FLAGS */
 }
 #endif /* HAVE_FREEBSD_SENDFILE */
@@ -161,13 +166,13 @@ MHD_conn_init_static_ (void)
  */
 static void
 connection_close_error (struct MHD_Connection *connection,
-                       enum MHD_StatusCode sc,
-                       const char *emsg)
+                        enum MHD_StatusCode sc,
+                        const char *emsg)
 {
 #ifdef HAVE_MESSAGES
   if (NULL != emsg)
     MHD_DLOG (connection->daemon,
-             sc,
+              sc,
               emsg);
 #else  /* ! HAVE_MESSAGES */
   (void) emsg; /* Mute compiler warning. */
@@ -209,8 +214,8 @@ try_grow_read_buffer (struct MHD_Request *request)
   if (0 == request->read_buffer_size)
     new_size = daemon->connection_memory_limit_b / 2;
   else
-    new_size = request->read_buffer_size +
-      daemon->connection_memory_increment_b;
+    new_size = request->read_buffer_size
+               + daemon->connection_memory_increment_b;
   buf = MHD_pool_reallocate (request->connection->pool,
                              request->read_buffer,
                              request->read_buffer_size,
@@ -245,16 +250,16 @@ MHD_request_handle_read_ (struct MHD_Request *request)
     struct MHD_TLS_Plugin *tls;
 
     if ( (NULL != (tls = daemon->tls_api)) &&
-        (! tls->handshake (tls->cls,
-                           connection->tls_cs)) )
+         (! tls->handshake (tls->cls,
+                            connection->tls_cs)) )
       return;
   }
 #endif /* HTTPS_SUPPORT */
 
   /* make sure "read" has a reasonable number of bytes
      in buffer to use per system call (if possible) */
-  if (request->read_buffer_offset +
-      daemon->connection_memory_increment_b >
+  if (request->read_buffer_offset
+      + daemon->connection_memory_increment_b >
       request->read_buffer_size)
     try_grow_read_buffer (request);
 
@@ -263,82 +268,84 @@ MHD_request_handle_read_ (struct MHD_Request *request)
   bytes_read = connection->recv_cls (connection,
                                      &request->read_buffer
                                      [request->read_buffer_offset],
-                                     request->read_buffer_size -
-                                     request->read_buffer_offset);
+                                     request->read_buffer_size
+                                     - request->read_buffer_offset);
   if (bytes_read < 0)
+  {
+    if (MHD_ERR_AGAIN_ == bytes_read)
+      return;     /* No new data to process. */
+    if (MHD_ERR_CONNRESET_ == bytes_read)
     {
-      if (MHD_ERR_AGAIN_ == bytes_read)
-          return; /* No new data to process. */
-      if (MHD_ERR_CONNRESET_ == bytes_read)
-        {
-         CONNECTION_CLOSE_ERROR (connection,
-                                 (MHD_REQUEST_INIT == request->state)
-                                 ? MHD_SC_CONNECTION_CLOSED
-                                 : MHD_SC_CONNECTION_RESET_CLOSED,
-                                 (MHD_REQUEST_INIT == request->state)
-                                 ? NULL
-                                 : _("Socket disconnected while reading 
request.\n"));
-           return;
-        }
       CONNECTION_CLOSE_ERROR (connection,
-                             (MHD_REQUEST_INIT == request->state)
-                             ? MHD_SC_CONNECTION_CLOSED
-                             : MHD_SC_CONNECTION_READ_FAIL_CLOSED,
                               (MHD_REQUEST_INIT == request->state)
-                             ? NULL
-                              : _("Connection socket is closed due to error 
when reading request.\n"));
+                              ? MHD_SC_CONNECTION_CLOSED
+                              : MHD_SC_CONNECTION_RESET_CLOSED,
+                              (MHD_REQUEST_INIT == request->state)
+                              ? NULL
+                              : _ (
+                                "Socket disconnected while reading 
request.\n"));
       return;
     }
+    CONNECTION_CLOSE_ERROR (connection,
+                            (MHD_REQUEST_INIT == request->state)
+                            ? MHD_SC_CONNECTION_CLOSED
+                            : MHD_SC_CONNECTION_READ_FAIL_CLOSED,
+                            (MHD_REQUEST_INIT == request->state)
+                            ? NULL
+                            : _ (
+                              "Connection socket is closed due to error when 
reading request.\n"));
+    return;
+  }
 
   if (0 == bytes_read)
-    { /* Remote side closed connection. */
-      connection->read_closed = true;
-      MHD_connection_close_ (connection,
-                             MHD_REQUEST_TERMINATED_CLIENT_ABORT);
-      return;
-    }
+  {   /* Remote side closed connection. */
+    connection->read_closed = true;
+    MHD_connection_close_ (connection,
+                           MHD_REQUEST_TERMINATED_CLIENT_ABORT);
+    return;
+  }
   request->read_buffer_offset += bytes_read;
   MHD_connection_update_last_activity_ (connection);
 #if DEBUG_STATES
   MHD_DLOG (daemon,
-           MHD_SC_STATE_MACHINE_STATUS_REPORT,
-            _("In function %s handling connection at state: %s\n"),
+            MHD_SC_STATE_MACHINE_STATUS_REPORT,
+            _ ("In function %s handling connection at state: %s\n"),
             __FUNCTION__,
             MHD_state_to_string (request->state));
 #endif
   switch (request->state)
+  {
+  case MHD_REQUEST_INIT:
+  case MHD_REQUEST_URL_RECEIVED:
+  case MHD_REQUEST_HEADER_PART_RECEIVED:
+  case MHD_REQUEST_HEADERS_RECEIVED:
+  case MHD_REQUEST_HEADERS_PROCESSED:
+  case MHD_REQUEST_CONTINUE_SENDING:
+  case MHD_REQUEST_CONTINUE_SENT:
+  case MHD_REQUEST_BODY_RECEIVED:
+  case MHD_REQUEST_FOOTER_PART_RECEIVED:
+    /* nothing to do but default action */
+    if (connection->read_closed)
     {
-    case MHD_REQUEST_INIT:
-    case MHD_REQUEST_URL_RECEIVED:
-    case MHD_REQUEST_HEADER_PART_RECEIVED:
-    case MHD_REQUEST_HEADERS_RECEIVED:
-    case MHD_REQUEST_HEADERS_PROCESSED:
-    case MHD_REQUEST_CONTINUE_SENDING:
-    case MHD_REQUEST_CONTINUE_SENT:
-    case MHD_REQUEST_BODY_RECEIVED:
-    case MHD_REQUEST_FOOTER_PART_RECEIVED:
-      /* nothing to do but default action */
-      if (connection->read_closed)
-        {
-          MHD_connection_close_ (connection,
-                                 MHD_REQUEST_TERMINATED_READ_ERROR);
-        }
-      return;
-    case MHD_REQUEST_CLOSED:
-      return;
+      MHD_connection_close_ (connection,
+                             MHD_REQUEST_TERMINATED_READ_ERROR);
+    }
+    return;
+  case MHD_REQUEST_CLOSED:
+    return;
 #ifdef UPGRADE_SUPPORT
-    case MHD_REQUEST_UPGRADE:
-      mhd_assert (0);
-      return;
+  case MHD_REQUEST_UPGRADE:
+    mhd_assert (0);
+    return;
 #endif /* UPGRADE_SUPPORT */
-    default:
-      /* shrink read buffer to how much is actually used */
-      MHD_pool_reallocate (connection->pool,
-                           request->read_buffer,
-                           request->read_buffer_size + 1,
-                           request->read_buffer_offset);
-      break;
-    }
+  default:
+    /* shrink read buffer to how much is actually used */
+    MHD_pool_reallocate (connection->pool,
+                         request->read_buffer,
+                         request->read_buffer_size + 1,
+                         request->read_buffer_offset);
+    break;
+  }
   return;
 }
 
@@ -361,9 +368,9 @@ sendfile_adapter (struct MHD_Connection *connection)
   uint64_t left;
   uint64_t offsetu64;
 #ifndef HAVE_SENDFILE64
-  const uint64_t max_off_t = (uint64_t)OFF_T_MAX;
+  const uint64_t max_off_t = (uint64_t) OFF_T_MAX;
 #else  /* HAVE_SENDFILE64 */
-  const uint64_t max_off_t = (uint64_t)OFF64_T_MAX;
+  const uint64_t max_off_t = (uint64_t) OFF64_T_MAX;
 #endif /* HAVE_SENDFILE64 */
 #ifdef MHD_LINUX_SOLARIS_SENDFILE
 #ifndef HAVE_SENDFILE64
@@ -379,8 +386,10 @@ sendfile_adapter (struct MHD_Connection *connection)
 #ifdef HAVE_DARWIN_SENDFILE
   off_t len;
 #endif /* HAVE_DARWIN_SENDFILE */
-  const bool used_thr_p_c = (MHD_TM_THREAD_PER_CONNECTION == 
daemon->threading_mode);
-  const size_t chunk_size = used_thr_p_c ? MHD_SENFILE_CHUNK_THR_P_C_ : 
MHD_SENFILE_CHUNK_;
+  const bool used_thr_p_c = (MHD_TM_THREAD_PER_CONNECTION ==
+                             daemon->threading_mode);
+  const size_t chunk_size = used_thr_p_c ? MHD_SENFILE_CHUNK_THR_P_C_ :
+                            MHD_SENFILE_CHUNK_;
   size_t send_size = 0;
 
   mhd_assert (MHD_resp_sender_sendfile == request->resp_sender);
@@ -390,10 +399,10 @@ sendfile_adapter (struct MHD_Connection *connection)
    * use 128KiB chunks (2MiB for thread-per-connection). */
   send_size = (left > chunk_size) ? chunk_size : (size_t) left;
   if (max_off_t < offsetu64)
-    { /* Retry to send with standard 'send()'. */
-      request->resp_sender = MHD_resp_sender_std;
-      return MHD_ERR_AGAIN_;
-    }
+  {   /* Retry to send with standard 'send()'. */
+    request->resp_sender = MHD_resp_sender_std;
+    return MHD_ERR_AGAIN_;
+  }
 #ifdef MHD_LINUX_SOLARIS_SENDFILE
 #ifndef HAVE_SENDFILE64
   offset = (off_t) offsetu64;
@@ -409,54 +418,54 @@ sendfile_adapter (struct MHD_Connection *connection)
                     send_size);
 #endif /* HAVE_SENDFILE64 */
   if (0 > ret)
-    {
-      const int err = MHD_socket_get_error_();
+  {
+    const int err = MHD_socket_get_error_ ();
 
-      if (MHD_SCKT_ERR_IS_EAGAIN_(err))
-        {
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
+    {
 #ifdef EPOLL_SUPPORT
-          /* EAGAIN --- no longer write-ready */
-          connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
+      /* EAGAIN --- no longer write-ready */
+      connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
 #endif /* EPOLL_SUPPORT */
-          return MHD_ERR_AGAIN_;
-        }
-      if (MHD_SCKT_ERR_IS_EINTR_ (err))
-        return MHD_ERR_AGAIN_;
+      return MHD_ERR_AGAIN_;
+    }
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return MHD_ERR_AGAIN_;
 #ifdef HAVE_LINUX_SENDFILE
-      if (MHD_SCKT_ERR_IS_(err,
-                           MHD_SCKT_EBADF_))
-        return MHD_ERR_BADF_;
-      /* sendfile() failed with EINVAL if mmap()-like operations are not
-         supported for FD or other 'unusual' errors occurred, so we should try
-         to fall back to 'SEND'; see also this thread for info on
-         odd libc/Linux behavior with sendfile:
-         http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html 
*/
+    if (MHD_SCKT_ERR_IS_ (err,
+                          MHD_SCKT_EBADF_))
+      return MHD_ERR_BADF_;
+    /* sendfile() failed with EINVAL if mmap()-like operations are not
+       supported for FD or other 'unusual' errors occurred, so we should try
+       to fall back to 'SEND'; see also this thread for info on
+       odd libc/Linux behavior with sendfile:
+       http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */
+    request->resp_sender = MHD_resp_sender_std;
+    return MHD_ERR_AGAIN_;
+#else  /* HAVE_SOLARIS_SENDFILE */
+    if ( (EAFNOSUPPORT == err) ||
+         (EINVAL == err) ||
+         (EOPNOTSUPP == err) )
+    {     /* Retry with standard file reader. */
       request->resp_sender = MHD_resp_sender_std;
       return MHD_ERR_AGAIN_;
-#else  /* HAVE_SOLARIS_SENDFILE */
-      if ( (EAFNOSUPPORT == err) ||
-           (EINVAL == err) ||
-           (EOPNOTSUPP == err) )
-        { /* Retry with standard file reader. */
-          request->resp_sender = MHD_resp_sender_std;
-          return MHD_ERR_AGAIN_;
-        }
-      if ( (ENOTCONN == err) ||
-           (EPIPE == err) )
-        {
-          return MHD_ERR_CONNRESET_;
-        }
-      return MHD_ERR_BADF_; /* Fail hard */
-#endif /* HAVE_SOLARIS_SENDFILE */
     }
+    if ( (ENOTCONN == err) ||
+         (EPIPE == err) )
+    {
+      return MHD_ERR_CONNRESET_;
+    }
+    return MHD_ERR_BADF_;   /* Fail hard */
+#endif /* HAVE_SOLARIS_SENDFILE */
+  }
 #ifdef EPOLL_SUPPORT
-  else if (send_size > (size_t)ret)
-        connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
+  else if (send_size > (size_t) ret)
+    connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
 #endif /* EPOLL_SUPPORT */
 #elif defined(HAVE_FREEBSD_SENDFILE)
 #ifdef SF_FLAGS
   flags = used_thr_p_c ?
-      freebsd_sendfile_flags_thd_p_c_ : freebsd_sendfile_flags_;
+          freebsd_sendfile_flags_thd_p_c_ : freebsd_sendfile_flags_;
 #endif /* SF_FLAGS */
   if (0 != sendfile (file_fd,
                      connection->socket_fd,
@@ -465,26 +474,26 @@ sendfile_adapter (struct MHD_Connection *connection)
                      NULL,
                      &sent_bytes,
                      flags))
+  {
+    const int err = MHD_socket_get_error_ ();
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err) ||
+        MHD_SCKT_ERR_IS_EINTR_ (err) ||
+        (EBUSY == err) )
     {
-      const int err = MHD_socket_get_error_();
-      if (MHD_SCKT_ERR_IS_EAGAIN_(err) ||
-          MHD_SCKT_ERR_IS_EINTR_(err) ||
-          EBUSY == err)
-        {
-          mhd_assert (SSIZE_MAX >= sent_bytes);
-          if (0 != sent_bytes)
-            return (ssize_t)sent_bytes;
+      mhd_assert (SSIZE_MAX >= sent_bytes);
+      if (0 != sent_bytes)
+        return (ssize_t) sent_bytes;
 
-          return MHD_ERR_AGAIN_;
-        }
-      /* Some unrecoverable error. Possibly file FD is not suitable
-       * for sendfile(). Retry with standard send(). */
-      request->resp_sender = MHD_resp_sender_std;
       return MHD_ERR_AGAIN_;
     }
+    /* Some unrecoverable error. Possibly file FD is not suitable
+     * for sendfile(). Retry with standard send(). */
+    request->resp_sender = MHD_resp_sender_std;
+    return MHD_ERR_AGAIN_;
+  }
   mhd_assert (0 < sent_bytes);
   mhd_assert (SSIZE_MAX >= sent_bytes);
-  ret = (ssize_t)sent_bytes;
+  ret = (ssize_t) sent_bytes;
 #elif defined(HAVE_DARWIN_SENDFILE)
   len = (off_t) send_size; /* chunk always fit */
   if (0 != sendfile (file_fd,
@@ -493,35 +502,35 @@ sendfile_adapter (struct MHD_Connection *connection)
                      &len,
                      NULL,
                      0))
+  {
+    const int err = MHD_socket_get_error_ ();
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err) ||
+        MHD_SCKT_ERR_IS_EINTR_ (err))
     {
-      const int err = MHD_socket_get_error_();
-      if (MHD_SCKT_ERR_IS_EAGAIN_(err) ||
-          MHD_SCKT_ERR_IS_EINTR_(err))
-        {
-          mhd_assert (0 <= len);
-          mhd_assert (SSIZE_MAX >= len);
-          mhd_assert (send_size >= (size_t)len);
-          if (0 != len)
-            return (ssize_t)len;
+      mhd_assert (0 <= len);
+      mhd_assert (SSIZE_MAX >= len);
+      mhd_assert (send_size >= (size_t) len);
+      if (0 != len)
+        return (ssize_t) len;
 
-          return MHD_ERR_AGAIN_;
-        }
-      if (ENOTCONN == err ||
-          EPIPE == err)
-        return MHD_ERR_CONNRESET_;
-      if (ENOTSUP == err ||
-          EOPNOTSUPP == err)
-        { /* This file FD is not suitable for sendfile().
+      return MHD_ERR_AGAIN_;
+    }
+    if ((ENOTCONN == err) ||
+        (EPIPE == err) )
+      return MHD_ERR_CONNRESET_;
+    if ((ENOTSUP == err) ||
+        (EOPNOTSUPP == err) )
+    {     /* This file FD is not suitable for sendfile().
            * Retry with standard send(). */
-          request->resp_sender = MHD_resp_sender_std;
-          return MHD_ERR_AGAIN_;
-        }
-      return MHD_ERR_BADF_; /* Return hard error. */
+      request->resp_sender = MHD_resp_sender_std;
+      return MHD_ERR_AGAIN_;
     }
+    return MHD_ERR_BADF_;   /* Return hard error. */
+  }
   mhd_assert (0 <= len);
   mhd_assert (SSIZE_MAX >= len);
-  mhd_assert (send_size >= (size_t)len);
-  ret = (ssize_t)len;
+  mhd_assert (send_size >= (size_t) len);
+  ret = (ssize_t) len;
 #endif /* HAVE_FREEBSD_SENDFILE */
   return ret;
 }
@@ -547,7 +556,7 @@ check_write_done (struct MHD_Request *request,
   request->write_buffer_send_offset = 0;
   request->state = next_state;
   MHD_pool_reallocate (request->connection->pool,
-                      request->write_buffer,
+                       request->write_buffer,
                        request->write_buffer_size,
                        0);
   request->write_buffer = NULL;
@@ -579,47 +588,48 @@ try_ready_normal_body (struct MHD_Request *request)
        (request->response_write_position == response->total_size) )
     return true; /* 0-byte response is always ready */
   if ( (response->data_start <=
-       request->response_write_position) &&
+        request->response_write_position) &&
        (response->data_size + response->data_start >
-       request->response_write_position) )
+        request->response_write_position) )
     return true; /* response already ready */
 #if defined(_MHD_HAVE_SENDFILE)
   if (MHD_resp_sender_sendfile == request->resp_sender)
-    {
-      /* will use sendfile, no need to bother response crc */
-      return true;
-    }
+  {
+    /* will use sendfile, no need to bother response crc */
+    return true;
+  }
 #endif /* _MHD_HAVE_SENDFILE */
 
   ret = response->crc (response->crc_cls,
                        request->response_write_position,
                        response->data,
                        (size_t) MHD_MIN ((uint64_t) response->data_buffer_size,
-                                         response->total_size -
-                                         request->response_write_position));
+                                         response->total_size
+                                         - request->response_write_position));
   if ( (((ssize_t) MHD_CONTENT_READER_END_OF_STREAM) == ret) ||
        (((ssize_t) MHD_CONTENT_READER_END_WITH_ERROR) == ret) )
-    {
-      /* either error or http 1.0 transfer, close socket! */
-      response->total_size = request->response_write_position;
-      MHD_mutex_unlock_chk_ (&response->mutex);
-      if ( ((ssize_t)MHD_CONTENT_READER_END_OF_STREAM) == ret)
-       MHD_connection_close_ (connection,
-                               MHD_REQUEST_TERMINATED_COMPLETED_OK);
-      else
-       CONNECTION_CLOSE_ERROR (connection,
-                               
MHD_SC_APPLICATION_DATA_GENERATION_FAILURE_CLOSED,
-                               _("Closing connection (application reported 
error generating data)\n"));
-      return false;
-    }
+  {
+    /* either error or http 1.0 transfer, close socket! */
+    response->total_size = request->response_write_position;
+    MHD_mutex_unlock_chk_ (&response->mutex);
+    if ( ((ssize_t) MHD_CONTENT_READER_END_OF_STREAM) == ret)
+      MHD_connection_close_ (connection,
+                             MHD_REQUEST_TERMINATED_COMPLETED_OK);
+    else
+      CONNECTION_CLOSE_ERROR (connection,
+                              
MHD_SC_APPLICATION_DATA_GENERATION_FAILURE_CLOSED,
+                              _ (
+                                "Closing connection (application reported 
error generating data)\n"));
+    return false;
+  }
   response->data_start = request->response_write_position;
   response->data_size = ret;
   if (0 == ret)
-    {
-      request->state = MHD_REQUEST_NORMAL_BODY_UNREADY;
-      MHD_mutex_unlock_chk_ (&response->mutex);
-      return false;
-    }
+  {
+    request->state = MHD_REQUEST_NORMAL_BODY_UNREADY;
+    MHD_mutex_unlock_chk_ (&response->mutex);
+    return false;
+  }
   return true;
 }
 
@@ -647,93 +657,94 @@ try_ready_chunked_body (struct MHD_Request *request)
   if (NULL == response->crc)
     return true;
   if (0 == request->write_buffer_size)
-    {
-      size = MHD_MIN (daemon->connection_memory_limit_b,
-                      2 * (0xFFFFFF + sizeof(cbuf) + 2));
-      do
-        {
-          size /= 2;
-          if (size < 128)
-            {
-              MHD_mutex_unlock_chk_ (&response->mutex);
-              /* not enough memory */
-              CONNECTION_CLOSE_ERROR (connection,
-                                     MHD_SC_CONNECTION_POOL_MALLOC_FAILURE,
-                                     _("Closing connection (out of 
memory)\n"));
-              return false;
-            }
-          buf = MHD_pool_allocate (connection->pool,
-                                   size,
-                                   MHD_NO);
-        }
-      while (NULL == buf);
-      request->write_buffer_size = size;
-      request->write_buffer = buf;
-    }
+  {
+    size = MHD_MIN (daemon->connection_memory_limit_b,
+                    2 * (0xFFFFFF + sizeof(cbuf) + 2));
+    do
+    {
+      size /= 2;
+      if (size < 128)
+      {
+        MHD_mutex_unlock_chk_ (&response->mutex);
+        /* not enough memory */
+        CONNECTION_CLOSE_ERROR (connection,
+                                MHD_SC_CONNECTION_POOL_MALLOC_FAILURE,
+                                _ ("Closing connection (out of memory)\n"));
+        return false;
+      }
+      buf = MHD_pool_allocate (connection->pool,
+                               size,
+                               MHD_NO);
+    }
+    while (NULL == buf);
+    request->write_buffer_size = size;
+    request->write_buffer = buf;
+  }
 
   if (0 == response->total_size)
     ret = 0; /* response must be empty, don't bother calling crc */
   else if ( (response->data_start <=
-       request->response_write_position) &&
-       (response->data_start + response->data_size >
-       request->response_write_position) )
-    {
-      /* difference between response_write_position and data_start is less
-         than data_size which is size_t type, no need to check for overflow */
-      const size_t data_write_offset
-        = (size_t)(request->response_write_position - response->data_start);
-      /* buffer already ready, use what is there for the chunk */
-      ret = response->data_size - data_write_offset;
-      if ( ((size_t) ret) > request->write_buffer_size - sizeof (cbuf) - 2 )
-       ret = request->write_buffer_size - sizeof (cbuf) - 2;
-      memcpy (&request->write_buffer[sizeof (cbuf)],
-              &response->data[data_write_offset],
-              ret);
-    }
+             request->response_write_position) &&
+            (response->data_start + response->data_size >
+             request->response_write_position) )
+  {
+    /* difference between response_write_position and data_start is less
+       than data_size which is size_t type, no need to check for overflow */
+    const size_t data_write_offset
+      = (size_t) (request->response_write_position - response->data_start);
+    /* buffer already ready, use what is there for the chunk */
+    ret = response->data_size - data_write_offset;
+    if ( ((size_t) ret) > request->write_buffer_size - sizeof (cbuf) - 2 )
+      ret = request->write_buffer_size - sizeof (cbuf) - 2;
+    memcpy (&request->write_buffer[sizeof (cbuf)],
+            &response->data[data_write_offset],
+            ret);
+  }
   else
-    {
-      /* buffer not in range, try to fill it */
-      ret = response->crc (response->crc_cls,
-                           request->response_write_position,
-                           &request->write_buffer[sizeof (cbuf)],
-                           request->write_buffer_size - sizeof (cbuf) - 2);
-    }
+  {
+    /* buffer not in range, try to fill it */
+    ret = response->crc (response->crc_cls,
+                         request->response_write_position,
+                         &request->write_buffer[sizeof (cbuf)],
+                         request->write_buffer_size - sizeof (cbuf) - 2);
+  }
   if ( ((ssize_t) MHD_CONTENT_READER_END_WITH_ERROR) == ret)
-    {
-      /* error, close socket! */
-      response->total_size = request->response_write_position;
-      MHD_mutex_unlock_chk_ (&response->mutex);
-      CONNECTION_CLOSE_ERROR (connection,
-                             MHD_SC_APPLICATION_DATA_GENERATION_FAILURE_CLOSED,
-                             _("Closing connection (application error 
generating response)\n"));
-      return false;
-    }
+  {
+    /* error, close socket! */
+    response->total_size = request->response_write_position;
+    MHD_mutex_unlock_chk_ (&response->mutex);
+    CONNECTION_CLOSE_ERROR (connection,
+                            MHD_SC_APPLICATION_DATA_GENERATION_FAILURE_CLOSED,
+                            _ (
+                              "Closing connection (application error 
generating response)\n"));
+    return false;
+  }
   if ( (((ssize_t) MHD_CONTENT_READER_END_OF_STREAM) == ret) ||
        (0 == response->total_size) )
-    {
-      /* end of message, signal other side! */
-      memcpy (request->write_buffer,
-              "0\r\n",
-              3);
-      request->write_buffer_append_offset = 3;
-      request->write_buffer_send_offset = 0;
-      response->total_size = request->response_write_position;
-      return true;
-    }
+  {
+    /* end of message, signal other side! */
+    memcpy (request->write_buffer,
+            "0\r\n",
+            3);
+    request->write_buffer_append_offset = 3;
+    request->write_buffer_send_offset = 0;
+    response->total_size = request->response_write_position;
+    return true;
+  }
   if (0 == ret)
-    {
-      request->state = MHD_REQUEST_CHUNKED_BODY_UNREADY;
-      MHD_mutex_unlock_chk_ (&response->mutex);
-      return false;
-    }
+  {
+    request->state = MHD_REQUEST_CHUNKED_BODY_UNREADY;
+    MHD_mutex_unlock_chk_ (&response->mutex);
+    return false;
+  }
   if (ret > 0xFFFFFF)
     ret = 0xFFFFFF;
-  cblen = MHD_snprintf_(cbuf,
-                        sizeof (cbuf),
-                        "%X\r\n",
-                        (unsigned int) ret);
-  mhd_assert(cblen > 0);
-  mhd_assert((size_t)cblen < sizeof(cbuf));
+  cblen = MHD_snprintf_ (cbuf,
+                         sizeof (cbuf),
+                         "%X\r\n",
+                         (unsigned int) ret);
+  mhd_assert (cblen > 0);
+  mhd_assert ((size_t) cblen < sizeof(cbuf));
   memcpy (&request->write_buffer[sizeof (cbuf) - cblen],
           cbuf,
           cblen);
@@ -768,221 +779,224 @@ MHD_request_handle_write_ (struct MHD_Request *request)
     struct MHD_TLS_Plugin *tls;
 
     if ( (NULL != (tls = daemon->tls_api)) &&
-        (! tls->handshake (tls->cls,
-                           connection->tls_cs)) )
+         (! tls->handshake (tls->cls,
+                            connection->tls_cs)) )
       return;
   }
 #endif /* HTTPS_SUPPORT */
 
 #if DEBUG_STATES
   MHD_DLOG (daemon,
-           MHD_SC_STATE_MACHINE_STATUS_REPORT,
-            _("In function %s handling connection at state: %s\n"),
+            MHD_SC_STATE_MACHINE_STATUS_REPORT,
+            _ ("In function %s handling connection at state: %s\n"),
             __FUNCTION__,
             MHD_state_to_string (request->state));
 #endif
   switch (request->state)
-    {
-    case MHD_REQUEST_INIT:
-    case MHD_REQUEST_URL_RECEIVED:
-    case MHD_REQUEST_HEADER_PART_RECEIVED:
-    case MHD_REQUEST_HEADERS_RECEIVED:
-      mhd_assert (0);
-      return;
-    case MHD_REQUEST_HEADERS_PROCESSED:
-      return;
-    case MHD_REQUEST_CONTINUE_SENDING:
-      ret = connection->send_cls (connection,
-                                  &HTTP_100_CONTINUE
-                                  [request->continue_message_write_offset],
-                                  MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE) -
-                                  request->continue_message_write_offset);
-      if (ret < 0)
-        {
-          if (MHD_ERR_AGAIN_ == ret)
-            return;
+  {
+  case MHD_REQUEST_INIT:
+  case MHD_REQUEST_URL_RECEIVED:
+  case MHD_REQUEST_HEADER_PART_RECEIVED:
+  case MHD_REQUEST_HEADERS_RECEIVED:
+    mhd_assert (0);
+    return;
+  case MHD_REQUEST_HEADERS_PROCESSED:
+    return;
+  case MHD_REQUEST_CONTINUE_SENDING:
+    ret = connection->send_cls (connection,
+                                &HTTP_100_CONTINUE
+                                [request->continue_message_write_offset],
+                                MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE)
+                                - request->continue_message_write_offset);
+    if (ret < 0)
+    {
+      if (MHD_ERR_AGAIN_ == ret)
+        return;
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
-                    _("Failed to send data in request for %s.\n"),
-                    request->url);
+      MHD_DLOG (daemon,
+                MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
+                _ ("Failed to send data in request for %s.\n"),
+                request->url);
 #endif
-          CONNECTION_CLOSE_ERROR (connection,
-                                 MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
-                                  NULL);
-          return;
-        }
-      request->continue_message_write_offset += ret;
-      MHD_connection_update_last_activity_ (connection);
-      return;
-    case MHD_REQUEST_CONTINUE_SENT:
-    case MHD_REQUEST_BODY_RECEIVED:
-    case MHD_REQUEST_FOOTER_PART_RECEIVED:
-    case MHD_REQUEST_FOOTERS_RECEIVED:
-      mhd_assert (0);
+      CONNECTION_CLOSE_ERROR (connection,
+                              MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
+                              NULL);
       return;
-    case MHD_REQUEST_HEADERS_SENDING:
-      ret = connection->send_cls (connection,
-                                  &request->write_buffer
-                                  [request->write_buffer_send_offset],
-                                  request->write_buffer_append_offset -
-                                    request->write_buffer_send_offset);
-      if (ret < 0)
-        {
-          if (MHD_ERR_AGAIN_ == ret)
-            return;
-          CONNECTION_CLOSE_ERROR (connection,
-                                 MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
-                                  _("Connection was closed while sending 
response headers.\n"));
-          return;
-        }
-      request->write_buffer_send_offset += ret;
-      MHD_connection_update_last_activity_ (connection);
-      if (MHD_REQUEST_HEADERS_SENDING != request->state)
+    }
+    request->continue_message_write_offset += ret;
+    MHD_connection_update_last_activity_ (connection);
+    return;
+  case MHD_REQUEST_CONTINUE_SENT:
+  case MHD_REQUEST_BODY_RECEIVED:
+  case MHD_REQUEST_FOOTER_PART_RECEIVED:
+  case MHD_REQUEST_FOOTERS_RECEIVED:
+    mhd_assert (0);
+    return;
+  case MHD_REQUEST_HEADERS_SENDING:
+    ret = connection->send_cls (connection,
+                                &request->write_buffer
+                                [request->write_buffer_send_offset],
+                                request->write_buffer_append_offset
+                                - request->write_buffer_send_offset);
+    if (ret < 0)
+    {
+      if (MHD_ERR_AGAIN_ == ret)
         return;
-      check_write_done (request,
-                        MHD_REQUEST_HEADERS_SENT);
+      CONNECTION_CLOSE_ERROR (connection,
+                              MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
+                              _ (
+                                "Connection was closed while sending response 
headers.\n"));
       return;
-    case MHD_REQUEST_HEADERS_SENT:
+    }
+    request->write_buffer_send_offset += ret;
+    MHD_connection_update_last_activity_ (connection);
+    if (MHD_REQUEST_HEADERS_SENDING != request->state)
       return;
-    case MHD_REQUEST_NORMAL_BODY_READY:
-      response = request->response;
-      if (request->response_write_position <
-          request->response->total_size)
-        {
-          uint64_t data_write_offset;
-
-          if (NULL != response->crc)
-            MHD_mutex_lock_chk_ (&response->mutex);
-          if (! try_ready_normal_body (request))
-            {
-              /* mutex was already unlocked by try_ready_normal_body */
-              return;
-            }
+    check_write_done (request,
+                      MHD_REQUEST_HEADERS_SENT);
+    return;
+  case MHD_REQUEST_HEADERS_SENT:
+    return;
+  case MHD_REQUEST_NORMAL_BODY_READY:
+    response = request->response;
+    if (request->response_write_position <
+        request->response->total_size)
+    {
+      uint64_t data_write_offset;
+
+      if (NULL != response->crc)
+        MHD_mutex_lock_chk_ (&response->mutex);
+      if (! try_ready_normal_body (request))
+      {
+        /* mutex was already unlocked by try_ready_normal_body */
+        return;
+      }
 #if defined(_MHD_HAVE_SENDFILE)
-          if (MHD_resp_sender_sendfile == request->resp_sender)
-            {
-              ret = sendfile_adapter (connection);
-            }
-          else
+      if (MHD_resp_sender_sendfile == request->resp_sender)
+      {
+        ret = sendfile_adapter (connection);
+      }
+      else
 #else  /* ! _MHD_HAVE_SENDFILE */
-          if (1)
+      if (1)
 #endif /* ! _MHD_HAVE_SENDFILE */
-            {
-              data_write_offset = request->response_write_position
-                                  - response->data_start;
-              if (data_write_offset > (uint64_t)SIZE_MAX)
-                MHD_PANIC (_("Data offset exceeds limit"));
-              ret = connection->send_cls (connection,
-                                          &response->data
-                                          [(size_t)data_write_offset],
-                                          response->data_size -
-                                          (size_t)data_write_offset);
+      {
+        data_write_offset = request->response_write_position
+                            - response->data_start;
+        if (data_write_offset > (uint64_t) SIZE_MAX)
+          MHD_PANIC (_ ("Data offset exceeds limit"));
+        ret = connection->send_cls (connection,
+                                    &response->data
+                                    [(size_t) data_write_offset],
+                                    response->data_size
+                                    - (size_t) data_write_offset);
 #if DEBUG_SEND_DATA
-              if (ret > 0)
-                fprintf (stderr,
-                         _("Sent %d-byte DATA response: `%.*s'\n"),
-                         (int) ret,
-                         (int) ret,
-                         &response->data[request->response_write_position -
-                                         response->data_start]);
-#endif
-            }
-          if (NULL != response->crc)
-            MHD_mutex_unlock_chk_ (&response->mutex);
-          if (ret < 0)
-            {
-              if (MHD_ERR_AGAIN_ == ret)
-                return;
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                       MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
-                        _("Failed to send data in request for `%s'.\n"),
-                        request->url);
+        if (ret > 0)
+          fprintf (stderr,
+                   _ ("Sent %d-byte DATA response: `%.*s'\n"),
+                   (int) ret,
+                   (int) ret,
+                   &response->data[request->response_write_position
+                                   - response->data_start]);
 #endif
-              CONNECTION_CLOSE_ERROR (connection,
-                                     MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
-                                      NULL);
-              return;
-            }
-          request->response_write_position += ret;
-          MHD_connection_update_last_activity_ (connection);
-        }
-      if (request->response_write_position ==
-          request->response->total_size)
-        request->state = MHD_REQUEST_FOOTERS_SENT; /* have no footers */
-      return;
-    case MHD_REQUEST_NORMAL_BODY_UNREADY:
-      mhd_assert (0);
-      return;
-    case MHD_REQUEST_CHUNKED_BODY_READY:
-      ret = connection->send_cls (connection,
-                                  &request->write_buffer
-                                  [request->write_buffer_send_offset],
-                                  request->write_buffer_append_offset -
-                                    request->write_buffer_send_offset);
+      }
+      if (NULL != response->crc)
+        MHD_mutex_unlock_chk_ (&response->mutex);
       if (ret < 0)
-        {
-          if (MHD_ERR_AGAIN_ == ret)
-            return;
-          CONNECTION_CLOSE_ERROR (connection,
-                                 MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
-                                  _("Connection was closed while sending 
response body.\n"));
+      {
+        if (MHD_ERR_AGAIN_ == ret)
           return;
-        }
-      request->write_buffer_send_offset += ret;
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (daemon,
+                  MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
+                  _ ("Failed to send data in request for `%s'.\n"),
+                  request->url);
+#endif
+        CONNECTION_CLOSE_ERROR (connection,
+                                MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
+                                NULL);
+        return;
+      }
+      request->response_write_position += ret;
       MHD_connection_update_last_activity_ (connection);
-      if (MHD_REQUEST_CHUNKED_BODY_READY != request->state)
+    }
+    if (request->response_write_position ==
+        request->response->total_size)
+      request->state = MHD_REQUEST_FOOTERS_SENT;   /* have no footers */
+    return;
+  case MHD_REQUEST_NORMAL_BODY_UNREADY:
+    mhd_assert (0);
+    return;
+  case MHD_REQUEST_CHUNKED_BODY_READY:
+    ret = connection->send_cls (connection,
+                                &request->write_buffer
+                                [request->write_buffer_send_offset],
+                                request->write_buffer_append_offset
+                                - request->write_buffer_send_offset);
+    if (ret < 0)
+    {
+      if (MHD_ERR_AGAIN_ == ret)
         return;
-      check_write_done (request,
-                        (request->response->total_size ==
-                         request->response_write_position) ?
-                        MHD_REQUEST_BODY_SENT :
-                        MHD_REQUEST_CHUNKED_BODY_UNREADY);
+      CONNECTION_CLOSE_ERROR (connection,
+                              MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
+                              _ (
+                                "Connection was closed while sending response 
body.\n"));
       return;
-    case MHD_REQUEST_CHUNKED_BODY_UNREADY:
-    case MHD_REQUEST_BODY_SENT:
-      mhd_assert (0);
+    }
+    request->write_buffer_send_offset += ret;
+    MHD_connection_update_last_activity_ (connection);
+    if (MHD_REQUEST_CHUNKED_BODY_READY != request->state)
       return;
-    case MHD_REQUEST_FOOTERS_SENDING:
-      ret = connection->send_cls (connection,
-                                  &request->write_buffer
-                                  [request->write_buffer_send_offset],
-                                  request->write_buffer_append_offset -
-                                    request->write_buffer_send_offset);
-      if (ret < 0)
-        {
-          if (MHD_ERR_AGAIN_ == ret)
-            return;
-          CONNECTION_CLOSE_ERROR (connection,
-                                 MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
-                                  _("Connection was closed while sending 
response body.\n"));
-          return;
-        }
-      request->write_buffer_send_offset += ret;
-      MHD_connection_update_last_activity_ (connection);
-      if (MHD_REQUEST_FOOTERS_SENDING != request->state)
+    check_write_done (request,
+                      (request->response->total_size ==
+                       request->response_write_position) ?
+                      MHD_REQUEST_BODY_SENT :
+                      MHD_REQUEST_CHUNKED_BODY_UNREADY);
+    return;
+  case MHD_REQUEST_CHUNKED_BODY_UNREADY:
+  case MHD_REQUEST_BODY_SENT:
+    mhd_assert (0);
+    return;
+  case MHD_REQUEST_FOOTERS_SENDING:
+    ret = connection->send_cls (connection,
+                                &request->write_buffer
+                                [request->write_buffer_send_offset],
+                                request->write_buffer_append_offset
+                                - request->write_buffer_send_offset);
+    if (ret < 0)
+    {
+      if (MHD_ERR_AGAIN_ == ret)
         return;
-      check_write_done (request,
-                        MHD_REQUEST_FOOTERS_SENT);
-      return;
-    case MHD_REQUEST_FOOTERS_SENT:
-      mhd_assert (0);
+      CONNECTION_CLOSE_ERROR (connection,
+                              MHD_SC_CONNECTION_WRITE_FAIL_CLOSED,
+                              _ (
+                                "Connection was closed while sending response 
body.\n"));
       return;
-    case MHD_REQUEST_CLOSED:
+    }
+    request->write_buffer_send_offset += ret;
+    MHD_connection_update_last_activity_ (connection);
+    if (MHD_REQUEST_FOOTERS_SENDING != request->state)
       return;
+    check_write_done (request,
+                      MHD_REQUEST_FOOTERS_SENT);
+    return;
+  case MHD_REQUEST_FOOTERS_SENT:
+    mhd_assert (0);
+    return;
+  case MHD_REQUEST_CLOSED:
+    return;
 #ifdef UPGRADE_SUPPORT
-    case MHD_REQUEST_UPGRADE:
-      mhd_assert (0);
-      return;
+  case MHD_REQUEST_UPGRADE:
+    mhd_assert (0);
+    return;
 #endif /* UPGRADE_SUPPORT */
-    default:
-      mhd_assert (0);
-      CONNECTION_CLOSE_ERROR (connection,
-                             MHD_SC_STATEMACHINE_FAILURE_CONNECTION_CLOSED,
-                              _("Internal error\n"));
-      break;
-    }
+  default:
+    mhd_assert (0);
+    CONNECTION_CLOSE_ERROR (connection,
+                            MHD_SC_STATEMACHINE_FAILURE_CONNECTION_CLOSED,
+                            _ ("Internal error\n"));
+    break;
+  }
 }
 
 
@@ -1001,9 +1015,9 @@ MHD_request_handle_write_ (struct MHD_Request *request)
  */
 static bool
 MHD_lookup_header_token_ci (const struct MHD_Request *request,
-                           const char *header,
-                           const char *token,
-                           size_t token_len)
+                            const char *header,
+                            const char *token,
+                            size_t token_len)
 {
   struct MHD_HTTP_Header *pos;
 
@@ -1014,16 +1028,16 @@ MHD_lookup_header_token_ci (const struct MHD_Request 
*request,
        (0 == token[0]) )
     return false;
   for (pos = request->headers_received; NULL != pos; pos = pos->next)
-    {
-      if ( (0 != (pos->kind & MHD_HEADER_KIND)) &&
-          ( (header == pos->header) ||
-            (MHD_str_equal_caseless_(header,
-                                     pos->header)) ) &&
-          (MHD_str_has_token_caseless_ (pos->value,
-                                        token,
-                                        token_len)) )
-        return true;
-    }
+  {
+    if ( (0 != (pos->kind & MHD_HEADER_KIND)) &&
+         ( (header == pos->header) ||
+           (MHD_str_equal_caseless_ (header,
+                                     pos->header)) ) &&
+         (MHD_str_has_token_caseless_ (pos->value,
+                                       token,
+                                       token_len)) )
+      return true;
+  }
   return false;
 }
 
@@ -1040,7 +1054,7 @@ MHD_lookup_header_token_ci (const struct MHD_Request 
*request,
  *         false otherwise
  */
 #define MHD_lookup_header_s_token_ci(r,h,tkn) \
-    MHD_lookup_header_token_ci((r),(h),(tkn),MHD_STATICSTR_LEN_(tkn))
+  MHD_lookup_header_token_ci ((r),(h),(tkn),MHD_STATICSTR_LEN_ (tkn))
 
 
 /**
@@ -1071,41 +1085,41 @@ keepalive_possible (struct MHD_Request *request)
     return false;
 
   if (MHD_str_equal_caseless_ (request->version_s,
-                              MHD_HTTP_VERSION_1_1))
-    {
-      if (MHD_lookup_header_s_token_ci (request,
-                                        MHD_HTTP_HEADER_CONNECTION,
-                                        "upgrade"))
-        return false;
-      if (MHD_lookup_header_s_token_ci (request,
-                                        MHD_HTTP_HEADER_CONNECTION,
-                                        "close"))
-        return false;
-      return true;
-    }
-  if (MHD_str_equal_caseless_ (request->version_s,
-                              MHD_HTTP_VERSION_1_0))
-    {
-      if (MHD_lookup_header_s_token_ci (request,
-                                        MHD_HTTP_HEADER_CONNECTION,
-                                        "Keep-Alive"))
-        return true;
+                               MHD_HTTP_VERSION_1_1))
+  {
+    if (MHD_lookup_header_s_token_ci (request,
+                                      MHD_HTTP_HEADER_CONNECTION,
+                                      "upgrade"))
       return false;
-    }
-  return false;
-}
-
-
-/**
- * Produce HTTP time stamp.
- *
+    if (MHD_lookup_header_s_token_ci (request,
+                                      MHD_HTTP_HEADER_CONNECTION,
+                                      "close"))
+      return false;
+    return true;
+  }
+  if (MHD_str_equal_caseless_ (request->version_s,
+                               MHD_HTTP_VERSION_1_0))
+  {
+    if (MHD_lookup_header_s_token_ci (request,
+                                      MHD_HTTP_HEADER_CONNECTION,
+                                      "Keep-Alive"))
+      return true;
+    return false;
+  }
+  return false;
+}
+
+
+/**
+ * Produce HTTP time stamp.
+ *
  * @param date where to write the header, with
  *        at least 128 bytes available space.
  * @param date_len number of bytes in @a date
  */
 static void
 get_date_string (char *date,
-                size_t date_len)
+                 size_t date_len)
 {
   static const char *const days[] = {
     "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
@@ -1116,8 +1130,9 @@ get_date_string (char *date,
   };
   struct tm now;
   time_t t;
-#if !defined(HAVE_C11_GMTIME_S) && !defined(HAVE_W32_GMTIME_S) && 
!defined(HAVE_GMTIME_R)
-  struct tm* pNow;
+#if ! defined(HAVE_C11_GMTIME_S) && ! defined(HAVE_W32_GMTIME_S) && \
+  ! defined(HAVE_GMTIME_R)
+  struct tm*pNow;
 #endif
 
   date[0] = 0;
@@ -1131,25 +1146,25 @@ get_date_string (char *date,
                      &t))
     return;
 #elif defined(HAVE_GMTIME_R)
-  if (NULL == gmtime_r(&t,
-                       &now))
+  if (NULL == gmtime_r (&t,
+                        &now))
     return;
 #else
-  pNow = gmtime(&t);
+  pNow = gmtime (&t);
   if (NULL == pNow)
     return;
   now = *pNow;
 #endif
   MHD_snprintf_ (date,
-                date_len,
-                "Date: %3s, %02u %3s %04u %02u:%02u:%02u GMT\r\n",
-                days[now.tm_wday % 7],
-                (unsigned int) now.tm_mday,
-                mons[now.tm_mon % 12],
-                (unsigned int) (1900 + now.tm_year),
-                (unsigned int) now.tm_hour,
-                (unsigned int) now.tm_min,
-                (unsigned int) now.tm_sec);
+                 date_len,
+                 "Date: %3s, %02u %3s %04u %02u:%02u:%02u GMT\r\n",
+                 days[now.tm_wday % 7],
+                 (unsigned int) now.tm_mday,
+                 mons[now.tm_mon % 12],
+                 (unsigned int) (1900 + now.tm_year),
+                 (unsigned int) now.tm_hour,
+                 (unsigned int) now.tm_min,
+                 (unsigned int) now.tm_sec);
 }
 
 
@@ -1168,9 +1183,9 @@ get_date_string (char *date,
  */
 static bool
 check_response_header_token_ci (const struct MHD_Response *response,
-                               const char *key,
-                               const char *token,
-                               size_t token_len)
+                                const char *key,
+                                const char *token,
+                                size_t token_len)
 {
   struct MHD_HTTP_Header *pos;
 
@@ -1183,15 +1198,15 @@ check_response_header_token_ci (const struct 
MHD_Response *response,
   for (pos = response->first_header;
        NULL != pos;
        pos = pos->next)
-    {
-      if ( (pos->kind == MHD_HEADER_KIND) &&
-           MHD_str_equal_caseless_ (pos->header,
-                                    key) &&
-           MHD_str_has_token_caseless_ (pos->value,
-                                        token,
-                                        token_len) )
-        return true;
-    }
+  {
+    if ( (pos->kind == MHD_HEADER_KIND) &&
+         MHD_str_equal_caseless_ (pos->header,
+                                  key) &&
+         MHD_str_has_token_caseless_ (pos->value,
+                                      token,
+                                      token_len) )
+      return true;
+  }
   return false;
 }
 
@@ -1208,7 +1223,7 @@ check_response_header_token_ci (const struct MHD_Response 
*response,
  *         false otherwise
  */
 #define check_response_header_s_token_ci(r,k,tkn) \
-    check_response_header_token_ci((r),(k),(tkn),MHD_STATICSTR_LEN_(tkn))
+  check_response_header_token_ci ((r),(k),(tkn),MHD_STATICSTR_LEN_ (tkn))
 
 
 /**
@@ -1248,58 +1263,58 @@ build_header_response (struct MHD_Request *request)
 
   mhd_assert (NULL != request->version_s);
   if (0 == request->version_s[0])
-    {
-      data = MHD_pool_allocate (connection->pool,
-                                0,
-                                MHD_YES);
-      request->write_buffer = data;
-      request->write_buffer_append_offset = 0;
-      request->write_buffer_send_offset = 0;
-      request->write_buffer_size = 0;
-      return true;
-    }
+  {
+    data = MHD_pool_allocate (connection->pool,
+                              0,
+                              MHD_YES);
+    request->write_buffer = data;
+    request->write_buffer_append_offset = 0;
+    request->write_buffer_send_offset = 0;
+    request->write_buffer_size = 0;
+    return true;
+  }
   if (MHD_REQUEST_FOOTERS_RECEIVED == request->state)
-    {
-      const char *reason_phrase;
-      const char *version;
-
-      reason_phrase
-       = MHD_get_reason_phrase_for (response->status_code);
-      version
-       = (response->icy)
-       ? "ICY"
-       : ( (MHD_str_equal_caseless_ (MHD_HTTP_VERSION_1_0,
-                                     request->version_s))
-           ? MHD_HTTP_VERSION_1_0
-           : MHD_HTTP_VERSION_1_1);
-      MHD_snprintf_ (code,
-                    sizeof (code),
-                    "%s %u %s\r\n",
-                    version,
-                    response->status_code,
-                    reason_phrase);
-      off = strlen (code);
-      /* estimate size */
-      size = off + 2;           /* +2 for extra "\r\n" at the end */
-      kind = MHD_HEADER_KIND;
-      if ( (! daemon->suppress_date) &&
-          (NULL == MHD_response_get_header (response,
-                                            MHD_HTTP_HEADER_DATE)) )
-        get_date_string (date,
-                        sizeof (date));
-      else
-        date[0] = '\0';
-      datelen = strlen (date);
-      size += datelen;
-    }
+  {
+    const char *reason_phrase;
+    const char *version;
+
+    reason_phrase
+      = MHD_get_reason_phrase_for (response->status_code);
+    version
+      = (response->icy)
+        ? "ICY"
+        : ( (MHD_str_equal_caseless_ (MHD_HTTP_VERSION_1_0,
+                                      request->version_s))
+            ? MHD_HTTP_VERSION_1_0
+            : MHD_HTTP_VERSION_1_1);
+    MHD_snprintf_ (code,
+                   sizeof (code),
+                   "%s %u %s\r\n",
+                   version,
+                   response->status_code,
+                   reason_phrase);
+    off = strlen (code);
+    /* estimate size */
+    size = off + 2;             /* +2 for extra "\r\n" at the end */
+    kind = MHD_HEADER_KIND;
+    if ( (! daemon->suppress_date) &&
+         (NULL == MHD_response_get_header (response,
+                                           MHD_HTTP_HEADER_DATE)) )
+      get_date_string (date,
+                       sizeof (date));
+    else
+      date[0] = '\0';
+    datelen = strlen (date);
+    size += datelen;
+  }
   else
-    {
-      /* 2 bytes for final CRLF of a Chunked-Body */
-      size = 2;
-      kind = MHD_FOOTER_KIND;
-      off = 0;
-      datelen = 0;
-    }
+  {
+    /* 2 bytes for final CRLF of a Chunked-Body */
+    size = 2;
+    kind = MHD_FOOTER_KIND;
+    off = 0;
+    datelen = 0;
+  }
 
   /* calculate extra headers we need to add, such as 'Connection: close',
      first see what was explicitly requested by the application */
@@ -1309,153 +1324,154 @@ build_header_response (struct MHD_Request *request)
   must_add_content_length = false;
   response_has_close = false;
   switch (request->state)
-    {
-    case MHD_REQUEST_FOOTERS_RECEIVED:
-      response_has_close
-       = check_response_header_s_token_ci (response,
-                                           MHD_HTTP_HEADER_CONNECTION,
-                                           "close");
-      response_has_keepalive
-       = check_response_header_s_token_ci (response,
-                                           MHD_HTTP_HEADER_CONNECTION,
-                                           "Keep-Alive");
-      client_requested_close
-       = MHD_lookup_header_s_token_ci (request,
-                                       MHD_HTTP_HEADER_CONNECTION,
-                                       "close");
-
-      if (response->v10_only)
-        request->keepalive = MHD_CONN_MUST_CLOSE;
+  {
+  case MHD_REQUEST_FOOTERS_RECEIVED:
+    response_has_close
+      = check_response_header_s_token_ci (response,
+                                          MHD_HTTP_HEADER_CONNECTION,
+                                          "close");
+    response_has_keepalive
+      = check_response_header_s_token_ci (response,
+                                          MHD_HTTP_HEADER_CONNECTION,
+                                          "Keep-Alive");
+    client_requested_close
+      = MHD_lookup_header_s_token_ci (request,
+                                      MHD_HTTP_HEADER_CONNECTION,
+                                      "close");
+
+    if (response->v10_only)
+      request->keepalive = MHD_CONN_MUST_CLOSE;
 #ifdef UPGRADE_SUPPORT
-      else if (NULL != response->upgrade_handler)
-        /* If this connection will not be "upgraded", it must be closed. */
-        request->keepalive = MHD_CONN_MUST_CLOSE;
+    else if (NULL != response->upgrade_handler)
+      /* If this connection will not be "upgraded", it must be closed. */
+      request->keepalive = MHD_CONN_MUST_CLOSE;
 #endif /* UPGRADE_SUPPORT */
 
-      /* now analyze chunked encoding situation */
-      request->have_chunked_upload = false;
+    /* now analyze chunked encoding situation */
+    request->have_chunked_upload = false;
 
-      if ( (MHD_SIZE_UNKNOWN == response->total_size) &&
+    if ( (MHD_SIZE_UNKNOWN == response->total_size) &&
 #ifdef UPGRADE_SUPPORT
-           (NULL == response->upgrade_handler) &&
+         (NULL == response->upgrade_handler) &&
 #endif /* UPGRADE_SUPPORT */
-           (! response_has_close) &&
-           (! client_requested_close) )
+         (! response_has_close) &&
+         (! client_requested_close) )
+    {
+      /* size is unknown, and close was not explicitly requested;
+         need to either to HTTP 1.1 chunked encoding or
+         close the connection */
+      /* 'close' header doesn't exist yet, see if we need to add one;
+         if the client asked for a close, no need to start chunk'ing */
+      if ( (keepalive_possible (request)) &&
+           (MHD_str_equal_caseless_ (MHD_HTTP_VERSION_1_1,
+                                     request->version_s)) )
+      {
+        have_encoding
+          = MHD_response_get_header (response,
+                                     MHD_HTTP_HEADER_TRANSFER_ENCODING);
+        if (NULL == have_encoding)
         {
-          /* size is unknown, and close was not explicitly requested;
-             need to either to HTTP 1.1 chunked encoding or
-             close the connection */
-          /* 'close' header doesn't exist yet, see if we need to add one;
-             if the client asked for a close, no need to start chunk'ing */
-          if ( (keepalive_possible (request)) &&
-               (MHD_str_equal_caseless_ (MHD_HTTP_VERSION_1_1,
-                                         request->version_s)) )
-            {
-              have_encoding
-               = MHD_response_get_header (response,
-                                          MHD_HTTP_HEADER_TRANSFER_ENCODING);
-              if (NULL == have_encoding)
-                {
-                  must_add_chunked_encoding = true;
-                  request->have_chunked_upload = true;
-                }
-              else if (MHD_str_equal_caseless_ (have_encoding,
-                                                "identity"))
-                {
-                  /* application forced identity encoding, can't do 'chunked' 
*/
-                  must_add_close = true;
-                }
-              else
-                {
-                  request->have_chunked_upload = true;
-                }
-            }
-          else
-            {
-              /* Keep alive or chunking not possible
-                 => set close header if not present */
-              if (! response_has_close)
-                must_add_close = true;
-            }
+          must_add_chunked_encoding = true;
+          request->have_chunked_upload = true;
         }
-
-      /* check for other reasons to add 'close' header */
-      if ( ( (client_requested_close) ||
-             (connection->read_closed) ||
-             (MHD_CONN_MUST_CLOSE == request->keepalive)) &&
-           (! response_has_close) &&
-#ifdef UPGRADE_SUPPORT
-           (NULL == response->upgrade_handler) &&
-#endif /* UPGRADE_SUPPORT */
-           (! response->v10_only) )
-        must_add_close = true;
-
-      /* check if we should add a 'content length' header */
-      have_content_length
-       = MHD_response_get_header (response,
-                                  MHD_HTTP_HEADER_CONTENT_LENGTH);
-
-      /* MHD_HTTP_NO_CONTENT, MHD_HTTP_NOT_MODIFIED and 1xx-status
-         codes SHOULD NOT have a Content-Length according to spec;
-         also chunked encoding / unknown length or CONNECT... */
-      if ( (MHD_SIZE_UNKNOWN != response->total_size) &&
-           (MHD_HTTP_NO_CONTENT != response->status_code) &&
-           (MHD_HTTP_NOT_MODIFIED != response->status_code) &&
-           (MHD_HTTP_OK <= response->status_code) &&
-           (NULL == have_content_length) &&
-           (request->method != MHD_METHOD_CONNECT) )
+        else if (MHD_str_equal_caseless_ (have_encoding,
+                                          "identity"))
         {
-          /*
-            Here we add a content-length if one is missing; however,
-            for 'connect' methods, the responses MUST NOT include a
-            content-length header *if* the response code is 2xx (in
-            which case we expect there to be no body).  Still,
-            as we don't know the response code here in some cases, we
-            simply only force adding a content-length header if this
-            is not a 'connect' or if the response is not empty
-            (which is kind of more sane, because if some crazy
-            application did return content with a 2xx status code,
-            then having a content-length might again be a good idea).
-
-            Note that the change from 'SHOULD NOT' to 'MUST NOT' is
-            a recent development of the HTTP 1.1 specification.
-          */
-          content_length_len
-            = MHD_snprintf_ (content_length_buf,
-                            sizeof (content_length_buf),
-                            MHD_HTTP_HEADER_CONTENT_LENGTH ": " 
MHD_UNSIGNED_LONG_LONG_PRINTF "\r\n",
-                            (MHD_UNSIGNED_LONG_LONG) response->total_size);
-          must_add_content_length = true;
+          /* application forced identity encoding, can't do 'chunked' */
+          must_add_close = true;
         }
-
-      /* check for adding keep alive */
-      if ( (! response_has_keepalive) &&
-           (! response_has_close) &&
-           (! must_add_close) &&
-           (MHD_CONN_MUST_CLOSE != request->keepalive) &&
+        else
+        {
+          request->have_chunked_upload = true;
+        }
+      }
+      else
+      {
+        /* Keep alive or chunking not possible
+           => set close header if not present */
+        if (! response_has_close)
+          must_add_close = true;
+      }
+    }
+
+    /* check for other reasons to add 'close' header */
+    if ( ( (client_requested_close) ||
+           (connection->read_closed) ||
+           (MHD_CONN_MUST_CLOSE == request->keepalive)) &&
+         (! response_has_close) &&
 #ifdef UPGRADE_SUPPORT
-           (NULL == response->upgrade_handler) &&
+         (NULL == response->upgrade_handler) &&
 #endif /* UPGRADE_SUPPORT */
-           (keepalive_possible (request)) )
-        must_add_keep_alive = true;
-      break;
-    case MHD_REQUEST_BODY_SENT:
-      response_has_keepalive = false;
-      break;
-    default:
-      mhd_assert (0);
-      return MHD_NO;
-    }
+         (! response->v10_only) )
+      must_add_close = true;
+
+    /* check if we should add a 'content length' header */
+    have_content_length
+      = MHD_response_get_header (response,
+                                 MHD_HTTP_HEADER_CONTENT_LENGTH);
+
+    /* MHD_HTTP_NO_CONTENT, MHD_HTTP_NOT_MODIFIED and 1xx-status
+       codes SHOULD NOT have a Content-Length according to spec;
+       also chunked encoding / unknown length or CONNECT... */
+    if ( (MHD_SIZE_UNKNOWN != response->total_size) &&
+         (MHD_HTTP_NO_CONTENT != response->status_code) &&
+         (MHD_HTTP_NOT_MODIFIED != response->status_code) &&
+         (MHD_HTTP_OK <= response->status_code) &&
+         (NULL == have_content_length) &&
+         (request->method != MHD_METHOD_CONNECT) )
+    {
+      /*
+        Here we add a content-length if one is missing; however,
+        for 'connect' methods, the responses MUST NOT include a
+        content-length header *if* the response code is 2xx (in
+        which case we expect there to be no body).  Still,
+        as we don't know the response code here in some cases, we
+        simply only force adding a content-length header if this
+        is not a 'connect' or if the response is not empty
+        (which is kind of more sane, because if some crazy
+        application did return content with a 2xx status code,
+        then having a content-length might again be a good idea).
+
+        Note that the change from 'SHOULD NOT' to 'MUST NOT' is
+        a recent development of the HTTP 1.1 specification.
+      */
+      content_length_len
+        = MHD_snprintf_ (content_length_buf,
+                         sizeof (content_length_buf),
+                         MHD_HTTP_HEADER_CONTENT_LENGTH ": "
+                         MHD_UNSIGNED_LONG_LONG_PRINTF "\r\n",
+                         (MHD_UNSIGNED_LONG_LONG) response->total_size);
+      must_add_content_length = true;
+    }
+
+    /* check for adding keep alive */
+    if ( (! response_has_keepalive) &&
+         (! response_has_close) &&
+         (! must_add_close) &&
+         (MHD_CONN_MUST_CLOSE != request->keepalive) &&
+#ifdef UPGRADE_SUPPORT
+         (NULL == response->upgrade_handler) &&
+#endif /* UPGRADE_SUPPORT */
+         (keepalive_possible (request)) )
+      must_add_keep_alive = true;
+    break;
+  case MHD_REQUEST_BODY_SENT:
+    response_has_keepalive = false;
+    break;
+  default:
+    mhd_assert (0);
+    return MHD_NO;
+  }
 
   if (MHD_CONN_MUST_CLOSE != request->keepalive)
-    {
-      if ( (must_add_close) ||
-          (response_has_close) )
-        request->keepalive = MHD_CONN_MUST_CLOSE;
-      else if ( (must_add_keep_alive) ||
-               (response_has_keepalive) )
-        request->keepalive = MHD_CONN_USE_KEEPALIVE;
-    }
+  {
+    if ( (must_add_close) ||
+         (response_has_close) )
+      request->keepalive = MHD_CONN_MUST_CLOSE;
+    else if ( (must_add_keep_alive) ||
+              (response_has_keepalive) )
+      request->keepalive = MHD_CONN_USE_KEEPALIVE;
+  }
 
   if (must_add_close)
     size += MHD_STATICSTR_LEN_ ("Connection: close\r\n");
@@ -1469,91 +1485,91 @@ build_header_response (struct MHD_Request *request)
   mhd_assert (! (must_add_chunked_encoding && must_add_content_length) );
 
   for (pos = response->first_header; NULL != pos; pos = pos->next)
-    {
-      /* TODO: add proper support for excluding "Keep-Alive" token. */
-      if ( (pos->kind == kind) &&
-           (! ( (must_add_close) &&
-                (response_has_keepalive) &&
-                (MHD_str_equal_caseless_(pos->header,
-                                         MHD_HTTP_HEADER_CONNECTION)) &&
-                (MHD_str_equal_caseless_(pos->value,
-                                         "Keep-Alive")) ) ) )
-        size += strlen (pos->header) + strlen (pos->value) + 4; /* colon, 
space, linefeeds */
-    }
+  {
+    /* TODO: add proper support for excluding "Keep-Alive" token. */
+    if ( (pos->kind == kind) &&
+         (! ( (must_add_close) &&
+              (response_has_keepalive) &&
+              (MHD_str_equal_caseless_ (pos->header,
+                                        MHD_HTTP_HEADER_CONNECTION)) &&
+              (MHD_str_equal_caseless_ (pos->value,
+                                        "Keep-Alive")) ) ) )
+      size += strlen (pos->header) + strlen (pos->value) + 4;   /* colon, 
space, linefeeds */
+  }
   /* produce data */
   data = MHD_pool_allocate (connection->pool,
                             size + 1,
                             MHD_NO);
   if (NULL == data)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_CONNECTION_POOL_MALLOC_FAILURE,
-                "Not enough memory for write!\n");
+    MHD_DLOG (daemon,
+              MHD_SC_CONNECTION_POOL_MALLOC_FAILURE,
+              "Not enough memory for write!\n");
 #endif
-      return false;
-    }
+    return false;
+  }
   if (MHD_REQUEST_FOOTERS_RECEIVED == request->state)
-    {
-      memcpy (data,
-              code,
-              off);
-    }
+  {
+    memcpy (data,
+            code,
+            off);
+  }
   if (must_add_close)
-    {
-      /* we must add the 'Connection: close' header */
-      memcpy (&data[off],
-              "Connection: close\r\n",
-              MHD_STATICSTR_LEN_ ("Connection: close\r\n"));
-      off += MHD_STATICSTR_LEN_ ("Connection: close\r\n");
-    }
+  {
+    /* we must add the 'Connection: close' header */
+    memcpy (&data[off],
+            "Connection: close\r\n",
+            MHD_STATICSTR_LEN_ ("Connection: close\r\n"));
+    off += MHD_STATICSTR_LEN_ ("Connection: close\r\n");
+  }
   if (must_add_keep_alive)
-    {
-      /* we must add the 'Connection: Keep-Alive' header */
-      memcpy (&data[off],
-              "Connection: Keep-Alive\r\n",
-              MHD_STATICSTR_LEN_ ("Connection: Keep-Alive\r\n"));
-      off += MHD_STATICSTR_LEN_ ("Connection: Keep-Alive\r\n");
-    }
+  {
+    /* we must add the 'Connection: Keep-Alive' header */
+    memcpy (&data[off],
+            "Connection: Keep-Alive\r\n",
+            MHD_STATICSTR_LEN_ ("Connection: Keep-Alive\r\n"));
+    off += MHD_STATICSTR_LEN_ ("Connection: Keep-Alive\r\n");
+  }
   if (must_add_chunked_encoding)
-    {
-      /* we must add the 'Transfer-Encoding: chunked' header */
-      memcpy (&data[off],
-              "Transfer-Encoding: chunked\r\n",
-              MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n"));
-      off += MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n");
-    }
+  {
+    /* we must add the 'Transfer-Encoding: chunked' header */
+    memcpy (&data[off],
+            "Transfer-Encoding: chunked\r\n",
+            MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n"));
+    off += MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n");
+  }
   if (must_add_content_length)
-    {
-      /* we must add the 'Content-Length' header */
-      memcpy (&data[off],
-              content_length_buf,
-             content_length_len);
-      off += content_length_len;
-    }
+  {
+    /* we must add the 'Content-Length' header */
+    memcpy (&data[off],
+            content_length_buf,
+            content_length_len);
+    off += content_length_len;
+  }
   for (pos = response->first_header; NULL != pos; pos = pos->next)
-    {
-      /* TODO: add proper support for excluding "Keep-Alive" token. */
-      if ( (pos->kind == kind) &&
-           (! ( (must_add_close) &&
-                (response_has_keepalive) &&
-                (MHD_str_equal_caseless_(pos->header,
-                                         MHD_HTTP_HEADER_CONNECTION)) &&
-                (MHD_str_equal_caseless_(pos->value,
-                                         "Keep-Alive")) ) ) )
-        off += MHD_snprintf_ (&data[off],
-                              size - off,
-                              "%s: %s\r\n",
-                              pos->header,
-                              pos->value);
-    }
+  {
+    /* TODO: add proper support for excluding "Keep-Alive" token. */
+    if ( (pos->kind == kind) &&
+         (! ( (must_add_close) &&
+              (response_has_keepalive) &&
+              (MHD_str_equal_caseless_ (pos->header,
+                                        MHD_HTTP_HEADER_CONNECTION)) &&
+              (MHD_str_equal_caseless_ (pos->value,
+                                        "Keep-Alive")) ) ) )
+      off += MHD_snprintf_ (&data[off],
+                            size - off,
+                            "%s: %s\r\n",
+                            pos->header,
+                            pos->value);
+  }
   if (MHD_REQUEST_FOOTERS_RECEIVED == request->state)
-    {
-      memcpy (&data[off],
-              date,
-             datelen);
-      off += datelen;
-    }
+  {
+    memcpy (&data[off],
+            date,
+            datelen);
+    off += datelen;
+  }
   memcpy (&data[off],
           "\r\n",
           2);
@@ -1584,50 +1600,52 @@ build_header_response (struct MHD_Request *request)
  */
 static void
 transmit_error_response (struct MHD_Request *request,
-                        enum MHD_StatusCode ec,
+                         enum MHD_StatusCode ec,
                          enum MHD_HTTP_StatusCode status_code,
-                        const char *message)
+                         const char *message)
 {
   struct MHD_Response *response;
 
   if (NULL == request->version_s)
-    {
-      /* we were unable to process the full header line, so we don't
-        really know what version the client speaks; assume 1.0 */
-      request->version_s = MHD_HTTP_VERSION_1_0;
-    }
+  {
+    /* we were unable to process the full header line, so we don't
+ really know what version the client speaks; assume 1.0 */
+    request->version_s = MHD_HTTP_VERSION_1_0;
+  }
   request->state = MHD_REQUEST_FOOTERS_RECEIVED;
   request->connection->read_closed = true;
 #ifdef HAVE_MESSAGES
   MHD_DLOG (request->daemon,
-           ec,
-            _("Error processing request (HTTP response code is %u (`%s')). 
Closing connection.\n"),
+            ec,
+            _ (
+              "Error processing request (HTTP response code is %u (`%s')). 
Closing connection.\n"),
             status_code,
             message);
 #endif
   if (NULL != request->response)
-    {
-      MHD_response_queue_for_destroy (request->response);
-      request->response = NULL;
-    }
+  {
+    MHD_response_queue_for_destroy (request->response);
+    request->response = NULL;
+  }
   response = MHD_response_from_buffer (status_code,
-                                      strlen (message),
-                                      (void *) message,
-                                      MHD_RESPMEM_PERSISTENT);
+                                       strlen (message),
+                                       (void *) message,
+                                       MHD_RESPMEM_PERSISTENT);
   request->response = response;
   /* Do not reuse this connection. */
   request->keepalive = MHD_CONN_MUST_CLOSE;
   if (! build_header_response (request))
-    {
-      /* oops - close! */
-      CONNECTION_CLOSE_ERROR (request->connection,
-                             ec,
-                             _("Closing connection (failed to create response 
header)\n"));
-    }
+  {
+    /* oops - close! */
+    CONNECTION_CLOSE_ERROR (request->connection,
+                            ec,
+                            _ (
+                              "Closing connection (failed to create response 
header)\n"));
+  }
   else
-    {
-      request->state = MHD_REQUEST_HEADERS_SENDING;
-    }
+  {
+    request->state = MHD_REQUEST_HEADERS_SENDING;
+  }
 }
 
 
@@ -1640,7 +1658,8 @@ transmit_error_response (struct MHD_Request *request,
 static enum MHD_Method
 method_string_to_enum (const char *method)
 {
-  static const struct {
+  static const struct
+  {
     const char *key;
     enum MHD_Method value;
   } methods[] = {
@@ -1685,10 +1704,10 @@ method_string_to_enum (const char *method)
   };
   unsigned int i;
 
-  for (i=0;NULL != methods[i].key;i++)
+  for (i = 0; NULL != methods[i].key; i++)
     if (0 ==
-       MHD_str_equal_caseless_ (method,
-                                methods[i].key))
+        MHD_str_equal_caseless_ (method,
+                                 methods[i].key))
       return methods[i].value;
   return MHD_METHOD_UNKNOWN;
 }
@@ -1706,27 +1725,27 @@ method_string_to_enum (const char *method)
  */
 static bool
 request_add_header (struct MHD_Request *request,
-                   const char *key,
-                   const char *value,
-                   enum MHD_ValueKind kind)
+                    const char *key,
+                    const char *value,
+                    enum MHD_ValueKind kind)
 {
   if (MHD_NO ==
       MHD_request_set_value (request,
-                            kind,
-                            key,
-                            value))
-    {
+                             kind,
+                             key,
+                             value))
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (request->daemon,
-               MHD_SC_CONNECTION_POOL_MALLOC_FAILURE,
-                _("Not enough memory in pool to allocate header record!\n"));
+    MHD_DLOG (request->daemon,
+              MHD_SC_CONNECTION_POOL_MALLOC_FAILURE,
+              _ ("Not enough memory in pool to allocate header record!\n"));
 #endif
-      transmit_error_response (request,
-                              MHD_SC_CLIENT_HEADER_TOO_BIG,
-                               MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
-                               REQUEST_TOO_BIG);
-      return false;
-    }
+    transmit_error_response (request,
+                             MHD_SC_CLIENT_HEADER_TOO_BIG,
+                             MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
+                             REQUEST_TOO_BIG);
+    return false;
+  }
   return true;
 }
 
@@ -1763,76 +1782,76 @@ parse_initial_message_line (struct MHD_Request *request,
   /* Skip any spaces. Not required by standard but allow
      to be more tolerant. */
   while ( (' ' == uri[0]) &&
-          ( (size_t)(uri - line) < line_len) )
+          ( (size_t) (uri - line) < line_len) )
     uri++;
-  if ((size_t)(uri - line) == line_len)
-    {
-      curi = "";
-      uri = NULL;
-      request->version_s = "";
-      args = NULL;
-      url_end = line_len - (line - uri); // EH, this is garbage. FIXME!
-    }
+  if ((size_t) (uri - line) == line_len)
+  {
+    curi = "";
+    uri = NULL;
+    request->version_s = "";
+    args = NULL;
+    url_end = line_len - (line - uri);   // EH, this is garbage. FIXME!
+  }
   else
+  {
+    curi = uri;
+    /* Search from back to accept misformed URI with space */
+    http_version = line + line_len - 1;
+    /* Skip any trailing spaces */
+    while ( (' ' == http_version[0]) &&
+            (http_version > uri) )
+      http_version--;
+    /* Find first space in reverse direction */
+    while ( (' ' != http_version[0]) &&
+            (http_version > uri) )
+      http_version--;
+    if (http_version > uri)
+    {
+      http_version[0] = '\0';
+      request->version_s = http_version + 1;
+      args = memchr (uri,
+                     '?',
+                     http_version - uri);
+    }
+    else
     {
-      curi = uri;
-      /* Search from back to accept misformed URI with space */
-      http_version = line + line_len - 1;
-      /* Skip any trailing spaces */
-      while ( (' ' == http_version[0]) &&
-              (http_version > uri) )
-        http_version--;
-      /* Find first space in reverse direction */
-      while ( (' ' != http_version[0]) &&
-              (http_version > uri) )
-        http_version--;
-      if (http_version > uri)
-        {
-          http_version[0] = '\0';
-          request->version_s = http_version + 1;
-          args = memchr (uri,
-                         '?',
-                         http_version - uri);
-        }
-      else
-        {
-          request->version_s = "";
-          args = memchr (uri,
-                         '?',
-                         line_len - (uri - line));
-        }
-      url_end = http_version - uri;
+      request->version_s = "";
+      args = memchr (uri,
+                     '?',
+                     line_len - (uri - line));
     }
+    url_end = http_version - uri;
+  }
   if ( (MHD_PSL_STRICT == daemon->protocol_strict_level) &&
        (NULL != memchr (curi,
                         ' ',
                         url_end)) )
-    {
-      /* space exists in URI and we are supposed to be strict, reject */
-      return MHD_NO;
-    }
+  {
+    /* space exists in URI and we are supposed to be strict, reject */
+    return MHD_NO;
+  }
   if (NULL != daemon->early_uri_logger_cb)
-    {
-      request->client_context
-        = daemon->early_uri_logger_cb (daemon->early_uri_logger_cb_cls,
-                                      curi,
-                                      request);
-    }
+  {
+    request->client_context
+      = daemon->early_uri_logger_cb (daemon->early_uri_logger_cb_cls,
+                                     curi,
+                                     request);
+  }
   if (NULL != args)
-    {
-      args[0] = '\0';
-      args++;
-      /* note that this call clobbers 'args' */
-      MHD_parse_arguments_ (request,
-                           MHD_GET_ARGUMENT_KIND,
-                           args,
-                           &request_add_header,
-                           &unused_num_headers);
-    }
+  {
+    args[0] = '\0';
+    args++;
+    /* note that this call clobbers 'args' */
+    MHD_parse_arguments_ (request,
+                          MHD_GET_ARGUMENT_KIND,
+                          args,
+                          &request_add_header,
+                          &unused_num_headers);
+  }
   if (NULL != uri)
     daemon->unescape_cb (daemon->unescape_cb_cls,
-                        request,
-                        uri);
+                         request,
+                         uri);
   request->url = curi;
   return true;
 }
@@ -1856,43 +1875,46 @@ process_header_line (struct MHD_Request *request,
 
   /* line should be normal header line, find colon */
   colon = strchr (line,
-                 ':');
+                  ':');
   if (NULL == colon)
+  {
+    /* error in header line, die hard */
+    CONNECTION_CLOSE_ERROR (connection,
+                            MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
+                            _ (
+                              "Received malformed line (no colon). Closing 
connection.\n"));
+    return false;
+  }
+  if (MHD_PSL_PERMISSIVE != request->daemon->protocol_strict_level)
+  {
+    /* check for whitespace before colon, which is not allowed
+ by RFC 7230 section 3.2.4; we count space ' ' and
+ tab '\t', but not '\r\n' as those would have ended the line. */
+    const char *white;
+
+    white = strchr (line,
+                    (unsigned char) ' ');
+    if ( (NULL != white) &&
+         (white < colon) )
     {
-      /* error in header line, die hard */
       CONNECTION_CLOSE_ERROR (connection,
-                             MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
-                             _("Received malformed line (no colon). Closing 
connection.\n"));
+                              MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
+                              _ (
+                                "Whitespace before colon forbidden by RFC 
7230. Closing connection.\n"));
       return false;
     }
-  if (MHD_PSL_PERMISSIVE != request->daemon->protocol_strict_level)
+    white = strchr (line,
+                    (unsigned char) '\t');
+    if ( (NULL != white) &&
+         (white < colon) )
     {
-      /* check for whitespace before colon, which is not allowed
-        by RFC 7230 section 3.2.4; we count space ' ' and
-        tab '\t', but not '\r\n' as those would have ended the line. */
-      const char *white;
-
-      white = strchr (line,
-                     (unsigned char) ' ');
-      if ( (NULL != white) &&
-          (white < colon) )
-       {
-         CONNECTION_CLOSE_ERROR (connection,
-                                 MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
-                                 _("Whitespace before colon forbidden by RFC 
7230. Closing connection.\n"));
-         return false;
-       }
-      white = strchr (line,
-                     (unsigned char) '\t');
-      if ( (NULL != white) &&
-          (white < colon) )
-       {
-         CONNECTION_CLOSE_ERROR (connection,
-                                 MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
-                                 _("Tab before colon forbidden by RFC 7230. 
Closing connection.\n"));
-         return false;
-       }
+      CONNECTION_CLOSE_ERROR (connection,
+                              MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
+                              _ (
+                                "Tab before colon forbidden by RFC 7230. 
Closing connection.\n"));
+      return false;
     }
+  }
   /* zero-terminate header */
   colon[0] = '\0';
   colon++;                      /* advance to value */
@@ -1935,69 +1957,69 @@ process_broken_line (struct MHD_Request *request,
   last = request->last;
   if ( (' ' == line[0]) ||
        ('\t' == line[0]) )
-    {
-      /* value was continued on the next line, see
-         http://www.jmarshall.com/easy/http/ */
-      last_len = strlen (last);
-      /* skip whitespace at start of 2nd line */
-      tmp = line;
-      while ( (' ' == tmp[0]) ||
-              ('\t' == tmp[0]) )
-        tmp++;
-      tmp_len = strlen (tmp);
-      /* FIXME: we might be able to do this better (faster!), as most
-        likely 'last' and 'line' should already be adjacent in
-        memory; however, doing this right gets tricky if we have a
-        value continued over multiple lines (in which case we need to
-        record how often we have done this so we can check for
-        adjacency); also, in the case where these are not adjacent
-        (not sure how it can happen!), we would want to allocate from
-        the end of the pool, so as to not destroy the read-buffer's
-        ability to grow nicely. */
-      last = MHD_pool_reallocate (connection->pool,
-                                  last,
-                                  last_len + 1,
-                                  last_len + tmp_len + 1);
-      if (NULL == last)
-        {
-          transmit_error_response (request,
-                                  MHD_SC_CLIENT_HEADER_TOO_BIG,
-                                   MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
-                                   REQUEST_TOO_BIG);
-          return MHD_NO;
-        }
-      memcpy (&last[last_len],
-             tmp,
-             tmp_len + 1);
-      request->last = last;
-      return MHD_YES;           /* possibly more than 2 lines... */
-    }
-  mhd_assert ( (NULL != last) &&
-                (NULL != request->colon) );
-  if (! request_add_header (request,
-                           last,
-                           request->colon,
-                           kind))
+  {
+    /* value was continued on the next line, see
+       http://www.jmarshall.com/easy/http/ */
+    last_len = strlen (last);
+    /* skip whitespace at start of 2nd line */
+    tmp = line;
+    while ( (' ' == tmp[0]) ||
+            ('\t' == tmp[0]) )
+      tmp++;
+    tmp_len = strlen (tmp);
+    /* FIXME: we might be able to do this better (faster!), as most
+ likely 'last' and 'line' should already be adjacent in
+ memory; however, doing this right gets tricky if we have a
+ value continued over multiple lines (in which case we need to
+ record how often we have done this so we can check for
+ adjacency); also, in the case where these are not adjacent
+ (not sure how it can happen!), we would want to allocate from
+ the end of the pool, so as to not destroy the read-buffer's
+ ability to grow nicely. */
+    last = MHD_pool_reallocate (connection->pool,
+                                last,
+                                last_len + 1,
+                                last_len + tmp_len + 1);
+    if (NULL == last)
     {
       transmit_error_response (request,
-                              MHD_SC_CLIENT_HEADER_TOO_BIG,
+                               MHD_SC_CLIENT_HEADER_TOO_BIG,
                                MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
                                REQUEST_TOO_BIG);
-      return false;
+      return MHD_NO;
     }
+    memcpy (&last[last_len],
+            tmp,
+            tmp_len + 1);
+    request->last = last;
+    return MHD_YES;             /* possibly more than 2 lines... */
+  }
+  mhd_assert ( (NULL != last) &&
+               (NULL != request->colon) );
+  if (! request_add_header (request,
+                            last,
+                            request->colon,
+                            kind))
+  {
+    transmit_error_response (request,
+                             MHD_SC_CLIENT_HEADER_TOO_BIG,
+                             MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
+                             REQUEST_TOO_BIG);
+    return false;
+  }
   /* we still have the current line to deal with... */
   if ('\0' != line[0])
+  {
+    if (! process_header_line (request,
+                               line))
     {
-      if (! process_header_line (request,
-                                line))
-        {
-          transmit_error_response (request,
-                                  MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
-                                   MHD_HTTP_BAD_REQUEST,
-                                   REQUEST_MALFORMED);
-          return false;
-        }
+      transmit_error_response (request,
+                               MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
+                               MHD_HTTP_BAD_REQUEST,
+                               REQUEST_MALFORMED);
+      return false;
     }
+  }
   return true;
 }
 
@@ -2032,22 +2054,22 @@ get_next_header_line (struct MHD_Request *request,
     pos++;
   if ( (pos == request->read_buffer_offset - 1) &&
        ('\n' != rbuf[pos]) )
+  {
+    /* not found, consider growing... */
+    if ( (request->read_buffer_offset == request->read_buffer_size) &&
+         (! try_grow_read_buffer (request)) )
     {
-      /* not found, consider growing... */
-      if ( (request->read_buffer_offset == request->read_buffer_size) &&
-          (! try_grow_read_buffer (request)) )
-       {
-         transmit_error_response (request,
-                                  MHD_SC_CLIENT_HEADER_TOO_BIG,
-                                  (NULL != request->url)
-                                  ? MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
-                                  : MHD_HTTP_URI_TOO_LONG,
-                                  REQUEST_TOO_BIG);
-       }
-      if (line_len)
-        *line_len = 0;
-      return NULL;
+      transmit_error_response (request,
+                               MHD_SC_CLIENT_HEADER_TOO_BIG,
+                               (NULL != request->url)
+                               ? MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
+                               : MHD_HTTP_URI_TOO_LONG,
+                               REQUEST_TOO_BIG);
     }
+    if (line_len)
+      *line_len = 0;
+    return NULL;
+  }
 
   if (line_len)
     *line_len = pos;
@@ -2083,7 +2105,7 @@ get_next_header_line (struct MHD_Request *request,
  * @return true if force push is possible, false otherwise
  */
 static bool
-socket_flush_possible(struct MHD_Connection *connection)
+socket_flush_possible (struct MHD_Connection *connection)
 {
   (void) connection; /* Mute compiler warning. */
 #if defined(TCP_CORK) || defined(TCP_PUSH)
@@ -2105,21 +2127,21 @@ static bool
 socket_start_extra_buffering (struct MHD_Connection *connection)
 {
   bool res = false;
-  (void)connection; /* Mute compiler warning. */
+  (void) connection; /* Mute compiler warning. */
 #if defined(TCP_CORK) || defined(TCP_NOPUSH)
   const MHD_SCKT_OPT_BOOL_ on_val = 1;
 #if defined(TCP_NODELAY)
   const MHD_SCKT_OPT_BOOL_ off_val = 0;
 #endif /* TCP_NODELAY */
-  mhd_assert(NULL != connection);
-#if defined(TCP_NOPUSH) && !defined(TCP_CORK)
+  mhd_assert (NULL != connection);
+#if defined(TCP_NOPUSH) && ! defined(TCP_CORK)
   /* Buffer data before sending */
   res = (0 == setsockopt (connection->socket_fd,
                           IPPROTO_TCP,
                           TCP_NOPUSH,
                           (const void *) &on_val,
                           sizeof (on_val)))
-    ? true : false;
+        ? true : false;
 #if defined(TCP_NODELAY)
   /* Enable Nagle's algorithm */
   /* TCP_NODELAY may interfere with TCP_NOPUSH */
@@ -2128,7 +2150,7 @@ socket_start_extra_buffering (struct MHD_Connection 
*connection)
                            TCP_NODELAY,
                            (const void *) &off_val,
                            sizeof (off_val)))
-    ? true : false;
+         ? true : false;
 #endif /* TCP_NODELAY */
 #else /* TCP_CORK */
 #if defined(TCP_NODELAY)
@@ -2147,7 +2169,7 @@ socket_start_extra_buffering (struct MHD_Connection 
*connection)
                           TCP_CORK,
                           (const void *) &on_val,
                           sizeof (on_val)))
-    ? true : false;
+        ? true : false;
 #endif /* TCP_CORK */
 #endif /* TCP_CORK || TCP_NOPUSH */
   return res;
@@ -2170,8 +2192,8 @@ socket_start_no_buffering (struct MHD_Connection 
*connection)
   const MHD_SCKT_OPT_BOOL_ off_val = 0;
 #endif /* TCP_CORK || TCP_NOPUSH */
 
-  (void)connection; /* Mute compiler warning. */
-  mhd_assert(NULL != connection);
+  (void) connection; /* Mute compiler warning. */
+  mhd_assert (NULL != connection);
 #if defined(TCP_CORK)
   /* Allow partial packets */
   res &= (0 == setsockopt (connection->socket_fd,
@@ -2179,7 +2201,7 @@ socket_start_no_buffering (struct MHD_Connection 
*connection)
                            TCP_CORK,
                            (const void *) &off_val,
                            sizeof (off_val)))
-    ? true : false;
+         ? true : false;
 #endif /* TCP_CORK */
 #if defined(TCP_NODELAY)
   /* Disable Nagle's algorithm for sending packets without delay */
@@ -2188,16 +2210,16 @@ socket_start_no_buffering (struct MHD_Connection 
*connection)
                            TCP_NODELAY,
                            (const void *) &on_val,
                            sizeof (on_val)))
-    ? true : false;
+         ? true : false;
 #endif /* TCP_NODELAY */
-#if defined(TCP_NOPUSH) && !defined(TCP_CORK)
+#if defined(TCP_NOPUSH) && ! defined(TCP_CORK)
   /* Disable extra buffering */
   res &= (0 == setsockopt (connection->socket_fd,
                            IPPROTO_TCP,
                            TCP_NOPUSH,
                            (const void *) &off_val,
                            sizeof (off_val)))
-    ? true : false;
+         ? true : false;
 #endif /* TCP_NOPUSH  && !TCP_CORK */
   return res;
 #else  /* !TCP_NODELAY */
@@ -2217,21 +2239,21 @@ static bool
 socket_start_no_buffering_flush (struct MHD_Connection *connection)
 {
   bool res = true;
-#if defined(TCP_NOPUSH) && !defined(TCP_CORK)
+#if defined(TCP_NOPUSH) && ! defined(TCP_CORK)
   const int dummy = 0;
 #endif /* !TCP_CORK */
 
   if (NULL == connection)
     return false; /* FIXME: use MHD_NONNULL? */
   res = socket_start_no_buffering (connection);
-#if defined(TCP_NOPUSH) && !defined(TCP_CORK)
+#if defined(TCP_NOPUSH) && ! defined(TCP_CORK)
   /* Force flush data with zero send otherwise Darwin and some BSD systems
      will add 5 seconds delay. Not required with TCP_CORK as switching off
      TCP_CORK always flushes socket buffer. */
   res &= (0 <= MHD_send_ (connection->socket_fd,
                           &dummy,
                           0))
-    ? true : false;
+         ? true : false;
 #endif /* TCP_NOPUSH && !TCP_CORK*/
   return res;
 }
@@ -2254,7 +2276,7 @@ socket_start_normal_buffering (struct MHD_Connection 
*connection)
   socklen_t param_size = sizeof (cork_val);
 #endif /* TCP_CORK */
 
-  mhd_assert(NULL != connection);
+  mhd_assert (NULL != connection);
 #if defined(TCP_CORK)
   /* Allow partial packets */
   /* Disabling TCP_CORK will flush partial packet even if TCP_CORK wasn't 
enabled before
@@ -2262,7 +2284,7 @@ socket_start_normal_buffering (struct MHD_Connection 
*connection)
   if ( (0 != getsockopt (connection->socket_fd,
                          IPPROTO_TCP,
                          TCP_CORK,
-                         (void*)&cork_val,
+                         (void*) &cork_val,
                          &param_size)) ||
        (0 != cork_val))
     res &= (0 == setsockopt (connection->socket_fd,
@@ -2270,7 +2292,7 @@ socket_start_normal_buffering (struct MHD_Connection 
*connection)
                              TCP_CORK,
                              (const void *) &off_val,
                              sizeof (off_val)))
-      ? true : false;
+           ? true : false;
 #elif defined(TCP_NOPUSH)
   /* Disable extra buffering */
   /* No need to check current value as disabling TCP_NOPUSH will not flush 
partial
@@ -2280,7 +2302,7 @@ socket_start_normal_buffering (struct MHD_Connection 
*connection)
                            TCP_NOPUSH,
                            (const void *) &off_val,
                            sizeof (off_val)))
-    ? true : false;
+         ? true : false;
 #endif /* TCP_NOPUSH && !TCP_CORK */
   /* Enable Nagle's algorithm for normal buffering */
   res &= (0 == setsockopt (connection->socket_fd,
@@ -2288,7 +2310,7 @@ socket_start_normal_buffering (struct MHD_Connection 
*connection)
                            TCP_NODELAY,
                            (const void *) &off_val,
                            sizeof (off_val)))
-    ? true : false;
+         ? true : false;
   return res;
 #else  /* !TCP_NODELAY */
   return false;
@@ -2309,16 +2331,17 @@ need_100_continue (struct MHD_Request *request)
   const char *expect;
 
   return ( (NULL == request->response) &&
-          (NULL != request->version_s) &&
-       (MHD_str_equal_caseless_(request->version_s,
-                               MHD_HTTP_VERSION_1_1)) &&
-          (NULL != (expect = MHD_request_lookup_value (request,
-                                                       MHD_HEADER_KIND,
-                                                       
MHD_HTTP_HEADER_EXPECT))) &&
-          (MHD_str_equal_caseless_(expect,
-                                    "100-continue")) &&
-          (request->continue_message_write_offset <
-           MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE)) );
+           (NULL != request->version_s) &&
+           (MHD_str_equal_caseless_ (request->version_s,
+                                     MHD_HTTP_VERSION_1_1)) &&
+           (NULL != (expect = MHD_request_lookup_value (request,
+                                                        MHD_HEADER_KIND,
+                                                        
MHD_HTTP_HEADER_EXPECT)))
+           &&
+           (MHD_str_equal_caseless_ (expect,
+                                     "100-continue")) &&
+           (request->continue_message_write_offset <
+            MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE)) );
 }
 
 
@@ -2342,94 +2365,94 @@ parse_cookie_header (struct MHD_Request *request)
   int quotes;
 
   hdr = MHD_request_lookup_value (request,
-                                 MHD_HEADER_KIND,
-                                 MHD_HTTP_HEADER_COOKIE);
+                                  MHD_HEADER_KIND,
+                                  MHD_HTTP_HEADER_COOKIE);
   if (NULL == hdr)
     return true;
   cpy = MHD_pool_allocate (request->connection->pool,
                            strlen (hdr) + 1,
                            MHD_YES);
   if (NULL == cpy)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (request->daemon,
-               MHD_SC_COOKIE_POOL_ALLOCATION_FAILURE,
-                _("Not enough memory in pool to parse cookies!\n"));
+    MHD_DLOG (request->daemon,
+              MHD_SC_COOKIE_POOL_ALLOCATION_FAILURE,
+              _ ("Not enough memory in pool to parse cookies!\n"));
 #endif
-      transmit_error_response (request,
-                              MHD_SC_COOKIE_POOL_ALLOCATION_FAILURE,
-                               MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
-                               REQUEST_TOO_BIG);
-      return false;
-    }
+    transmit_error_response (request,
+                             MHD_SC_COOKIE_POOL_ALLOCATION_FAILURE,
+                             MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
+                             REQUEST_TOO_BIG);
+    return false;
+  }
   memcpy (cpy,
           hdr,
           strlen (hdr) + 1);
   pos = cpy;
   while (NULL != pos)
-    {
-      while (' ' == *pos)
-        pos++;                  /* skip spaces */
-
-      sce = pos;
-      while ( ((*sce) != '\0') &&
-              ((*sce) != ',') &&
-              ((*sce) != ';') &&
-              ((*sce) != '=') )
-        sce++;
-      /* remove tailing whitespace (if any) from key */
-      ekill = sce - 1;
-      while ( (*ekill == ' ') &&
-              (ekill >= pos) )
-        *(ekill--) = '\0';
-      old = *sce;
-      *sce = '\0';
-      if (old != '=')
-        {
-          /* value part omitted, use empty string... */
-          if (! request_add_header (request,
-                                   pos,
-                                   "",
-                                   MHD_COOKIE_KIND))
-            return false;
-          if (old == '\0')
-            break;
-          pos = sce + 1;
-          continue;
-        }
-      equals = sce + 1;
-      quotes = 0;
-      semicolon = equals;
-      while ( ('\0' != semicolon[0]) &&
-              ( (0 != quotes) ||
-                ( (';' != semicolon[0]) &&
-                  (',' != semicolon[0]) ) ) )
-        {
-          if ('"' == semicolon[0])
-            quotes = (quotes + 1) & 1;
-          semicolon++;
-        }
-      if ('\0' == semicolon[0])
-        semicolon = NULL;
-      if (NULL != semicolon)
-        {
-          semicolon[0] = '\0';
-          semicolon++;
-        }
-      /* remove quotes */
-      if ( ('"' == equals[0]) &&
-           ('"' == equals[strlen (equals) - 1]) )
-        {
-          equals[strlen (equals) - 1] = '\0';
-          equals++;
-        }
+  {
+    while (' ' == *pos)
+      pos++;                    /* skip spaces */
+
+    sce = pos;
+    while ( ((*sce) != '\0') &&
+            ((*sce) != ',') &&
+            ((*sce) != ';') &&
+            ((*sce) != '=') )
+      sce++;
+    /* remove tailing whitespace (if any) from key */
+    ekill = sce - 1;
+    while ( (*ekill == ' ') &&
+            (ekill >= pos) )
+      *(ekill--) = '\0';
+    old = *sce;
+    *sce = '\0';
+    if (old != '=')
+    {
+      /* value part omitted, use empty string... */
       if (! request_add_header (request,
-                               pos,
-                               equals,
-                               MHD_COOKIE_KIND))
+                                pos,
+                                "",
+                                MHD_COOKIE_KIND))
         return false;
-      pos = semicolon;
-    }
+      if (old == '\0')
+        break;
+      pos = sce + 1;
+      continue;
+    }
+    equals = sce + 1;
+    quotes = 0;
+    semicolon = equals;
+    while ( ('\0' != semicolon[0]) &&
+            ( (0 != quotes) ||
+              ( (';' != semicolon[0]) &&
+                (',' != semicolon[0]) ) ) )
+    {
+      if ('"' == semicolon[0])
+        quotes = (quotes + 1) & 1;
+      semicolon++;
+    }
+    if ('\0' == semicolon[0])
+      semicolon = NULL;
+    if (NULL != semicolon)
+    {
+      semicolon[0] = '\0';
+      semicolon++;
+    }
+    /* remove quotes */
+    if ( ('"' == equals[0]) &&
+         ('"' == equals[strlen (equals) - 1]) )
+    {
+      equals[strlen (equals) - 1] = '\0';
+      equals++;
+    }
+    if (! request_add_header (request,
+                              pos,
+                              equals,
+                              MHD_COOKIE_KIND))
+      return false;
+    pos = semicolon;
+  }
   return true;
 }
 
@@ -2454,64 +2477,64 @@ parse_request_headers (struct MHD_Request *request)
   parse_cookie_header (request); /* FIXME: return value ignored! */
   if ( (MHD_PSL_STRICT == daemon->protocol_strict_level) &&
        (NULL != request->version_s) &&
-       (MHD_str_equal_caseless_(MHD_HTTP_VERSION_1_1,
-                                request->version_s)) &&
+       (MHD_str_equal_caseless_ (MHD_HTTP_VERSION_1_1,
+                                 request->version_s)) &&
        (NULL ==
         MHD_request_lookup_value (request,
-                                 MHD_HEADER_KIND,
-                                 MHD_HTTP_HEADER_HOST)) )
-    {
-      /* die, http 1.1 request without host and we are pedantic */
-      request->state = MHD_REQUEST_FOOTERS_RECEIVED;
-      connection->read_closed = true;
+                                  MHD_HEADER_KIND,
+                                  MHD_HTTP_HEADER_HOST)) )
+  {
+    /* die, http 1.1 request without host and we are pedantic */
+    request->state = MHD_REQUEST_FOOTERS_RECEIVED;
+    connection->read_closed = true;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_HOST_HEADER_MISSING,
-                _("Received HTTP 1.1 request without `Host' header.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_HOST_HEADER_MISSING,
+              _ ("Received HTTP 1.1 request without `Host' header.\n"));
 #endif
-      mhd_assert (NULL == request->response);
-      response =
-        MHD_response_from_buffer (MHD_HTTP_BAD_REQUEST,
-                                 MHD_STATICSTR_LEN_ (REQUEST_LACKS_HOST),
-                                 REQUEST_LACKS_HOST,
-                                 MHD_RESPMEM_PERSISTENT);
-      request->response = response;
-      // FIXME: state machine advance?
-      return;
-    }
+    mhd_assert (NULL == request->response);
+    response =
+      MHD_response_from_buffer (MHD_HTTP_BAD_REQUEST,
+                                MHD_STATICSTR_LEN_ (REQUEST_LACKS_HOST),
+                                REQUEST_LACKS_HOST,
+                                MHD_RESPMEM_PERSISTENT);
+    request->response = response;
+    // FIXME: state machine advance?
+    return;
+  }
 
   request->remaining_upload_size = 0;
   enc = MHD_request_lookup_value (request,
-                                 MHD_HEADER_KIND,
-                                 MHD_HTTP_HEADER_TRANSFER_ENCODING);
+                                  MHD_HEADER_KIND,
+                                  MHD_HTTP_HEADER_TRANSFER_ENCODING);
   if (NULL != enc)
-    {
-      request->remaining_upload_size = MHD_SIZE_UNKNOWN;
-      if (MHD_str_equal_caseless_ (enc,
-                                  "chunked"))
-        request->have_chunked_upload = true;
-      return;
-    }
+  {
+    request->remaining_upload_size = MHD_SIZE_UNKNOWN;
+    if (MHD_str_equal_caseless_ (enc,
+                                 "chunked"))
+      request->have_chunked_upload = true;
+    return;
+  }
   clen = MHD_request_lookup_value (request,
-                                  MHD_HEADER_KIND,
-                                  MHD_HTTP_HEADER_CONTENT_LENGTH);
+                                   MHD_HEADER_KIND,
+                                   MHD_HTTP_HEADER_CONTENT_LENGTH);
   if (NULL == clen)
     return;
   end = clen + MHD_str_to_uint64_ (clen,
-                                  &request->remaining_upload_size);
+                                   &request->remaining_upload_size);
   if ( (clen == end) ||
        ('\0' != *end) )
-    {
-      request->remaining_upload_size = 0;
+  {
+    request->remaining_upload_size = 0;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (request->daemon,
-               MHD_SC_CONTENT_LENGTH_MALFORMED,
-               "Failed to parse `Content-Length' header. Closing 
connection.\n");
+    MHD_DLOG (request->daemon,
+              MHD_SC_CONTENT_LENGTH_MALFORMED,
+              "Failed to parse `Content-Length' header. Closing 
connection.\n");
 #endif
-      CONNECTION_CLOSE_ERROR (connection,
-                             MHD_SC_CONTENT_LENGTH_MALFORMED,
-                             NULL);
-    }
+    CONNECTION_CLOSE_ERROR (connection,
+                            MHD_SC_CONTENT_LENGTH_MALFORMED,
+                            NULL);
+  }
 }
 
 
@@ -2531,19 +2554,20 @@ call_request_handler (struct MHD_Request *request)
   if (NULL != request->response)
     return;                     /* already queued a response */
   if (NULL == (action =
-              daemon->rc (daemon->rc_cls,
-                          request,
-                          request->url,
-                          request->method)))
-    {
-      /* serious internal error, close connection */
-      CONNECTION_CLOSE_ERROR (connection,
-                             MHD_SC_APPLICATION_CALLBACK_FAILURE_CLOSED,
-                             _("Application reported internal error, closing 
connection.\n"));
-      return;
-    }
+                 daemon->rc (daemon->rc_cls,
+                             request,
+                             request->url,
+                             request->method)))
+  {
+    /* serious internal error, close connection */
+    CONNECTION_CLOSE_ERROR (connection,
+                            MHD_SC_APPLICATION_CALLBACK_FAILURE_CLOSED,
+                            _ (
+                              "Application reported internal error, closing 
connection.\n"));
+    return;
+  }
   action->action (action->action_cls,
-                 request);
+                  request);
 }
 
 
@@ -2568,208 +2592,212 @@ process_request_body (struct MHD_Request *request)
   buffer_head = request->read_buffer;
   available = request->read_buffer_offset;
   do
-    {
-      size_t to_be_processed;
-      size_t left_unprocessed;
-      size_t processed_size;
-
-      instant_retry = false;
-      if ( (request->have_chunked_upload) &&
-           (MHD_SIZE_UNKNOWN == request->remaining_upload_size) )
+  {
+    size_t to_be_processed;
+    size_t left_unprocessed;
+    size_t processed_size;
+
+    instant_retry = false;
+    if ( (request->have_chunked_upload) &&
+         (MHD_SIZE_UNKNOWN == request->remaining_upload_size) )
+    {
+      if ( (request->current_chunk_offset == request->current_chunk_size) &&
+           (0LLU != request->current_chunk_offset) &&
+           (available >= 2) )
+      {
+        size_t i;
+
+        /* skip new line at the *end* of a chunk */
+        i = 0;
+        if ( ('\r' == buffer_head[i]) ||
+             ('\n' == buffer_head[i]) )
+          i++;                  /* skip 1st part of line feed */
+        if ( ('\r' == buffer_head[i]) ||
+             ('\n' == buffer_head[i]) )
+          i++;                  /* skip 2nd part of line feed */
+        if (0 == i)
+        {
+          /* malformed encoding */
+          CONNECTION_CLOSE_ERROR (connection,
+                                  MHD_SC_CHUNKED_ENCODING_MALFORMED,
+                                  _ (
+                                    "Received malformed HTTP request (bad 
chunked encoding). Closing connection.\n"));
+          return;
+        }
+        available -= i;
+        buffer_head += i;
+        request->current_chunk_offset = 0;
+        request->current_chunk_size = 0;
+      }
+      if (request->current_chunk_offset <
+          request->current_chunk_size)
+      {
+        uint64_t cur_chunk_left;
+
+        /* we are in the middle of a chunk, give
+           as much as possible to the client (without
+           crossing chunk boundaries) */
+        cur_chunk_left
+          = request->current_chunk_size - request->current_chunk_offset;
+        if (cur_chunk_left > available)
         {
-          if ( (request->current_chunk_offset == request->current_chunk_size) 
&&
-               (0LLU != request->current_chunk_offset) &&
-               (available >= 2) )
-            {
-              size_t i;
-
-              /* skip new line at the *end* of a chunk */
-              i = 0;
-              if ( ('\r' == buffer_head[i]) ||
-                   ('\n' == buffer_head[i]) )
-                i++;            /* skip 1st part of line feed */
-              if ( ('\r' == buffer_head[i]) ||
-                   ('\n' == buffer_head[i]) )
-                i++;            /* skip 2nd part of line feed */
-              if (0 == i)
-                {
-                  /* malformed encoding */
-                  CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CHUNKED_ENCODING_MALFORMED,
-                                         _("Received malformed HTTP request 
(bad chunked encoding). Closing connection.\n"));
-                  return;
-                }
-              available -= i;
-              buffer_head += i;
-              request->current_chunk_offset = 0;
-              request->current_chunk_size = 0;
-            }
-          if (request->current_chunk_offset <
-              request->current_chunk_size)
-            {
-              uint64_t cur_chunk_left;
-
-              /* we are in the middle of a chunk, give
-                 as much as possible to the client (without
-                 crossing chunk boundaries) */
-              cur_chunk_left
-                = request->current_chunk_size - request->current_chunk_offset;
-              if (cur_chunk_left > available)
-               {
-                 to_be_processed = available;
-               }
-              else
-                { /* cur_chunk_left <= (size_t)available */
-                  to_be_processed = (size_t)cur_chunk_left;
-                  if (available > to_be_processed)
-                    instant_retry = true;
-                }
-            }
-          else
-            {
-              size_t i;
-              size_t end_size;
-              bool malformed;
-
-              /* we need to read chunk boundaries */
-              i = 0;
-              while (i < available)
-                {
-                  if ( ('\r' == buffer_head[i]) ||
-                       ('\n' == buffer_head[i]) ||
-                      (';' == buffer_head[i]) )
-                    break;
-                  i++;
-                  if (i >= 16)
-                    break;
-                }
-             end_size = i;
-             /* find beginning of CRLF (skip over chunk extensions) */
-             if (';' == buffer_head[i])
-               {
-                 while (i < available)
-                 {
-                   if ( ('\r' == buffer_head[i]) ||
-                        ('\n' == buffer_head[i]) )
-                     break;
-                   i++;
-                 }
-               }
-              /* take '\n' into account; if '\n' is the unavailable
-                 character, we will need to wait until we have it
-                 before going further */
-              if ( (i + 1 >= available) &&
-                   ! ( (1 == i) &&
-                       (2 == available) &&
-                       ('0' == buffer_head[0]) ) )
-                break;          /* need more data... */
-             i++;
-              malformed = (end_size >= 16);
-              if (! malformed)
-                {
-                  size_t num_dig = MHD_strx_to_uint64_n_ (buffer_head,
-                                                         end_size,
-                                                         
&request->current_chunk_size);
-                  malformed = (end_size != num_dig);
-                }
-              if (malformed)
-                {
-                  /* malformed encoding */
-                  CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CHUNKED_ENCODING_MALFORMED,
-                                         _("Received malformed HTTP request 
(bad chunked encoding). Closing connection.\n"));
-                  return;
-                }
-             /* skip 2nd part of line feed */
-              if ( (i < available) &&
-                   ( ('\r' == buffer_head[i]) ||
-                     ('\n' == buffer_head[i]) ) )
-                i++;
-
-              buffer_head += i;
-              available -= i;
-              request->current_chunk_offset = 0;
-
-              if (available > 0)
-                instant_retry = true;
-              if (0LLU == request->current_chunk_size)
-                {
-                  request->remaining_upload_size = 0;
-                  break;
-                }
-              continue;
-            }
+          to_be_processed = available;
+        }
+        else
+        {         /* cur_chunk_left <= (size_t)available */
+          to_be_processed = (size_t) cur_chunk_left;
+          if (available > to_be_processed)
+            instant_retry = true;
         }
+      }
       else
+      {
+        size_t i;
+        size_t end_size;
+        bool malformed;
+
+        /* we need to read chunk boundaries */
+        i = 0;
+        while (i < available)
         {
-          /* no chunked encoding, give all to the client */
-          if ( (0 != request->remaining_upload_size) &&
-              (MHD_SIZE_UNKNOWN != request->remaining_upload_size) &&
-              (request->remaining_upload_size < available) )
-           {
-              to_be_processed = (size_t)request->remaining_upload_size;
-           }
-          else
-           {
-              /**
-               * 1. no chunked encoding, give all to the client
-               * 2. client may send large chunked data, but only a smaller 
part is available at one time.
-               */
-              to_be_processed = available;
-           }
+          if ( ('\r' == buffer_head[i]) ||
+               ('\n' == buffer_head[i]) ||
+               (';' == buffer_head[i]) )
+            break;
+          i++;
+          if (i >= 16)
+            break;
         }
-      left_unprocessed = to_be_processed;
-#if FIXME_OLD_STYLE
-      if (MHD_NO ==
-          daemon->rc (daemon->rc_cls,
-                     request,
-                     request->url,
-                     request->method,
-                     request->version,
-                     buffer_head,
-                     &left_unprocessed,
-                     &request->client_context))
+        end_size = i;
+        /* find beginning of CRLF (skip over chunk extensions) */
+        if (';' == buffer_head[i])
         {
-          /* serious internal error, close connection */
+          while (i < available)
+          {
+            if ( ('\r' == buffer_head[i]) ||
+                 ('\n' == buffer_head[i]) )
+              break;
+            i++;
+          }
+        }
+        /* take '\n' into account; if '\n' is the unavailable
+           character, we will need to wait until we have it
+           before going further */
+        if ( (i + 1 >= available) &&
+             ! ( (1 == i) &&
+                 (2 == available) &&
+                 ('0' == buffer_head[0]) ) )
+          break;                /* need more data... */
+        i++;
+        malformed = (end_size >= 16);
+        if (! malformed)
+        {
+          size_t num_dig = MHD_strx_to_uint64_n_ (buffer_head,
+                                                  end_size,
+                                                  
&request->current_chunk_size);
+          malformed = (end_size != num_dig);
+        }
+        if (malformed)
+        {
+          /* malformed encoding */
           CONNECTION_CLOSE_ERROR (connection,
-                                 MHD_SC_APPLICATION_CALLBACK_FAILURE_CLOSED,
-                                  _("Application reported internal error, 
closing connection.\n"));
+                                  MHD_SC_CHUNKED_ENCODING_MALFORMED,
+                                  _ (
+                                    "Received malformed HTTP request (bad 
chunked encoding). Closing connection.\n"));
           return;
         }
+        /* skip 2nd part of line feed */
+        if ( (i < available) &&
+             ( ('\r' == buffer_head[i]) ||
+               ('\n' == buffer_head[i]) ) )
+          i++;
+
+        buffer_head += i;
+        available -= i;
+        request->current_chunk_offset = 0;
+
+        if (available > 0)
+          instant_retry = true;
+        if (0LLU == request->current_chunk_size)
+        {
+          request->remaining_upload_size = 0;
+          break;
+        }
+        continue;
+      }
+    }
+    else
+    {
+      /* no chunked encoding, give all to the client */
+      if ( (0 != request->remaining_upload_size) &&
+           (MHD_SIZE_UNKNOWN != request->remaining_upload_size) &&
+           (request->remaining_upload_size < available) )
+      {
+        to_be_processed = (size_t) request->remaining_upload_size;
+      }
+      else
+      {
+        /**
+         * 1. no chunked encoding, give all to the client
+         * 2. client may send large chunked data, but only a smaller part is 
available at one time.
+         */
+        to_be_processed = available;
+      }
+    }
+    left_unprocessed = to_be_processed;
+#if FIXME_OLD_STYLE
+    if (MHD_NO ==
+        daemon->rc (daemon->rc_cls,
+                    request,
+                    request->url,
+                    request->method,
+                    request->version,
+                    buffer_head,
+                    &left_unprocessed,
+                    &request->client_context))
+    {
+      /* serious internal error, close connection */
+      CONNECTION_CLOSE_ERROR (connection,
+                              MHD_SC_APPLICATION_CALLBACK_FAILURE_CLOSED,
+                              _ (
+                                "Application reported internal error, closing 
connection.\n"));
+      return;
+    }
 #endif
-      if (left_unprocessed > to_be_processed)
-        mhd_panic (mhd_panic_cls,
-                   __FILE__,
-                   __LINE__
+    if (left_unprocessed > to_be_processed)
+      mhd_panic (mhd_panic_cls,
+                 __FILE__,
+                 __LINE__
 #ifdef HAVE_MESSAGES
-                  , _("libmicrohttpd API violation")
+                 , _ ("libmicrohttpd API violation")
 #else
-                  , NULL
+                 , NULL
 #endif
-                  );
-      if (0 != left_unprocessed)
-       {
-         instant_retry = false; /* client did not process everything */
+                 );
+    if (0 != left_unprocessed)
+    {
+      instant_retry = false; /* client did not process everything */
 #ifdef HAVE_MESSAGES
-         /* client did not process all upload data, complain if
-            the setup was incorrect, which may prevent us from
-            handling the rest of the request */
-         if ( (MHD_TM_EXTERNAL_EVENT_LOOP == daemon->threading_mode) &&
-              (! connection->suspended) )
-           MHD_DLOG (daemon,
-                     MHD_SC_APPLICATION_HUNG_CONNECTION,
-                     _("WARNING: incomplete upload processing and connection 
not suspended may result in hung connection.\n"));
+      /* client did not process all upload data, complain if
+         the setup was incorrect, which may prevent us from
+         handling the rest of the request */
+      if ( (MHD_TM_EXTERNAL_EVENT_LOOP == daemon->threading_mode) &&
+           (! connection->suspended) )
+        MHD_DLOG (daemon,
+                  MHD_SC_APPLICATION_HUNG_CONNECTION,
+                  _ (
+                    "WARNING: incomplete upload processing and connection not 
suspended may result in hung connection.\n"));
 #endif
-       }
-      processed_size = to_be_processed - left_unprocessed;
-      if (request->have_chunked_upload)
-        request->current_chunk_offset += processed_size;
-      /* dh left "processed" bytes in buffer for next time... */
-      buffer_head += processed_size;
-      available -= processed_size;
-      if (MHD_SIZE_UNKNOWN != request->remaining_upload_size)
-        request->remaining_upload_size -= processed_size;
     }
+    processed_size = to_be_processed - left_unprocessed;
+    if (request->have_chunked_upload)
+      request->current_chunk_offset += processed_size;
+    /* dh left "processed" bytes in buffer for next time... */
+    buffer_head += processed_size;
+    available -= processed_size;
+    if (MHD_SIZE_UNKNOWN != request->remaining_upload_size)
+      request->remaining_upload_size -= processed_size;
+  }
   while (instant_retry);
   if (available > 0)
     memmove (request->read_buffer,
@@ -2796,58 +2824,59 @@ cleanup_connection (struct MHD_Connection *connection)
     return; /* Prevent double cleanup. */
   connection->request.in_cleanup = true;
   if (NULL != connection->request.response)
-    {
-      MHD_response_queue_for_destroy (connection->request.response);
-      connection->request.response = NULL;
-    }
+  {
+    MHD_response_queue_for_destroy (connection->request.response);
+    connection->request.response = NULL;
+  }
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   if (connection->suspended)
-    {
-      DLL_remove (daemon->suspended_connections_head,
-                  daemon->suspended_connections_tail,
-                  connection);
-      connection->suspended = false;
-    }
+  {
+    DLL_remove (daemon->suspended_connections_head,
+                daemon->suspended_connections_tail,
+                connection);
+    connection->suspended = false;
+  }
   else
+  {
+    if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode)
     {
-      if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode)
-        {
-          if (connection->connection_timeout ==
-             daemon->connection_default_timeout)
-            XDLL_remove (daemon->normal_timeout_head,
-                         daemon->normal_timeout_tail,
-                         connection);
-          else
-            XDLL_remove (daemon->manual_timeout_head,
-                         daemon->manual_timeout_tail,
-                         connection);
-        }
-      DLL_remove (daemon->connections_head,
-                  daemon->connections_tail,
-                  connection);
+      if (connection->connection_timeout ==
+          daemon->connection_default_timeout)
+        XDLL_remove (daemon->normal_timeout_head,
+                     daemon->normal_timeout_tail,
+                     connection);
+      else
+        XDLL_remove (daemon->manual_timeout_head,
+                     daemon->manual_timeout_tail,
+                     connection);
     }
+    DLL_remove (daemon->connections_head,
+                daemon->connections_tail,
+                connection);
+  }
   DLL_insert (daemon->cleanup_head,
-             daemon->cleanup_tail,
-             connection);
+              daemon->cleanup_tail,
+              connection);
   connection->resuming = false;
   connection->request.in_idle = false;
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
   if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
+  {
+    /* if we were at the connection limit before and are in
+       thread-per-connection mode, signal the main thread
+       to resume accepting connections */
+    if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
+         (! MHD_itc_activate_ (daemon->itc,
+                               "c")) )
     {
-      /* if we were at the connection limit before and are in
-         thread-per-connection mode, signal the main thread
-         to resume accepting connections */
-      if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
-           (! MHD_itc_activate_ (daemon->itc,
-                                "c")) )
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_ITC_USE_FAILED,
-                    _("Failed to signal end of connection via inter-thread 
communication channel"));
+      MHD_DLOG (daemon,
+                MHD_SC_ITC_USE_FAILED,
+                _ (
+                  "Failed to signal end of connection via inter-thread 
communication channel"));
 #endif
-        }
     }
+  }
 }
 
 
@@ -2870,31 +2899,31 @@ connection_epoll_update_ (struct MHD_Connection 
*connection)
        (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) &&
        ( ( (MHD_EVENT_LOOP_INFO_WRITE == connection->request.event_loop_info) 
&&
            (0 == (connection->epoll_state & MHD_EPOLL_STATE_WRITE_READY))) ||
-        ( (MHD_EVENT_LOOP_INFO_READ == connection->request.event_loop_info) &&
-          (0 == (connection->epoll_state & MHD_EPOLL_STATE_READ_READY)) ) ) )
+         ( (MHD_EVENT_LOOP_INFO_READ == connection->request.event_loop_info) &&
+           (0 == (connection->epoll_state & MHD_EPOLL_STATE_READ_READY)) ) ) )
+  {
+    /* add to epoll set */
+    struct epoll_event event;
+
+    event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
+    event.data.ptr = connection;
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_ADD,
+                        connection->socket_fd,
+                        &event))
     {
-      /* add to epoll set */
-      struct epoll_event event;
-
-      event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
-      event.data.ptr = connection;
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                         EPOLL_CTL_ADD,
-                         connection->socket_fd,
-                         &event))
-       {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_EPOLL_CTL_ADD_FAILED,
-                   _("Call to epoll_ctl failed: %s\n"),
-                   MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_EPOLL_CTL_ADD_FAILED,
+                _ ("Call to epoll_ctl failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-         connection->request.state = MHD_REQUEST_CLOSED;
-         cleanup_connection (connection);
-         return false;
-       }
-      connection->epoll_state |= MHD_EPOLL_STATE_IN_EPOLL_SET;
+      connection->request.state = MHD_REQUEST_CLOSED;
+      cleanup_connection (connection);
+      return false;
     }
+    connection->epoll_state |= MHD_EPOLL_STATE_IN_EPOLL_SET;
+  }
   return true;
 }
 #endif
@@ -2922,142 +2951,142 @@ connection_update_event_loop_info (struct 
MHD_Connection *connection)
     struct MHD_TLS_Plugin *tls;
 
     if ( (NULL != (tls = daemon->tls_api)) &&
-        (tls->update_event_loop_info (tls->cls,
-                                      connection->tls_cs,
-                                      &request->event_loop_info)) )
+         (tls->update_event_loop_info (tls->cls,
+                                       connection->tls_cs,
+                                       &request->event_loop_info)) )
       return; /* TLS has decided what to do */
   }
 #endif /* HTTPS_SUPPORT */
   while (1)
-    {
+  {
 #if DEBUG_STATES
-      MHD_DLOG (daemon,
-               MHD_SC_STATE_MACHINE_STATUS_REPORT,
-                _("In function %s handling connection at state: %s\n"),
-                __FUNCTION__,
-                MHD_state_to_string (request->state));
+    MHD_DLOG (daemon,
+              MHD_SC_STATE_MACHINE_STATUS_REPORT,
+              _ ("In function %s handling connection at state: %s\n"),
+              __FUNCTION__,
+              MHD_state_to_string (request->state));
 #endif
-      switch (request->state)
+    switch (request->state)
+    {
+    case MHD_REQUEST_INIT:
+    case MHD_REQUEST_URL_RECEIVED:
+    case MHD_REQUEST_HEADER_PART_RECEIVED:
+      /* while reading headers, we always grow the
+         read buffer if needed, no size-check required */
+      if ( (request->read_buffer_offset == request->read_buffer_size) &&
+           (! try_grow_read_buffer (request)) )
+      {
+        transmit_error_response (request,
+                                 MHD_SC_CLIENT_HEADER_TOO_BIG,
+                                 (NULL != request->url)
+                                 ? MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
+                                 : MHD_HTTP_URI_TOO_LONG,
+                                 REQUEST_TOO_BIG);
+        continue;
+      }
+      if (! connection->read_closed)
+        request->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
+      else
+        request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
+      break;
+    case MHD_REQUEST_HEADERS_RECEIVED:
+      mhd_assert (0);
+      break;
+    case MHD_REQUEST_HEADERS_PROCESSED:
+      mhd_assert (0);
+      break;
+    case MHD_REQUEST_CONTINUE_SENDING:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
+      break;
+    case MHD_REQUEST_CONTINUE_SENT:
+      if (request->read_buffer_offset == request->read_buffer_size)
+      {
+        if ( (! try_grow_read_buffer (request)) &&
+             (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode) )
         {
-        case MHD_REQUEST_INIT:
-        case MHD_REQUEST_URL_RECEIVED:
-        case MHD_REQUEST_HEADER_PART_RECEIVED:
-          /* while reading headers, we always grow the
-             read buffer if needed, no size-check required */
-          if ( (request->read_buffer_offset == request->read_buffer_size) &&
-              (! try_grow_read_buffer (request)) )
-            {
-              transmit_error_response (request,
-                                      MHD_SC_CLIENT_HEADER_TOO_BIG,
-                                       (NULL != request->url)
-                                       ? 
MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
-                                       : MHD_HTTP_URI_TOO_LONG,
-                                       REQUEST_TOO_BIG);
-              continue;
-            }
-         if (! connection->read_closed)
-           request->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
-         else
-           request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
-          break;
-        case MHD_REQUEST_HEADERS_RECEIVED:
-          mhd_assert (0);
-          break;
-        case MHD_REQUEST_HEADERS_PROCESSED:
-          mhd_assert (0);
-          break;
-        case MHD_REQUEST_CONTINUE_SENDING:
-          request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
-          break;
-        case MHD_REQUEST_CONTINUE_SENT:
-          if (request->read_buffer_offset == request->read_buffer_size)
-            {
-              if ( (! try_grow_read_buffer (request)) &&
-                  (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode) )
-                {
-                  /* failed to grow the read buffer, and the client
-                     which is supposed to handle the received data in
-                     a *blocking* fashion (in this mode) did not
-                     handle the data as it was supposed to!
-
-                     => we would either have to do busy-waiting
-                     (on the client, which would likely fail),
-                     or if we do nothing, we would just timeout
-                     on the connection (if a timeout is even set!).
-
-                     Solution: we kill the connection with an error */
-                  transmit_error_response (request,
-                                          
MHD_SC_APPLICATION_HUNG_CONNECTION_CLOSED,
-                                           MHD_HTTP_INTERNAL_SERVER_ERROR,
-                                           INTERNAL_ERROR);
-                  continue;
-                }
-            }
-          if ( (request->read_buffer_offset < request->read_buffer_size) &&
-              (! connection->read_closed) )
-           request->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
-         else
-           request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
-          break;
-        case MHD_REQUEST_BODY_RECEIVED:
-        case MHD_REQUEST_FOOTER_PART_RECEIVED:
-          /* while reading footers, we always grow the
-             read buffer if needed, no size-check required */
-          if (connection->read_closed)
-            {
-             CONNECTION_CLOSE_ERROR (connection,
-                                     MHD_SC_CONNECTION_READ_FAIL_CLOSED,
-                                     NULL);
-              continue;
-            }
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
-          /* transition to FOOTERS_RECEIVED
-             happens in read handler */
-          break;
-        case MHD_REQUEST_FOOTERS_RECEIVED:
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
-          break;
-        case MHD_REQUEST_HEADERS_SENDING:
-          /* headers in buffer, keep writing */
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
-          break;
-        case MHD_REQUEST_HEADERS_SENT:
-          mhd_assert (0);
-          break;
-        case MHD_REQUEST_NORMAL_BODY_READY:
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
-          break;
-        case MHD_REQUEST_NORMAL_BODY_UNREADY:
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
-          break;
-        case MHD_REQUEST_CHUNKED_BODY_READY:
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
-          break;
-        case MHD_REQUEST_CHUNKED_BODY_UNREADY:
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
-          break;
-        case MHD_REQUEST_BODY_SENT:
-          mhd_assert (0);
-          break;
-        case MHD_REQUEST_FOOTERS_SENDING:
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
-          break;
-        case MHD_REQUEST_FOOTERS_SENT:
-          mhd_assert (0);
-          break;
-        case MHD_REQUEST_CLOSED:
-         request->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
-          return;       /* do nothing, not even reading */
-#ifdef UPGRADE_SUPPORT
-        case MHD_REQUEST_UPGRADE:
-          mhd_assert (0);
-          break;
-#endif /* UPGRADE_SUPPORT */
-        default:
-          mhd_assert (0);
+          /* failed to grow the read buffer, and the client
+             which is supposed to handle the received data in
+             a *blocking* fashion (in this mode) did not
+             handle the data as it was supposed to!
+
+             => we would either have to do busy-waiting
+             (on the client, which would likely fail),
+             or if we do nothing, we would just timeout
+             on the connection (if a timeout is even set!).
+
+             Solution: we kill the connection with an error */
+          transmit_error_response (request,
+                                   MHD_SC_APPLICATION_HUNG_CONNECTION_CLOSED,
+                                   MHD_HTTP_INTERNAL_SERVER_ERROR,
+                                   INTERNAL_ERROR);
+          continue;
         }
+      }
+      if ( (request->read_buffer_offset < request->read_buffer_size) &&
+           (! connection->read_closed) )
+        request->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
+      else
+        request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
       break;
+    case MHD_REQUEST_BODY_RECEIVED:
+    case MHD_REQUEST_FOOTER_PART_RECEIVED:
+      /* while reading footers, we always grow the
+         read buffer if needed, no size-check required */
+      if (connection->read_closed)
+      {
+        CONNECTION_CLOSE_ERROR (connection,
+                                MHD_SC_CONNECTION_READ_FAIL_CLOSED,
+                                NULL);
+        continue;
+      }
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_READ;
+      /* transition to FOOTERS_RECEIVED
+         happens in read handler */
+      break;
+    case MHD_REQUEST_FOOTERS_RECEIVED:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
+      break;
+    case MHD_REQUEST_HEADERS_SENDING:
+      /* headers in buffer, keep writing */
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
+      break;
+    case MHD_REQUEST_HEADERS_SENT:
+      mhd_assert (0);
+      break;
+    case MHD_REQUEST_NORMAL_BODY_READY:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
+      break;
+    case MHD_REQUEST_NORMAL_BODY_UNREADY:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
+      break;
+    case MHD_REQUEST_CHUNKED_BODY_READY:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
+      break;
+    case MHD_REQUEST_CHUNKED_BODY_UNREADY:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK;
+      break;
+    case MHD_REQUEST_BODY_SENT:
+      mhd_assert (0);
+      break;
+    case MHD_REQUEST_FOOTERS_SENDING:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
+      break;
+    case MHD_REQUEST_FOOTERS_SENT:
+      mhd_assert (0);
+      break;
+    case MHD_REQUEST_CLOSED:
+      request->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
+      return;           /* do nothing, not even reading */
+#ifdef UPGRADE_SUPPORT
+    case MHD_REQUEST_UPGRADE:
+      mhd_assert (0);
+      break;
+#endif /* UPGRADE_SUPPORT */
+    default:
+      mhd_assert (0);
     }
+    break;
+  }
 }
 
 
@@ -3082,491 +3111,494 @@ MHD_request_handle_idle_ (struct MHD_Request *request)
 
   request->in_idle = true;
   while (! connection->suspended)
-    {
+  {
 #ifdef HTTPS_SUPPORT
-      struct MHD_TLS_Plugin *tls;
+    struct MHD_TLS_Plugin *tls;
 
-      if ( (NULL != (tls = daemon->tls_api)) &&
-          (! tls->idle_ready (tls->cls,
-                              connection->tls_cs)) )
-       break;
+    if ( (NULL != (tls = daemon->tls_api)) &&
+         (! tls->idle_ready (tls->cls,
+                             connection->tls_cs)) )
+      break;
 #endif /* HTTPS_SUPPORT */
 #if DEBUG_STATES
-      MHD_DLOG (daemon,
-               MHD_SC_STATE_MACHINE_STATUS_REPORT,
-                _("In function %s handling connection at state: %s\n"),
-                __FUNCTION__,
-                MHD_state_to_string (request->state));
+    MHD_DLOG (daemon,
+              MHD_SC_STATE_MACHINE_STATUS_REPORT,
+              _ ("In function %s handling connection at state: %s\n"),
+              __FUNCTION__,
+              MHD_state_to_string (request->state));
 #endif
-      switch (request->state)
+    switch (request->state)
+    {
+    case MHD_REQUEST_INIT:
+      line = get_next_header_line (request,
+                                   &line_len);
+      /* Check for empty string, as we might want
+         to tolerate 'spurious' empty lines; also
+         NULL means we didn't get a full line yet;
+         line is not 0-terminated here. */
+      if ( (NULL == line) ||
+           (0 == line[0]) )
+      {
+        if (MHD_REQUEST_INIT != request->state)
+          continue;
+        if (connection->read_closed)
         {
-        case MHD_REQUEST_INIT:
-          line = get_next_header_line (request,
-                                       &line_len);
-          /* Check for empty string, as we might want
-             to tolerate 'spurious' empty lines; also
-             NULL means we didn't get a full line yet;
-             line is not 0-terminated here. */
-          if ( (NULL == line) ||
-               (0 == line[0]) )
-            {
-              if (MHD_REQUEST_INIT != request->state)
-                continue;
-              if (connection->read_closed)
-                {
-                 CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CONNECTION_READ_FAIL_CLOSED,
-                                         NULL);
-                  continue;
-                }
-              break;
-            }
-          if (MHD_NO ==
-             parse_initial_message_line (request,
-                                         line,
-                                         line_len))
-            CONNECTION_CLOSE_ERROR (connection,
-                                   MHD_SC_CONNECTION_CLOSED,
-                                    NULL);
-          else
-            request->state = MHD_REQUEST_URL_RECEIVED;
+          CONNECTION_CLOSE_ERROR (connection,
+                                  MHD_SC_CONNECTION_READ_FAIL_CLOSED,
+                                  NULL);
           continue;
-        case MHD_REQUEST_URL_RECEIVED:
-          line = get_next_header_line (request,
-                                       NULL);
-          if (NULL == line)
-            {
-              if (MHD_REQUEST_URL_RECEIVED != request->state)
-                continue;
-              if (connection->read_closed)
-                {
-                 CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CONNECTION_READ_FAIL_CLOSED,
-                                         NULL);
-                  continue;
-                }
-              break;
-            }
-          if (0 == line[0])
-            {
-              request->state = MHD_REQUEST_HEADERS_RECEIVED;
-              request->header_size = (size_t) (line - request->read_buffer);
-              continue;
-            }
-          if (! process_header_line (request,
-                                    line))
-            {
-              transmit_error_response (request,
-                                      MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
-                                       MHD_HTTP_BAD_REQUEST,
-                                       REQUEST_MALFORMED);
-              break;
-            }
-          request->state = MHD_REQUEST_HEADER_PART_RECEIVED;
+        }
+        break;
+      }
+      if (MHD_NO ==
+          parse_initial_message_line (request,
+                                      line,
+                                      line_len))
+        CONNECTION_CLOSE_ERROR (connection,
+                                MHD_SC_CONNECTION_CLOSED,
+                                NULL);
+      else
+        request->state = MHD_REQUEST_URL_RECEIVED;
+      continue;
+    case MHD_REQUEST_URL_RECEIVED:
+      line = get_next_header_line (request,
+                                   NULL);
+      if (NULL == line)
+      {
+        if (MHD_REQUEST_URL_RECEIVED != request->state)
           continue;
-        case MHD_REQUEST_HEADER_PART_RECEIVED:
-          line = get_next_header_line (request,
-                                       NULL);
-          if (NULL == line)
-            {
-              if (request->state != MHD_REQUEST_HEADER_PART_RECEIVED)
-                continue;
-              if (connection->read_closed)
-                {
-                 CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CONNECTION_READ_FAIL_CLOSED,
-                                         NULL);
-                  continue;
-                }
-              break;
-            }
-          if (MHD_NO ==
-              process_broken_line (request,
-                                   line,
-                                   MHD_HEADER_KIND))
-            continue;
-          if (0 == line[0])
-            {
-              request->state = MHD_REQUEST_HEADERS_RECEIVED;
-              request->header_size = (size_t) (line - request->read_buffer);
-              continue;
-            }
+        if (connection->read_closed)
+        {
+          CONNECTION_CLOSE_ERROR (connection,
+                                  MHD_SC_CONNECTION_READ_FAIL_CLOSED,
+                                  NULL);
           continue;
-        case MHD_REQUEST_HEADERS_RECEIVED:
-          parse_request_headers (request);
-          if (MHD_REQUEST_CLOSED == request->state)
-            continue;
-          request->state = MHD_REQUEST_HEADERS_PROCESSED;
-          if (connection->suspended)
-            break;
+        }
+        break;
+      }
+      if (0 == line[0])
+      {
+        request->state = MHD_REQUEST_HEADERS_RECEIVED;
+        request->header_size = (size_t) (line - request->read_buffer);
+        continue;
+      }
+      if (! process_header_line (request,
+                                 line))
+      {
+        transmit_error_response (request,
+                                 MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
+                                 MHD_HTTP_BAD_REQUEST,
+                                 REQUEST_MALFORMED);
+        break;
+      }
+      request->state = MHD_REQUEST_HEADER_PART_RECEIVED;
+      continue;
+    case MHD_REQUEST_HEADER_PART_RECEIVED:
+      line = get_next_header_line (request,
+                                   NULL);
+      if (NULL == line)
+      {
+        if (request->state != MHD_REQUEST_HEADER_PART_RECEIVED)
           continue;
-        case MHD_REQUEST_HEADERS_PROCESSED:
-          call_request_handler (request); /* first call */
-          if (MHD_REQUEST_CLOSED == request->state)
-            continue;
-          if (need_100_continue (request))
-            {
-              request->state = MHD_REQUEST_CONTINUE_SENDING;
-              if (socket_flush_possible (connection))
-                socket_start_extra_buffering (connection);
-              else
-                socket_start_no_buffering (connection);
-              break;
-            }
-          if ( (NULL != request->response) &&
-              ( (MHD_METHOD_POST == request->method) ||
-                (MHD_METHOD_PUT == request->method) ) )
-            {
-              /* we refused (no upload allowed!) */
-              request->remaining_upload_size = 0;
-              /* force close, in case client still tries to upload... */
-              connection->read_closed = true;
-            }
-          request->state = (0 == request->remaining_upload_size)
-            ? MHD_REQUEST_FOOTERS_RECEIVED
-           : MHD_REQUEST_CONTINUE_SENT;
-          if (connection->suspended)
-            break;
+        if (connection->read_closed)
+        {
+          CONNECTION_CLOSE_ERROR (connection,
+                                  MHD_SC_CONNECTION_READ_FAIL_CLOSED,
+                                  NULL);
           continue;
-        case MHD_REQUEST_CONTINUE_SENDING:
-          if (request->continue_message_write_offset ==
-              MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE))
-            {
-              request->state = MHD_REQUEST_CONTINUE_SENT;
-              if (! socket_flush_possible (connection))
-                socket_start_no_buffering_flush (connection);
-              else
-                socket_start_normal_buffering (connection);
-              continue;
-            }
-          break;
-        case MHD_REQUEST_CONTINUE_SENT:
-          if (0 != request->read_buffer_offset)
-            {
-              process_request_body (request);     /* loop call */
-              if (MHD_REQUEST_CLOSED == request->state)
-                continue;
-            }
-          if ( (0 == request->remaining_upload_size) ||
-               ( (MHD_SIZE_UNKNOWN == request->remaining_upload_size) &&
-                 (0 == request->read_buffer_offset) &&
-                 (connection->read_closed) ) )
-            {
-              if ( (request->have_chunked_upload) &&
-                   (! connection->read_closed) )
-                request->state = MHD_REQUEST_BODY_RECEIVED;
-              else
-                request->state = MHD_REQUEST_FOOTERS_RECEIVED;
-              if (connection->suspended)
-                break;
-              continue;
-            }
+        }
+        break;
+      }
+      if (MHD_NO ==
+          process_broken_line (request,
+                               line,
+                               MHD_HEADER_KIND))
+        continue;
+      if (0 == line[0])
+      {
+        request->state = MHD_REQUEST_HEADERS_RECEIVED;
+        request->header_size = (size_t) (line - request->read_buffer);
+        continue;
+      }
+      continue;
+    case MHD_REQUEST_HEADERS_RECEIVED:
+      parse_request_headers (request);
+      if (MHD_REQUEST_CLOSED == request->state)
+        continue;
+      request->state = MHD_REQUEST_HEADERS_PROCESSED;
+      if (connection->suspended)
+        break;
+      continue;
+    case MHD_REQUEST_HEADERS_PROCESSED:
+      call_request_handler (request);     /* first call */
+      if (MHD_REQUEST_CLOSED == request->state)
+        continue;
+      if (need_100_continue (request))
+      {
+        request->state = MHD_REQUEST_CONTINUE_SENDING;
+        if (socket_flush_possible (connection))
+          socket_start_extra_buffering (connection);
+        else
+          socket_start_no_buffering (connection);
+        break;
+      }
+      if ( (NULL != request->response) &&
+           ( (MHD_METHOD_POST == request->method) ||
+             (MHD_METHOD_PUT == request->method) ) )
+      {
+        /* we refused (no upload allowed!) */
+        request->remaining_upload_size = 0;
+        /* force close, in case client still tries to upload... */
+        connection->read_closed = true;
+      }
+      request->state = (0 == request->remaining_upload_size)
+                       ? MHD_REQUEST_FOOTERS_RECEIVED
+                       : MHD_REQUEST_CONTINUE_SENT;
+      if (connection->suspended)
+        break;
+      continue;
+    case MHD_REQUEST_CONTINUE_SENDING:
+      if (request->continue_message_write_offset ==
+          MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE))
+      {
+        request->state = MHD_REQUEST_CONTINUE_SENT;
+        if (! socket_flush_possible (connection))
+          socket_start_no_buffering_flush (connection);
+        else
+          socket_start_normal_buffering (connection);
+        continue;
+      }
+      break;
+    case MHD_REQUEST_CONTINUE_SENT:
+      if (0 != request->read_buffer_offset)
+      {
+        process_request_body (request);           /* loop call */
+        if (MHD_REQUEST_CLOSED == request->state)
+          continue;
+      }
+      if ( (0 == request->remaining_upload_size) ||
+           ( (MHD_SIZE_UNKNOWN == request->remaining_upload_size) &&
+             (0 == request->read_buffer_offset) &&
+             (connection->read_closed) ) )
+      {
+        if ( (request->have_chunked_upload) &&
+             (! connection->read_closed) )
+          request->state = MHD_REQUEST_BODY_RECEIVED;
+        else
+          request->state = MHD_REQUEST_FOOTERS_RECEIVED;
+        if (connection->suspended)
           break;
-        case MHD_REQUEST_BODY_RECEIVED:
-          line = get_next_header_line (request,
-                                       NULL);
-          if (NULL == line)
-            {
-              if (request->state != MHD_REQUEST_BODY_RECEIVED)
-                continue;
-              if (connection->read_closed)
-                {
-                 CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CONNECTION_CLOSED,
-                                         NULL);
-                  continue;
-                }
-              break;
-            }
-          if (0 == line[0])
-            {
-              request->state = MHD_REQUEST_FOOTERS_RECEIVED;
-              if (connection->suspended)
-                break;
-              continue;
-            }
-          if (MHD_NO == process_header_line (request,
-                                             line))
-            {
-              transmit_error_response (request,
-                                      MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
-                                       MHD_HTTP_BAD_REQUEST,
-                                       REQUEST_MALFORMED);
-              break;
-            }
-          request->state = MHD_REQUEST_FOOTER_PART_RECEIVED;
+        continue;
+      }
+      break;
+    case MHD_REQUEST_BODY_RECEIVED:
+      line = get_next_header_line (request,
+                                   NULL);
+      if (NULL == line)
+      {
+        if (request->state != MHD_REQUEST_BODY_RECEIVED)
           continue;
-        case MHD_REQUEST_FOOTER_PART_RECEIVED:
-          line = get_next_header_line (request,
-                                       NULL);
-          if (NULL == line)
-            {
-              if (request->state != MHD_REQUEST_FOOTER_PART_RECEIVED)
-                continue;
-              if (connection->read_closed)
-                {
-                 CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CONNECTION_CLOSED,
-                                         NULL);
-                  continue;
-                }
-              break;
-            }
-          if (MHD_NO ==
-              process_broken_line (request,
-                                   line,
-                                   MHD_FOOTER_KIND))
-            continue;
-          if (0 == line[0])
-            {
-              request->state = MHD_REQUEST_FOOTERS_RECEIVED;
-              if (connection->suspended)
-                break;
-              continue;
-            }
+        if (connection->read_closed)
+        {
+          CONNECTION_CLOSE_ERROR (connection,
+                                  MHD_SC_CONNECTION_CLOSED,
+                                  NULL);
           continue;
-        case MHD_REQUEST_FOOTERS_RECEIVED:
-          call_request_handler (request); /* "final" call */
-          if (request->state == MHD_REQUEST_CLOSED)
-            continue;
-          if (NULL == request->response)
-            break;              /* try again next time */
-          if (! build_header_response (request))
-            {
-              /* oops - close! */
-             CONNECTION_CLOSE_ERROR (connection,
-                                     MHD_SC_FAILED_RESPONSE_HEADER_GENERATION,
-                                     _("Closing connection (failed to create 
response header)\n"));
-              continue;
-            }
-          request->state = MHD_REQUEST_HEADERS_SENDING;
-          if (MHD_NO != socket_flush_possible (connection))
-            socket_start_extra_buffering (connection);
-          else
-            socket_start_no_buffering (connection);
-
+        }
+        break;
+      }
+      if (0 == line[0])
+      {
+        request->state = MHD_REQUEST_FOOTERS_RECEIVED;
+        if (connection->suspended)
           break;
-        case MHD_REQUEST_HEADERS_SENDING:
-          /* no default action */
+        continue;
+      }
+      if (MHD_NO == process_header_line (request,
+                                         line))
+      {
+        transmit_error_response (request,
+                                 MHD_SC_CONNECTION_PARSE_FAIL_CLOSED,
+                                 MHD_HTTP_BAD_REQUEST,
+                                 REQUEST_MALFORMED);
+        break;
+      }
+      request->state = MHD_REQUEST_FOOTER_PART_RECEIVED;
+      continue;
+    case MHD_REQUEST_FOOTER_PART_RECEIVED:
+      line = get_next_header_line (request,
+                                   NULL);
+      if (NULL == line)
+      {
+        if (request->state != MHD_REQUEST_FOOTER_PART_RECEIVED)
+          continue;
+        if (connection->read_closed)
+        {
+          CONNECTION_CLOSE_ERROR (connection,
+                                  MHD_SC_CONNECTION_CLOSED,
+                                  NULL);
+          continue;
+        }
+        break;
+      }
+      if (MHD_NO ==
+          process_broken_line (request,
+                               line,
+                               MHD_FOOTER_KIND))
+        continue;
+      if (0 == line[0])
+      {
+        request->state = MHD_REQUEST_FOOTERS_RECEIVED;
+        if (connection->suspended)
           break;
-        case MHD_REQUEST_HEADERS_SENT:
-          /* Some clients may take some actions right after header receive */
-          if (MHD_NO != socket_flush_possible (connection))
-            socket_start_no_buffering_flush (connection);
+        continue;
+      }
+      continue;
+    case MHD_REQUEST_FOOTERS_RECEIVED:
+      call_request_handler (request);     /* "final" call */
+      if (request->state == MHD_REQUEST_CLOSED)
+        continue;
+      if (NULL == request->response)
+        break;                  /* try again next time */
+      if (! build_header_response (request))
+      {
+        /* oops - close! */
+        CONNECTION_CLOSE_ERROR (connection,
+                                MHD_SC_FAILED_RESPONSE_HEADER_GENERATION,
+                                _ (
+                                  "Closing connection (failed to create 
response header)\n"));
+        continue;
+      }
+      request->state = MHD_REQUEST_HEADERS_SENDING;
+      if (MHD_NO != socket_flush_possible (connection))
+        socket_start_extra_buffering (connection);
+      else
+        socket_start_no_buffering (connection);
+
+      break;
+    case MHD_REQUEST_HEADERS_SENDING:
+      /* no default action */
+      break;
+    case MHD_REQUEST_HEADERS_SENT:
+      /* Some clients may take some actions right after header receive */
+      if (MHD_NO != socket_flush_possible (connection))
+        socket_start_no_buffering_flush (connection);
 
 #ifdef UPGRADE_SUPPORT
-          if (NULL != request->response->upgrade_handler)
-            {
-              socket_start_normal_buffering (connection);
-              request->state = MHD_REQUEST_UPGRADE;
+      if (NULL != request->response->upgrade_handler)
+      {
+        socket_start_normal_buffering (connection);
+        request->state = MHD_REQUEST_UPGRADE;
 #if FIXME_LEGACY_STYLE
-              /* This request is "upgraded".  Pass socket to application. */
-              if (! MHD_response_execute_upgrade_ (request->response,
-                                                  request))
-                {
-                  /* upgrade failed, fail hard */
-                  CONNECTION_CLOSE_ERROR (connection,
-                                         MHD_SC_CONNECTION_CLOSED,
-                                          NULL);
-                  continue;
-                }
+        /* This request is "upgraded".  Pass socket to application. */
+        if (! MHD_response_execute_upgrade_ (request->response,
+                                             request))
+        {
+          /* upgrade failed, fail hard */
+          CONNECTION_CLOSE_ERROR (connection,
+                                  MHD_SC_CONNECTION_CLOSED,
+                                  NULL);
+          continue;
+        }
 #endif
-              /* Response is not required anymore for this request. */
-              {
-                struct MHD_Response * const resp = request->response;
-
-                request->response = NULL;
-                MHD_response_queue_for_destroy (resp);
-              }
-              continue;
-            }
+        /* Response is not required anymore for this request. */
+        {
+          struct MHD_Response *const resp = request->response;
+
+          request->response = NULL;
+          MHD_response_queue_for_destroy (resp);
+        }
+        continue;
+      }
 #endif /* UPGRADE_SUPPORT */
-          if (MHD_NO != socket_flush_possible (connection))
-            socket_start_extra_buffering (connection);
-          else
-            socket_start_normal_buffering (connection);
-
-          if (request->have_chunked_upload)
-            request->state = MHD_REQUEST_CHUNKED_BODY_UNREADY;
-          else
-            request->state = MHD_REQUEST_NORMAL_BODY_UNREADY;
-          continue;
-        case MHD_REQUEST_NORMAL_BODY_READY:
-          /* nothing to do here */
-          break;
-        case MHD_REQUEST_NORMAL_BODY_UNREADY:
-          if (NULL != request->response->crc)
-            MHD_mutex_lock_chk_ (&request->response->mutex);
-          if (0 == request->response->total_size)
-            {
-              if (NULL != request->response->crc)
-                MHD_mutex_unlock_chk_ (&request->response->mutex);
-              request->state = MHD_REQUEST_BODY_SENT;
-              continue;
-            }
-          if (try_ready_normal_body (request))
-            {
-             if (NULL != request->response->crc)
-               MHD_mutex_unlock_chk_ (&request->response->mutex);
-              request->state = MHD_REQUEST_NORMAL_BODY_READY;
-              /* Buffering for flushable socket was already enabled*/
-              if (MHD_NO == socket_flush_possible (connection))
-                socket_start_no_buffering (connection);
-              break;
-            }
-          /* mutex was already unlocked by "try_ready_normal_body */
-          /* not ready, no socket action */
-          break;
-        case MHD_REQUEST_CHUNKED_BODY_READY:
-          /* nothing to do here */
-          break;
-        case MHD_REQUEST_CHUNKED_BODY_UNREADY:
-          if (NULL != request->response->crc)
-            MHD_mutex_lock_chk_ (&request->response->mutex);
-          if ( (0 == request->response->total_size) ||
-               (request->response_write_position ==
-                request->response->total_size) )
-            {
-              if (NULL != request->response->crc)
-                MHD_mutex_unlock_chk_ (&request->response->mutex);
-              request->state = MHD_REQUEST_BODY_SENT;
-              continue;
-            }
-          if (try_ready_chunked_body (request))
-            {
-              if (NULL != request->response->crc)
-                MHD_mutex_unlock_chk_ (&request->response->mutex);
-              request->state = MHD_REQUEST_CHUNKED_BODY_READY;
-              /* Buffering for flushable socket was already enabled */
-              if (MHD_NO == socket_flush_possible (connection))
-                socket_start_no_buffering (connection);
-              continue;
-            }
-          /* mutex was already unlocked by try_ready_chunked_body */
-          break;
-        case MHD_REQUEST_BODY_SENT:
-          if (! build_header_response (request))
-            {
-              /* oops - close! */
-             CONNECTION_CLOSE_ERROR (connection,
-                                     MHD_SC_FAILED_RESPONSE_HEADER_GENERATION,
-                                     _("Closing connection (failed to create 
response header)\n"));
-              continue;
-            }
-          if ( (! request->have_chunked_upload) ||
-               (request->write_buffer_send_offset ==
-                request->write_buffer_append_offset) )
-            request->state = MHD_REQUEST_FOOTERS_SENT;
-          else
-            request->state = MHD_REQUEST_FOOTERS_SENDING;
-          continue;
-        case MHD_REQUEST_FOOTERS_SENDING:
-          /* no default action */
-          break;
-        case MHD_REQUEST_FOOTERS_SENT:
-         {
-           struct MHD_Response *response = request->response;
-
-           if (MHD_HTTP_PROCESSING == response->status_code)
-             {
-               /* After this type of response, we allow sending another! */
-               request->state = MHD_REQUEST_HEADERS_PROCESSED;
-               MHD_response_queue_for_destroy (response);
-               request->response = NULL;
-               /* FIXME: maybe partially reset memory pool? */
-               continue;
-             }
-           if (socket_flush_possible (connection))
-             socket_start_no_buffering_flush (connection);
-           else
-             socket_start_normal_buffering (connection);
-
-           if (NULL != response->termination_cb)
-             {
-               response->termination_cb (response->termination_cb_cls,
-                                         MHD_REQUEST_TERMINATED_COMPLETED_OK,
-                                         request->client_context);
-             }
-           MHD_response_queue_for_destroy (response);
-           request->response = NULL;
-         }
-         if ( (MHD_CONN_USE_KEEPALIVE != request->keepalive) ||
-               (connection->read_closed) )
-            {
-              /* have to close for some reason */
-              MHD_connection_close_ (connection,
-                                     MHD_REQUEST_TERMINATED_COMPLETED_OK);
-              MHD_pool_destroy (connection->pool);
-              connection->pool = NULL;
-              request->read_buffer = NULL;
-              request->read_buffer_size = 0;
-              request->read_buffer_offset = 0;
-            }
-          else
-            {
-              /* can try to keep-alive */
-              if (socket_flush_possible (connection))
-                socket_start_normal_buffering (connection);
-              request->version_s = NULL;
-              request->state = MHD_REQUEST_INIT;
-              request->last = NULL;
-              request->colon = NULL;
-              request->header_size = 0;
-              request->keepalive = MHD_CONN_KEEPALIVE_UNKOWN;
-              /* Reset the read buffer to the starting size,
-                 preserving the bytes we have already read. */
-              request->read_buffer
-                = MHD_pool_reset (connection->pool,
-                                  request->read_buffer,
-                                  request->read_buffer_offset,
-                                  daemon->connection_memory_limit_b / 2);
-              request->read_buffer_size
-                = daemon->connection_memory_limit_b / 2;
-            }
-         // FIXME: this is too much, NULLs out some of the things
-         // initialized above...
-         memset (request,
-                 0,
-                 sizeof (struct MHD_Request));
-         request->daemon = daemon;
-         request->connection = connection;
+      if (MHD_NO != socket_flush_possible (connection))
+        socket_start_extra_buffering (connection);
+      else
+        socket_start_normal_buffering (connection);
+
+      if (request->have_chunked_upload)
+        request->state = MHD_REQUEST_CHUNKED_BODY_UNREADY;
+      else
+        request->state = MHD_REQUEST_NORMAL_BODY_UNREADY;
+      continue;
+    case MHD_REQUEST_NORMAL_BODY_READY:
+      /* nothing to do here */
+      break;
+    case MHD_REQUEST_NORMAL_BODY_UNREADY:
+      if (NULL != request->response->crc)
+        MHD_mutex_lock_chk_ (&request->response->mutex);
+      if (0 == request->response->total_size)
+      {
+        if (NULL != request->response->crc)
+          MHD_mutex_unlock_chk_ (&request->response->mutex);
+        request->state = MHD_REQUEST_BODY_SENT;
+        continue;
+      }
+      if (try_ready_normal_body (request))
+      {
+        if (NULL != request->response->crc)
+          MHD_mutex_unlock_chk_ (&request->response->mutex);
+        request->state = MHD_REQUEST_NORMAL_BODY_READY;
+        /* Buffering for flushable socket was already enabled*/
+        if (MHD_NO == socket_flush_possible (connection))
+          socket_start_no_buffering (connection);
+        break;
+      }
+      /* mutex was already unlocked by "try_ready_normal_body */
+      /* not ready, no socket action */
+      break;
+    case MHD_REQUEST_CHUNKED_BODY_READY:
+      /* nothing to do here */
+      break;
+    case MHD_REQUEST_CHUNKED_BODY_UNREADY:
+      if (NULL != request->response->crc)
+        MHD_mutex_lock_chk_ (&request->response->mutex);
+      if ( (0 == request->response->total_size) ||
+           (request->response_write_position ==
+            request->response->total_size) )
+      {
+        if (NULL != request->response->crc)
+          MHD_mutex_unlock_chk_ (&request->response->mutex);
+        request->state = MHD_REQUEST_BODY_SENT;
+        continue;
+      }
+      if (try_ready_chunked_body (request))
+      {
+        if (NULL != request->response->crc)
+          MHD_mutex_unlock_chk_ (&request->response->mutex);
+        request->state = MHD_REQUEST_CHUNKED_BODY_READY;
+        /* Buffering for flushable socket was already enabled */
+        if (MHD_NO == socket_flush_possible (connection))
+          socket_start_no_buffering (connection);
+        continue;
+      }
+      /* mutex was already unlocked by try_ready_chunked_body */
+      break;
+    case MHD_REQUEST_BODY_SENT:
+      if (! build_header_response (request))
+      {
+        /* oops - close! */
+        CONNECTION_CLOSE_ERROR (connection,
+                                MHD_SC_FAILED_RESPONSE_HEADER_GENERATION,
+                                _ (
+                                  "Closing connection (failed to create 
response header)\n"));
+        continue;
+      }
+      if ( (! request->have_chunked_upload) ||
+           (request->write_buffer_send_offset ==
+            request->write_buffer_append_offset) )
+        request->state = MHD_REQUEST_FOOTERS_SENT;
+      else
+        request->state = MHD_REQUEST_FOOTERS_SENDING;
+      continue;
+    case MHD_REQUEST_FOOTERS_SENDING:
+      /* no default action */
+      break;
+    case MHD_REQUEST_FOOTERS_SENT:
+      {
+        struct MHD_Response *response = request->response;
+
+        if (MHD_HTTP_PROCESSING == response->status_code)
+        {
+          /* After this type of response, we allow sending another! */
+          request->state = MHD_REQUEST_HEADERS_PROCESSED;
+          MHD_response_queue_for_destroy (response);
+          request->response = NULL;
+          /* FIXME: maybe partially reset memory pool? */
           continue;
-        case MHD_REQUEST_CLOSED:
-         cleanup_connection (connection);
-          request->in_idle = false;
-         return false;
+        }
+        if (socket_flush_possible (connection))
+          socket_start_no_buffering_flush (connection);
+        else
+          socket_start_normal_buffering (connection);
+
+        if (NULL != response->termination_cb)
+        {
+          response->termination_cb (response->termination_cb_cls,
+                                    MHD_REQUEST_TERMINATED_COMPLETED_OK,
+                                    request->client_context);
+        }
+        MHD_response_queue_for_destroy (response);
+        request->response = NULL;
+      }
+      if ( (MHD_CONN_USE_KEEPALIVE != request->keepalive) ||
+           (connection->read_closed) )
+      {
+        /* have to close for some reason */
+        MHD_connection_close_ (connection,
+                               MHD_REQUEST_TERMINATED_COMPLETED_OK);
+        MHD_pool_destroy (connection->pool);
+        connection->pool = NULL;
+        request->read_buffer = NULL;
+        request->read_buffer_size = 0;
+        request->read_buffer_offset = 0;
+      }
+      else
+      {
+        /* can try to keep-alive */
+        if (socket_flush_possible (connection))
+          socket_start_normal_buffering (connection);
+        request->version_s = NULL;
+        request->state = MHD_REQUEST_INIT;
+        request->last = NULL;
+        request->colon = NULL;
+        request->header_size = 0;
+        request->keepalive = MHD_CONN_KEEPALIVE_UNKOWN;
+        /* Reset the read buffer to the starting size,
+           preserving the bytes we have already read. */
+        request->read_buffer
+          = MHD_pool_reset (connection->pool,
+                            request->read_buffer,
+                            request->read_buffer_offset,
+                            daemon->connection_memory_limit_b / 2);
+        request->read_buffer_size
+          = daemon->connection_memory_limit_b / 2;
+      }
+      // FIXME: this is too much, NULLs out some of the things
+      // initialized above...
+      memset (request,
+              0,
+              sizeof (struct MHD_Request));
+      request->daemon = daemon;
+      request->connection = connection;
+      continue;
+    case MHD_REQUEST_CLOSED:
+      cleanup_connection (connection);
+      request->in_idle = false;
+      return false;
 #ifdef UPGRADE_SUPPORT
-       case MHD_REQUEST_UPGRADE:
-          request->in_idle = false;
-          return true; /* keep open */
+    case MHD_REQUEST_UPGRADE:
+      request->in_idle = false;
+      return true;     /* keep open */
 #endif /* UPGRADE_SUPPORT */
-       default:
-          mhd_assert (0);
-          break;
-        }
+    default:
+      mhd_assert (0);
       break;
     }
+    break;
+  }
   if (! connection->suspended)
+  {
+    time_t timeout;
+    timeout = connection->connection_timeout;
+    if ( (0 != timeout) &&
+         (timeout < (MHD_monotonic_sec_counter ()
+                     - connection->last_activity)) )
     {
-      time_t timeout;
-      timeout = connection->connection_timeout;
-      if ( (0 != timeout) &&
-           (timeout < (MHD_monotonic_sec_counter() - 
connection->last_activity)) )
-        {
-          MHD_connection_close_ (connection,
-                                 MHD_REQUEST_TERMINATED_TIMEOUT_REACHED);
-          request->in_idle = false;
-          return true;
-        }
+      MHD_connection_close_ (connection,
+                             MHD_REQUEST_TERMINATED_TIMEOUT_REACHED);
+      request->in_idle = false;
+      return true;
     }
+  }
   connection_update_event_loop_info (connection);
   ret = true;
 #ifdef EPOLL_SUPPORT
   if ( (! connection->suspended) &&
        (MHD_ELS_EPOLL == daemon->event_loop_syscall) )
-    {
-      ret = connection_epoll_update_ (connection);
-    }
+  {
+    ret = connection_epoll_update_ (connection);
+  }
 #endif /* EPOLL_SUPPORT */
   request->in_idle = false;
   return ret;
@@ -3589,9 +3621,9 @@ MHD_request_handle_idle_ (struct MHD_Request *request)
 // FIXME: rename connection->request?
 int
 MHD_connection_call_handlers_ (struct MHD_Connection *con,
-                              bool read_ready,
-                              bool write_ready,
-                              bool force_close)
+                               bool read_ready,
+                               bool write_ready,
+                               bool force_close)
 {
   struct MHD_Daemon *daemon = con->daemon;
   int ret;
@@ -3604,38 +3636,38 @@ MHD_connection_call_handlers_ (struct MHD_Connection 
*con,
     read_ready = true;
 #endif /* HTTPS_SUPPORT */
   if (! force_close)
+  {
+    if ( (MHD_EVENT_LOOP_INFO_READ ==
+          con->request.event_loop_info) &&
+         read_ready)
     {
-      if ( (MHD_EVENT_LOOP_INFO_READ ==
-           con->request.event_loop_info) &&
-          read_ready)
-        {
-          MHD_request_handle_read_ (&con->request);
-          ret = MHD_request_handle_idle_ (&con->request);
-          states_info_processed = true;
-        }
-      /* No need to check value of 'ret' here as closed connection
-       * cannot be in MHD_EVENT_LOOP_INFO_WRITE state. */
-      if ( (MHD_EVENT_LOOP_INFO_WRITE ==
-           con->request.event_loop_info) &&
-          write_ready)
-        {
-          MHD_request_handle_write_ (&con->request);
-          ret = MHD_request_handle_idle_ (&con->request);
-          states_info_processed = true;
-        }
+      MHD_request_handle_read_ (&con->request);
+      ret = MHD_request_handle_idle_ (&con->request);
+      states_info_processed = true;
     }
-  else
+    /* No need to check value of 'ret' here as closed connection
+     * cannot be in MHD_EVENT_LOOP_INFO_WRITE state. */
+    if ( (MHD_EVENT_LOOP_INFO_WRITE ==
+          con->request.event_loop_info) &&
+         write_ready)
     {
-      MHD_connection_close_ (con,
-                             MHD_REQUEST_TERMINATED_WITH_ERROR);
-      return MHD_request_handle_idle_ (&con->request);
+      MHD_request_handle_write_ (&con->request);
+      ret = MHD_request_handle_idle_ (&con->request);
+      states_info_processed = true;
     }
+  }
+  else
+  {
+    MHD_connection_close_ (con,
+                           MHD_REQUEST_TERMINATED_WITH_ERROR);
+    return MHD_request_handle_idle_ (&con->request);
+  }
 
   if (! states_info_processed)
-    { /* Connection is not read or write ready, but external conditions
+  {   /* Connection is not read or write ready, but external conditions
        * may be changed and need to be processed. */
-      ret = MHD_request_handle_idle_ (&con->request);
-    }
+    ret = MHD_request_handle_idle_ (&con->request);
+  }
   /* Fast track for fast connections. */
   /* If full request was read by single read_handler() invocation
      and headers were completely prepared by single MHD_request_handle_idle_()
@@ -3647,24 +3679,24 @@ MHD_connection_call_handlers_ (struct MHD_Connection 
*con,
   /* No need to check 'ret' as connection is always in
    * MHD_CONNECTION_CLOSED state if 'ret' is equal 'MHD_NO'. */
   else if (on_fasttrack &&
-          con->sk_nonblck)
+           con->sk_nonblck)
+  {
+    if (MHD_REQUEST_HEADERS_SENDING == con->request.state)
     {
-      if (MHD_REQUEST_HEADERS_SENDING == con->request.state)
-        {
-          MHD_request_handle_write_ (&con->request);
-          /* Always call 'MHD_request_handle_idle_()' after each read/write. */
-          ret = MHD_request_handle_idle_ (&con->request);
-        }
-      /* If all headers were sent by single write_handler() and
-       * response body is prepared by single MHD_request_handle_idle_()
-       * call - continue. */
-      if ((MHD_REQUEST_NORMAL_BODY_READY == con->request.state) ||
-          (MHD_REQUEST_CHUNKED_BODY_READY == con->request.state))
-        {
-          MHD_request_handle_write_ (&con->request);
-          ret = MHD_request_handle_idle_ (&con->request);
-        }
+      MHD_request_handle_write_ (&con->request);
+      /* Always call 'MHD_request_handle_idle_()' after each read/write. */
+      ret = MHD_request_handle_idle_ (&con->request);
     }
+    /* If all headers were sent by single write_handler() and
+     * response body is prepared by single MHD_request_handle_idle_()
+     * call - continue. */
+    if ((MHD_REQUEST_NORMAL_BODY_READY == con->request.state) ||
+        (MHD_REQUEST_CHUNKED_BODY_READY == con->request.state))
+    {
+      MHD_request_handle_write_ (&con->request);
+      ret = MHD_request_handle_idle_ (&con->request);
+    }
+  }
 
   /* All connection's data and states are processed for this turn.
    * If connection already has more data to be processed - use
@@ -3676,17 +3708,17 @@ MHD_connection_call_handlers_ (struct MHD_Connection 
*con,
    * without space in read buffer will be market as 'info block'. */
   if ( (! daemon->data_already_pending) &&
        (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode) )
-    {
-      if (MHD_EVENT_LOOP_INFO_BLOCK ==
-         con->request.event_loop_info)
-        daemon->data_already_pending = true;
+  {
+    if (MHD_EVENT_LOOP_INFO_BLOCK ==
+        con->request.event_loop_info)
+      daemon->data_already_pending = true;
 #ifdef HTTPS_SUPPORT
-      else if ( (con->tls_read_ready) &&
-                (MHD_EVENT_LOOP_INFO_READ ==
-                con->request.event_loop_info) )
-        daemon->data_already_pending = true;
+    else if ( (con->tls_read_ready) &&
+              (MHD_EVENT_LOOP_INFO_READ ==
+               con->request.event_loop_info) )
+      daemon->data_already_pending = true;
 #endif /* HTTPS_SUPPORT */
-    }
+  }
   return ret;
 }
 
diff --git a/src/lib/connection_call_handlers.h 
b/src/lib/connection_call_handlers.h
index 980e8064..6297bb9e 100644
--- a/src/lib/connection_call_handlers.h
+++ b/src/lib/connection_call_handlers.h
@@ -40,10 +40,10 @@
  */
 int
 MHD_connection_call_handlers_ (struct MHD_Connection *con,
-                              bool read_ready,
-                              bool write_ready,
-                              bool force_close)
-  MHD_NONNULL (1);
+                               bool read_ready,
+                               bool write_ready,
+                               bool force_close)
+MHD_NONNULL (1);
 
 
 /**
@@ -58,7 +58,7 @@ MHD_connection_call_handlers_ (struct MHD_Connection *con,
  */
 bool
 MHD_request_handle_idle_ (struct MHD_Request *request)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
+
 
-  
 #endif
diff --git a/src/lib/connection_cleanup.c b/src/lib/connection_cleanup.c
index 8883213b..4f2cfb0f 100644
--- a/src/lib/connection_cleanup.c
+++ b/src/lib/connection_cleanup.c
@@ -49,7 +49,7 @@ connection_cleanup_upgraded (struct MHD_Connection 
*connection)
 
     if (NULL != (tls = connection->daemon->tls_api))
       (void) tls->shutdown_connection (tls->cls,
-                                      connection->tls_cs);
+                                       connection->tls_cs);
   }
   if (MHD_INVALID_SOCKET != urh->mhd.socket)
     MHD_socket_close_chk_ (urh->mhd.socket);
@@ -65,7 +65,7 @@ connection_cleanup_upgraded (struct MHD_Connection 
*connection)
 /**
  * Free resources associated with all closed connections.  (destroy
  * responses, free buffers, etc.).  All closed connections are kept in
- * the "cleanup" doubly-linked list. 
+ * the "cleanup" doubly-linked list.
  *
  * @remark To be called only from thread that process daemon's
  * select()/poll()/etc.
@@ -79,79 +79,79 @@ MHD_connection_cleanup_ (struct MHD_Daemon *daemon)
 
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   while (NULL != (pos = daemon->cleanup_tail))
-    {
-      DLL_remove (daemon->cleanup_head,
-                 daemon->cleanup_tail,
-                 pos);
-      MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+  {
+    DLL_remove (daemon->cleanup_head,
+                daemon->cleanup_tail,
+                pos);
+    MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 
-      if ( (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) &&
-          (! pos->thread_joined) &&
-           (! MHD_join_thread_ (pos->pid.handle)) )
-        MHD_PANIC (_("Failed to join a thread\n"));
+    if ( (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) &&
+         (! pos->thread_joined) &&
+         (! MHD_join_thread_ (pos->pid.handle)) )
+      MHD_PANIC (_ ("Failed to join a thread\n"));
 #ifdef UPGRADE_SUPPORT
-      connection_cleanup_upgraded (pos);
+    connection_cleanup_upgraded (pos);
 #endif /* UPGRADE_SUPPORT */
-      MHD_pool_destroy (pos->pool);
+    MHD_pool_destroy (pos->pool);
 #ifdef HTTPS_SUPPORT
-      {
-       struct MHD_TLS_Plugin *tls;
-       
-       if (NULL != (tls = daemon->tls_api))
-         tls->teardown_connection (tls->cls,
-                                   pos->tls_cs);
-      }
+    {
+      struct MHD_TLS_Plugin *tls;
+
+      if (NULL != (tls = daemon->tls_api))
+        tls->teardown_connection (tls->cls,
+                                  pos->tls_cs);
+    }
 #endif /* HTTPS_SUPPORT */
 
-      /* clean up the connection */
-      if (NULL != daemon->notify_connection_cb)
-        daemon->notify_connection_cb (daemon->notify_connection_cb_cls,
-                                     pos,
-                                     MHD_CONNECTION_NOTIFY_CLOSED);
-      MHD_ip_limit_del (daemon,
-                        (const struct sockaddr *) &pos->addr,
-                        pos->addr_len);
+    /* clean up the connection */
+    if (NULL != daemon->notify_connection_cb)
+      daemon->notify_connection_cb (daemon->notify_connection_cb_cls,
+                                    pos,
+                                    MHD_CONNECTION_NOTIFY_CLOSED);
+    MHD_ip_limit_del (daemon,
+                      (const struct sockaddr *) &pos->addr,
+                      pos->addr_len);
 #ifdef EPOLL_SUPPORT
-      if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
-        {
-          if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-            {
-              EDLL_remove (daemon->eready_head,
-                           daemon->eready_tail,
-                           pos);
-              pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
-            }
-          if ( (-1 != daemon->epoll_fd) &&
-               (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET)) )
-            {
-              /* epoll documentation suggests that closing a FD
-                 automatically removes it from the epoll set; however,
-                 this is not true as if we fail to do manually remove it,
-                 we are still seeing an event for this fd in epoll,
-                 causing grief (use-after-free...) --- at least on my
-                 system. */
-              if (0 != epoll_ctl (daemon->epoll_fd,
-                                  EPOLL_CTL_DEL,
-                                  pos->socket_fd,
-                                  NULL))
-                MHD_PANIC (_("Failed to remove FD from epoll set\n"));
-              pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
-            }
-        }
+    if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
+    {
+      if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
+      {
+        EDLL_remove (daemon->eready_head,
+                     daemon->eready_tail,
+                     pos);
+        pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
+      }
+      if ( (-1 != daemon->epoll_fd) &&
+           (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET)) )
+      {
+        /* epoll documentation suggests that closing a FD
+           automatically removes it from the epoll set; however,
+           this is not true as if we fail to do manually remove it,
+           we are still seeing an event for this fd in epoll,
+           causing grief (use-after-free...) --- at least on my
+           system. */
+        if (0 != epoll_ctl (daemon->epoll_fd,
+                            EPOLL_CTL_DEL,
+                            pos->socket_fd,
+                            NULL))
+          MHD_PANIC (_ ("Failed to remove FD from epoll set\n"));
+        pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
+      }
+    }
 #endif
-      if (NULL != pos->request.response)
-       {
-         MHD_response_queue_for_destroy (pos->request.response);
-         pos->request.response = NULL;
-       }
-      if (MHD_INVALID_SOCKET != pos->socket_fd)
-        MHD_socket_close_chk_ (pos->socket_fd);
-      free (pos);
-
-      MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
-      daemon->connections--;
-      daemon->at_limit = false;
+    if (NULL != pos->request.response)
+    {
+      MHD_response_queue_for_destroy (pos->request.response);
+      pos->request.response = NULL;
     }
+    if (MHD_INVALID_SOCKET != pos->socket_fd)
+      MHD_socket_close_chk_ (pos->socket_fd);
+    free (pos);
+
+    MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+    daemon->connections--;
+    daemon->at_limit = false;
+  }
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 }
 
diff --git a/src/lib/connection_cleanup.h b/src/lib/connection_cleanup.h
index 26fbebaf..c6beeeee 100644
--- a/src/lib/connection_cleanup.h
+++ b/src/lib/connection_cleanup.h
@@ -18,7 +18,7 @@
 */
 /**
  * @file lib/connection_cleanup.h
- * @brief functions to cleanup completed connection 
+ * @brief functions to cleanup completed connection
  * @author Christian Grothoff
  */
 #ifndef CONNECTION_CLEANUP_H
@@ -28,7 +28,7 @@
 /**
  * Free resources associated with all closed connections.  (destroy
  * responses, free buffers, etc.).  All closed connections are kept in
- * the "cleanup" doubly-linked list. 
+ * the "cleanup" doubly-linked list.
  *
  * @remark To be called only from thread that process daemon's
  * select()/poll()/etc.
@@ -37,6 +37,6 @@
  */
 void
 MHD_connection_cleanup_ (struct MHD_Daemon *daemon)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
 
 #endif
diff --git a/src/lib/connection_close.c b/src/lib/connection_close.c
index 945997db..3c872b0b 100644
--- a/src/lib/connection_close.c
+++ b/src/lib/connection_close.c
@@ -40,33 +40,33 @@ MHD_connection_mark_closed_ (struct MHD_Connection 
*connection)
   connection->request.state = MHD_REQUEST_CLOSED;
   connection->request.event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
   if (! daemon->enable_turbo)
-    {
+  {
 #ifdef HTTPS_SUPPORT
-      struct MHD_TLS_Plugin *tls;
+    struct MHD_TLS_Plugin *tls;
 
-      /* For TLS connection use shutdown of TLS layer
-       * and do not shutdown TCP socket. This give more
-       * chances to send TLS closure data to remote side.
-       * Closure of TLS layer will be interpreted by
-       * remote side as end of transmission. */
-      if (NULL != (tls = daemon->tls_api))
-        {
-          if (MHD_YES !=
-             tls->shutdown_connection (tls->cls,
-                                       connection->tls_cs))
-           {
-             (void) shutdown (connection->socket_fd,
-                              SHUT_WR);
-             /* FIXME: log errors */
-           }
-        }
-      else /* Combined with next 'shutdown()'. */
+    /* For TLS connection use shutdown of TLS layer
+     * and do not shutdown TCP socket. This give more
+     * chances to send TLS closure data to remote side.
+     * Closure of TLS layer will be interpreted by
+     * remote side as end of transmission. */
+    if (NULL != (tls = daemon->tls_api))
+    {
+      if (MHD_YES !=
+          tls->shutdown_connection (tls->cls,
+                                    connection->tls_cs))
+      {
+        (void) shutdown (connection->socket_fd,
+                         SHUT_WR);
+        /* FIXME: log errors */
+      }
+    }
+    else   /* Combined with next 'shutdown()'. */
 #endif /* HTTPS_SUPPORT */
-       {
-         (void) shutdown (connection->socket_fd,
-                          SHUT_WR); /* FIXME: log errors */
-       }
+    {
+      (void) shutdown (connection->socket_fd,
+                       SHUT_WR); /* FIXME: log errors */
     }
+  }
 }
 
 
@@ -90,14 +90,14 @@ MHD_connection_close_ (struct MHD_Connection *connection,
   (void) rtc; // FIXME
   MHD_connection_mark_closed_ (connection);
   if (NULL != resp)
-    {
-      connection->request.response = NULL;
-      MHD_response_queue_for_destroy (resp);
-    }
+  {
+    connection->request.response = NULL;
+    MHD_response_queue_for_destroy (resp);
+  }
   if (NULL != daemon->notify_connection_cb)
     daemon->notify_connection_cb (daemon->notify_connection_cb_cls,
-                                 connection,
-                                 MHD_CONNECTION_NOTIFY_CLOSED);
+                                  connection,
+                                  MHD_CONNECTION_NOTIFY_CLOSED);
 }
 
 /* end of connection_close.c */
diff --git a/src/lib/connection_close.h b/src/lib/connection_close.h
index 41f141d2..c8e159ee 100644
--- a/src/lib/connection_close.h
+++ b/src/lib/connection_close.h
@@ -35,7 +35,7 @@
  */
 void
 MHD_connection_mark_closed_ (struct MHD_Connection *connection)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
 
 
 /**
@@ -51,6 +51,6 @@ MHD_connection_mark_closed_ (struct MHD_Connection 
*connection)
 void
 MHD_connection_close_ (struct MHD_Connection *connection,
                        enum MHD_RequestTerminationCode rtc)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
 
 #endif
diff --git a/src/lib/connection_finish_forward.c 
b/src/lib/connection_finish_forward.c
index 335a03bf..1ea9aa31 100644
--- a/src/lib/connection_finish_forward.c
+++ b/src/lib/connection_finish_forward.c
@@ -55,34 +55,34 @@ MHD_connection_finish_forward_ (struct MHD_Connection 
*connection)
                         EPOLL_CTL_DEL,
                         connection->socket_fd,
                         NULL)) )
-    {
-      MHD_PANIC (_("Failed to remove FD from epoll set\n"));
-    }
+  {
+    MHD_PANIC (_ ("Failed to remove FD from epoll set\n"));
+  }
   if (urh->in_eready_list)
-    {
-      EDLL_remove (daemon->eready_urh_head,
-                  daemon->eready_urh_tail,
-                  urh);
-      urh->in_eready_list = false;
-    }
+  {
+    EDLL_remove (daemon->eready_urh_head,
+                 daemon->eready_urh_tail,
+                 urh);
+    urh->in_eready_list = false;
+  }
 #endif /* EPOLL_SUPPORT */
   if (MHD_INVALID_SOCKET != urh->mhd.socket)
-    {
+  {
 #if EPOLL_SUPPORT
-      if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
-           (0 != epoll_ctl (daemon->epoll_upgrade_fd,
-                            EPOLL_CTL_DEL,
-                            urh->mhd.socket,
-                            NULL)) )
-        {
-          MHD_PANIC (_("Failed to remove FD from epoll set\n"));
-        }
-#endif /* EPOLL_SUPPORT */
-      /* Reflect remote disconnect to application by breaking
-       * socketpair connection. */
-      shutdown (urh->mhd.socket,
-               SHUT_RDWR);
+    if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
+         (0 != epoll_ctl (daemon->epoll_upgrade_fd,
+                          EPOLL_CTL_DEL,
+                          urh->mhd.socket,
+                          NULL)) )
+    {
+      MHD_PANIC (_ ("Failed to remove FD from epoll set\n"));
     }
+#endif /* EPOLL_SUPPORT */
+    /* Reflect remote disconnect to application by breaking
+     * socketpair connection. */
+    shutdown (urh->mhd.socket,
+              SHUT_RDWR);
+  }
   /* Socketpair sockets will remain open as they will be
    * used with MHD_UPGRADE_ACTION_CLOSE. They will be
    * closed by MHD_cleanup_upgraded_connection_() during
diff --git a/src/lib/connection_finish_forward.h 
b/src/lib/connection_finish_forward.h
index c6c04f42..ebb77d12 100644
--- a/src/lib/connection_finish_forward.h
+++ b/src/lib/connection_finish_forward.h
@@ -39,6 +39,6 @@
  */
 void
 MHD_connection_finish_forward_ (struct MHD_Connection *connection)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
 
 #endif
diff --git a/src/lib/connection_info.c b/src/lib/connection_info.c
index 88055fa4..d83b34c5 100644
--- a/src/lib/connection_info.c
+++ b/src/lib/connection_info.c
@@ -42,13 +42,13 @@
  */
 enum MHD_Bool
 MHD_connection_get_information_sz (struct MHD_Connection *connection,
-                                  enum MHD_ConnectionInformationType info_type,
-                                  union MHD_ConnectionInformation 
*return_value,
-                                  size_t return_value_size)
+                                   enum MHD_ConnectionInformationType 
info_type,
+                                   union MHD_ConnectionInformation 
*return_value,
+                                   size_t return_value_size)
 {
 #define CHECK_SIZE(type) if (sizeof(type) < return_value_size) \
     return MHD_NO
-  
+
   switch (info_type)
   {
 #ifdef HTTPS_SUPPORT
@@ -63,7 +63,7 @@ MHD_connection_get_information_sz (struct MHD_Connection 
*connection,
     CHECK_SIZE (int);
     if (NULL == connection->tls_cs)
       return MHD_NO;
-    //return_value->protocol
+    // return_value->protocol
     //  = gnutls_protocol_get_version (connection->tls_session);
     return MHD_NO; // FIXME: to be implemented
   case MHD_CONNECTION_INFORMATION_GNUTLS_SESSION:
@@ -103,7 +103,7 @@ MHD_connection_get_information_sz (struct MHD_Connection 
*connection,
   default:
     return MHD_NO;
   }
-  
+
 #undef CHECK_SIZE
 }
 
diff --git a/src/lib/connection_options.c b/src/lib/connection_options.c
index 00652161..ce31b315 100644
--- a/src/lib/connection_options.c
+++ b/src/lib/connection_options.c
@@ -35,44 +35,44 @@
  */
 void
 MHD_connection_set_timeout (struct MHD_Connection *connection,
-                           unsigned int timeout_s)
+                            unsigned int timeout_s)
 {
   struct MHD_Daemon *daemon = connection->daemon;
-  
-  connection->last_activity = MHD_monotonic_sec_counter();
+
+  connection->last_activity = MHD_monotonic_sec_counter ();
   if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
-    {
-      /* Simple case, no need to lock to update DLLs */
-      connection->connection_timeout = (time_t) timeout_s;
-      return;
-    }
+  {
+    /* Simple case, no need to lock to update DLLs */
+    connection->connection_timeout = (time_t) timeout_s;
+    return;
+  }
 
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   if (! connection->suspended)
-    {
-      if (connection->connection_timeout ==
-         daemon->connection_default_timeout)
-       XDLL_remove (daemon->normal_timeout_head,
-                    daemon->normal_timeout_tail,
-                    connection);
-      else
-       XDLL_remove (daemon->manual_timeout_head,
-                    daemon->manual_timeout_tail,
-                    connection);
-    }  
+  {
+    if (connection->connection_timeout ==
+        daemon->connection_default_timeout)
+      XDLL_remove (daemon->normal_timeout_head,
+                   daemon->normal_timeout_tail,
+                   connection);
+    else
+      XDLL_remove (daemon->manual_timeout_head,
+                   daemon->manual_timeout_tail,
+                   connection);
+  }
   connection->connection_timeout = (time_t) timeout_s;
   if (! connection->suspended)
-    {
-      if (connection->connection_timeout ==
-         daemon->connection_default_timeout)
-       XDLL_insert (daemon->normal_timeout_head,
-                    daemon->normal_timeout_tail,
-                    connection);
-      else
-       XDLL_insert (daemon->manual_timeout_head,
-                    daemon->manual_timeout_tail,
-                    connection);
-    }
+  {
+    if (connection->connection_timeout ==
+        daemon->connection_default_timeout)
+      XDLL_insert (daemon->normal_timeout_head,
+                   daemon->normal_timeout_tail,
+                   connection);
+    else
+      XDLL_insert (daemon->manual_timeout_head,
+                   daemon->manual_timeout_tail,
+                   connection);
+  }
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 }
 
@@ -95,7 +95,7 @@ MHD_update_last_activity_ (struct MHD_Connection *connection)
   if (connection->suspended)
     return; /* no activity on suspended connections */
 
-  connection->last_activity = MHD_monotonic_sec_counter();
+  connection->last_activity = MHD_monotonic_sec_counter ();
   if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
     return; /* each connection has personal timeout */
 
@@ -106,11 +106,11 @@ MHD_update_last_activity_ (struct MHD_Connection 
*connection)
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   /* move connection to head of timeout list (by remove + add operation) */
   XDLL_remove (daemon->normal_timeout_head,
-              daemon->normal_timeout_tail,
-              connection);
+               daemon->normal_timeout_tail,
+               connection);
   XDLL_insert (daemon->normal_timeout_head,
-              daemon->normal_timeout_tail,
-              connection);
+               daemon->normal_timeout_tail,
+               connection);
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 }
 
diff --git a/src/lib/connection_update_last_activity.c 
b/src/lib/connection_update_last_activity.c
index 7253dc83..741da681 100644
--- a/src/lib/connection_update_last_activity.c
+++ b/src/lib/connection_update_last_activity.c
@@ -43,7 +43,7 @@ MHD_connection_update_last_activity_ (struct MHD_Connection 
*connection)
   if (connection->suspended)
     return; /* no activity on suspended connections */
 
-  connection->last_activity = MHD_monotonic_sec_counter();
+  connection->last_activity = MHD_monotonic_sec_counter ();
   if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
     return; /* each connection has personal timeout */
 
@@ -53,13 +53,12 @@ MHD_connection_update_last_activity_ (struct MHD_Connection 
*connection)
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   /* move connection to head of timeout list (by remove + add operation) */
   XDLL_remove (daemon->normal_timeout_head,
-              daemon->normal_timeout_tail,
-              connection);
+               daemon->normal_timeout_tail,
+               connection);
   XDLL_insert (daemon->normal_timeout_head,
-              daemon->normal_timeout_tail,
-              connection);
+               daemon->normal_timeout_tail,
+               connection);
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 }
 
 /* end of connection_update_last_activity.c */
-
diff --git a/src/lib/connection_update_last_activity.h 
b/src/lib/connection_update_last_activity.h
index 8383b6be..ee9f9975 100644
--- a/src/lib/connection_update_last_activity.h
+++ b/src/lib/connection_update_last_activity.h
@@ -35,6 +35,6 @@
  */
 void
 MHD_connection_update_last_activity_ (struct MHD_Connection *connection)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
 
 #endif
diff --git a/src/lib/daemon_close_all_connections.c 
b/src/lib/daemon_close_all_connections.c
index d4b825da..1a777494 100644
--- a/src/lib/daemon_close_all_connections.c
+++ b/src/lib/daemon_close_all_connections.c
@@ -45,10 +45,10 @@ close_connection (struct MHD_Connection *pos)
   struct MHD_Daemon *daemon = pos->daemon;
 
   if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
-    {
-      MHD_connection_mark_closed_ (pos);
-      return; /* must let thread to do the rest */
-    }
+  {
+    MHD_connection_mark_closed_ (pos);
+    return;   /* must let thread to do the rest */
+  }
   MHD_connection_close_ (pos,
                          MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN);
 
@@ -59,18 +59,18 @@ close_connection (struct MHD_Connection *pos)
   if (pos->connection_timeout ==
       pos->daemon->connection_default_timeout)
     XDLL_remove (daemon->normal_timeout_head,
-                daemon->normal_timeout_tail,
-                pos);
+                 daemon->normal_timeout_tail,
+                 pos);
   else
     XDLL_remove (daemon->manual_timeout_head,
-                daemon->manual_timeout_tail,
-                pos);
+                 daemon->manual_timeout_tail,
+                 pos);
   DLL_remove (daemon->connections_head,
-             daemon->connections_tail,
-             pos);
+              daemon->connections_tail,
+              pos);
   DLL_insert (daemon->cleanup_head,
-             daemon->cleanup_tail,
-             pos);
+              daemon->cleanup_tail,
+              pos);
 
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 }
@@ -89,7 +89,8 @@ void
 MHD_daemon_close_all_connections_ (struct MHD_Daemon *daemon)
 {
   struct MHD_Connection *pos;
-  const bool used_thr_p_c = (MHD_TM_THREAD_PER_CONNECTION == 
daemon->threading_mode);
+  const bool used_thr_p_c = (MHD_TM_THREAD_PER_CONNECTION ==
+                             daemon->threading_mode);
 #ifdef UPGRADE_SUPPORT
   const bool upg_allowed = (! daemon->disallow_upgrade);
 #endif /* UPGRADE_SUPPORT */
@@ -103,16 +104,16 @@ MHD_daemon_close_all_connections_ (struct MHD_Daemon 
*daemon)
   /* give upgraded HTTPS connections a chance to finish */
   /* 'daemon->urh_head' is not used in thread-per-connection mode. */
   for (urh = daemon->urh_tail; NULL != urh; urh = urhn)
-    {
-      urhn = urh->prev;
-      /* call generic forwarding function for passing data
-         with chance to detect that application is done. */
-      MHD_upgrade_response_handle_process_ (urh);
-      MHD_connection_finish_forward_ (urh->connection);
-      urh->clean_ready = true;
-      /* Resuming will move connection to cleanup list. */
-      MHD_request_resume (&urh->connection->request);
-    }
+  {
+    urhn = urh->prev;
+    /* call generic forwarding function for passing data
+       with chance to detect that application is done. */
+    MHD_upgrade_response_handle_process_ (urh);
+    MHD_connection_finish_forward_ (urh->connection);
+    urh->clean_ready = true;
+    /* Resuming will move connection to cleanup list. */
+    MHD_request_resume (&urh->connection->request);
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
 
   /* Give suspended connections a chance to resume to avoid
@@ -120,89 +121,93 @@ MHD_daemon_close_all_connections_ (struct MHD_Daemon 
*daemon)
      connections left in case of a tight race with a recently
      resumed connection. */
   if (! daemon->disallow_suspend_resume)
-    {
-      daemon->resuming = true; /* Force check for pending resume. */
-      MHD_resume_suspended_connections_ (daemon);
-    }
+  {
+    daemon->resuming = true;   /* Force check for pending resume. */
+    MHD_resume_suspended_connections_ (daemon);
+  }
   /* first, make sure all threads are aware of shutdown; need to
      traverse DLLs in peace... */
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #ifdef UPGRADE_SUPPORT
   if (upg_allowed)
-    {
-      struct MHD_Connection * susp;
+  {
+    struct MHD_Connection *susp;
 
-      susp = daemon->suspended_connections_tail;
-      while (NULL != susp)
-        {
-          if (NULL == susp->request.urh) /* "Upgraded" connection? */
-            MHD_PANIC (_("MHD_stop_daemon() called while we have suspended 
connections.\n"));
+    susp = daemon->suspended_connections_tail;
+    while (NULL != susp)
+    {
+      if (NULL == susp->request.urh)     /* "Upgraded" connection? */
+        MHD_PANIC (_ (
+                     "MHD_stop_daemon() called while we have suspended 
connections.\n"));
 #ifdef HTTPS_SUPPORT
-          else if (used_tls &&
-                   used_thr_p_c &&
-                   (! susp->request.urh->clean_ready) )
-            shutdown (susp->request.urh->app.socket,
-                      SHUT_RDWR); /* Wake thread by shutdown of app socket. */
+      else if (used_tls &&
+               used_thr_p_c &&
+               (! susp->request.urh->clean_ready) )
+        shutdown (susp->request.urh->app.socket,
+                  SHUT_RDWR);     /* Wake thread by shutdown of app socket. */
 #endif /* HTTPS_SUPPORT */
-          else
-            {
+      else
+      {
 #ifdef HAVE_MESSAGES
-              if (! susp->request.urh->was_closed)
-                MHD_DLOG (daemon,
-                         MHD_SC_SHUTDOWN_WITH_OPEN_UPGRADED_CONNECTION,
-                          _("Initiated daemon shutdown while \"upgraded\" 
connection was not closed.\n"));
+        if (! susp->request.urh->was_closed)
+          MHD_DLOG (daemon,
+                    MHD_SC_SHUTDOWN_WITH_OPEN_UPGRADED_CONNECTION,
+                    _ (
+                      "Initiated daemon shutdown while \"upgraded\" connection 
was not closed.\n"));
 #endif
-              susp->request.urh->was_closed = true;
-              /* If thread-per-connection is used, connection's thread
-               * may still processing "upgrade" (exiting). */
-              if (! used_thr_p_c)
-                MHD_connection_finish_forward_ (susp);
-              /* Do not use MHD_resume_connection() as mutex is
-               * already locked. */
-              susp->resuming = true;
-              daemon->resuming = true;
-            }
-          susp = susp->prev;
-        }
+        susp->request.urh->was_closed = true;
+        /* If thread-per-connection is used, connection's thread
+         * may still processing "upgrade" (exiting). */
+        if (! used_thr_p_c)
+          MHD_connection_finish_forward_ (susp);
+        /* Do not use MHD_resume_connection() as mutex is
+         * already locked. */
+        susp->resuming = true;
+        daemon->resuming = true;
+      }
+      susp = susp->prev;
     }
+  }
   else /* This 'else' is combined with next 'if' */
 #endif /* UPGRADE_SUPPORT */
   if (NULL != daemon->suspended_connections_head)
-    MHD_PANIC (_("MHD_stop_daemon() called while we have suspended 
connections.\n"));
+    MHD_PANIC (_ (
+                 "MHD_stop_daemon() called while we have suspended 
connections.\n"));
   for (pos = daemon->connections_tail; NULL != pos; pos = pos->prev)
-    {
-      shutdown (pos->socket_fd,
-                SHUT_RDWR);
+  {
+    shutdown (pos->socket_fd,
+              SHUT_RDWR);
 #if MHD_WINSOCK_SOCKETS
-      if ( (used_thr_p_c) &&
-           (MHD_ITC_IS_VALID_(daemon->itc)) &&
-           (! MHD_itc_activate_ (daemon->itc,
-                                "e")) )
-        MHD_PANIC (_("Failed to signal shutdown via inter-thread communication 
channel"));
+    if ( (used_thr_p_c) &&
+         (MHD_ITC_IS_VALID_ (daemon->itc)) &&
+         (! MHD_itc_activate_ (daemon->itc,
+                               "e")) )
+      MHD_PANIC (_ (
+                   "Failed to signal shutdown via inter-thread communication 
channel"));
 #endif
-    }
+  }
 
   /* now, collect per-connection threads */
   if (used_thr_p_c)
+  {
+    pos = daemon->connections_tail;
+    while (NULL != pos)
     {
-      pos = daemon->connections_tail;
-      while (NULL != pos)
+      if (! pos->thread_joined)
       {
-        if (! pos->thread_joined)
-          {
-            MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-            if (! MHD_join_thread_ (pos->pid.handle))
-              MHD_PANIC (_("Failed to join a thread\n"));
-            MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
-            pos->thread_joined = true;
-            /* The thread may have concurrently modified the DLL,
-               need to restart from the beginning */
-            pos = daemon->connections_tail;
-            continue;
-          }
-        pos = pos->prev;
+        MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+        if (! MHD_join_thread_ (pos->pid.handle))
+          MHD_PANIC (_ ("Failed to join a thread\n"));
+        MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+        pos->thread_joined = true;
+        /* The thread may have concurrently modified the DLL,
+           need to restart from the beginning */
+        pos = daemon->connections_tail;
+        continue;
       }
+      pos = pos->prev;
     }
+  }
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 
 #ifdef UPGRADE_SUPPORT
@@ -211,10 +216,10 @@ MHD_daemon_close_all_connections_ (struct MHD_Daemon 
*daemon)
   /* "Upgraded" connections that were not closed explicitly by
    * application should be moved to cleanup list too. */
   if (upg_allowed)
-    {
-      daemon->resuming = true; /* Force check for pending resume. */
-      MHD_resume_suspended_connections_ (daemon);
-    }
+  {
+    daemon->resuming = true;   /* Force check for pending resume. */
+    MHD_resume_suspended_connections_ (daemon);
+  }
 #endif /* UPGRADE_SUPPORT */
 
   /* now that we're alone, move everyone to cleanup */
@@ -222,7 +227,7 @@ MHD_daemon_close_all_connections_ (struct MHD_Daemon 
*daemon)
   {
     if ( (used_thr_p_c) &&
          (! pos->thread_joined) )
-      MHD_PANIC (_("Failed to join a thread\n"));
+      MHD_PANIC (_ ("Failed to join a thread\n"));
     close_connection (pos);
   }
   MHD_connection_cleanup_ (daemon);
diff --git a/src/lib/daemon_close_all_connections.h 
b/src/lib/daemon_close_all_connections.h
index 340b0d47..2716f9ba 100644
--- a/src/lib/daemon_close_all_connections.h
+++ b/src/lib/daemon_close_all_connections.h
@@ -37,6 +37,6 @@
  */
 void
 MHD_daemon_close_all_connections_ (struct MHD_Daemon *daemon)
-  MHD_NONNULL (1);
+MHD_NONNULL (1);
 
 #endif
diff --git a/src/lib/daemon_create.c b/src/lib/daemon_create.c
index a2173d88..cd3d0ec4 100644
--- a/src/lib/daemon_create.c
+++ b/src/lib/daemon_create.c
@@ -38,16 +38,16 @@
  */
 static void
 file_logger (void *cls,
-            enum MHD_StatusCode sc,
-            const char *fm,
-            va_list ap)
+             enum MHD_StatusCode sc,
+             const char *fm,
+             va_list ap)
 {
   FILE *f = cls;
 
   (void) sc;
   (void) vfprintf (f,
-                  fm,
-                  ap);
+                   fm,
+                   ap);
 }
 
 
@@ -84,16 +84,16 @@ unescape_wrapper (void *cls,
  */
 struct MHD_Daemon *
 MHD_daemon_create (MHD_RequestCallback cb,
-                  void *cb_cls)
+                   void *cb_cls)
 {
   struct MHD_Daemon *daemon;
 
-  MHD_check_global_init_();
+  MHD_check_global_init_ ();
   if (NULL == (daemon = malloc (sizeof (struct MHD_Daemon))))
     return NULL;
   memset (daemon,
-         0,
-         sizeof (struct MHD_Daemon));
+          0,
+          sizeof (struct MHD_Daemon));
 #ifdef EPOLL_SUPPORT
   daemon->epoll_itc_marker = "itc_marker";
 #endif
@@ -107,29 +107,29 @@ MHD_daemon_create (MHD_RequestCallback cb,
 #if ENABLE_DAUTH
   daemon->digest_nc_length = DIGEST_NC_LENGTH_DEFAULT;
 #endif
-  daemon->listen_backlog = LISTEN_BACKLOG_DEFAULT;  
+  daemon->listen_backlog = LISTEN_BACKLOG_DEFAULT;
   daemon->fo_queue_length = FO_QUEUE_LENGTH_DEFAULT;
   daemon->listen_socket = MHD_INVALID_SOCKET;
 
   if (! MHD_mutex_init_ (&daemon->cleanup_connection_mutex))
-    {
-      free (daemon);
-      return NULL;
-    }  
+  {
+    free (daemon);
+    return NULL;
+  }
   if (! MHD_mutex_init_ (&daemon->per_ip_connection_mutex))
-    {
-      (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
-      free (daemon);
-      return NULL;
-    }
+  {
+    (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
+    free (daemon);
+    return NULL;
+  }
 #ifdef DAUTH_SUPPORT
   if (! MHD_mutex_init_ (&daemon->nnc_lock))
-    {
-      (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
-      (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
-      free (daemon);
-      return NULL;
-    }
+  {
+    (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
+    (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
+    free (daemon);
+    return NULL;
+  }
 #endif
   return daemon;
 }
diff --git a/src/lib/daemon_destroy.c b/src/lib/daemon_destroy.c
index b4f34d16..a76c2d6b 100644
--- a/src/lib/daemon_destroy.c
+++ b/src/lib/daemon_destroy.c
@@ -46,35 +46,36 @@ stop_workers (struct MHD_Daemon *daemon)
     fd = daemon->listen_socket;
   /* Let workers shutdown in parallel. */
   for (i = 0; i < daemon->worker_pool_size; i++)
+  {
+    daemon->worker_pool[i].shutdown = true;
+    if (MHD_ITC_IS_VALID_ (daemon->worker_pool[i].itc))
     {
-      daemon->worker_pool[i].shutdown = true;
-      if (MHD_ITC_IS_VALID_(daemon->worker_pool[i].itc))
-       {
-         if (! MHD_itc_activate_ (daemon->worker_pool[i].itc,
-                                  "e"))
-           MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel."));
-       }
-      else
-       {
-         /* Better hope shutdown() works... */
-         mhd_assert (MHD_INVALID_SOCKET != fd);
-       }
+      if (! MHD_itc_activate_ (daemon->worker_pool[i].itc,
+                               "e"))
+        MHD_PANIC (_ (
+                     "Failed to signal shutdown via inter-thread communication 
channel."));
     }
-#ifdef HAVE_LISTEN_SHUTDOWN
-  if (MHD_INVALID_SOCKET != fd)
+    else
     {
-      (void) shutdown (fd,
-                      SHUT_RDWR);
+      /* Better hope shutdown() works... */
+      mhd_assert (MHD_INVALID_SOCKET != fd);
     }
+  }
+#ifdef HAVE_LISTEN_SHUTDOWN
+  if (MHD_INVALID_SOCKET != fd)
+  {
+    (void) shutdown (fd,
+                     SHUT_RDWR);
+  }
 #endif /* HAVE_LISTEN_SHUTDOWN */
   for (i = 0; i < daemon->worker_pool_size; ++i)
-    {
-      MHD_daemon_destroy (&daemon->worker_pool[i]);
-    }
+  {
+    MHD_daemon_destroy (&daemon->worker_pool[i]);
+  }
   free (daemon->worker_pool);
   daemon->worker_pool = NULL;
   /* FIXME: does this still hold? */
-  mhd_assert (MHD_ITC_IS_INVALID_(daemon->itc));
+  mhd_assert (MHD_ITC_IS_INVALID_ (daemon->itc));
 #ifdef EPOLL_SUPPORT
   mhd_assert (-1 == daemon->epoll_fd);
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
@@ -104,65 +105,66 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
   /* FIXME: convert from here to microhttpd2-style API! */
 
   if (NULL != daemon->worker_pool)
-    { /* Master daemon with worker pool. */
-      stop_workers (daemon);
-    }
+  {   /* Master daemon with worker pool. */
+    stop_workers (daemon);
+  }
   else
+  {
+    mhd_assert (0 == daemon->worker_pool_size);
+    /* Worker daemon or single-thread daemon. */
+    if (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode)
     {
-      mhd_assert (0 == daemon->worker_pool_size);
-      /* Worker daemon or single-thread daemon. */
-      if (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode)
-        {
-         /* Worker daemon or single daemon with internal thread(s). */
-         /* Separate thread(s) is used for polling sockets. */
-         if (MHD_ITC_IS_VALID_(daemon->itc))
-           {
-             if (! MHD_itc_activate_ (daemon->itc,
-                                      "e"))
-               MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel"));
-           }
-         else
-           {
-#ifdef HAVE_LISTEN_SHUTDOWN
-             if (MHD_INVALID_SOCKET != fd)
-               {
-                 if (NULL == daemon->master)
-                   (void) shutdown (fd,
-                                    SHUT_RDWR);
-               }
-             else
-#endif /* HAVE_LISTEN_SHUTDOWN */
-               mhd_assert (false); /* Should never happen */
-           }
-
-         if (! MHD_join_thread_ (daemon->pid.handle))
-           {
-             MHD_PANIC (_("Failed to join a thread\n"));
-           }
-         /* close_all_connections() was called in daemon thread. */
-       }
+      /* Worker daemon or single daemon with internal thread(s). */
+      /* Separate thread(s) is used for polling sockets. */
+      if (MHD_ITC_IS_VALID_ (daemon->itc))
+      {
+        if (! MHD_itc_activate_ (daemon->itc,
+                                 "e"))
+          MHD_PANIC (_ (
+                       "Failed to signal shutdown via inter-thread 
communication channel"));
+      }
       else
+      {
+#ifdef HAVE_LISTEN_SHUTDOWN
+        if (MHD_INVALID_SOCKET != fd)
         {
-          /* No internal threads are used for polling sockets
-            (external event loop) */
-          MHD_daemon_close_all_connections_ (daemon);
+          if (NULL == daemon->master)
+            (void) shutdown (fd,
+                             SHUT_RDWR);
         }
-      if (MHD_ITC_IS_VALID_ (daemon->itc))
-        MHD_itc_destroy_chk_ (daemon->itc);
+        else
+#endif /* HAVE_LISTEN_SHUTDOWN */
+        mhd_assert (false); /* Should never happen */
+      }
+
+      if (! MHD_join_thread_ (daemon->pid.handle))
+      {
+        MHD_PANIC (_ ("Failed to join a thread\n"));
+      }
+      /* close_all_connections() was called in daemon thread. */
+    }
+    else
+    {
+      /* No internal threads are used for polling sockets
+   (external event loop) */
+      MHD_daemon_close_all_connections_ (daemon);
+    }
+    if (MHD_ITC_IS_VALID_ (daemon->itc))
+      MHD_itc_destroy_chk_ (daemon->itc);
 
 #ifdef EPOLL_SUPPORT
-      if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
-           (-1 != daemon->epoll_fd) )
-        MHD_socket_close_chk_ (daemon->epoll_fd);
+    if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
+         (-1 != daemon->epoll_fd) )
+      MHD_socket_close_chk_ (daemon->epoll_fd);
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-      if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
-           (-1 != daemon->epoll_upgrade_fd) )
-        MHD_socket_close_chk_ (daemon->epoll_upgrade_fd);
+    if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
+         (-1 != daemon->epoll_upgrade_fd) )
+      MHD_socket_close_chk_ (daemon->epoll_upgrade_fd);
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
 #endif /* EPOLL_SUPPORT */
 
-      MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
-    }
+    MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
+  }
 
   if (NULL != daemon->master)
     return;
@@ -175,18 +177,18 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
   /* TLS clean up */
 #ifdef HTTPS_SUPPORT
   if (NULL != daemon->tls_api)
-    {
+  {
 #if FIXME_TLS_API
-      if (daemon->have_dhparams)
-       {
-         gnutls_dh_params_deinit (daemon->https_mem_dhparams);
-         daemon->have_dhparams = false;
-       }
-      gnutls_priority_deinit (daemon->priority_cache);
-      if (daemon->x509_cred)
-       gnutls_certificate_free_credentials (daemon->x509_cred);
-#endif
+    if (daemon->have_dhparams)
+    {
+      gnutls_dh_params_deinit (daemon->https_mem_dhparams);
+      daemon->have_dhparams = false;
     }
+    gnutls_priority_deinit (daemon->priority_cache);
+    if (daemon->x509_cred)
+      gnutls_certificate_free_credentials (daemon->x509_cred);
+#endif
+  }
 #endif /* HTTPS_SUPPORT */
 
 #ifdef DAUTH_SUPPORT
diff --git a/src/lib/daemon_epoll.c b/src/lib/daemon_epoll.c
index 4bed148f..b25ba9a7 100644
--- a/src/lib/daemon_epoll.c
+++ b/src/lib/daemon_epoll.c
@@ -53,9 +53,9 @@
  *         'false' otherwise
  */
 static bool
-is_urh_ready (struct MHD_UpgradeResponseHandle * const urh)
+is_urh_ready (struct MHD_UpgradeResponseHandle *const urh)
 {
-  const struct MHD_Connection * const connection = urh->connection;
+  const struct MHD_Connection *const connection = urh->connection;
 
   if ( (0 == urh->in_buffer_size) &&
        (0 == urh->out_buffer_size) &&
@@ -80,7 +80,7 @@ is_urh_ready (struct MHD_UpgradeResponseHandle * const urh)
     return true;
 
   if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->mhd.celi)) &&
-         (urh->in_buffer_used > 0) )
+       (urh->in_buffer_used > 0) )
     return true;
 
   return false;
@@ -103,99 +103,99 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon)
 {
   struct epoll_event events[MAX_EVENTS];
   int num_events;
-  struct MHD_UpgradeResponseHandle * pos;
-  struct MHD_UpgradeResponseHandle * prev;
+  struct MHD_UpgradeResponseHandle *pos;
+  struct MHD_UpgradeResponseHandle *prev;
 
   num_events = MAX_EVENTS;
   while (MAX_EVENTS == num_events)
+  {
+    unsigned int i;
+
+    /* update event masks */
+    num_events = epoll_wait (daemon->epoll_upgrade_fd,
+                             events,
+                             MAX_EVENTS,
+                             0);
+    if (-1 == num_events)
     {
-      unsigned int i;
-      
-      /* update event masks */
-      num_events = epoll_wait (daemon->epoll_upgrade_fd,
-                              events,
-                               MAX_EVENTS,
-                               0);
-      if (-1 == num_events)
-       {
-          const int err = MHD_socket_get_error_ ();
-          if (MHD_SCKT_ERR_IS_EINTR_ (err))
-           return MHD_SC_OK;
+      const int err = MHD_socket_get_error_ ();
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
+        return MHD_SC_OK;
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR,
-                    _("Call to epoll_wait failed: %s\n"),
-                    MHD_socket_strerr_ (err));
+      MHD_DLOG (daemon,
+                MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR,
+                _ ("Call to epoll_wait failed: %s\n"),
+                MHD_socket_strerr_ (err));
 #endif
-         return MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR;
-       }
-      for (i = 0; i < (unsigned int) num_events; i++)
-       {
-          struct UpgradeEpollHandle * const ueh = events[i].data.ptr;
-          struct MHD_UpgradeResponseHandle * const urh = ueh->urh;
-          bool new_err_state = false;
-
-          if (urh->clean_ready)
-            continue;
-
-          /* Update ueh state based on what is ready according to epoll() */
-          if (0 != (events[i].events & EPOLLIN))
-            ueh->celi |= MHD_EPOLL_STATE_READ_READY;
-          if (0 != (events[i].events & EPOLLOUT))
-            ueh->celi |= MHD_EPOLL_STATE_WRITE_READY;
-          if (0 != (events[i].events & EPOLLHUP))
-            ueh->celi |= MHD_EPOLL_STATE_READ_READY | 
MHD_EPOLL_STATE_WRITE_READY;
-
-          if ( (0 == (ueh->celi & MHD_EPOLL_STATE_ERROR)) &&
-               (0 != (events[i].events & (EPOLLERR | EPOLLPRI))) )
-           {
-              /* Process new error state only one time
-               * and avoid continuously marking this connection
-               * as 'ready'. */
-              ueh->celi |= MHD_EPOLL_STATE_ERROR;
-              new_err_state = true;
-           }
-
-          if (! urh->in_eready_list)
-            {
-              if (new_err_state ||
-                 is_urh_ready(urh))
-               {
-                 EDLL_insert (daemon->eready_urh_head,
-                              daemon->eready_urh_tail,
-                              urh);
-                 urh->in_eready_list = true;
-               }
-            }
+      return MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR;
+    }
+    for (i = 0; i < (unsigned int) num_events; i++)
+    {
+      struct UpgradeEpollHandle *const ueh = events[i].data.ptr;
+      struct MHD_UpgradeResponseHandle *const urh = ueh->urh;
+      bool new_err_state = false;
+
+      if (urh->clean_ready)
+        continue;
+
+      /* Update ueh state based on what is ready according to epoll() */
+      if (0 != (events[i].events & EPOLLIN))
+        ueh->celi |= MHD_EPOLL_STATE_READ_READY;
+      if (0 != (events[i].events & EPOLLOUT))
+        ueh->celi |= MHD_EPOLL_STATE_WRITE_READY;
+      if (0 != (events[i].events & EPOLLHUP))
+        ueh->celi |= MHD_EPOLL_STATE_READ_READY | MHD_EPOLL_STATE_WRITE_READY;
+
+      if ( (0 == (ueh->celi & MHD_EPOLL_STATE_ERROR)) &&
+           (0 != (events[i].events & (EPOLLERR | EPOLLPRI))) )
+      {
+        /* Process new error state only one time
+         * and avoid continuously marking this connection
+         * as 'ready'. */
+        ueh->celi |= MHD_EPOLL_STATE_ERROR;
+        new_err_state = true;
+      }
+
+      if (! urh->in_eready_list)
+      {
+        if (new_err_state ||
+            is_urh_ready (urh))
+        {
+          EDLL_insert (daemon->eready_urh_head,
+                       daemon->eready_urh_tail,
+                       urh);
+          urh->in_eready_list = true;
         }
+      }
     }
+  }
   prev = daemon->eready_urh_tail;
   while (NULL != (pos = prev))
+  {
+    prev = pos->prevE;
+    MHD_upgrade_response_handle_process_ (pos);
+    if (! is_urh_ready (pos))
     {
-      prev = pos->prevE;
-      MHD_upgrade_response_handle_process_ (pos);
-      if (! is_urh_ready(pos))
-       {
-         EDLL_remove (daemon->eready_urh_head,
-                      daemon->eready_urh_tail,
-                      pos);
-         pos->in_eready_list = false;
-       }
-      /* Finished forwarding? */
-      if ( (0 == pos->in_buffer_size) &&
-           (0 == pos->out_buffer_size) &&
-           (0 == pos->in_buffer_used) &&
-           (0 == pos->out_buffer_used) )
-        {
-          MHD_connection_finish_forward_ (pos->connection);
-          pos->clean_ready = true;
-          /* If 'pos->was_closed' already was set to true, connection
-           * will be moved immediately to cleanup list. Otherwise
-           * connection will stay in suspended list until 'pos' will
-           * be marked with 'was_closed' by application. */
-          MHD_request_resume (&pos->connection->request);
-        }
+      EDLL_remove (daemon->eready_urh_head,
+                   daemon->eready_urh_tail,
+                   pos);
+      pos->in_eready_list = false;
+    }
+    /* Finished forwarding? */
+    if ( (0 == pos->in_buffer_size) &&
+         (0 == pos->out_buffer_size) &&
+         (0 == pos->in_buffer_used) &&
+         (0 == pos->out_buffer_used) )
+    {
+      MHD_connection_finish_forward_ (pos->connection);
+      pos->clean_ready = true;
+      /* If 'pos->was_closed' already was set to true, connection
+       * will be moved immediately to cleanup list. Otherwise
+       * connection will stay in suspended list until 'pos' will
+       * be marked with 'was_closed' by application. */
+      MHD_request_resume (&pos->connection->request);
     }
+  }
 
   return MHD_SC_OK;
 }
@@ -212,10 +212,10 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon)
  */
 enum MHD_StatusCode
 MHD_daemon_epoll_ (struct MHD_Daemon *daemon,
-                  bool may_block)
+                   bool may_block)
 {
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-  static const char * const upgrade_marker = "upgrade_ptr";
+  static const char *const upgrade_marker = "upgrade_ptr";
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   struct MHD_Connection *pos;
   struct MHD_Connection *prev;
@@ -239,24 +239,24 @@ MHD_daemon_epoll_ (struct MHD_Daemon *daemon,
        (daemon->connections < daemon->global_connection_limit) &&
        (! daemon->listen_socket_in_epoll) &&
        (! daemon->at_limit) )
+  {
+    event.events = EPOLLIN;
+    event.data.ptr = daemon;
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_ADD,
+                        ls,
+                        &event))
     {
-      event.events = EPOLLIN;
-      event.data.ptr = daemon;
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                         EPOLL_CTL_ADD,
-                         ls,
-                         &event))
-       {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_EPOLL_CTL_ADD_FAILED,
-                    _("Call to epoll_ctl failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_EPOLL_CTL_ADD_FAILED,
+                _ ("Call to epoll_ctl failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-         return MHD_SC_EPOLL_CTL_ADD_FAILED;
-       }
-      daemon->listen_socket_in_epoll = true;
+      return MHD_SC_EPOLL_CTL_ADD_FAILED;
     }
+    daemon->listen_socket_in_epoll = true;
+  }
   if ( (daemon->was_quiesced) &&
        (daemon->listen_socket_in_epoll) )
   {
@@ -271,58 +271,58 @@ MHD_daemon_epoll_ (struct MHD_Daemon *daemon,
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   if ( (! daemon->upgrade_fd_in_epoll) &&
        (-1 != daemon->epoll_upgrade_fd) )
+  {
+    event.events = EPOLLIN | EPOLLOUT;
+    event.data.ptr = (void *) upgrade_marker;
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_ADD,
+                        daemon->epoll_upgrade_fd,
+                        &event))
     {
-      event.events = EPOLLIN | EPOLLOUT;
-      event.data.ptr = (void *) upgrade_marker;
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                         EPOLL_CTL_ADD,
-                         daemon->epoll_upgrade_fd,
-                         &event))
-       {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_EPOLL_CTL_ADD_FAILED,
-                    _("Call to epoll_ctl failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_EPOLL_CTL_ADD_FAILED,
+                _ ("Call to epoll_ctl failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-         return MHD_SC_EPOLL_CTL_ADD_FAILED;
-       }
-      daemon->upgrade_fd_in_epoll = true;
+      return MHD_SC_EPOLL_CTL_ADD_FAILED;
     }
+    daemon->upgrade_fd_in_epoll = true;
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   if ( (daemon->listen_socket_in_epoll) &&
        ( (daemon->connections == daemon->global_connection_limit) ||
          (daemon->at_limit) ||
          (daemon->was_quiesced) ) )
-    {
-      /* we're at the connection limit, disable listen socket
-        for event loop for now */
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                         EPOLL_CTL_DEL,
-                         ls,
-                         NULL))
-       MHD_PANIC (_("Failed to remove listen FD from epoll set\n"));
-      daemon->listen_socket_in_epoll = false;
-    }
+  {
+    /* we're at the connection limit, disable listen socket
+ for event loop for now */
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_DEL,
+                        ls,
+                        NULL))
+      MHD_PANIC (_ ("Failed to remove listen FD from epoll set\n"));
+    daemon->listen_socket_in_epoll = false;
+  }
 
   if ( (! daemon->disallow_suspend_resume) &&
        (MHD_resume_suspended_connections_ (daemon)) )
     may_block = false;
 
   if (may_block)
+  {
+    if (MHD_SC_OK ==   /* FIXME: distinguish between NO_TIMEOUT and errors */
+        MHD_daemon_get_timeout (daemon,
+                                &timeout_ll))
     {
-      if (MHD_SC_OK == /* FIXME: distinguish between NO_TIMEOUT and errors */
-         MHD_daemon_get_timeout (daemon,
-                                 &timeout_ll))
-       {
-         if (timeout_ll >= (MHD_UNSIGNED_LONG_LONG) INT_MAX)
-           timeout_ms = INT_MAX;
-         else
-           timeout_ms = (int) timeout_ll;
-       }
+      if (timeout_ll >= (MHD_UNSIGNED_LONG_LONG) INT_MAX)
+        timeout_ms = INT_MAX;
       else
-       timeout_ms = -1;
+        timeout_ms = (int) timeout_ll;
     }
+    else
+      timeout_ms = -1;
+  }
   else
     timeout_ms = 0;
 
@@ -337,113 +337,114 @@ MHD_daemon_epoll_ (struct MHD_Daemon *daemon,
      than unfair behavior... */
   num_events = MAX_EVENTS;
   while (MAX_EVENTS == num_events)
+  {
+    /* update event masks */
+    num_events = epoll_wait (daemon->epoll_fd,
+                             events,
+                             MAX_EVENTS,
+                             timeout_ms);
+    if (-1 == num_events)
     {
-      /* update event masks */
-      num_events = epoll_wait (daemon->epoll_fd,
-                              events,
-                               MAX_EVENTS,
-                               timeout_ms);
-      if (-1 == num_events)
-       {
-          const int err = MHD_socket_get_error_ ();
-          if (MHD_SCKT_ERR_IS_EINTR_ (err))
-           return MHD_SC_OK;
+      const int err = MHD_socket_get_error_ ();
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
+        return MHD_SC_OK;
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR,
-                    _("Call to epoll_wait failed: %s\n"),
-                    MHD_socket_strerr_ (err));
+      MHD_DLOG (daemon,
+                MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR,
+                _ ("Call to epoll_wait failed: %s\n"),
+                MHD_socket_strerr_ (err));
 #endif
-         return MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR;
-       }
-      for (i=0;i<(unsigned int) num_events;i++)
-       {
-          /* First, check for the values of `ptr` that would indicate
-             that this event is not about a normal connection. */
-         if (NULL == events[i].data.ptr)
-           continue; /* shutdown signal! */
+      return MHD_SC_UNEXPECTED_EPOLL_WAIT_ERROR;
+    }
+    for (i = 0; i<(unsigned int) num_events; i++)
+    {
+      /* First, check for the values of `ptr` that would indicate
+         that this event is not about a normal connection. */
+      if (NULL == events[i].data.ptr)
+        continue; /* shutdown signal! */
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-          if (upgrade_marker == events[i].data.ptr)
-            {
-              /* activity on an upgraded connection, we process
-                 those in a separate epoll() */
-              run_upgraded = true;
-              continue;
-            }
+      if (upgrade_marker == events[i].data.ptr)
+      {
+        /* activity on an upgraded connection, we process
+           those in a separate epoll() */
+        run_upgraded = true;
+        continue;
+      }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
-          if (daemon->epoll_itc_marker == events[i].data.ptr)
-            {
-              /* It's OK to clear ITC here as all external
-                 conditions will be processed later. */
-              MHD_itc_clear_ (daemon->itc);
-              continue;
-            }
-         if (daemon == events[i].data.ptr)
-           {
-              /* Check for error conditions on listen socket. */
-              /* FIXME: Initiate MHD_quiesce_daemon() to prevent busy waiting? 
*/
-              if (0 == (events[i].events & (EPOLLERR | EPOLLHUP)))
-                {
-                  unsigned int series_length = 0;
-                  /* Run 'accept' until it fails or daemon at limit of 
connections.
-                   * Do not accept more then 10 connections at once. The rest 
will
-                   * be accepted on next turn (level trigger is used for listen
-                   * socket). */
-                  while ( (MHD_SC_OK ==
-                          MHD_accept_connection_ (daemon)) &&
-                          (series_length < 10) &&
-                          (daemon->connections < 
daemon->global_connection_limit) &&
-                          (! daemon->at_limit) )
-                    series_length++;
-               }
-              continue;
-           }
-          /* this is an event relating to a 'normal' connection,
-             remember the event and if appropriate mark the
-             connection as 'eready'. */
-          pos = events[i].data.ptr;
-          /* normal processing: update read/write data */
-          if (0 != (events[i].events & (EPOLLPRI | EPOLLERR | EPOLLHUP)))
-            {
-              pos->epoll_state |= MHD_EPOLL_STATE_ERROR;
-              if (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-                {
-                  EDLL_insert (daemon->eready_head,
-                               daemon->eready_tail,
-                               pos);
-                  pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
-                }
-            }
-          else
-            {
-              if (0 != (events[i].events & EPOLLIN))
-                {
-                  pos->epoll_state |= MHD_EPOLL_STATE_READ_READY;
-                  if ( ( (MHD_EVENT_LOOP_INFO_READ == 
pos->request.event_loop_info) ||
-                         (pos->request.read_buffer_size > 
pos->request.read_buffer_offset) ) &&
-                       (0 == (pos->epoll_state & 
MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
-                    {
-                      EDLL_insert (daemon->eready_head,
-                                   daemon->eready_tail,
-                                   pos);
-                      pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
-                    }
-                }
-              if (0 != (events[i].events & EPOLLOUT))
-                {
-                  pos->epoll_state |= MHD_EPOLL_STATE_WRITE_READY;
-                  if ( (MHD_EVENT_LOOP_INFO_WRITE == 
pos->request.event_loop_info) &&
-                       (0 == (pos->epoll_state & 
MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
-                    {
-                      EDLL_insert (daemon->eready_head,
-                                   daemon->eready_tail,
-                                   pos);
-                      pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
-                    }
-                }
-            }
+      if (daemon->epoll_itc_marker == events[i].data.ptr)
+      {
+        /* It's OK to clear ITC here as all external
+           conditions will be processed later. */
+        MHD_itc_clear_ (daemon->itc);
+        continue;
+      }
+      if (daemon == events[i].data.ptr)
+      {
+        /* Check for error conditions on listen socket. */
+        /* FIXME: Initiate MHD_quiesce_daemon() to prevent busy waiting? */
+        if (0 == (events[i].events & (EPOLLERR | EPOLLHUP)))
+        {
+          unsigned int series_length = 0;
+          /* Run 'accept' until it fails or daemon at limit of connections.
+           * Do not accept more then 10 connections at once. The rest will
+           * be accepted on next turn (level trigger is used for listen
+           * socket). */
+          while ( (MHD_SC_OK ==
+                   MHD_accept_connection_ (daemon)) &&
+                  (series_length < 10) &&
+                  (daemon->connections < daemon->global_connection_limit) &&
+                  (! daemon->at_limit) )
+            series_length++;
+        }
+        continue;
+      }
+      /* this is an event relating to a 'normal' connection,
+         remember the event and if appropriate mark the
+         connection as 'eready'. */
+      pos = events[i].data.ptr;
+      /* normal processing: update read/write data */
+      if (0 != (events[i].events & (EPOLLPRI | EPOLLERR | EPOLLHUP)))
+      {
+        pos->epoll_state |= MHD_EPOLL_STATE_ERROR;
+        if (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
+        {
+          EDLL_insert (daemon->eready_head,
+                       daemon->eready_tail,
+                       pos);
+          pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
+        }
+      }
+      else
+      {
+        if (0 != (events[i].events & EPOLLIN))
+        {
+          pos->epoll_state |= MHD_EPOLL_STATE_READ_READY;
+          if ( ( (MHD_EVENT_LOOP_INFO_READ == pos->request.event_loop_info) ||
+                 (pos->request.read_buffer_size >
+                  pos->request.read_buffer_offset) ) &&
+               (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
+          {
+            EDLL_insert (daemon->eready_head,
+                         daemon->eready_tail,
+                         pos);
+            pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
+          }
+        }
+        if (0 != (events[i].events & EPOLLOUT))
+        {
+          pos->epoll_state |= MHD_EPOLL_STATE_WRITE_READY;
+          if ( (MHD_EVENT_LOOP_INFO_WRITE == pos->request.event_loop_info) &&
+               (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
+          {
+            EDLL_insert (daemon->eready_head,
+                         daemon->eready_tail,
+                         pos);
+            pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
+          }
         }
+      }
     }
+  }
 
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   if (run_upgraded)
@@ -453,28 +454,32 @@ MHD_daemon_epoll_ (struct MHD_Daemon *daemon,
   /* process events for connections */
   prev = daemon->eready_tail;
   while (NULL != (pos = prev))
+  {
+    prev = pos->prevE;
+    MHD_connection_call_handlers_ (pos,
+                                   0 != (pos->epoll_state
+                                         & MHD_EPOLL_STATE_READ_READY),
+                                   0 != (pos->epoll_state
+                                         & MHD_EPOLL_STATE_WRITE_READY),
+                                   0 != (pos->epoll_state
+                                         & MHD_EPOLL_STATE_ERROR));
+    if (MHD_EPOLL_STATE_IN_EREADY_EDLL ==
+        (pos->epoll_state & (MHD_EPOLL_STATE_SUSPENDED
+                             | MHD_EPOLL_STATE_IN_EREADY_EDLL)))
     {
-      prev = pos->prevE;
-      MHD_connection_call_handlers_ (pos,
-                                    0 != (pos->epoll_state & 
MHD_EPOLL_STATE_READ_READY),
-                                    0 != (pos->epoll_state & 
MHD_EPOLL_STATE_WRITE_READY),
-                                    0 != (pos->epoll_state & 
MHD_EPOLL_STATE_ERROR));
-      if (MHD_EPOLL_STATE_IN_EREADY_EDLL ==
-            (pos->epoll_state & (MHD_EPOLL_STATE_SUSPENDED | 
MHD_EPOLL_STATE_IN_EREADY_EDLL)))
-        {
-          if ( (MHD_EVENT_LOOP_INFO_READ == pos->request.event_loop_info &&
-               0 == (pos->epoll_state & MHD_EPOLL_STATE_READ_READY) ) ||
-               (MHD_EVENT_LOOP_INFO_WRITE == pos->request.event_loop_info &&
-               0 == (pos->epoll_state & MHD_EPOLL_STATE_WRITE_READY) ) ||
-               MHD_EVENT_LOOP_INFO_CLEANUP == pos->request.event_loop_info)
-            {
-              EDLL_remove (daemon->eready_head,
-                           daemon->eready_tail,
-                           pos);
-              pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
-            }
-        }
+      if ( ((MHD_EVENT_LOOP_INFO_READ == pos->request.event_loop_info) &&
+            (0 == (pos->epoll_state & MHD_EPOLL_STATE_READ_READY)) ) ||
+           ((MHD_EVENT_LOOP_INFO_WRITE == pos->request.event_loop_info) &&
+            (0 == (pos->epoll_state & MHD_EPOLL_STATE_WRITE_READY)) ) ||
+           (MHD_EVENT_LOOP_INFO_CLEANUP == pos->request.event_loop_info) )
+      {
+        EDLL_remove (daemon->eready_head,
+                     daemon->eready_tail,
+                     pos);
+        pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
+      }
     }
+  }
 
   /* Finally, handle timed-out connections; we need to do this here
      as the epoll mechanism won't call the 'MHD_request_handle_idle_()' on 
everything,
@@ -486,22 +491,22 @@ MHD_daemon_epoll_ (struct MHD_Daemon *daemon,
      do not bother to sort that (presumably very short) list. */
   prev = daemon->manual_timeout_tail;
   while (NULL != (pos = prev))
-    {
-      prev = pos->prevX;
-      MHD_request_handle_idle_ (&pos->request);
-    }
+  {
+    prev = pos->prevX;
+    MHD_request_handle_idle_ (&pos->request);
+  }
   /* Connections with the default timeout are sorted by prepending
      them to the head of the list whenever we touch the connection;
      thus it suffices to iterate from the tail until the first
      connection is NOT timed out */
   prev = daemon->normal_timeout_tail;
   while (NULL != (pos = prev))
-    {
-      prev = pos->prevX;
-      MHD_request_handle_idle_ (&pos->request);
-      if (MHD_REQUEST_CLOSED != pos->request.state)
-       break; /* sorted by timeout, no need to visit the rest! */
-    }
+  {
+    prev = pos->prevX;
+    MHD_request_handle_idle_ (&pos->request);
+    if (MHD_REQUEST_CLOSED != pos->request.state)
+      break; /* sorted by timeout, no need to visit the rest! */
+  }
   return MHD_SC_OK;
 }
 #endif
diff --git a/src/lib/daemon_epoll.h b/src/lib/daemon_epoll.h
index 50452d8d..37d0e423 100644
--- a/src/lib/daemon_epoll.h
+++ b/src/lib/daemon_epoll.h
@@ -38,8 +38,8 @@
  */
 enum MHD_StatusCode
 MHD_daemon_epoll_ (struct MHD_Daemon *daemon,
-                  bool may_block)
-  MHD_NONNULL (1);
+                   bool may_block)
+MHD_NONNULL (1);
 
 #endif
 
diff --git a/src/lib/daemon_get_timeout.c b/src/lib/daemon_get_timeout.c
index fcf3ecbc..604c52e2 100644
--- a/src/lib/daemon_get_timeout.c
+++ b/src/lib/daemon_get_timeout.c
@@ -46,7 +46,7 @@
  */
 enum MHD_StatusCode
 MHD_daemon_get_timeout (struct MHD_Daemon *daemon,
-                       MHD_UNSIGNED_LONG_LONG *timeout)
+                        MHD_UNSIGNED_LONG_LONG *timeout)
 {
   time_t earliest_deadline;
   time_t now;
@@ -54,71 +54,71 @@ MHD_daemon_get_timeout (struct MHD_Daemon *daemon,
   bool have_timeout;
 
   if (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_CONFIGURATION_MISMATCH_FOR_GET_TIMEOUT,
-                _("Illegal call to MHD_get_timeout\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_CONFIGURATION_MISMATCH_FOR_GET_TIMEOUT,
+              _ ("Illegal call to MHD_get_timeout\n"));
 #endif
-      return MHD_SC_CONFIGURATION_MISSMATCH_FOR_GET_TIMEOUT;
-    }
+    return MHD_SC_CONFIGURATION_MISSMATCH_FOR_GET_TIMEOUT;
+  }
 
   if (daemon->data_already_pending)
-    {
-      /* Some data already waiting to be processed. */
-      *timeout = 0;
-      return MHD_SC_OK;
-    }
+  {
+    /* Some data already waiting to be processed. */
+    *timeout = 0;
+    return MHD_SC_OK;
+  }
 
 #ifdef EPOLL_SUPPORT
   if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
        ((NULL != daemon->eready_head)
 #if defined(UPGRADE_SUPPORT) && defined(HTTPS_SUPPORT)
-        || (NULL != daemon->eready_urh_head)
+        || (NULL != daemon->eready_urh_head)
 #endif /* UPGRADE_SUPPORT && HTTPS_SUPPORT */
-        ) )
-    {
-         /* Some connection(s) already have some data pending. */
-      *timeout = 0;
-      return MHD_SC_OK;
-    }
+       ) )
+  {
+    /* Some connection(s) already have some data pending. */
+    *timeout = 0;
+    return MHD_SC_OK;
+  }
 #endif /* EPOLL_SUPPORT */
 
   have_timeout = false;
   earliest_deadline = 0; /* avoid compiler warnings */
   for (pos = daemon->manual_timeout_tail; NULL != pos; pos = pos->prevX)
+  {
+    if (0 != pos->connection_timeout)
     {
-      if (0 != pos->connection_timeout)
-       {
-         if ( (! have_timeout) ||
-              (earliest_deadline - pos->last_activity > 
pos->connection_timeout) )
-           earliest_deadline = pos->last_activity + pos->connection_timeout;
-         have_timeout = true;
-       }
+      if ( (! have_timeout) ||
+           (earliest_deadline - pos->last_activity > pos->connection_timeout) )
+        earliest_deadline = pos->last_activity + pos->connection_timeout;
+      have_timeout = true;
     }
+  }
   /* normal timeouts are sorted, so we only need to look at the 'tail' 
(oldest) */
   pos = daemon->normal_timeout_tail;
   if ( (NULL != pos) &&
        (0 != pos->connection_timeout) )
-    {
-      if ( (! have_timeout) ||
-          (earliest_deadline - pos->connection_timeout > pos->last_activity) )
-       earliest_deadline = pos->last_activity + pos->connection_timeout;
-      have_timeout = true;
-    }
+  {
+    if ( (! have_timeout) ||
+         (earliest_deadline - pos->connection_timeout > pos->last_activity) )
+      earliest_deadline = pos->last_activity + pos->connection_timeout;
+    have_timeout = true;
+  }
 
   if (! have_timeout)
     return MHD_SC_NO_TIMEOUT;
-  now = MHD_monotonic_sec_counter();
+  now = MHD_monotonic_sec_counter ();
   if (earliest_deadline < now)
     *timeout = 0;
   else
-    {
-      const time_t second_left = earliest_deadline - now;
-      if (second_left > ULLONG_MAX / 1000) /* Ignore compiler warning: 
'second_left' is always positive. */
-        *timeout = ULLONG_MAX;
-      else
-        *timeout = 1000LL * second_left;
+  {
+    const time_t second_left = earliest_deadline - now;
+    if (second_left > ULLONG_MAX / 1000)   /* Ignore compiler warning: 
'second_left' is always positive. */
+      *timeout = ULLONG_MAX;
+    else
+      *timeout = 1000LL * second_left;
   }
   return MHD_SC_OK;
 }
diff --git a/src/lib/daemon_info.c b/src/lib/daemon_info.c
index b0c5ec14..d32f244b 100644
--- a/src/lib/daemon_info.c
+++ b/src/lib/daemon_info.c
@@ -43,62 +43,62 @@
  */
 enum MHD_Bool
 MHD_daemon_get_information_sz (struct MHD_Daemon *daemon,
-                              enum MHD_DaemonInformationType info_type,
-                              union MHD_DaemonInformation *return_value,
-                              size_t return_value_size)
+                               enum MHD_DaemonInformationType info_type,
+                               union MHD_DaemonInformation *return_value,
+                               size_t return_value_size)
 {
-#define CHECK_SIZE(type) if (sizeof(type) < return_value_size) \
+#define CHECK_SIZE(type) if (sizeof(type) < return_value_size)  \
     return MHD_NO
 
   switch (info_type)
-    {
-    case MHD_DAEMON_INFORMATION_LISTEN_SOCKET:
-      CHECK_SIZE (MHD_socket);
-      return_value->listen_socket
-       = daemon->listen_socket;
-      return MHD_YES;
+  {
+  case MHD_DAEMON_INFORMATION_LISTEN_SOCKET:
+    CHECK_SIZE (MHD_socket);
+    return_value->listen_socket
+      = daemon->listen_socket;
+    return MHD_YES;
 #ifdef EPOLL_SUPPORT
-    case MHD_DAEMON_INFORMATION_EPOLL_FD:
-      CHECK_SIZE (int);
-      // FIXME: maybe return MHD_NO if we are not using EPOLL?
-      return_value->epoll_fd = daemon->epoll_fd;
-      return MHD_YES;
+  case MHD_DAEMON_INFORMATION_EPOLL_FD:
+    CHECK_SIZE (int);
+    // FIXME: maybe return MHD_NO if we are not using EPOLL?
+    return_value->epoll_fd = daemon->epoll_fd;
+    return MHD_YES;
 #endif
-    case MHD_DAEMON_INFORMATION_CURRENT_CONNECTIONS:
-      CHECK_SIZE (unsigned int);
-      if (MHD_TM_EXTERNAL_EVENT_LOOP == daemon->threading_mode)
-        {
-          /* Assumes that MHD_run() in not called in other thread
-            (of the application) at the same time. */
-          MHD_connection_cleanup_ (daemon);
-         return_value->num_connections
-           = daemon->connections;
-        }
-      else if (daemon->worker_pool)
-        {
-          unsigned int i;
-          /* Collect the connection information stored in the workers. */
-         return_value->num_connections = 0;
-         for (i = 0; i < daemon->worker_pool_size; i++)
-            {
-              /* FIXME: next line is thread-safe only if read is atomic. */
-              return_value->num_connections
-               += daemon->worker_pool[i].connections;
-            }
-        }
-      else
-       return_value->num_connections
-         = daemon->connections;
-      return MHD_YES;
-    case MHD_DAEMON_INFORMATION_BIND_PORT:
-      CHECK_SIZE (uint16_t);
-      // FIXME: return MHD_NO if port is not known/UNIX?
-      return_value->port = daemon->listen_port;
-      return MHD_YES;
-    default:
-      return MHD_NO;
+  case MHD_DAEMON_INFORMATION_CURRENT_CONNECTIONS:
+    CHECK_SIZE (unsigned int);
+    if (MHD_TM_EXTERNAL_EVENT_LOOP == daemon->threading_mode)
+    {
+      /* Assumes that MHD_run() in not called in other thread
+   (of the application) at the same time. */
+      MHD_connection_cleanup_ (daemon);
+      return_value->num_connections
+        = daemon->connections;
     }
-  
+    else if (daemon->worker_pool)
+    {
+      unsigned int i;
+      /* Collect the connection information stored in the workers. */
+      return_value->num_connections = 0;
+      for (i = 0; i < daemon->worker_pool_size; i++)
+      {
+        /* FIXME: next line is thread-safe only if read is atomic. */
+        return_value->num_connections
+          += daemon->worker_pool[i].connections;
+      }
+    }
+    else
+      return_value->num_connections
+        = daemon->connections;
+    return MHD_YES;
+  case MHD_DAEMON_INFORMATION_BIND_PORT:
+    CHECK_SIZE (uint16_t);
+    // FIXME: return MHD_NO if port is not known/UNIX?
+    return_value->port = daemon->listen_port;
+    return MHD_YES;
+  default:
+    return MHD_NO;
+  }
+
 #undef CHECK_SIZE
 }
 
diff --git a/src/lib/daemon_ip_limit.c b/src/lib/daemon_ip_limit.c
index 4a131c92..21550265 100644
--- a/src/lib/daemon_ip_limit.c
+++ b/src/lib/daemon_ip_limit.c
@@ -89,7 +89,7 @@ get_master (struct MHD_Daemon *daemon)
 static void
 MHD_ip_count_lock (struct MHD_Daemon *daemon)
 {
-  MHD_mutex_lock_chk_(&daemon->per_ip_connection_mutex);
+  MHD_mutex_lock_chk_ (&daemon->per_ip_connection_mutex);
 }
 
 
@@ -101,7 +101,7 @@ MHD_ip_count_lock (struct MHD_Daemon *daemon)
 static void
 MHD_ip_count_unlock (struct MHD_Daemon *daemon)
 {
-  MHD_mutex_unlock_chk_(&daemon->per_ip_connection_mutex);
+  MHD_mutex_unlock_chk_ (&daemon->per_ip_connection_mutex);
 }
 
 
@@ -135,37 +135,37 @@ MHD_ip_addr_compare (const void *a1,
  */
 static int
 MHD_ip_addr_to_key (const struct sockaddr *addr,
-                   socklen_t addrlen,
-                   struct MHD_IPCount *key)
+                    socklen_t addrlen,
+                    struct MHD_IPCount *key)
 {
-  memset(key,
-         0,
-         sizeof(*key));
+  memset (key,
+          0,
+          sizeof(*key));
 
   /* IPv4 addresses */
   if (sizeof (struct sockaddr_in) == addrlen)
-    {
-      const struct sockaddr_in *addr4 = (const struct sockaddr_in*) addr;
+  {
+    const struct sockaddr_in *addr4 = (const struct sockaddr_in*) addr;
 
-      key->family = AF_INET;
-      memcpy (&key->addr.ipv4,
-              &addr4->sin_addr,
-              sizeof(addr4->sin_addr));
-      return MHD_YES;
-    }
+    key->family = AF_INET;
+    memcpy (&key->addr.ipv4,
+            &addr4->sin_addr,
+            sizeof(addr4->sin_addr));
+    return MHD_YES;
+  }
 
 #if HAVE_INET6
   /* IPv6 addresses */
   if (sizeof (struct sockaddr_in6) == addrlen)
-    {
-      const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6*) addr;
-
-      key->family = AF_INET6;
-      memcpy (&key->addr.ipv6,
-              &addr6->sin6_addr,
-              sizeof(addr6->sin6_addr));
-      return MHD_YES;
-    }
+  {
+    const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6*) addr;
+
+    key->family = AF_INET6;
+    memcpy (&key->addr.ipv6,
+            &addr6->sin6_addr,
+            sizeof(addr6->sin6_addr));
+    return MHD_YES;
+  }
 #endif
 
   /* Some other address */
@@ -186,8 +186,8 @@ MHD_ip_addr_to_key (const struct sockaddr *addr,
  */
 int
 MHD_ip_limit_add (struct MHD_Daemon *daemon,
-                 const struct sockaddr *addr,
-                 socklen_t addrlen)
+                  const struct sockaddr *addr,
+                  socklen_t addrlen)
 {
   struct MHD_IPCount *key;
   void **nodep;
@@ -206,31 +206,31 @@ MHD_ip_limit_add (struct MHD_Daemon *daemon,
   if (MHD_NO == MHD_ip_addr_to_key (addr,
                                     addrlen,
                                     key))
-    {
-      /* Allow unhandled address types through */
-      free (key);
-      return MHD_YES;
-    }
+  {
+    /* Allow unhandled address types through */
+    free (key);
+    return MHD_YES;
+  }
   MHD_ip_count_lock (daemon);
 
   /* Search for the IP address */
   if (NULL == (nodep = tsearch (key,
-                               &daemon->per_ip_connection_count,
-                               &MHD_ip_addr_compare)))
-    {
+                                &daemon->per_ip_connection_count,
+                                &MHD_ip_addr_compare)))
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_IP_COUNTER_FAILURE,
-               _("Failed to add IP connection count node\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_IP_COUNTER_FAILURE,
+              _ ("Failed to add IP connection count node\n"));
 #endif
-      MHD_ip_count_unlock (daemon);
-      free (key);
-      return MHD_NO;
-    }
+    MHD_ip_count_unlock (daemon);
+    free (key);
+    return MHD_NO;
+  }
   node = *nodep;
   /* If we got an existing node back, free the one we created */
   if (node != key)
-    free(key);
+    free (key);
   key = (struct MHD_IPCount *) node;
   /* Test if there is room for another connection; if so,
    * increment count */
@@ -253,8 +253,8 @@ MHD_ip_limit_add (struct MHD_Daemon *daemon,
  */
 void
 MHD_ip_limit_del (struct MHD_Daemon *daemon,
-                 const struct sockaddr *addr,
-                 socklen_t addrlen)
+                  const struct sockaddr *addr,
+                  socklen_t addrlen)
 {
   struct MHD_IPCount search_key;
   struct MHD_IPCount *found_key;
@@ -274,27 +274,27 @@ MHD_ip_limit_del (struct MHD_Daemon *daemon,
 
   /* Search for the IP address */
   if (NULL == (nodep = tfind (&search_key,
-                             &daemon->per_ip_connection_count,
-                             &MHD_ip_addr_compare)))
-    {
-      /* Something's wrong if we couldn't find an IP address
-       * that was previously added */
-      MHD_PANIC (_("Failed to find previously-added IP address\n"));
-    }
+                              &daemon->per_ip_connection_count,
+                              &MHD_ip_addr_compare)))
+  {
+    /* Something's wrong if we couldn't find an IP address
+     * that was previously added */
+    MHD_PANIC (_ ("Failed to find previously-added IP address\n"));
+  }
   found_key = (struct MHD_IPCount *) *nodep;
   /* Validate existing count for IP address */
   if (0 == found_key->count)
-    {
-      MHD_PANIC (_("Previously-added IP address had counter of zero\n"));
-    }
+  {
+    MHD_PANIC (_ ("Previously-added IP address had counter of zero\n"));
+  }
   /* Remove the node entirely if count reduces to 0 */
   if (0 == --found_key->count)
-    {
-      tdelete (found_key,
-              &daemon->per_ip_connection_count,
-              &MHD_ip_addr_compare);
-      free (found_key);
-    }
+  {
+    tdelete (found_key,
+             &daemon->per_ip_connection_count,
+             &MHD_ip_addr_compare);
+    free (found_key);
+  }
 
   MHD_ip_count_unlock (daemon);
 }
diff --git a/src/lib/daemon_ip_limit.h b/src/lib/daemon_ip_limit.h
index 5f22db05..9c587825 100644
--- a/src/lib/daemon_ip_limit.h
+++ b/src/lib/daemon_ip_limit.h
@@ -38,9 +38,9 @@
  */
 int
 MHD_ip_limit_add (struct MHD_Daemon *daemon,
-                 const struct sockaddr *addr,
-                 socklen_t addrlen)
-  MHD_NONNULL (1,2);
+                  const struct sockaddr *addr,
+                  socklen_t addrlen)
+MHD_NONNULL (1,2);
 
 
 /**
@@ -53,8 +53,8 @@ MHD_ip_limit_add (struct MHD_Daemon *daemon,
  */
 void
 MHD_ip_limit_del (struct MHD_Daemon *daemon,
-                 const struct sockaddr *addr,
-                 socklen_t addrlen)
-  MHD_NONNULL (1,2);
+                  const struct sockaddr *addr,
+                  socklen_t addrlen)
+MHD_NONNULL (1,2);
 
 #endif
diff --git a/src/lib/daemon_options.c b/src/lib/daemon_options.c
index 4d7bbdf1..04c9cb2f 100644
--- a/src/lib/daemon_options.c
+++ b/src/lib/daemon_options.c
@@ -38,8 +38,8 @@
  */
 void
 MHD_daemon_set_logger (struct MHD_Daemon *daemon,
-                      MHD_LoggingCallback logger,
-                      void *logger_cls)
+                       MHD_LoggingCallback logger,
+                       void *logger_cls)
 {
   daemon->logger = logger;
   daemon->logger_cls = logger_cls;
@@ -148,8 +148,8 @@ MHD_daemon_disallow_upgrade (struct MHD_Daemon *daemon)
  */
 enum MHD_Bool
 MHD_daemon_tcp_fastopen (struct MHD_Daemon *daemon,
-                        enum MHD_FastOpenMethod fom,
-                        unsigned int queue_length)
+                         enum MHD_FastOpenMethod fom,
+                         unsigned int queue_length)
 {
   daemon->fast_open_method = fom;
   daemon->fo_queue_length = queue_length;
@@ -185,8 +185,8 @@ MHD_daemon_tcp_fastopen (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_bind_port (struct MHD_Daemon *daemon,
-                     enum MHD_AddressFamily af,
-                     uint16_t port)
+                      enum MHD_AddressFamily af,
+                      uint16_t port)
 {
   daemon->listen_af = af;
   daemon->listen_port = port;
@@ -204,12 +204,12 @@ MHD_daemon_bind_port (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_bind_socket_address (struct MHD_Daemon *daemon,
-                               const struct sockaddr *sa,
-                               size_t sa_len)
+                                const struct sockaddr *sa,
+                                size_t sa_len)
 {
   memcpy (&daemon->listen_sa,
-         sa,
-         sa_len);
+          sa,
+          sa_len);
   daemon->listen_sa_len = sa_len;
 }
 
@@ -223,7 +223,7 @@ MHD_daemon_bind_socket_address (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_listen_backlog (struct MHD_Daemon *daemon,
-                          int listen_backlog)
+                           int listen_backlog)
 {
   daemon->listen_backlog = listen_backlog;
 }
@@ -275,7 +275,7 @@ MHD_daemon_enable_shoutcast (struct MHD_Daemon *daemon)
  */
 void
 MHD_daemon_listen_socket (struct MHD_Daemon *daemon,
-                         MHD_socket listen_socket)
+                          MHD_socket listen_socket)
 {
   daemon->listen_socket = listen_socket;
 }
@@ -290,7 +290,7 @@ MHD_daemon_listen_socket (struct MHD_Daemon *daemon,
  */
 enum MHD_Bool
 MHD_daemon_event_loop (struct MHD_Daemon *daemon,
-                      enum MHD_EventLoopSyscall els)
+                       enum MHD_EventLoopSyscall els)
 {
   switch (els)
   {
@@ -326,7 +326,7 @@ MHD_daemon_event_loop (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_protocol_strict_level (struct MHD_Daemon *daemon,
-                                 enum MHD_ProtocolStrictLevel sl)
+                                  enum MHD_ProtocolStrictLevel sl)
 {
   daemon->protocol_strict_level = sl;
 }
@@ -349,8 +349,8 @@ MHD_daemon_protocol_strict_level (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
-                           const char *tls_backend,
-                           const char *ciphers)
+                            const char *tls_backend,
+                            const char *ciphers)
 {
 #if ! (defined(HTTPS_SUPPORT) && defined (HAVE_DLFCN_H))
   return MHD_SC_TLS_DISABLED;
@@ -361,18 +361,18 @@ MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
 
   /* todo: .dll on W32? */
   res = MHD_snprintf_ (filename,
-                      sizeof (filename),
-                      "%s/libmicrohttpd_tls_%s.so",
-                      MHD_PLUGIN_INSTALL_PREFIX,
-                      tls_backend);
+                       sizeof (filename),
+                       "%s/libmicrohttpd_tls_%s.so",
+                       MHD_PLUGIN_INSTALL_PREFIX,
+                       tls_backend);
   if (0 >= res)
     return MHD_SC_TLS_BACKEND_UNSUPPORTED; /* string too long? */
   if (NULL ==
       (daemon->tls_backend_lib = dlopen (filename,
-                                        RTLD_NOW | RTLD_LOCAL)))
+                                         RTLD_NOW | RTLD_LOCAL)))
     return MHD_SC_TLS_BACKEND_UNSUPPORTED; /* plugin not found */
   if (NULL == (init = dlsym (daemon->tls_backend_lib,
-                            "MHD_TLS_init_" MHD_TLS_ABI_VERSION_STR)))
+                             "MHD_TLS_init_" MHD_TLS_ABI_VERSION_STR)))
 
   {
     dlclose (daemon->tls_backend_lib);
@@ -405,9 +405,9 @@ MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon,
-                                        const char *mem_key,
-                                        const char *mem_cert,
-                                        const char *pass)
+                                         const char *mem_key,
+                                         const char *mem_cert,
+                                         const char *pass)
 {
 #ifndef HTTPS_SUPPORT
   return MHD_SC_TLS_DISABLED;
@@ -417,9 +417,9 @@ MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon 
*daemon,
   if (NULL == (plugin = daemon->tls_api))
     return MHD_SC_TLS_BACKEND_UNINITIALIZED;
   return plugin->init_kcp (plugin->cls,
-                          mem_key,
-                          mem_cert,
-                          pass);
+                           mem_key,
+                           mem_cert,
+                           pass);
 #endif
 }
 
@@ -435,7 +435,7 @@ MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon 
*daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
-                            const char *dh)
+                             const char *dh)
 {
 #ifndef HTTPS_SUPPORT
   return MHD_SC_TLS_DISABLED;
@@ -445,7 +445,7 @@ MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
   if (NULL == (plugin = daemon->tls_api))
     return MHD_SC_TLS_BACKEND_UNINITIALIZED;
   return plugin->init_dhparams (plugin->cls,
-                               dh);
+                                dh);
 #endif
 }
 
@@ -461,7 +461,7 @@ MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
-                         const char *mem_trust)
+                          const char *mem_trust)
 {
 #ifndef HTTPS_SUPPORT
   return MHD_SC_TLS_DISABLED;
@@ -471,7 +471,7 @@ MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
   if (NULL == (plugin = daemon->tls_api))
     return MHD_SC_TLS_BACKEND_UNINITIALIZED;
   return plugin->init_mem_trust (plugin->cls,
-                                mem_trust);
+                                 mem_trust);
 #endif
 }
 
@@ -485,7 +485,7 @@ MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon,
-                              int gnutls_credentials)
+                               int gnutls_credentials)
 {
 #ifndef HTTPS_SUPPORT
   return MHD_SC_TLS_DISABLED;
@@ -518,7 +518,7 @@ MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_gnutls_key_and_cert_from_callback (struct MHD_Daemon *daemon,
-                                             void *cb)
+                                              void *cb)
 {
 #ifndef HTTPS_SUPPORT
   return MHD_SC_TLS_DISABLED;
@@ -541,7 +541,7 @@ MHD_daemon_gnutls_key_and_cert_from_callback (struct 
MHD_Daemon *daemon,
  */
 void
 MHD_daemon_threading_mode (struct MHD_Daemon *daemon,
-                           enum MHD_ThreadingMode tm)
+                           enum MHD_ThreadingMode tm)
 {
   daemon->threading_mode = tm;
 }
@@ -558,8 +558,8 @@ MHD_daemon_threading_mode (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_accept_policy (struct MHD_Daemon *daemon,
-                         MHD_AcceptPolicyCallback apc,
-                         void *apc_cls)
+                          MHD_AcceptPolicyCallback apc,
+                          void *apc_cls)
 {
   daemon->accept_policy_cb = apc;
   daemon->accept_policy_cb_cls = apc_cls;
@@ -577,8 +577,8 @@ MHD_daemon_accept_policy (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_set_early_uri_logger (struct MHD_Daemon *daemon,
-                                MHD_EarlyUriLogCallback cb,
-                                void *cb_cls)
+                                 MHD_EarlyUriLogCallback cb,
+                                 void *cb_cls)
 {
   daemon->early_uri_logger_cb = cb;
   daemon->early_uri_logger_cb_cls = cb_cls;
@@ -595,8 +595,8 @@ MHD_daemon_set_early_uri_logger (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_set_notify_connection (struct MHD_Daemon *daemon,
-                                 MHD_NotifyConnectionCallback ncc,
-                                 void *ncc_cls)
+                                  MHD_NotifyConnectionCallback ncc,
+                                  void *ncc_cls)
 {
   daemon->notify_connection_cb = ncc;
   daemon->notify_connection_cb_cls = ncc_cls;
@@ -616,8 +616,8 @@ MHD_daemon_set_notify_connection (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_connection_memory_limit (struct MHD_Daemon *daemon,
-                                   size_t memory_limit_b,
-                                   size_t memory_increment_b)
+                                    size_t memory_limit_b,
+                                    size_t memory_increment_b)
 {
   if (memory_increment_b >= memory_limit_b)
     MHD_PANIC ("sane memory increment must be below memory limit");
@@ -636,7 +636,7 @@ MHD_daemon_connection_memory_limit (struct MHD_Daemon 
*daemon,
  */
 void
 MHD_daemon_thread_stack_size (struct MHD_Daemon *daemon,
-                             size_t stack_limit_b)
+                              size_t stack_limit_b)
 {
   daemon->thread_stack_limit_b = stack_limit_b;
 }
@@ -659,8 +659,8 @@ MHD_daemon_thread_stack_size (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_connection_limits (struct MHD_Daemon *daemon,
-                             unsigned int global_connection_limit,
-                             unsigned int ip_connection_limit)
+                              unsigned int global_connection_limit,
+                              unsigned int ip_connection_limit)
 {
   daemon->global_connection_limit = global_connection_limit;
   daemon->ip_connection_limit = ip_connection_limit;
@@ -677,7 +677,7 @@ MHD_daemon_connection_limits (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_connection_default_timeout (struct MHD_Daemon *daemon,
-                                      unsigned int timeout_s)
+                                       unsigned int timeout_s)
 {
   daemon->connection_default_timeout = (time_t) timeout_s;
 }
@@ -696,8 +696,8 @@ MHD_daemon_connection_default_timeout (struct MHD_Daemon 
*daemon,
  */
 void
 MHD_daemon_unescape_cb (struct MHD_Daemon *daemon,
-                       MHD_UnescapeCallback unescape_cb,
-                       void *unescape_cb_cls)
+                        MHD_UnescapeCallback unescape_cb,
+                        void *unescape_cb_cls)
 {
   daemon->unescape_cb = unescape_cb;
   daemon->unescape_cb_cls = unescape_cb_cls;
@@ -715,8 +715,8 @@ MHD_daemon_unescape_cb (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_digest_auth_random (struct MHD_Daemon *daemon,
-                              size_t buf_size,
-                              const void *buf)
+                               size_t buf_size,
+                               const void *buf)
 {
 #if ENABLE_DAUTH
   daemon->digest_auth_random_buf = buf;
@@ -739,34 +739,34 @@ MHD_daemon_digest_auth_random (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_digest_auth_nc_length (struct MHD_Daemon *daemon,
-                                 size_t nc_length)
+                                  size_t nc_length)
 {
 #if ENABLE_DAUTH
-  if ( ( (size_t) (nc_length * sizeof (struct MHD_NonceNc))) /
-       sizeof (struct MHD_NonceNc) != nc_length)
-    {
+  if ( ( (size_t) (nc_length * sizeof (struct MHD_NonceNc)))
+       / sizeof (struct MHD_NonceNc) != nc_length)
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("Specified value for NC_SIZE too large\n"));
+    MHD_DLOG (daemon,
+              _ ("Specified value for NC_SIZE too large\n"));
 #endif
-      return MHD_SC_DIGEST_AUTH_NC_LENGTH_TOO_BIG;
-    }
+    return MHD_SC_DIGEST_AUTH_NC_LENGTH_TOO_BIG;
+  }
   if (0 < nc_length)
+  {
+    if (NULL != daemon->nnc)
+      free (daemon->nnc);
+    daemon->nnc = malloc (daemon->nonce_nc_size
+                          * sizeof (struct MHD_NonceNc));
+    if (NULL == daemon->nnc)
     {
-      if (NULL != daemon->nnc)
-       free (daemon->nnc);
-      daemon->nnc = malloc (daemon->nonce_nc_size *
-                           sizeof (struct MHD_NonceNc));
-      if (NULL == daemon->nnc)
-       {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   _("Failed to allocate memory for nonce-nc map: %s\n"),
-                   MHD_strerror_ (errno));
+      MHD_DLOG (daemon,
+                _ ("Failed to allocate memory for nonce-nc map: %s\n"),
+                MHD_strerror_ (errno));
 #endif
-         return MHD_SC_DIGEST_AUTH_NC_ALLOCATION_FAILURE;
-       }
+      return MHD_SC_DIGEST_AUTH_NC_ALLOCATION_FAILURE;
     }
+  }
   daemon->digest_nc_length = nc_length;
   return MHD_SC_OK;
 #else
diff --git a/src/lib/daemon_poll.c b/src/lib/daemon_poll.c
index 80599e93..1fea9fd6 100644
--- a/src/lib/daemon_poll.c
+++ b/src/lib/daemon_poll.c
@@ -45,7 +45,7 @@
  */
 static void
 urh_update_pollfd (struct MHD_UpgradeResponseHandle *urh,
-                  struct pollfd p[2])
+                   struct pollfd p[2])
 {
   p[0].events = 0;
   p[1].events = 0;
@@ -86,12 +86,12 @@ urh_update_pollfd (struct MHD_UpgradeResponseHandle *urh,
  */
 static void
 urh_to_pollfd (struct MHD_UpgradeResponseHandle *urh,
-              struct pollfd p[2])
+               struct pollfd p[2])
 {
   p[0].fd = urh->connection->socket_fd;
   p[1].fd = urh->mhd.socket;
   urh_update_pollfd (urh,
-                    p);
+                     p);
 }
 
 
@@ -102,7 +102,7 @@ urh_to_pollfd (struct MHD_UpgradeResponseHandle *urh,
  */
 static void
 urh_from_pollfd (struct MHD_UpgradeResponseHandle *urh,
-                struct pollfd p[2])
+                 struct pollfd p[2])
 {
   /* Reset read/write ready, preserve error state. */
   urh->app.celi &= (~MHD_EPOLL_STATE_READ_READY & 
~MHD_EPOLL_STATE_WRITE_READY);
@@ -138,7 +138,7 @@ urh_from_pollfd (struct MHD_UpgradeResponseHandle *urh,
  */
 enum MHD_StatusCode
 MHD_daemon_poll_all_ (struct MHD_Daemon *daemon,
-                     bool may_block)
+                      bool may_block)
 {
   unsigned int num_connections;
   struct MHD_Connection *pos;
@@ -171,103 +171,103 @@ MHD_daemon_poll_all_ (struct MHD_Daemon *daemon,
     MHD_socket ls;
 
     p = MHD_calloc_ ((2 + num_connections),
-                    sizeof (struct pollfd));
+                     sizeof (struct pollfd));
     if (NULL == p)
-      {
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (daemon,
-                 MHD_SC_POLL_MALLOC_FAILURE,
-                  _("Error allocating memory: %s\n"),
-                  MHD_strerror_(errno));
+      MHD_DLOG (daemon,
+                MHD_SC_POLL_MALLOC_FAILURE,
+                _ ("Error allocating memory: %s\n"),
+                MHD_strerror_ (errno));
 #endif
-        return MHD_SC_POLL_MALLOC_FAILURE;
-      }
+      return MHD_SC_POLL_MALLOC_FAILURE;
+    }
     poll_server = 0;
     poll_listen = -1;
     if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_socket)) &&
          (! daemon->was_quiesced) &&
-        (daemon->connections < daemon->global_connection_limit) &&
+         (daemon->connections < daemon->global_connection_limit) &&
          (! daemon->at_limit) )
-      {
-       /* only listen if we are not at the connection limit */
-       p[poll_server].fd = ls;
-       p[poll_server].events = POLLIN;
-       p[poll_server].revents = 0;
-       poll_listen = (int) poll_server;
-       poll_server++;
-      }
+    {
+      /* only listen if we are not at the connection limit */
+      p[poll_server].fd = ls;
+      p[poll_server].events = POLLIN;
+      p[poll_server].revents = 0;
+      poll_listen = (int) poll_server;
+      poll_server++;
+    }
     poll_itc_idx = -1;
-    if (MHD_ITC_IS_VALID_(daemon->itc))
-      {
-       p[poll_server].fd = MHD_itc_r_fd_ (daemon->itc);
-       p[poll_server].events = POLLIN;
-       p[poll_server].revents = 0;
-        poll_itc_idx = (int) poll_server;
-       poll_server++;
-      }
+    if (MHD_ITC_IS_VALID_ (daemon->itc))
+    {
+      p[poll_server].fd = MHD_itc_r_fd_ (daemon->itc);
+      p[poll_server].events = POLLIN;
+      p[poll_server].revents = 0;
+      poll_itc_idx = (int) poll_server;
+      poll_server++;
+    }
     if (! may_block)
       timeout = 0;
     else if ( (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) ||
-             (MHD_SC_OK != /* FIXME: distinguish between NO_TIMEOUT and 
errors! */
-              MHD_daemon_get_timeout (daemon,
-                                      &ltimeout)) )
+              (MHD_SC_OK != /* FIXME: distinguish between NO_TIMEOUT and 
errors! */
+               MHD_daemon_get_timeout (daemon,
+                                       &ltimeout)) )
       timeout = -1;
     else
       timeout = (ltimeout > INT_MAX) ? INT_MAX : (int) ltimeout;
 
     i = 0;
     for (pos = daemon->connections_tail; NULL != pos; pos = pos->prev)
+    {
+      p[poll_server + i].fd = pos->socket_fd;
+      switch (pos->request.event_loop_info)
       {
-       p[poll_server+i].fd = pos->socket_fd;
-       switch (pos->request.event_loop_info)
-         {
-         case MHD_EVENT_LOOP_INFO_READ:
-           p[poll_server+i].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
-           break;
-         case MHD_EVENT_LOOP_INFO_WRITE:
-           p[poll_server+i].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
-           break;
-         case MHD_EVENT_LOOP_INFO_BLOCK:
-           p[poll_server+i].events |=  MHD_POLL_EVENTS_ERR_DISC;
-           break;
-         case MHD_EVENT_LOOP_INFO_CLEANUP:
-           timeout = 0; /* clean up "pos" immediately */
-           break;
-         }
-       i++;
+      case MHD_EVENT_LOOP_INFO_READ:
+        p[poll_server + i].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_WRITE:
+        p[poll_server + i].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_BLOCK:
+        p[poll_server + i].events |=  MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_CLEANUP:
+        timeout = 0; /* clean up "pos" immediately */
+        break;
       }
+      i++;
+    }
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
     for (urh = daemon->urh_tail; NULL != urh; urh = urh->prev)
-      {
-        urh_to_pollfd (urh,
-                      &(p[poll_server+i]));
-        i += 2;
-      }
+    {
+      urh_to_pollfd (urh,
+                     &(p[poll_server + i]));
+      i += 2;
+    }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
     if (0 == poll_server + num_connections)
+    {
+      free (p);
+      return MHD_SC_OK;
+    }
+    if (MHD_sys_poll_ (p,
+                       poll_server + num_connections,
+                       timeout) < 0)
+    {
+      const int err = MHD_socket_get_error_ ();
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
       {
         free (p);
         return MHD_SC_OK;
       }
-    if (MHD_sys_poll_(p,
-                      poll_server + num_connections,
-                      timeout) < 0)
-      {
-        const int err = MHD_socket_get_error_ ();
-       if (MHD_SCKT_ERR_IS_EINTR_ (err))
-      {
-        free(p);
-        return MHD_SC_OK;
-      }
 #ifdef HAVE_MESSAGES
-       MHD_DLOG (daemon,
-                 MHD_SC_UNEXPECTED_POLL_ERROR,
-                 _("poll failed: %s\n"),
-                 MHD_socket_strerr_ (err));
+      MHD_DLOG (daemon,
+                MHD_SC_UNEXPECTED_POLL_ERROR,
+                _ ("poll failed: %s\n"),
+                MHD_socket_strerr_ (err));
 #endif
-        free(p);
-       return MHD_SC_UNEXPECTED_POLL_ERROR;
-      }
+      free (p);
+      return MHD_SC_UNEXPECTED_POLL_ERROR;
+    }
 
     /* Reset. New value will be set when connections are processed. */
     daemon->data_already_pending = false;
@@ -281,67 +281,69 @@ MHD_daemon_poll_all_ (struct MHD_Daemon *daemon,
 
     /* handle shutdown */
     if (daemon->shutdown)
-      {
-        free(p);
-        return MHD_SC_DAEMON_ALREADY_SHUTDOWN;
-      }
+    {
+      free (p);
+      return MHD_SC_DAEMON_ALREADY_SHUTDOWN;
+    }
     i = 0;
     prev = daemon->connections_tail;
     while (NULL != (pos = prev))
-      {
-       prev = pos->prev;
-        /* first, sanity checks */
-        if (i >= num_connections)
-          break; /* connection list changed somehow, retry later ... */
-        if (p[poll_server+i].fd != pos->socket_fd)
-          continue; /* fd mismatch, something else happened, retry later ... */
-        MHD_connection_call_handlers_ (pos,
-                                      0 != (p[poll_server+i].revents & POLLIN),
-                                      0 != (p[poll_server+i].revents & 
POLLOUT),
-                                      0 != (p[poll_server+i].revents & 
MHD_POLL_REVENTS_ERR_DISC));
-        i++;
-      }
+    {
+      prev = pos->prev;
+      /* first, sanity checks */
+      if (i >= num_connections)
+        break;   /* connection list changed somehow, retry later ... */
+      if (p[poll_server + i].fd != pos->socket_fd)
+        continue;   /* fd mismatch, something else happened, retry later ... */
+      MHD_connection_call_handlers_ (pos,
+                                     0 != (p[poll_server + i].revents & 
POLLIN),
+                                     0 != (p[poll_server + i].revents
+                                           & POLLOUT),
+                                     0 != (p[poll_server + i].revents
+                                           & MHD_POLL_REVENTS_ERR_DISC));
+      i++;
+    }
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
     for (urh = daemon->urh_tail; NULL != urh; urh = urhn)
+    {
+      if (i >= num_connections)
+        break;   /* connection list changed somehow, retry later ... */
+
+      /* Get next connection here as connection can be removed
+       * from 'daemon->urh_head' list. */
+      urhn = urh->prev;
+      /* Check for fd mismatch. FIXME: required for safety? */
+      if ((p[poll_server + i].fd != urh->connection->socket_fd) ||
+          (p[poll_server + i + 1].fd != urh->mhd.socket))
+        break;
+      urh_from_pollfd (urh,
+                       &p[poll_server + i]);
+      i += 2;
+      MHD_upgrade_response_handle_process_ (urh);
+      /* Finished forwarding? */
+      if ( (0 == urh->in_buffer_size) &&
+           (0 == urh->out_buffer_size) &&
+           (0 == urh->in_buffer_used) &&
+           (0 == urh->out_buffer_used) )
       {
-        if (i >= num_connections)
-          break; /* connection list changed somehow, retry later ... */
-
-        /* Get next connection here as connection can be removed
-         * from 'daemon->urh_head' list. */
-        urhn = urh->prev;
-        /* Check for fd mismatch. FIXME: required for safety? */
-        if ((p[poll_server+i].fd != urh->connection->socket_fd) ||
-            (p[poll_server+i+1].fd != urh->mhd.socket))
-          break;
-        urh_from_pollfd (urh,
-                        &p[poll_server+i]);
-        i += 2;
-        MHD_upgrade_response_handle_process_ (urh);
-        /* Finished forwarding? */
-        if ( (0 == urh->in_buffer_size) &&
-             (0 == urh->out_buffer_size) &&
-             (0 == urh->in_buffer_used) &&
-             (0 == urh->out_buffer_used) )
-          {
-            /* MHD_connection_finish_forward_() will remove connection from
-             * 'daemon->urh_head' list. */
-            MHD_connection_finish_forward_ (urh->connection);
-            urh->clean_ready = true;
-            /* If 'urh->was_closed' already was set to true, connection will be
-             * moved immediately to cleanup list. Otherwise connection
-             * will stay in suspended list until 'urh' will be marked
-             * with 'was_closed' by application. */
-            MHD_request_resume (&urh->connection->request);
-          }
+        /* MHD_connection_finish_forward_() will remove connection from
+         * 'daemon->urh_head' list. */
+        MHD_connection_finish_forward_ (urh->connection);
+        urh->clean_ready = true;
+        /* If 'urh->was_closed' already was set to true, connection will be
+         * moved immediately to cleanup list. Otherwise connection
+         * will stay in suspended list until 'urh' will be marked
+         * with 'was_closed' by application. */
+        MHD_request_resume (&urh->connection->request);
       }
+    }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
     /* handle 'listen' FD */
     if ( (-1 != poll_listen) &&
-        (0 != (p[poll_listen].revents & POLLIN)) )
+         (0 != (p[poll_listen].revents & POLLIN)) )
       (void) MHD_accept_connection_ (daemon);
 
-    free(p);
+    free (p);
   }
   return MHD_SC_OK;
 }
@@ -356,7 +358,7 @@ MHD_daemon_poll_all_ (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_poll_listen_socket_ (struct MHD_Daemon *daemon,
-                               bool may_block)
+                                bool may_block)
 {
   struct pollfd p[2];
   int timeout;
@@ -374,21 +376,21 @@ MHD_daemon_poll_listen_socket_ (struct MHD_Daemon *daemon,
   if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_socket)) &&
        (! daemon->was_quiesced) )
 
-    {
-      p[poll_count].fd = ls;
-      p[poll_count].events = POLLIN;
-      p[poll_count].revents = 0;
-      poll_listen = poll_count;
-      poll_count++;
-    }
-  if (MHD_ITC_IS_VALID_(daemon->itc))
-    {
-      p[poll_count].fd = MHD_itc_r_fd_ (daemon->itc);
-      p[poll_count].events = POLLIN;
-      p[poll_count].revents = 0;
-      poll_itc_idx = poll_count;
-      poll_count++;
-    }
+  {
+    p[poll_count].fd = ls;
+    p[poll_count].events = POLLIN;
+    p[poll_count].revents = 0;
+    poll_listen = poll_count;
+    poll_count++;
+  }
+  if (MHD_ITC_IS_VALID_ (daemon->itc))
+  {
+    p[poll_count].fd = MHD_itc_r_fd_ (daemon->itc);
+    p[poll_count].events = POLLIN;
+    p[poll_count].revents = 0;
+    poll_itc_idx = poll_count;
+    poll_count++;
+  }
 
   if (! daemon->disallow_suspend_resume)
     (void) MHD_resume_suspended_connections_ (daemon);
@@ -399,22 +401,22 @@ MHD_daemon_poll_listen_socket_ (struct MHD_Daemon *daemon,
     timeout = -1;
   if (0 == poll_count)
     return MHD_SC_OK;
-  if (MHD_sys_poll_(p,
-                    poll_count,
-                    timeout) < 0)
-    {
-      const int err = MHD_socket_get_error_ ();
+  if (MHD_sys_poll_ (p,
+                     poll_count,
+                     timeout) < 0)
+  {
+    const int err = MHD_socket_get_error_ ();
 
-      if (MHD_SCKT_ERR_IS_EINTR_ (err))
-       return MHD_SC_OK;
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return MHD_SC_OK;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_UNEXPECTED_POLL_ERROR,
-                _("poll failed: %s\n"),
-                MHD_socket_strerr_ (err));
+    MHD_DLOG (daemon,
+              MHD_SC_UNEXPECTED_POLL_ERROR,
+              _ ("poll failed: %s\n"),
+              MHD_socket_strerr_ (err));
 #endif
-      return MHD_SC_UNEXPECTED_POLL_ERROR;
-    }
+    return MHD_SC_UNEXPECTED_POLL_ERROR;
+  }
   if ( (-1 != poll_itc_idx) &&
        (0 != (p[poll_itc_idx].revents & POLLIN)) )
     MHD_itc_clear_ (daemon->itc);
@@ -439,16 +441,16 @@ MHD_daemon_poll_listen_socket_ (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_poll_ (struct MHD_Daemon *daemon,
-                 bool may_block)
+                  bool may_block)
 {
 #ifdef HAVE_POLL
   if (daemon->shutdown)
     return MHD_SC_DAEMON_ALREADY_SHUTDOWN;
   if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode)
     return MHD_daemon_poll_all_ (daemon,
-                                may_block);
+                                 may_block);
   return MHD_daemon_poll_listen_socket_ (daemon,
-                                        may_block);
+                                         may_block);
 #else
   /* This code should be dead, as we should have checked
      this earlier... */
@@ -472,47 +474,47 @@ MHD_daemon_upgrade_connection_with_poll_ (struct 
MHD_Connection *con)
   struct pollfd p[2];
 
   memset (p,
-         0,
-         sizeof (p));
+          0,
+          sizeof (p));
   p[0].fd = urh->connection->socket_fd;
   p[1].fd = urh->mhd.socket;
 
   while ( (0 != urh->in_buffer_size) ||
-         (0 != urh->out_buffer_size) ||
-         (0 != urh->in_buffer_used) ||
-         (0 != urh->out_buffer_used) )
-    {
-      int timeout;
+          (0 != urh->out_buffer_size) ||
+          (0 != urh->in_buffer_used) ||
+          (0 != urh->out_buffer_used) )
+  {
+    int timeout;
 
-      urh_update_pollfd (urh,
-                        p);
+    urh_update_pollfd (urh,
+                       p);
 
-      if ( (con->tls_read_ready) &&
-          (urh->in_buffer_used < urh->in_buffer_size))
-       timeout = 0; /* No need to wait if incoming data is already pending in 
TLS buffers. */
-      else
-       timeout = -1;
+    if ( (con->tls_read_ready) &&
+         (urh->in_buffer_used < urh->in_buffer_size))
+      timeout = 0; /* No need to wait if incoming data is already pending in 
TLS buffers. */
+    else
+      timeout = -1;
 
-      if (MHD_sys_poll_ (p,
-                        2,
-                        timeout) < 0)
-       {
-         const int err = MHD_socket_get_error_ ();
+    if (MHD_sys_poll_ (p,
+                       2,
+                       timeout) < 0)
+    {
+      const int err = MHD_socket_get_error_ ();
 
-         if (MHD_SCKT_ERR_IS_EINTR_ (err))
-           continue;
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
+        continue;
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (con->daemon,
-                   MHD_SC_UNEXPECTED_POLL_ERROR,
-                   _("Error during poll: `%s'\n"),
-                   MHD_socket_strerr_ (err));
+      MHD_DLOG (con->daemon,
+                MHD_SC_UNEXPECTED_POLL_ERROR,
+                _ ("Error during poll: `%s'\n"),
+                MHD_socket_strerr_ (err));
 #endif
-         break;
-       }
-      urh_from_pollfd (urh,
-                      p);
-      MHD_upgrade_response_handle_process_ (urh);
+      break;
     }
+    urh_from_pollfd (urh,
+                     p);
+    MHD_upgrade_response_handle_process_ (urh);
+  }
 }
 #endif
 #endif
diff --git a/src/lib/daemon_poll.h b/src/lib/daemon_poll.h
index fc5663b0..3c408620 100644
--- a/src/lib/daemon_poll.h
+++ b/src/lib/daemon_poll.h
@@ -37,8 +37,8 @@
  */
 enum MHD_StatusCode
 MHD_daemon_poll_all_ (struct MHD_Daemon *daemon,
-                     bool may_block)
-  MHD_NONNULL(1);
+                      bool may_block)
+MHD_NONNULL (1);
 
 
 /**
@@ -50,8 +50,8 @@ MHD_daemon_poll_all_ (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_poll_listen_socket_ (struct MHD_Daemon *daemon,
-                               bool may_block)
-  MHD_NONNULL (1);
+                                bool may_block)
+MHD_NONNULL (1);
 
 
 /**
@@ -63,8 +63,8 @@ MHD_daemon_poll_listen_socket_ (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_poll_ (struct MHD_Daemon *daemon,
-                 bool may_block)
-  MHD_NONNULL (1);
+                  bool may_block)
+MHD_NONNULL (1);
 #endif
 
 
@@ -78,7 +78,7 @@ MHD_daemon_poll_ (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_upgrade_connection_with_poll_ (struct MHD_Connection *con)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 #endif
 #endif
 
diff --git a/src/lib/daemon_quiesce.c b/src/lib/daemon_quiesce.c
index 0d920608..c7275099 100644
--- a/src/lib/daemon_quiesce.c
+++ b/src/lib/daemon_quiesce.c
@@ -54,75 +54,76 @@ MHD_daemon_quiesce (struct MHD_Daemon *daemon)
     return MHD_INVALID_SOCKET;
   if ( (daemon->disable_itc) &&
        (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_SYSCALL_QUIESCE_REQUIRES_ITC,
-               "Using MHD_quiesce_daemon in this mode requires ITC\n");
+    MHD_DLOG (daemon,
+              MHD_SC_SYSCALL_QUIESCE_REQUIRES_ITC,
+              "Using MHD_quiesce_daemon in this mode requires ITC\n");
 #endif
-      return MHD_INVALID_SOCKET;
-    }
+    return MHD_INVALID_SOCKET;
+  }
 
   if (NULL != daemon->worker_pool)
+  {
+    unsigned int i;
+
+    for (i = 0; i < daemon->worker_pool_size; i++)
     {
-      unsigned int i;
+      struct MHD_Daemon *worker = &daemon->worker_pool[i];
 
-      for (i = 0; i < daemon->worker_pool_size; i++)
-       {
-         struct MHD_Daemon *worker = &daemon->worker_pool[i];
-         
-         worker->was_quiesced = true;
-#ifdef EPOLL_SUPPORT
-         if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
-              (-1 != worker->epoll_fd) &&
-              (worker->listen_socket_in_epoll) )
-           {
-             if (0 != epoll_ctl (worker->epoll_fd,
-                                 EPOLL_CTL_DEL,
-                                 listen_socket,
-                                 NULL))
-               MHD_PANIC (_("Failed to remove listen FD from epoll set\n"));
-             worker->listen_socket_in_epoll = false;
-           }
-         else
-#endif
-           if (MHD_ITC_IS_VALID_(worker->itc))
-             {
-               if (! MHD_itc_activate_ (worker->itc,
-                                        "q"))
-                 MHD_PANIC (_("Failed to signal quiesce via inter-thread 
communication channel"));
-             }
-       }
-      daemon->was_quiesced = true;
+      worker->was_quiesced = true;
 #ifdef EPOLL_SUPPORT
       if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
-          (-1 != daemon->epoll_fd) &&
-          (daemon->listen_socket_in_epoll) )
-       {
-         if (0 != epoll_ctl (daemon->epoll_fd,
-                             EPOLL_CTL_DEL,
-                             listen_socket,
-                             NULL))
-           MHD_PANIC ("Failed to remove listen FD from epoll set\n");
-         daemon->listen_socket_in_epoll = false;
-       }
+           (-1 != worker->epoll_fd) &&
+           (worker->listen_socket_in_epoll) )
+      {
+        if (0 != epoll_ctl (worker->epoll_fd,
+                            EPOLL_CTL_DEL,
+                            listen_socket,
+                            NULL))
+          MHD_PANIC (_ ("Failed to remove listen FD from epoll set\n"));
+        worker->listen_socket_in_epoll = false;
+      }
+      else
 #endif
+      if (MHD_ITC_IS_VALID_ (worker->itc))
+      {
+        if (! MHD_itc_activate_ (worker->itc,
+                                 "q"))
+          MHD_PANIC (_ (
+                       "Failed to signal quiesce via inter-thread 
communication channel"));
+      }
     }
-  
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+    daemon->was_quiesced = true;
+#ifdef EPOLL_SUPPORT
+    if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
+         (-1 != daemon->epoll_fd) &&
+         (daemon->listen_socket_in_epoll) )
+    {
+      if (0 != epoll_ctl (daemon->epoll_fd,
+                          EPOLL_CTL_DEL,
+                          listen_socket,
+                          NULL))
+        MHD_PANIC ("Failed to remove listen FD from epoll set\n");
+      daemon->listen_socket_in_epoll = false;
+    }
+#endif
+  }
+
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_itc_activate_ (daemon->itc,
-                            "q")) )
-    MHD_PANIC (_("Failed to signal quiesce via inter-thread communication 
channel"));
+                             "q")) )
+    MHD_PANIC (_ (
+                 "Failed to signal quiesce via inter-thread communication 
channel"));
 
   /* FIXME: we might want some bi-directional communication here
-     (in both the thread-pool and single-thread case!) 
+     (in both the thread-pool and single-thread case!)
      to be sure that the threads have stopped using the listen
      socket, otherwise there is still the possibility of a race
      between a thread accept()ing and the caller closing and
      re-binding the socket. */
-  
+
   return listen_socket;
 }
 
 /* end of daemon_quiesce.c */
-
diff --git a/src/lib/daemon_run.c b/src/lib/daemon_run.c
index 129f7efb..cae500da 100644
--- a/src/lib/daemon_run.c
+++ b/src/lib/daemon_run.c
@@ -57,26 +57,26 @@ MHD_daemon_run (struct MHD_Daemon *daemon)
   if (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode)
     return MHD_SC_CONFIGURATION_MISMATCH_FOR_RUN_EXTERNAL;
   switch (daemon->event_loop_syscall)
-    {
-    case MHD_ELS_POLL:
-      sc = MHD_daemon_poll_ (daemon,
-                            MHD_NO);
-      MHD_connection_cleanup_ (daemon);
-      return sc;
+  {
+  case MHD_ELS_POLL:
+    sc = MHD_daemon_poll_ (daemon,
+                           MHD_NO);
+    MHD_connection_cleanup_ (daemon);
+    return sc;
 #ifdef EPOLL_SUPPORT
-    case MHD_ELS_EPOLL:
-      sc = MHD_daemon_epoll_ (daemon,
-                             MHD_NO);
-      MHD_connection_cleanup_ (daemon);
-      return sc;
+  case MHD_ELS_EPOLL:
+    sc = MHD_daemon_epoll_ (daemon,
+                            MHD_NO);
+    MHD_connection_cleanup_ (daemon);
+    return sc;
 #endif
-    case MHD_ELS_SELECT:
-      return MHD_daemon_select_ (daemon,
-                                MHD_NO);
-      /* MHD_select does MHD_connection_cleanup_ already */
-    default:
-      return MHD_SC_CONFIGURATION_UNEXPECTED_ELS;
-    }
+  case MHD_ELS_SELECT:
+    return MHD_daemon_select_ (daemon,
+                               MHD_NO);
+  /* MHD_select does MHD_connection_cleanup_ already */
+  default:
+    return MHD_SC_CONFIGURATION_UNEXPECTED_ELS;
+  }
 }
 
 /* end of daemon_run.c */
diff --git a/src/lib/daemon_select.c b/src/lib/daemon_select.c
index 08281d8c..69913a9a 100644
--- a/src/lib/daemon_select.c
+++ b/src/lib/daemon_select.c
@@ -66,17 +66,17 @@
  */
 enum MHD_StatusCode
 MHD_daemon_get_fdset (struct MHD_Daemon *daemon,
-                     fd_set *read_fd_set,
-                     fd_set *write_fd_set,
-                     fd_set *except_fd_set,
-                     MHD_socket *max_fd)
+                      fd_set *read_fd_set,
+                      fd_set *write_fd_set,
+                      fd_set *except_fd_set,
+                      MHD_socket *max_fd)
 {
   return MHD_daemon_get_fdset2 (daemon,
-                               read_fd_set,
-                               write_fd_set,
-                               except_fd_set,
-                               max_fd,
-                               _MHD_SYS_DEFAULT_FD_SETSIZE);
+                                read_fd_set,
+                                write_fd_set,
+                                except_fd_set,
+                                max_fd,
+                                _MHD_SYS_DEFAULT_FD_SETSIZE);
 }
 
 
@@ -108,55 +108,55 @@ urh_to_fdset (struct MHD_UpgradeResponseHandle *urh,
   /* Do not add to 'es' only if socket is closed
    * or not used anymore. */
   if (MHD_INVALID_SOCKET != conn_sckt)
-    {
-      if ( (urh->in_buffer_used < urh->in_buffer_size) &&
-           (! MHD_add_to_fd_set_ (conn_sckt,
-                                  rs,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      if ( (0 != urh->out_buffer_used) &&
-           (! MHD_add_to_fd_set_ (conn_sckt,
-                                  ws,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      /* Do not monitor again for errors if error was detected before as
-       * error state is remembered. */
-      if ((0 == (urh->app.celi & MHD_EPOLL_STATE_ERROR)) &&
-          ((0 != urh->in_buffer_size) ||
-           (0 != urh->out_buffer_size) ||
-           (0 != urh->out_buffer_used)))
-        MHD_add_to_fd_set_ (conn_sckt,
-                            es,
-                            max_fd,
-                            fd_setsize);
-    }
+  {
+    if ( (urh->in_buffer_used < urh->in_buffer_size) &&
+         (! MHD_add_to_fd_set_ (conn_sckt,
+                                rs,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    if ( (0 != urh->out_buffer_used) &&
+         (! MHD_add_to_fd_set_ (conn_sckt,
+                                ws,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    /* Do not monitor again for errors if error was detected before as
+     * error state is remembered. */
+    if ((0 == (urh->app.celi & MHD_EPOLL_STATE_ERROR)) &&
+        ((0 != urh->in_buffer_size) ||
+         (0 != urh->out_buffer_size) ||
+         (0 != urh->out_buffer_used)))
+      MHD_add_to_fd_set_ (conn_sckt,
+                          es,
+                          max_fd,
+                          fd_setsize);
+  }
   if (MHD_INVALID_SOCKET != mhd_sckt)
-    {
-      if ( (urh->out_buffer_used < urh->out_buffer_size) &&
-           (! MHD_add_to_fd_set_ (mhd_sckt,
-                                  rs,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      if ( (0 != urh->in_buffer_used) &&
-           (! MHD_add_to_fd_set_ (mhd_sckt,
-                                  ws,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      /* Do not monitor again for errors if error was detected before as
-       * error state is remembered. */
-      if ((0 == (urh->mhd.celi & MHD_EPOLL_STATE_ERROR)) &&
-          ((0 != urh->out_buffer_size) ||
-           (0 != urh->in_buffer_size) ||
-           (0 != urh->in_buffer_used)))
-        MHD_add_to_fd_set_ (mhd_sckt,
-                            es,
-                            max_fd,
-                            fd_setsize);
-    }
+  {
+    if ( (urh->out_buffer_used < urh->out_buffer_size) &&
+         (! MHD_add_to_fd_set_ (mhd_sckt,
+                                rs,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    if ( (0 != urh->in_buffer_used) &&
+         (! MHD_add_to_fd_set_ (mhd_sckt,
+                                ws,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    /* Do not monitor again for errors if error was detected before as
+     * error state is remembered. */
+    if ((0 == (urh->mhd.celi & MHD_EPOLL_STATE_ERROR)) &&
+        ((0 != urh->out_buffer_size) ||
+         (0 != urh->in_buffer_size) ||
+         (0 != urh->in_buffer_used)))
+      MHD_add_to_fd_set_ (mhd_sckt,
+                          es,
+                          max_fd,
+                          fd_setsize);
+  }
 
   return res;
 }
@@ -207,77 +207,77 @@ internal_get_fdset2 (struct MHD_Daemon *daemon,
    * or INFO_WRITE sockets will not fit 'except_fd_set'. */
   /* Start from oldest connections. Make sense for W32 FDSETs. */
   for (pos = daemon->connections_tail; NULL != pos; pos = posn)
+  {
+    posn = pos->prev;
+
+    switch (pos->request.event_loop_info)
     {
-      posn = pos->prev;
-
-      switch (pos->request.event_loop_info)
-       {
-       case MHD_EVENT_LOOP_INFO_READ:
-         if (! MHD_add_to_fd_set_ (pos->socket_fd,
-                                    read_fd_set,
-                                    max_fd,
-                                    fd_setsize))
-           result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
+    case MHD_EVENT_LOOP_INFO_READ:
+      if (! MHD_add_to_fd_set_ (pos->socket_fd,
+                                read_fd_set,
+                                max_fd,
+                                fd_setsize))
+        result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
 #ifdef MHD_POSIX_SOCKETS
-          MHD_add_to_fd_set_ (pos->socket_fd,
-                              except_fd_set,
-                              max_fd,
-                              fd_setsize);
+      MHD_add_to_fd_set_ (pos->socket_fd,
+                          except_fd_set,
+                          max_fd,
+                          fd_setsize);
 #endif /* MHD_POSIX_SOCKETS */
-         break;
-       case MHD_EVENT_LOOP_INFO_WRITE:
-         if (! MHD_add_to_fd_set_ (pos->socket_fd,
-                                    write_fd_set,
-                                    max_fd,
-                                    fd_setsize))
-           result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
+      break;
+    case MHD_EVENT_LOOP_INFO_WRITE:
+      if (! MHD_add_to_fd_set_ (pos->socket_fd,
+                                write_fd_set,
+                                max_fd,
+                                fd_setsize))
+        result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
 #ifdef MHD_POSIX_SOCKETS
-          MHD_add_to_fd_set_ (pos->socket_fd,
-                              except_fd_set,
-                              max_fd,
-                              fd_setsize);
+      MHD_add_to_fd_set_ (pos->socket_fd,
+                          except_fd_set,
+                          max_fd,
+                          fd_setsize);
 #endif /* MHD_POSIX_SOCKETS */
-         break;
-       case MHD_EVENT_LOOP_INFO_BLOCK:
-         if ( (NULL == except_fd_set) ||
-             ! MHD_add_to_fd_set_ (pos->socket_fd,
-                                   except_fd_set,
-                                    max_fd,
-                                    fd_setsize))
-            result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
-         break;
-       case MHD_EVENT_LOOP_INFO_CLEANUP:
-         /* this should never happen */
-         break;
-       }
+      break;
+    case MHD_EVENT_LOOP_INFO_BLOCK:
+      if ( (NULL == except_fd_set) ||
+           ! MHD_add_to_fd_set_ (pos->socket_fd,
+                                 except_fd_set,
+                                 max_fd,
+                                 fd_setsize))
+        result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
+      break;
+    case MHD_EVENT_LOOP_INFO_CLEANUP:
+      /* this should never happen */
+      break;
     }
+  }
 #ifdef MHD_WINSOCK_SOCKETS
   /* W32 use limited array for fd_set so add INFO_READ/INFO_WRITE sockets
    * only after INFO_BLOCK sockets to ensure that INFO_BLOCK sockets will
    * not be pushed out. */
   for (pos = daemon->connections_tail; NULL != pos; pos = posn)
-    {
-      posn = pos->prev;
-      MHD_add_to_fd_set_ (pos->socket_fd,
-                          except_fd_set,
-                          max_fd,
-                          fd_setsize);
-    }
+  {
+    posn = pos->prev;
+    MHD_add_to_fd_set_ (pos->socket_fd,
+                        except_fd_set,
+                        max_fd,
+                        fd_setsize);
+  }
 #endif /* MHD_WINSOCK_SOCKETS */
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   {
     struct MHD_UpgradeResponseHandle *urh;
 
     for (urh = daemon->urh_tail; NULL != urh; urh = urh->prev)
-      {
-        if (! urh_to_fdset (urh,
-                           read_fd_set,
-                           write_fd_set,
-                           except_fd_set,
-                           max_fd,
-                           fd_setsize))
-          result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
-      }
+    {
+      if (! urh_to_fdset (urh,
+                          read_fd_set,
+                          write_fd_set,
+                          except_fd_set,
+                          max_fd,
+                          fd_setsize))
+        result = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
+    }
   }
 #endif
   return result;
@@ -313,11 +313,11 @@ internal_get_fdset2 (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
-                      fd_set *read_fd_set,
-                      fd_set *write_fd_set,
-                      fd_set *except_fd_set,
-                      MHD_socket *max_fd,
-                      unsigned int fd_setsize)
+                       fd_set *read_fd_set,
+                       fd_set *write_fd_set,
+                       fd_set *except_fd_set,
+                       MHD_socket *max_fd,
+                       unsigned int fd_setsize)
 {
   if ( (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode) ||
        (MHD_ELS_POLL == daemon->event_loop_syscall) )
@@ -325,28 +325,28 @@ MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
 
 #ifdef EPOLL_SUPPORT
   if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
-    {
-      if (daemon->shutdown)
-        return MHD_SC_DAEMON_ALREADY_SHUTDOWN;
-
-      /* we're in epoll mode, use the epoll FD as a stand-in for
-         the entire event set */
-
-      return MHD_add_to_fd_set_ (daemon->epoll_fd,
-                                 read_fd_set,
-                                 max_fd,
-                                 fd_setsize)
-       ? MHD_SC_OK
-       : MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
-    }
+  {
+    if (daemon->shutdown)
+      return MHD_SC_DAEMON_ALREADY_SHUTDOWN;
+
+    /* we're in epoll mode, use the epoll FD as a stand-in for
+       the entire event set */
+
+    return MHD_add_to_fd_set_ (daemon->epoll_fd,
+                               read_fd_set,
+                               max_fd,
+                               fd_setsize)
+           ? MHD_SC_OK
+           : MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
+  }
 #endif
 
   return internal_get_fdset2 (daemon,
-                             read_fd_set,
+                              read_fd_set,
                               write_fd_set,
-                             except_fd_set,
+                              except_fd_set,
                               max_fd,
-                             fd_setsize);
+                              fd_setsize);
 }
 
 
@@ -374,23 +374,23 @@ urh_from_fdset (struct MHD_UpgradeResponseHandle *urh,
   urh->mhd.celi &= (~MHD_EPOLL_STATE_READ_READY & 
~MHD_EPOLL_STATE_WRITE_READY);
 
   if (MHD_INVALID_SOCKET != conn_sckt)
-    {
-      if (FD_ISSET (conn_sckt, rs))
-        urh->app.celi |= MHD_EPOLL_STATE_READ_READY;
-      if (FD_ISSET (conn_sckt, ws))
-        urh->app.celi |= MHD_EPOLL_STATE_WRITE_READY;
-      if (FD_ISSET (conn_sckt, es))
-        urh->app.celi |= MHD_EPOLL_STATE_ERROR;
-    }
+  {
+    if (FD_ISSET (conn_sckt, rs))
+      urh->app.celi |= MHD_EPOLL_STATE_READ_READY;
+    if (FD_ISSET (conn_sckt, ws))
+      urh->app.celi |= MHD_EPOLL_STATE_WRITE_READY;
+    if (FD_ISSET (conn_sckt, es))
+      urh->app.celi |= MHD_EPOLL_STATE_ERROR;
+  }
   if ((MHD_INVALID_SOCKET != mhd_sckt))
-    {
-      if (FD_ISSET (mhd_sckt, rs))
-        urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
-      if (FD_ISSET (mhd_sckt, ws))
-        urh->mhd.celi |= MHD_EPOLL_STATE_WRITE_READY;
-      if (FD_ISSET (mhd_sckt, es))
-        urh->mhd.celi |= MHD_EPOLL_STATE_ERROR;
-    }
+  {
+    if (FD_ISSET (mhd_sckt, rs))
+      urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
+    if (FD_ISSET (mhd_sckt, ws))
+      urh->mhd.celi |= MHD_EPOLL_STATE_WRITE_READY;
+    if (FD_ISSET (mhd_sckt, es))
+      urh->mhd.celi |= MHD_EPOLL_STATE_ERROR;
+  }
 }
 #endif
 
@@ -425,7 +425,7 @@ internal_run_from_select (struct MHD_Daemon *daemon,
   /* Clear ITC to avoid spinning select */
   /* Do it before any other processing so new signals
      will trigger select again and will be processed */
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
                   read_fd_set)) )
     MHD_itc_clear_ (daemon->itc);
@@ -438,49 +438,49 @@ internal_run_from_select (struct MHD_Daemon *daemon,
     (void) MHD_accept_connection_ (daemon);
 
   if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode)
+  {
+    /* do not have a thread per connection, process all connections now */
+    prev = daemon->connections_tail;
+    while (NULL != (pos = prev))
     {
-      /* do not have a thread per connection, process all connections now */
-      prev = daemon->connections_tail;
-      while (NULL != (pos = prev))
-        {
-         prev = pos->prev;
-          ds = pos->socket_fd;
-          if (MHD_INVALID_SOCKET == ds)
-           continue;
-          MHD_connection_call_handlers_ (pos,
-                                        FD_ISSET (ds,
-                                                  read_fd_set),
-                                        FD_ISSET (ds,
-                                                  write_fd_set),
-                                        FD_ISSET (ds,
-                                                  except_fd_set));
-        }
+      prev = pos->prev;
+      ds = pos->socket_fd;
+      if (MHD_INVALID_SOCKET == ds)
+        continue;
+      MHD_connection_call_handlers_ (pos,
+                                     FD_ISSET (ds,
+                                               read_fd_set),
+                                     FD_ISSET (ds,
+                                               write_fd_set),
+                                     FD_ISSET (ds,
+                                               except_fd_set));
     }
+  }
 
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   /* handle upgraded HTTPS connections */
   for (urh = daemon->urh_tail; NULL != urh; urh = urhn)
+  {
+    urhn = urh->prev;
+    /* update urh state based on select() output */
+    urh_from_fdset (urh,
+                    read_fd_set,
+                    write_fd_set,
+                    except_fd_set);
+    /* call generic forwarding function for passing data */
+    MHD_upgrade_response_handle_process_ (urh);
+    /* Finished forwarding? */
+    if ( (0 == urh->in_buffer_size) &&
+         (0 == urh->out_buffer_size) &&
+         (0 == urh->in_buffer_used) &&
+         (0 == urh->out_buffer_used) )
     {
-      urhn = urh->prev;
-      /* update urh state based on select() output */
-      urh_from_fdset (urh,
-                      read_fd_set,
-                      write_fd_set,
-                      except_fd_set);
-      /* call generic forwarding function for passing data */
-      MHD_upgrade_response_handle_process_ (urh);
-      /* Finished forwarding? */
-      if ( (0 == urh->in_buffer_size) &&
-           (0 == urh->out_buffer_size) &&
-           (0 == urh->in_buffer_used) &&
-           (0 == urh->out_buffer_used) )
-        {
-          MHD_connection_finish_forward_ (urh->connection);
-          urh->clean_ready = true;
-          /* Resuming will move connection to cleanup list. */
-          MHD_request_resume (&urh->connection->request);
-        }
+      MHD_connection_finish_forward_ (urh->connection);
+      urh->clean_ready = true;
+      /* Resuming will move connection to cleanup list. */
+      MHD_request_resume (&urh->connection->request);
     }
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   MHD_connection_cleanup_ (daemon);
   return MHD_SC_OK;
@@ -500,80 +500,80 @@ MHD_daemon_upgrade_connection_with_select_ (struct 
MHD_Connection *con)
   struct MHD_UpgradeResponseHandle *urh = con->request.urh;
 
   while ( (0 != urh->in_buffer_size) ||
-         (0 != urh->out_buffer_size) ||
-         (0 != urh->in_buffer_used) ||
-         (0 != urh->out_buffer_used) )
+          (0 != urh->out_buffer_size) ||
+          (0 != urh->in_buffer_used) ||
+          (0 != urh->out_buffer_used) )
+  {
+    /* use select */
+    fd_set rs;
+    fd_set ws;
+    fd_set es;
+    MHD_socket max_fd;
+    int num_ready;
+    bool result;
+
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    max_fd = MHD_INVALID_SOCKET;
+    result = urh_to_fdset (urh,
+                           &rs,
+                           &ws,
+                           &es,
+                           &max_fd,
+                           FD_SETSIZE);
+    if (! result)
     {
-      /* use select */
-      fd_set rs;
-      fd_set ws;
-      fd_set es;
-      MHD_socket max_fd;
-      int num_ready;
-      bool result;
-
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      max_fd = MHD_INVALID_SOCKET;
-      result = urh_to_fdset (urh,
-                            &rs,
-                            &ws,
-                            &es,
-                            &max_fd,
-                            FD_SETSIZE);
-      if (! result)
-       {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (con->daemon,
-                   MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
-                   _("Error preparing select\n"));
+      MHD_DLOG (con->daemon,
+                MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
+                _ ("Error preparing select\n"));
 #endif
-         break;
-       }
-      /* FIXME: does this check really needed? */
-      if (MHD_INVALID_SOCKET != max_fd)
-       {
-         struct timeval* tvp;
-         struct timeval tv;
-         if ( (con->tls_read_ready) &&
-              (urh->in_buffer_used < urh->in_buffer_size))
-           { /* No need to wait if incoming data is already pending in TLS 
buffers. */
-             tv.tv_sec = 0;
-             tv.tv_usec = 0;
-             tvp = &tv;
-           }
-         else
-           tvp = NULL;
-         num_ready = MHD_SYS_select_ (max_fd + 1,
-                                      &rs,
-                                      &ws,
-                                      &es,
-                                      tvp);
-       }
+      break;
+    }
+    /* FIXME: does this check really needed? */
+    if (MHD_INVALID_SOCKET != max_fd)
+    {
+      struct timeval*tvp;
+      struct timeval tv;
+      if ( (con->tls_read_ready) &&
+           (urh->in_buffer_used < urh->in_buffer_size))
+      { /* No need to wait if incoming data is already pending in TLS buffers. 
*/
+        tv.tv_sec = 0;
+        tv.tv_usec = 0;
+        tvp = &tv;
+      }
       else
-       num_ready = 0;
-      if (num_ready < 0)
-       {
-         const int err = MHD_socket_get_error_();
+        tvp = NULL;
+      num_ready = MHD_SYS_select_ (max_fd + 1,
+                                   &rs,
+                                   &ws,
+                                   &es,
+                                   tvp);
+    }
+    else
+      num_ready = 0;
+    if (num_ready < 0)
+    {
+      const int err = MHD_socket_get_error_ ();
 
-         if (MHD_SCKT_ERR_IS_EINTR_(err))
-           continue;
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
+        continue;
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (con->daemon,
-                   MHD_SC_UNEXPECTED_SELECT_ERROR,
-                   _("Error during select (%d): `%s'\n"),
-                   err,
-                   MHD_socket_strerr_ (err));
+      MHD_DLOG (con->daemon,
+                MHD_SC_UNEXPECTED_SELECT_ERROR,
+                _ ("Error during select (%d): `%s'\n"),
+                err,
+                MHD_socket_strerr_ (err));
 #endif
-         break;
-       }
-      urh_from_fdset (urh,
-                     &rs,
-                     &ws,
-                     &es);
-      MHD_upgrade_response_handle_process_ (urh);
+      break;
     }
+    urh_from_fdset (urh,
+                    &rs,
+                    &ws,
+                    &es);
+    MHD_upgrade_response_handle_process_ (urh);
+  }
 }
 #endif
 
@@ -602,37 +602,37 @@ MHD_daemon_upgrade_connection_with_select_ (struct 
MHD_Connection *con)
  */
 enum MHD_StatusCode
 MHD_daemon_run_from_select (struct MHD_Daemon *daemon,
-                           const fd_set *read_fd_set,
+                            const fd_set *read_fd_set,
 
 
-                           const fd_set *write_fd_set,
-                           const fd_set *except_fd_set)
+                            const fd_set *write_fd_set,
+                            const fd_set *except_fd_set)
 {
   if ( (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_mode) ||
        (MHD_ELS_POLL == daemon->event_loop_syscall) )
     return MHD_SC_CONFIGURATION_MISSMATCH_FOR_RUN_SELECT;
   if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
-    {
+  {
 #ifdef EPOLL_SUPPORT
-      enum MHD_StatusCode sc;
+    enum MHD_StatusCode sc;
 
-      sc = MHD_daemon_epoll_ (daemon,
-                             MHD_NO);
-      MHD_connection_cleanup_ (daemon);
-      return sc;
+    sc = MHD_daemon_epoll_ (daemon,
+                            MHD_NO);
+    MHD_connection_cleanup_ (daemon);
+    return sc;
 #else  /* ! EPOLL_SUPPORT */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* ! EPOLL_SUPPORT */
-    }
+  }
 
   /* Resuming external connections when using an extern mainloop  */
   if (! daemon->disallow_suspend_resume)
     (void) MHD_resume_suspended_connections_ (daemon);
 
   return internal_run_from_select (daemon,
-                                  read_fd_set,
+                                   read_fd_set,
                                    write_fd_set,
-                                  except_fd_set);
+                                   except_fd_set);
 }
 
 
@@ -646,7 +646,7 @@ MHD_daemon_run_from_select (struct MHD_Daemon *daemon,
  */
 enum MHD_StatusCode
 MHD_daemon_select_ (struct MHD_Daemon *daemon,
-                   int may_block)
+                    int may_block)
 {
   int num_ready;
   fd_set rs;
@@ -675,74 +675,75 @@ MHD_daemon_select_ (struct MHD_Daemon *daemon,
     may_block = MHD_NO;
 
   if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode)
-    {
+  {
 
-      /* single-threaded, go over everything */
-      if (MHD_SC_OK !=
-         (sc = internal_get_fdset2 (daemon,
-                                    &rs,
-                                    &ws,
-                                    &es,
-                                    &maxsock,
-                                    FD_SETSIZE)))
-        {
+    /* single-threaded, go over everything */
+    if (MHD_SC_OK !=
+        (sc = internal_get_fdset2 (daemon,
+                                   &rs,
+                                   &ws,
+                                   &es,
+                                   &maxsock,
+                                   FD_SETSIZE)))
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   sc,
-                   _("Could not obtain daemon fdsets"));
+      MHD_DLOG (daemon,
+                sc,
+                _ ("Could not obtain daemon fdsets"));
 #endif
-        }
     }
+  }
   else
+  {
+    /* accept only, have one thread per connection */
+    if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_socket)) &&
+         (! daemon->was_quiesced) &&
+         (! MHD_add_to_fd_set_ (ls,
+                                &rs,
+                                &maxsock,
+                                FD_SETSIZE)) )
     {
-      /* accept only, have one thread per connection */
-      if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_socket)) &&
-           (! daemon->was_quiesced) &&
-           (! MHD_add_to_fd_set_ (ls,
-                                  &rs,
-                                  &maxsock,
-                                  FD_SETSIZE)) )
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
-                    _("Could not add listen socket to fdset"));
+      MHD_DLOG (daemon,
+                MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE,
+                _ ("Could not add listen socket to fdset"));
 #endif
-          return MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
-        }
+      return MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
     }
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  }
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
                               &rs,
                               &maxsock,
                               FD_SETSIZE)) )
-    {
+  {
 #if defined(MHD_WINSOCK_SOCKETS)
-      /* fdset limit reached, new connections
-         cannot be handled. Remove listen socket FD
-         from fdset and retry to add ITC FD. */
-      if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_socket)) &&
-           (! daemon->was_quiesced) )
-        {
-          FD_CLR (ls,
-                  &rs);
-          if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_(daemon->itc),
-                                    &rs,
-                                    &maxsock,
-                                    FD_SETSIZE))
-            {
+    /* fdset limit reached, new connections
+       cannot be handled. Remove listen socket FD
+       from fdset and retry to add ITC FD. */
+    if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_socket)) &&
+         (! daemon->was_quiesced) )
+    {
+      FD_CLR (ls,
+              &rs);
+      if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
+                                &rs,
+                                &maxsock,
+                                FD_SETSIZE))
+      {
 #endif /* MHD_WINSOCK_SOCKETS */
-              sc = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
+    sc = MHD_SC_SOCKET_OUTSIDE_OF_FDSET_RANGE;
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                       sc,
-                        _("Could not add control inter-thread communication 
channel FD to fdset"));
+    MHD_DLOG (daemon,
+              sc,
+              _ (
+                "Could not add control inter-thread communication channel FD 
to fdset"));
 #endif
 #if defined(MHD_WINSOCK_SOCKETS)
-            }
-        }
+  }
+}
 #endif /* MHD_WINSOCK_SOCKETS */
-    }
+  }
   /* Stop listening if we are at the configured connection limit */
   /* If we're at the connection limit, no point in really
      accepting new connections; however, make sure we do not miss
@@ -750,35 +751,35 @@ MHD_daemon_select_ (struct MHD_Daemon *daemon,
      only do this optimization if we have a signaling ITC in
      place. */
   if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_socket)) &&
-       (MHD_ITC_IS_VALID_(daemon->itc)) &&
+       (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        ( (daemon->connections == daemon->global_connection_limit) ||
          (daemon->at_limit) ) )
-    {
-      FD_CLR (ls,
-              &rs);
-    }
+  {
+    FD_CLR (ls,
+            &rs);
+  }
   tv = NULL;
   if (MHD_SC_OK != sc)
     may_block = MHD_NO;
   if (MHD_NO == may_block)
-    {
-      timeout.tv_usec = 0;
-      timeout.tv_sec = 0;
-      tv = &timeout;
-    }
+  {
+    timeout.tv_usec = 0;
+    timeout.tv_sec = 0;
+    tv = &timeout;
+  }
   else if ( (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode) &&
-           (MHD_SC_OK ==
-            MHD_daemon_get_timeout (daemon,
-                                    &ltimeout)) )
-    {
-      /* ltimeout is in ms */
-      timeout.tv_usec = (ltimeout % 1000) * 1000;
-      if (ltimeout / 1000 > TIMEVAL_TV_SEC_MAX)
-        timeout.tv_sec = TIMEVAL_TV_SEC_MAX;
-      else
-        timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE)(ltimeout / 1000);
-      tv = &timeout;
-    }
+            (MHD_SC_OK ==
+             MHD_daemon_get_timeout (daemon,
+                                     &ltimeout)) )
+  {
+    /* ltimeout is in ms */
+    timeout.tv_usec = (ltimeout % 1000) * 1000;
+    if (ltimeout / 1000 > TIMEVAL_TV_SEC_MAX)
+      timeout.tv_sec = TIMEVAL_TV_SEC_MAX;
+    else
+      timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) (ltimeout / 1000);
+    tv = &timeout;
+  }
   num_ready = MHD_SYS_select_ (maxsock + 1,
                                &rs,
                                &ws,
@@ -787,24 +788,24 @@ MHD_daemon_select_ (struct MHD_Daemon *daemon,
   if (daemon->shutdown)
     return MHD_SC_DAEMON_ALREADY_SHUTDOWN;
   if (num_ready < 0)
-    {
-      const int err = MHD_socket_get_error_ ();
+  {
+    const int err = MHD_socket_get_error_ ();
 
-      if (MHD_SCKT_ERR_IS_EINTR_(err))
-        return sc;
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return sc;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_UNEXPECTED_SELECT_ERROR,
-                _("select failed: %s\n"),
-                MHD_socket_strerr_ (err));
+    MHD_DLOG (daemon,
+              MHD_SC_UNEXPECTED_SELECT_ERROR,
+              _ ("select failed: %s\n"),
+              MHD_socket_strerr_ (err));
 #endif
-      return MHD_SC_UNEXPECTED_SELECT_ERROR;
-    }
+    return MHD_SC_UNEXPECTED_SELECT_ERROR;
+  }
   if (MHD_SC_OK !=
       (sc2 = internal_run_from_select (daemon,
-                                      &rs,
-                                      &ws,
-                                      &es)))
+                                       &rs,
+                                       &ws,
+                                       &es)))
     return sc2;
   return sc;
 }
diff --git a/src/lib/daemon_select.h b/src/lib/daemon_select.h
index d6e9e106..7dac8a80 100644
--- a/src/lib/daemon_select.h
+++ b/src/lib/daemon_select.h
@@ -36,8 +36,8 @@
  */
 enum MHD_StatusCode
 MHD_daemon_select_ (struct MHD_Daemon *daemon,
-                   int may_block)
-  MHD_NONNULL(1);
+                    int may_block)
+MHD_NONNULL (1);
 
 
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
@@ -49,7 +49,7 @@ MHD_daemon_select_ (struct MHD_Daemon *daemon,
  */
 void
 MHD_daemon_upgrade_connection_with_select_ (struct MHD_Connection *con)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 #endif
 
 #endif
diff --git a/src/lib/daemon_start.c b/src/lib/daemon_start.c
index 52124c77..c8c498be 100644
--- a/src/lib/daemon_start.c
+++ b/src/lib/daemon_start.c
@@ -46,63 +46,64 @@ configure_listen_reuse (struct MHD_Daemon *daemon)
   /* Apply the socket options according to
      listening_address_reuse. */
   if (daemon->allow_address_reuse)
-    {
-      /* User requested to allow reusing listening address:port. */
+  {
+    /* User requested to allow reusing listening address:port. */
 #ifndef MHD_WINSOCK_SOCKETS
-      /* Use SO_REUSEADDR on non-W32 platforms, and do not fail if
-       * it doesn't work. */
-      if (0 > setsockopt (daemon->listen_socket,
-                         SOL_SOCKET,
-                         SO_REUSEADDR,
-                         (void *) &on,
-                         sizeof (on)))
-       {
+    /* Use SO_REUSEADDR on non-W32 platforms, and do not fail if
+     * it doesn't work. */
+    if (0 > setsockopt (daemon->listen_socket,
+                        SOL_SOCKET,
+                        SO_REUSEADDR,
+                        (void *) &on,
+                        sizeof (on)))
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED,
-                   _("setsockopt failed: %s\n"),
-                   MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED,
+                _ ("setsockopt failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-         return MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED;
-       }
-      return MHD_SC_OK;
+      return MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED;
+    }
+    return MHD_SC_OK;
 #endif /* ! MHD_WINSOCK_SOCKETS */
-      /* Use SO_REUSEADDR on Windows and SO_REUSEPORT on most platforms.
-       * Fail if SO_REUSEPORT is not defined or setsockopt fails.
-       */
-      /* SO_REUSEADDR on W32 has the same semantics
-        as SO_REUSEPORT on BSD/Linux */
+       /* Use SO_REUSEADDR on Windows and SO_REUSEPORT on most platforms.
+        * Fail if SO_REUSEPORT is not defined or setsockopt fails.
+        */
+       /* SO_REUSEADDR on W32 has the same semantics
+    as SO_REUSEPORT on BSD/Linux */
 #if defined(MHD_WINSOCK_SOCKETS) || defined(SO_REUSEPORT)
-      if (0 > setsockopt (daemon->listen_socket,
-                         SOL_SOCKET,
+    if (0 > setsockopt (daemon->listen_socket,
+                        SOL_SOCKET,
 #ifndef MHD_WINSOCK_SOCKETS
-                         SO_REUSEPORT,
+                        SO_REUSEPORT,
 #else  /* MHD_WINSOCK_SOCKETS */
-                         SO_REUSEADDR,
+                        SO_REUSEADDR,
 #endif /* MHD_WINSOCK_SOCKETS */
-                         (void *) &on,
-                         sizeof (on)))
-       {
+                        (void *) &on,
+                        sizeof (on)))
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED,
-                   _("setsockopt failed: %s\n"),
-                   MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED,
+                _ ("setsockopt failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-         return MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED;
-       }
-      return MHD_SC_OK;
+      return MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_FAILED;
+    }
+    return MHD_SC_OK;
 #else  /* !MHD_WINSOCK_SOCKETS && !SO_REUSEPORT */
-      /* we're supposed to allow address:port re-use, but
-        on this platform we cannot; fail hard */
+       /* we're supposed to allow address:port re-use, but
+    on this platform we cannot; fail hard */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_NOT_SUPPORTED,
-               _("Cannot allow listening address reuse: SO_REUSEPORT not 
defined\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_NOT_SUPPORTED,
+              _ (
+                "Cannot allow listening address reuse: SO_REUSEPORT not 
defined\n"));
 #endif
-      return MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_NOT_SUPPORTED;
+    return MHD_SC_LISTEN_ADDRESS_REUSE_ENABLE_NOT_SUPPORTED;
 #endif /* !MHD_WINSOCK_SOCKETS && !SO_REUSEPORT */
-    }
+  }
 
   /* if (! daemon->allow_address_reuse) */
   /* User requested to disallow reusing listening address:port.
@@ -111,32 +112,33 @@ configure_listen_reuse (struct MHD_Daemon *daemon)
    * Fail if MHD was compiled for W32 without SO_EXCLUSIVEADDRUSE
    * or setsockopt fails.
    */
-#if (defined(MHD_WINSOCK_SOCKETS) && defined(SO_EXCLUSIVEADDRUSE)) ||  \
+#if (defined(MHD_WINSOCK_SOCKETS) && defined(SO_EXCLUSIVEADDRUSE)) || \
   (defined(__sun) && defined(SO_EXCLBIND))
   if (0 > setsockopt (daemon->listen_socket,
-                     SOL_SOCKET,
+                      SOL_SOCKET,
 #ifdef SO_EXCLUSIVEADDRUSE
-                     SO_EXCLUSIVEADDRUSE,
+                      SO_EXCLUSIVEADDRUSE,
 #else  /* SO_EXCLBIND */
-                     SO_EXCLBIND,
+                      SO_EXCLBIND,
 #endif /* SO_EXCLBIND */
-                     (void *) &on,
-                     sizeof (on)))
-    {
+                      (void *) &on,
+                      sizeof (on)))
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_ADDRESS_REUSE_DISABLE_FAILED,
-               _("setsockopt failed: %s\n"),
-               MHD_socket_last_strerr_ ());
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_ADDRESS_REUSE_DISABLE_FAILED,
+              _ ("setsockopt failed: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      return MHD_SC_LISTEN_ADDRESS_REUSE_DISABLE_FAILED;
-    }
+    return MHD_SC_LISTEN_ADDRESS_REUSE_DISABLE_FAILED;
+  }
   return MHD_SC_OK;
 #elif defined(MHD_WINSOCK_SOCKETS) /* SO_EXCLUSIVEADDRUSE not defined on W32? 
*/
 #ifdef HAVE_MESSAGES
   MHD_DLOG (daemon,
-           MHD_SC_LISTEN_ADDRESS_REUSE_DISABLE_NOT_SUPPORTED,
-           _("Cannot disallow listening address reuse: SO_EXCLUSIVEADDRUSE not 
defined\n"));
+            MHD_SC_LISTEN_ADDRESS_REUSE_DISABLE_NOT_SUPPORTED,
+            _ (
+              "Cannot disallow listening address reuse: SO_EXCLUSIVEADDRUSE 
not defined\n"));
 #endif
   return MHD_SC_LISTEN_ADDRESS_REUSE_DISABLE_NOT_SUPPORTED;
 #endif /* MHD_WINSOCK_SOCKETS */
@@ -166,86 +168,86 @@ open_listen_socket (struct MHD_Daemon *daemon)
   pf = -1;
   /* Determine address family */
   switch (daemon->listen_af)
+  {
+  case MHD_AF_NONE:
+    if (0 == daemon->listen_sa_len)
     {
-    case MHD_AF_NONE:
-      if (0 == daemon->listen_sa_len)
-       {
-         /* no listening desired, that's OK */
-         return MHD_SC_OK;
-       }
-      /* we have a listen address, get AF from there! */
-      switch (daemon->listen_sa.ss_family)
-       {
-       case AF_INET:
-         pf = PF_INET;
-         use_v6 = false;
-         break;
+      /* no listening desired, that's OK */
+      return MHD_SC_OK;
+    }
+    /* we have a listen address, get AF from there! */
+    switch (daemon->listen_sa.ss_family)
+    {
+    case AF_INET:
+      pf = PF_INET;
+      use_v6 = false;
+      break;
 #ifdef AF_INET6
-       case AF_INET6:
-         pf = PF_INET6;
-         use_v6 = true;
-         break;
-#endif
-#ifdef AF_UNIX
-       case AF_UNIX:
-         pf = PF_UNIX;
-         use_v6 = false;
-         break;
-#endif
-       default:
-         return MHD_SC_AF_NOT_SUPPORTED_BY_BUILD;
-       } /* switch on ss_family */
-      break; /* MHD_AF_NONE */
-    case MHD_AF_AUTO:
-#if HAVE_INET6
+    case AF_INET6:
       pf = PF_INET6;
       use_v6 = true;
-#else
-      pf = PF_INET;
-      use_v6 = false;
-#endif
       break;
-    case MHD_AF_INET4:
+#endif
+#ifdef AF_UNIX
+    case AF_UNIX:
+      pf = PF_UNIX;
       use_v6 = false;
-      pf = PF_INET;
       break;
-    case MHD_AF_INET6:
-    case MHD_AF_DUAL:
+#endif
+    default:
+      return MHD_SC_AF_NOT_SUPPORTED_BY_BUILD;
+    } /* switch on ss_family */
+    break;   /* MHD_AF_NONE */
+  case MHD_AF_AUTO:
 #if HAVE_INET6
-      pf = PF_INET6;
-      use_v6 = true;
-      break;
+    pf = PF_INET6;
+    use_v6 = true;
+#else
+    pf = PF_INET;
+    use_v6 = false;
+#endif
+    break;
+  case MHD_AF_INET4:
+    use_v6 = false;
+    pf = PF_INET;
+    break;
+  case MHD_AF_INET6:
+  case MHD_AF_DUAL:
+#if HAVE_INET6
+    pf = PF_INET6;
+    use_v6 = true;
+    break;
 #else
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_IPV6_NOT_SUPPORTED_BY_BUILD,
-               _("IPv6 not supported by this build\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_IPV6_NOT_SUPPORTED_BY_BUILD,
+              _ ("IPv6 not supported by this build\n"));
 #endif
-      return MHD_SC_IPV6_NOT_SUPPORTED_BY_BUILD;
+    return MHD_SC_IPV6_NOT_SUPPORTED_BY_BUILD;
 #endif
-    }
+  }
   mhd_assert (-1 != pf);
   /* try to open listen socket */
- try_open_listen_socket:
-  daemon->listen_socket = MHD_socket_create_listen_(pf);
+try_open_listen_socket:
+  daemon->listen_socket = MHD_socket_create_listen_ (pf);
   if ( (MHD_INVALID_SOCKET == daemon->listen_socket) &&
        (MHD_AF_AUTO == daemon->listen_af) &&
        (use_v6) )
-    {
-      use_v6 = false;
-      pf = PF_INET;
-      goto try_open_listen_socket;
-    }
+  {
+    use_v6 = false;
+    pf = PF_INET;
+    goto try_open_listen_socket;
+  }
   if (MHD_INVALID_SOCKET == daemon->listen_socket)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_FAILED_TO_OPEN_LISTEN_SOCKET,
-               _("Failed to create socket for listening: %s\n"),
-               MHD_socket_last_strerr_ ());
+    MHD_DLOG (daemon,
+              MHD_SC_FAILED_TO_OPEN_LISTEN_SOCKET,
+              _ ("Failed to create socket for listening: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      return MHD_SC_FAILED_TO_OPEN_LISTEN_SOCKET;
-    }
+    return MHD_SC_FAILED_TO_OPEN_LISTEN_SOCKET;
+  }
 
   if (MHD_SC_OK !=
       (sc = configure_listen_reuse (daemon)))
@@ -253,156 +255,157 @@ open_listen_socket (struct MHD_Daemon *daemon)
 
   /* configure for dual stack (or not) */
   if (use_v6)
-    {
+  {
 #if defined IPPROTO_IPV6 && defined IPV6_V6ONLY
-      /* Note: "IPV6_V6ONLY" is declared by Windows Vista ff., see 
"IPPROTO_IPV6 Socket Options"
-        (http://msdn.microsoft.com/en-us/library/ms738574%28v=VS.85%29.aspx);
-        and may also be missing on older POSIX systems; good luck if you have 
any of those,
-        your IPv6 socket may then also bind against IPv4 anyway... */
-      const MHD_SCKT_OPT_BOOL_ v6_only =
-       (MHD_AF_INET6 == daemon->listen_af);
-      if (0 > setsockopt (daemon->listen_socket,
-                         IPPROTO_IPV6,
-                         IPV6_V6ONLY,
-                         (const void *) &v6_only,
-                         sizeof (v6_only)))
-       {
+    /* Note: "IPV6_V6ONLY" is declared by Windows Vista ff., see "IPPROTO_IPV6 
Socket Options"
+ (http://msdn.microsoft.com/en-us/library/ms738574%28v=VS.85%29.aspx);
+ and may also be missing on older POSIX systems; good luck if you have any of 
those,
+ your IPv6 socket may then also bind against IPv4 anyway... */
+    const MHD_SCKT_OPT_BOOL_ v6_only =
+      (MHD_AF_INET6 == daemon->listen_af);
+    if (0 > setsockopt (daemon->listen_socket,
+                        IPPROTO_IPV6,
+                        IPV6_V6ONLY,
+                        (const void *) &v6_only,
+                        sizeof (v6_only)))
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_LISTEN_DUAL_STACK_CONFIGURATION_FAILED,
-                   _("setsockopt failed: %s\n"),
-                   MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_LISTEN_DUAL_STACK_CONFIGURATION_FAILED,
+                _ ("setsockopt failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-       }
+    }
 #else
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_LISTEN_DUAL_STACK_CONFIGURATION_NOT_SUPPORTED,
-                   _("Cannot explicitly setup dual stack behavior on this 
platform\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_DUAL_STACK_CONFIGURATION_NOT_SUPPORTED,
+              _ (
+                "Cannot explicitly setup dual stack behavior on this 
platform\n"));
 #endif
 #endif
-    }
+  }
 
   /* Determine address to bind to */
   if (0 != daemon->listen_sa_len)
-    {
-      /* Bind address explicitly given */
-      sa = (const struct sockaddr *) &daemon->listen_sa;
-      addrlen = daemon->listen_sa_len;
-    }
+  {
+    /* Bind address explicitly given */
+    sa = (const struct sockaddr *) &daemon->listen_sa;
+    addrlen = daemon->listen_sa_len;
+  }
   else
-    {
-      /* Compute bind address based on port and AF */
+  {
+    /* Compute bind address based on port and AF */
 #if HAVE_INET6
-      if (use_v6)
-       {
+    if (use_v6)
+    {
 #ifdef IN6ADDR_ANY_INIT
-         static const struct in6_addr static_in6any = IN6ADDR_ANY_INIT;
+      static const struct in6_addr static_in6any = IN6ADDR_ANY_INIT;
 #endif
-         struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &ss;
+      struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &ss;
 
-         addrlen = sizeof (struct sockaddr_in6);
-         memset (sin6,
-                 0,
-                 sizeof (struct sockaddr_in6));
-         sin6->sin6_family = AF_INET6;
-         sin6->sin6_port = htons (daemon->listen_port);
+      addrlen = sizeof (struct sockaddr_in6);
+      memset (sin6,
+              0,
+              sizeof (struct sockaddr_in6));
+      sin6->sin6_family = AF_INET6;
+      sin6->sin6_port = htons (daemon->listen_port);
 #ifdef IN6ADDR_ANY_INIT
-         sin6->sin6_addr = static_in6any;
+      sin6->sin6_addr = static_in6any;
 #endif
 #if HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
-         sin6->sin6_len = sizeof (struct sockaddr_in6);
+      sin6->sin6_len = sizeof (struct sockaddr_in6);
 #endif
-       }
-      else
+    }
+    else
 #endif
-       {
-         struct sockaddr_in *sin4 = (struct sockaddr_in *) &ss;
-
-         addrlen = sizeof (struct sockaddr_in);
-         memset (sin4,
-                 0,
-                 sizeof (struct sockaddr_in));
-         sin4->sin_family = AF_INET;
-         sin4->sin_port = htons (daemon->listen_port);
-         if (0 != INADDR_ANY)
-           sin4->sin_addr.s_addr = htonl (INADDR_ANY);
+    {
+      struct sockaddr_in *sin4 = (struct sockaddr_in *) &ss;
+
+      addrlen = sizeof (struct sockaddr_in);
+      memset (sin4,
+              0,
+              sizeof (struct sockaddr_in));
+      sin4->sin_family = AF_INET;
+      sin4->sin_port = htons (daemon->listen_port);
+      if (0 != INADDR_ANY)
+        sin4->sin_addr.s_addr = htonl (INADDR_ANY);
 #if HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
-         sin4->sin_len = sizeof (struct sockaddr_in);
+      sin4->sin_len = sizeof (struct sockaddr_in);
 #endif
-       }
-      sa = (const struct sockaddr *) &ss;
     }
+    sa = (const struct sockaddr *) &ss;
+  }
 
   /* actually do the bind() */
   if (-1 == bind (daemon->listen_socket,
-                 sa,
-                 addrlen))
-    {
+                  sa,
+                  addrlen))
+  {
 #ifdef HAVE_MESSAGES
-      unsigned int port = 0;
-
-      switch (sa->sa_family)
-       {
-       case AF_INET:
-         if (addrlen == sizeof (struct sockaddr_in))
-           port = ntohs (((const struct sockaddr_in *) sa)->sin_port);
-         else
-           port = UINT16_MAX + 1; /* indicate size error */
-         break;
-       case AF_INET6:
-         if (addrlen == sizeof (struct sockaddr_in6))
-           port = ntohs (((const struct sockaddr_in6 *) sa)->sin6_port);
-         else
-           port = UINT16_MAX + 1; /* indicate size error */
-         break;
-       default:
-         port = UINT_MAX; /* AF_UNIX? */
-         break;
-       }
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_SOCKET_BIND_FAILED,
-               _("Failed to bind to port %u: %s\n"),
-               port,
-               MHD_socket_last_strerr_ ());
-#endif
-      return MHD_SC_LISTEN_SOCKET_BIND_FAILED;
+    unsigned int port = 0;
+
+    switch (sa->sa_family)
+    {
+    case AF_INET:
+      if (addrlen == sizeof (struct sockaddr_in))
+        port = ntohs (((const struct sockaddr_in *) sa)->sin_port);
+      else
+        port = UINT16_MAX + 1; /* indicate size error */
+      break;
+    case AF_INET6:
+      if (addrlen == sizeof (struct sockaddr_in6))
+        port = ntohs (((const struct sockaddr_in6 *) sa)->sin6_port);
+      else
+        port = UINT16_MAX + 1; /* indicate size error */
+      break;
+    default:
+      port = UINT_MAX; /* AF_UNIX? */
+      break;
     }
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_SOCKET_BIND_FAILED,
+              _ ("Failed to bind to port %u: %s\n"),
+              port,
+              MHD_socket_last_strerr_ ());
+#endif
+    return MHD_SC_LISTEN_SOCKET_BIND_FAILED;
+  }
 
   /* setup TCP_FASTOPEN */
 #ifdef TCP_FASTOPEN
   if (MHD_FOM_DISABLE != daemon->fast_open_method)
+  {
+    if (0 != setsockopt (daemon->listen_socket,
+                         IPPROTO_TCP,
+                         TCP_FASTOPEN,
+                         &daemon->fo_queue_length,
+                         sizeof (daemon->fo_queue_length)))
     {
-      if (0 != setsockopt (daemon->listen_socket,
-                          IPPROTO_TCP,
-                          TCP_FASTOPEN,
-                          &daemon->fo_queue_length,
-                          sizeof (daemon->fo_queue_length)))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_FAST_OPEN_FAILURE,
-                    _("setsockopt failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
-#endif
-         if (MHD_FOM_REQUIRE == daemon->fast_open_method)
-           return MHD_SC_FAST_OPEN_FAILURE;
-        }
-      }
+      MHD_DLOG (daemon,
+                MHD_SC_FAST_OPEN_FAILURE,
+                _ ("setsockopt failed: %s\n"),
+                MHD_socket_last_strerr_ ());
+#endif
+      if (MHD_FOM_REQUIRE == daemon->fast_open_method)
+        return MHD_SC_FAST_OPEN_FAILURE;
+    }
+  }
 #endif
 
   /* setup listening */
   if (0 > listen (daemon->listen_socket,
                   daemon->listen_backlog))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_FAILURE,
-               _("Failed to listen for connections: %s\n"),
-               MHD_socket_last_strerr_ ());
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_FAILURE,
+              _ ("Failed to listen for connections: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      return MHD_SC_LISTEN_FAILURE;
-    }
+    return MHD_SC_LISTEN_FAILURE;
+  }
   return MHD_SC_OK;
 }
 
@@ -426,65 +429,66 @@ get_listen_port_number (struct MHD_Daemon *daemon)
     return; /* nothing to be done */
 
   memset (&servaddr,
-         0,
-         sizeof (struct sockaddr_storage));
+          0,
+          sizeof (struct sockaddr_storage));
   addrlen = sizeof (servaddr);
   if (0 != getsockname (daemon->listen_socket,
-                       (struct sockaddr *) &servaddr,
-                       &addrlen))
-    {
+                        (struct sockaddr *) &servaddr,
+                        &addrlen))
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_PORT_INTROSPECTION_FAILURE,
-               _("Failed to get listen port number: %s\n"),
-               MHD_socket_last_strerr_ ());
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_PORT_INTROSPECTION_FAILURE,
+              _ ("Failed to get listen port number: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif /* HAVE_MESSAGES */
-      return;
-    }
+    return;
+  }
 #ifdef MHD_POSIX_SOCKETS
   if (sizeof (servaddr) < addrlen)
-    {
-      /* should be impossible with `struct sockaddr_storage` */
+  {
+    /* should be impossible with `struct sockaddr_storage` */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_PORT_INTROSPECTION_FAILURE,
-               _("Failed to get listen port number (`struct sockaddr_storage` 
too small!?)\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_PORT_INTROSPECTION_FAILURE,
+              _ (
+                "Failed to get listen port number (`struct sockaddr_storage` 
too small!?)\n"));
 #endif /* HAVE_MESSAGES */
-      return;
-    }
+    return;
+  }
 #endif /* MHD_POSIX_SOCKETS */
   switch (servaddr.ss_family)
+  {
+  case AF_INET:
     {
-    case AF_INET:
-      {
-       struct sockaddr_in *s4 = (struct sockaddr_in *) &servaddr;
+      struct sockaddr_in *s4 = (struct sockaddr_in *) &servaddr;
 
-       daemon->listen_port = ntohs (s4->sin_port);
-       break;
-      }
+      daemon->listen_port = ntohs (s4->sin_port);
+      break;
+    }
 #ifdef HAVE_INET6
-    case AF_INET6:
-      {
-       struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) &servaddr;
+  case AF_INET6:
+    {
+      struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) &servaddr;
 
-       daemon->listen_port = ntohs(s6->sin6_port);
-       break;
-      }
+      daemon->listen_port = ntohs (s6->sin6_port);
+      break;
+    }
 #endif /* HAVE_INET6 */
 #ifdef AF_UNIX
-    case AF_UNIX:
-      daemon->listen_port = 0; /* special value for UNIX domain sockets */
-      break;
+  case AF_UNIX:
+    daemon->listen_port = 0;   /* special value for UNIX domain sockets */
+    break;
 #endif
-    default:
+  default:
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_PORT_INTROSPECTION_UNKNOWN_AF,
-               _("Unknown address family!\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_PORT_INTROSPECTION_UNKNOWN_AF,
+              _ ("Unknown address family!\n"));
 #endif
-      daemon->listen_port = 0; /* ugh */
-      break;
-    }
+    daemon->listen_port = 0;   /* ugh */
+    break;
+  }
 }
 
 
@@ -501,7 +505,7 @@ setup_epoll_fd (struct MHD_Daemon *daemon)
   int fd;
 
 #ifndef HAVE_MESSAGES
-  (void)daemon; /* Mute compiler warning. */
+  (void) daemon; /* Mute compiler warning. */
 #endif /* ! HAVE_MESSAGES */
 
 #ifdef USE_EPOLL_CREATE1
@@ -510,24 +514,24 @@ setup_epoll_fd (struct MHD_Daemon *daemon)
   fd = epoll_create (MAX_EVENTS);
 #endif /* ! USE_EPOLL_CREATE1 */
   if (MHD_INVALID_SOCKET == fd)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_EPOLL_CTL_CREATE_FAILED,
-                _("Call to epoll_create1 failed: %s\n"),
-                MHD_socket_last_strerr_ ());
-#endif
-      return MHD_INVALID_SOCKET;
-    }
-#if !defined(USE_EPOLL_CREATE1)
+    MHD_DLOG (daemon,
+              MHD_SC_EPOLL_CTL_CREATE_FAILED,
+              _ ("Call to epoll_create1 failed: %s\n"),
+              MHD_socket_last_strerr_ ());
+#endif
+    return MHD_INVALID_SOCKET;
+  }
+#if ! defined(USE_EPOLL_CREATE1)
   if (! MHD_socket_noninheritable_ (fd))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_EPOLL_CTL_CONFIGURE_NOINHERIT_FAILED,
-                _("Failed to set noninheritable mode on epoll FD.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_EPOLL_CTL_CONFIGURE_NOINHERIT_FAILED,
+              _ ("Failed to set noninheritable mode on epoll FD.\n"));
 #endif
-    }
+  }
 #endif /* ! USE_EPOLL_CREATE1 */
   return fd;
 }
@@ -554,11 +558,11 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
     return MHD_SC_EPOLL_CTL_CREATE_FAILED;
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   if (! daemon->disallow_upgrade)
-    {
-       daemon->epoll_upgrade_fd = setup_epoll_fd (daemon);
-       if (MHD_INVALID_SOCKET == daemon->epoll_upgrade_fd)
-         return MHD_SC_EPOLL_CTL_CREATE_FAILED;
-    }
+  {
+    daemon->epoll_upgrade_fd = setup_epoll_fd (daemon);
+    if (MHD_INVALID_SOCKET == daemon->epoll_upgrade_fd)
+      return MHD_SC_EPOLL_CTL_CREATE_FAILED;
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   if ( (MHD_INVALID_SOCKET == (ls = daemon->listen_socket)) ||
        (daemon->was_quiesced) )
@@ -566,37 +570,37 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
   event.events = EPOLLIN;
   event.data.ptr = daemon;
   if (0 != epoll_ctl (daemon->epoll_fd,
-                     EPOLL_CTL_ADD,
-                     ls,
-                     &event))
-    {
+                      EPOLL_CTL_ADD,
+                      ls,
+                      &event))
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_EPOLL_CTL_ADD_FAILED,
-                _("Call to epoll_ctl failed: %s\n"),
-                MHD_socket_last_strerr_ ());
+    MHD_DLOG (daemon,
+              MHD_SC_EPOLL_CTL_ADD_FAILED,
+              _ ("Call to epoll_ctl failed: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      return MHD_SC_EPOLL_CTL_ADD_FAILED;
-    }
+    return MHD_SC_EPOLL_CTL_ADD_FAILED;
+  }
   daemon->listen_socket_in_epoll = true;
-  if (MHD_ITC_IS_VALID_(daemon->itc))
+  if (MHD_ITC_IS_VALID_ (daemon->itc))
+  {
+    event.events = EPOLLIN;
+    event.data.ptr = (void *) daemon->epoll_itc_marker;
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_ADD,
+                        MHD_itc_r_fd_ (daemon->itc),
+                        &event))
     {
-      event.events = EPOLLIN;
-      event.data.ptr = (void *) daemon->epoll_itc_marker;
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                          EPOLL_CTL_ADD,
-                          MHD_itc_r_fd_ (daemon->itc),
-                          &event))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_EPOLL_CTL_ADD_FAILED,
-                    _("Call to epoll_ctl failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_EPOLL_CTL_ADD_FAILED,
+                _ ("Call to epoll_ctl failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-          return MHD_SC_EPOLL_CTL_ADD_FAILED;
-        }
+      return MHD_SC_EPOLL_CTL_ADD_FAILED;
     }
+  }
   return MHD_SC_OK;
 }
 #endif
@@ -616,35 +620,35 @@ MHD_polling_thread (void *cls)
 
   MHD_thread_init_ (&daemon->pid);
   while (! daemon->shutdown)
+  {
+    switch (daemon->event_loop_syscall)
     {
-      switch (daemon->event_loop_syscall)
-      {
-      case MHD_ELS_AUTO:
-       MHD_PANIC ("MHD_ELS_AUTO should have been mapped to preferred style");
-       break;
-      case MHD_ELS_SELECT:
-       MHD_daemon_select_ (daemon,
-                           MHD_YES);
-       break;
-      case MHD_ELS_POLL:
+    case MHD_ELS_AUTO:
+      MHD_PANIC ("MHD_ELS_AUTO should have been mapped to preferred style");
+      break;
+    case MHD_ELS_SELECT:
+      MHD_daemon_select_ (daemon,
+                          MHD_YES);
+      break;
+    case MHD_ELS_POLL:
 #if HAVE_POLL
-       MHD_daemon_poll_ (daemon,
-                         MHD_YES);
+      MHD_daemon_poll_ (daemon,
+                        MHD_YES);
 #else
-        MHD_PANIC ("MHD_ELS_POLL not supported, should have failed earlier");
+      MHD_PANIC ("MHD_ELS_POLL not supported, should have failed earlier");
 #endif
-       break;
-      case MHD_ELS_EPOLL:
+      break;
+    case MHD_ELS_EPOLL:
 #ifdef EPOLL_SUPPORT
-       MHD_daemon_epoll_ (daemon,
-                          MHD_YES);
+      MHD_daemon_epoll_ (daemon,
+                         MHD_YES);
 #else
-       MHD_PANIC ("MHD_ELS_EPOLL not supported, should have failed earlier");
+      MHD_PANIC ("MHD_ELS_EPOLL not supported, should have failed earlier");
 #endif
-       break;
-      }
-      MHD_connection_cleanup_ (daemon);
+      break;
     }
+    MHD_connection_cleanup_ (daemon);
+  }
   /* Resume any pending for resume connections, join
    * all connection's threads (if any) and finally cleanup
    * everything. */
@@ -652,7 +656,7 @@ MHD_polling_thread (void *cls)
     MHD_resume_suspended_connections_ (daemon);
   MHD_daemon_close_all_connections_ (daemon);
 
-  return (MHD_THRD_RTRN_TYPE_)0;
+  return (MHD_THRD_RTRN_TYPE_) 0;
 }
 
 
@@ -669,114 +673,116 @@ setup_thread_pool (struct MHD_Daemon *daemon)
    * due to integer division). Also keep track of how many
    * connections are leftover after an equal split. */
   unsigned int conns_per_thread = daemon->global_connection_limit
-    / daemon->threading_mode;
+                                  / daemon->threading_mode;
   unsigned int leftover_conns = daemon->global_connection_limit
-    % daemon->threading_mode;
+                                % daemon->threading_mode;
   int i;
   enum MHD_StatusCode sc;
 
   /* Allocate memory for pooled objects */
   daemon->worker_pool = MHD_calloc_ (daemon->threading_mode,
-                                    sizeof (struct MHD_Daemon));
+                                     sizeof (struct MHD_Daemon));
   if (NULL == daemon->worker_pool)
     return MHD_SC_THREAD_POOL_MALLOC_FAILURE;
 
   /* Start the workers in the pool */
   for (i = 0; i < daemon->threading_mode; i++)
+  {
+    /* Create copy of the Daemon object for each worker */
+    struct MHD_Daemon *d = &daemon->worker_pool[i];
+
+    memcpy (d,
+            daemon,
+            sizeof (struct MHD_Daemon));
+    /* Adjust pooling params for worker daemons; note that memcpy()
+ has already copied MHD_USE_INTERNAL_POLLING_THREAD thread mode into
+ the worker threads. */
+    d->master = daemon;
+    d->worker_pool_size = 0;
+    d->worker_pool = NULL;
+    /* Divide available connections evenly amongst the threads.
+     * Thread indexes in [0, leftover_conns) each get one of the
+     * leftover connections. */
+    d->global_connection_limit = conns_per_thread;
+    if (((unsigned int) i) < leftover_conns)
+      ++d->global_connection_limit;
+
+    if (! daemon->disable_itc)
     {
-      /* Create copy of the Daemon object for each worker */
-      struct MHD_Daemon *d = &daemon->worker_pool[i];
-
-      memcpy (d,
-             daemon,
-             sizeof (struct MHD_Daemon));
-      /* Adjust pooling params for worker daemons; note that memcpy()
-        has already copied MHD_USE_INTERNAL_POLLING_THREAD thread mode into
-        the worker threads. */
-      d->master = daemon;
-      d->worker_pool_size = 0;
-      d->worker_pool = NULL;
-      /* Divide available connections evenly amongst the threads.
-       * Thread indexes in [0, leftover_conns) each get one of the
-       * leftover connections. */
-      d->global_connection_limit = conns_per_thread;
-      if (((unsigned int) i) < leftover_conns)
-       ++d->global_connection_limit;
-
-      if (! daemon->disable_itc)
-       {
-         if (! MHD_itc_init_ (d->itc))
-           {
+      if (! MHD_itc_init_ (d->itc))
+      {
 #ifdef HAVE_MESSAGES
-             MHD_DLOG (daemon,
-                       MHD_SC_ITC_INITIALIZATION_FAILED,
-                       _("Failed to create worker inter-thread communication 
channel: %s\n"),
-                       MHD_itc_last_strerror_() );
-#endif
-             sc = MHD_SC_ITC_INITIALIZATION_FAILED;
-             goto thread_failed;
-           }
-         if ( (MHD_ELS_SELECT == daemon->event_loop_syscall) &&
-              (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (d->itc),
-                                         NULL)) )
-           {
+        MHD_DLOG (daemon,
+                  MHD_SC_ITC_INITIALIZATION_FAILED,
+                  _ (
+                    "Failed to create worker inter-thread communication 
channel: %s\n"),
+                  MHD_itc_last_strerror_ () );
+#endif
+        sc = MHD_SC_ITC_INITIALIZATION_FAILED;
+        goto thread_failed;
+      }
+      if ( (MHD_ELS_SELECT == daemon->event_loop_syscall) &&
+           (! MHD_SCKT_FD_FITS_FDSET_ (MHD_itc_r_fd_ (d->itc),
+                                       NULL)) )
+      {
 #ifdef HAVE_MESSAGES
-             MHD_DLOG (daemon,
-                       MHD_SC_ITC_DESCRIPTOR_TOO_LARGE,
-                       _("File descriptor for inter-thread communication 
channel exceeds maximum value\n"));
-#endif
-             MHD_itc_destroy_chk_ (d->itc);
-             sc = MHD_SC_ITC_DESCRIPTOR_TOO_LARGE;
-             goto thread_failed;
-           }
-       }
-      else
-       {
-         MHD_itc_set_invalid_ (d->itc);
-       }
+        MHD_DLOG (daemon,
+                  MHD_SC_ITC_DESCRIPTOR_TOO_LARGE,
+                  _ (
+                    "File descriptor for inter-thread communication channel 
exceeds maximum value\n"));
+#endif
+        MHD_itc_destroy_chk_ (d->itc);
+        sc = MHD_SC_ITC_DESCRIPTOR_TOO_LARGE;
+        goto thread_failed;
+      }
+    }
+    else
+    {
+      MHD_itc_set_invalid_ (d->itc);
+    }
 
 #ifdef EPOLL_SUPPORT
-      if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
-          (MHD_SC_OK != (sc = setup_epoll_to_listen (d))) )
-       goto thread_failed;
+    if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
+         (MHD_SC_OK != (sc = setup_epoll_to_listen (d))) )
+      goto thread_failed;
 #endif
 
-      /* Must init cleanup connection mutex for each worker */
-      if (! MHD_mutex_init_ (&d->cleanup_connection_mutex))
-       {
+    /* Must init cleanup connection mutex for each worker */
+    if (! MHD_mutex_init_ (&d->cleanup_connection_mutex))
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_THREAD_POOL_CREATE_MUTEX_FAILURE,
-                   _("MHD failed to initialize cleanup connection mutex\n"));
-#endif
-         if (! daemon->disable_itc)
-           MHD_itc_destroy_chk_ (d->itc);
-         sc = MHD_SC_THREAD_POOL_CREATE_MUTEX_FAILURE;
-         goto thread_failed;
-       }
-
-      /* Spawn the worker thread */
-      if (! MHD_create_named_thread_ (&d->pid,
-                                     "MHD-worker",
-                                     daemon->thread_stack_limit_b,
-                                     &MHD_polling_thread,
-                                     d))
-       {
+      MHD_DLOG (daemon,
+                MHD_SC_THREAD_POOL_CREATE_MUTEX_FAILURE,
+                _ ("MHD failed to initialize cleanup connection mutex\n"));
+#endif
+      if (! daemon->disable_itc)
+        MHD_itc_destroy_chk_ (d->itc);
+      sc = MHD_SC_THREAD_POOL_CREATE_MUTEX_FAILURE;
+      goto thread_failed;
+    }
+
+    /* Spawn the worker thread */
+    if (! MHD_create_named_thread_ (&d->pid,
+                                    "MHD-worker",
+                                    daemon->thread_stack_limit_b,
+                                    &MHD_polling_thread,
+                                    d))
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_THREAD_POOL_LAUNCH_FAILURE,
-                   _("Failed to create pool thread: %s\n"),
-                   MHD_strerror_ (errno));
-#endif
-         /* Free memory for this worker; cleanup below handles
-          * all previously-created workers. */
-         if (! daemon->disable_itc)
-           MHD_itc_destroy_chk_ (d->itc);
-         MHD_mutex_destroy_chk_ (&d->cleanup_connection_mutex);
-         sc = MHD_SC_THREAD_POOL_LAUNCH_FAILURE;
-         goto thread_failed;
-       }
-    } /* end for() */
+      MHD_DLOG (daemon,
+                MHD_SC_THREAD_POOL_LAUNCH_FAILURE,
+                _ ("Failed to create pool thread: %s\n"),
+                MHD_strerror_ (errno));
+#endif
+      /* Free memory for this worker; cleanup below handles
+       * all previously-created workers. */
+      if (! daemon->disable_itc)
+        MHD_itc_destroy_chk_ (d->itc);
+      MHD_mutex_destroy_chk_ (&d->cleanup_connection_mutex);
+      sc = MHD_SC_THREAD_POOL_LAUNCH_FAILURE;
+      goto thread_failed;
+    }
+  }   /* end for() */
   return MHD_SC_OK;
 
 thread_failed:
@@ -785,14 +791,14 @@ thread_failed:
      assumes a 0-sized thread pool means we had been in the default
      MHD_USE_INTERNAL_POLLING_THREAD mode. */
   if (0 == i)
+  {
+    if (NULL != daemon->worker_pool)
     {
-      if (NULL != daemon->worker_pool)
-       {
-         free (daemon->worker_pool);
-         daemon->worker_pool = NULL;
-       }
-      return MHD_SC_THREAD_LAUNCH_FAILURE;
+      free (daemon->worker_pool);
+      daemon->worker_pool = NULL;
     }
+    return MHD_SC_THREAD_LAUNCH_FAILURE;
+  }
   /* Shutdown worker threads we've already created. Pretend
      as though we had fully initialized our daemon, but
      with a smaller number of threads than had been
@@ -817,63 +823,65 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
   enum MHD_StatusCode sc;
 
   if (MHD_ELS_AUTO == daemon->event_loop_syscall)
-    {
+  {
 #if EPOLL_SUPPORT
-      /* We do not support thread-per-connection in combination
-        with epoll, so use poll in this case, otherwise prefer
-        epoll. */
-      if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
-       daemon->event_loop_syscall = MHD_ELS_POLL;
-      else
-       daemon->event_loop_syscall = MHD_ELS_EPOLL;
-#elif HAVE_POLL
+    /* We do not support thread-per-connection in combination
+ with epoll, so use poll in this case, otherwise prefer
+ epoll. */
+    if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
       daemon->event_loop_syscall = MHD_ELS_POLL;
+    else
+      daemon->event_loop_syscall = MHD_ELS_EPOLL;
+#elif HAVE_POLL
+    daemon->event_loop_syscall = MHD_ELS_POLL;
 #else
-      daemon->event_loop_syscall = MHD_ELS_SELECT;
+    daemon->event_loop_syscall = MHD_ELS_SELECT;
 #endif
-    }
+  }
 
 #ifdef EPOLL_SUPPORT
   if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
        (0 == daemon->worker_pool_size) &&
        (MHD_INVALID_SOCKET != daemon->listen_socket) &&
        (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_SYSCALL_THREAD_COMBINATION_INVALID,
-               _("Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL is 
not supported.\n"));
+    MHD_DLOG (daemon,
+              MHD_SC_SYSCALL_THREAD_COMBINATION_INVALID,
+              _ (
+                "Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL is 
not supported.\n"));
 #endif
-      return MHD_SC_SYSCALL_THREAD_COMBINATION_INVALID;
-    }
+    return MHD_SC_SYSCALL_THREAD_COMBINATION_INVALID;
+  }
 #endif
 
   /* Setup ITC */
   if ( (! daemon->disable_itc) &&
        (0 == daemon->worker_pool_size) )
+  {
+    if (! MHD_itc_init_ (daemon->itc))
     {
-      if (! MHD_itc_init_ (daemon->itc))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_ITC_INITIALIZATION_FAILED,
-                    _("Failed to create inter-thread communication channel: 
%s\n"),
-                    MHD_itc_last_strerror_ ());
+      MHD_DLOG (daemon,
+                MHD_SC_ITC_INITIALIZATION_FAILED,
+                _ ("Failed to create inter-thread communication channel: 
%s\n"),
+                MHD_itc_last_strerror_ ());
 #endif
-          return MHD_SC_ITC_INITIALIZATION_FAILED;
-        }
-      if ( (MHD_ELS_SELECT == daemon->event_loop_syscall) &&
-           (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc),
-                                      NULL)) )
-        {
+      return MHD_SC_ITC_INITIALIZATION_FAILED;
+    }
+    if ( (MHD_ELS_SELECT == daemon->event_loop_syscall) &&
+         (! MHD_SCKT_FD_FITS_FDSET_ (MHD_itc_r_fd_ (daemon->itc),
+                                     NULL)) )
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_ITC_DESCRIPTOR_TOO_LARGE,
-                   _("File descriptor for inter-thread communication channel 
exceeds maximum value\n"));
+      MHD_DLOG (daemon,
+                MHD_SC_ITC_DESCRIPTOR_TOO_LARGE,
+                _ (
+                  "File descriptor for inter-thread communication channel 
exceeds maximum value\n"));
 #endif
-         return MHD_SC_ITC_DESCRIPTOR_TOO_LARGE;
-       }
+      return MHD_SC_ITC_DESCRIPTOR_TOO_LARGE;
     }
+  }
 
   if (MHD_SC_OK != (sc = open_listen_socket (daemon)))
     return sc;
@@ -881,39 +889,39 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
   /* Check listen socket is in range (if we are limited) */
   if ( (MHD_INVALID_SOCKET != daemon->listen_socket) &&
        (MHD_ELS_SELECT == daemon->event_loop_syscall) &&
-       (! MHD_SCKT_FD_FITS_FDSET_(daemon->listen_socket,
-                                 NULL)) )
-    {
+       (! MHD_SCKT_FD_FITS_FDSET_ (daemon->listen_socket,
+                                   NULL)) )
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_SOCKET_TOO_LARGE,
-               _("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
-               daemon->listen_socket,
-               FD_SETSIZE);
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_SOCKET_TOO_LARGE,
+              _ ("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
+              daemon->listen_socket,
+              FD_SETSIZE);
 #endif
-      return MHD_SC_LISTEN_SOCKET_TOO_LARGE;
-    }
+    return MHD_SC_LISTEN_SOCKET_TOO_LARGE;
+  }
 
   /* set listen socket to non-blocking */
   if ( (MHD_INVALID_SOCKET != daemon->listen_socket) &&
        (! MHD_socket_nonblocking_ (daemon->listen_socket)) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_LISTEN_SOCKET_NONBLOCKING_FAILURE,
-               _("Failed to set nonblocking mode on listening socket: %s\n"),
-               MHD_socket_last_strerr_());
-#endif
-      if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) ||
-          (daemon->worker_pool_size > 0) )
-       {
-         /* Accept must be non-blocking. Multiple children may wake
-          * up to handle a new connection, but only one will win the
-          * race.  The others must immediately return. As this is
-          * not possible, we must fail hard here. */
-         return MHD_SC_LISTEN_SOCKET_NONBLOCKING_FAILURE;
-       }
+    MHD_DLOG (daemon,
+              MHD_SC_LISTEN_SOCKET_NONBLOCKING_FAILURE,
+              _ ("Failed to set nonblocking mode on listening socket: %s\n"),
+              MHD_socket_last_strerr_ ());
+#endif
+    if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) ||
+         (daemon->worker_pool_size > 0) )
+    {
+      /* Accept must be non-blocking. Multiple children may wake
+       * up to handle a new connection, but only one will win the
+       * race.  The others must immediately return. As this is
+       * not possible, we must fail hard here. */
+      return MHD_SC_LISTEN_SOCKET_NONBLOCKING_FAILURE;
     }
+  }
 
 #ifdef EPOLL_SUPPORT
   /* Setup epoll */
@@ -928,30 +936,31 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
      external event loop and do have a listen socket) */
   /* FIXME: why no worker thread if we have no listen socket? */
   if ( ( (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) ||
-        (1 == daemon->threading_mode) ) &&
+         (1 == daemon->threading_mode) ) &&
        (MHD_INVALID_SOCKET != daemon->listen_socket) &&
        (! MHD_create_named_thread_ (&daemon->pid,
-                                   (MHD_TM_THREAD_PER_CONNECTION == 
daemon->threading_mode)
-                                   ? "MHD-listen"
-                                   : "MHD-single",
-                                   daemon->thread_stack_limit_b,
-                                   &MHD_polling_thread,
-                                   daemon) ) )
-    {
+                                    (MHD_TM_THREAD_PER_CONNECTION ==
+                                     daemon->threading_mode)
+                                    ? "MHD-listen"
+                                    : "MHD-single",
+                                    daemon->thread_stack_limit_b,
+                                    &MHD_polling_thread,
+                                    daemon) ) )
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_THREAD_MAIN_LAUNCH_FAILURE,
-               _("Failed to create listen thread: %s\n"),
-               MHD_strerror_ (errno));
+    MHD_DLOG (daemon,
+              MHD_SC_THREAD_MAIN_LAUNCH_FAILURE,
+              _ ("Failed to create listen thread: %s\n"),
+              MHD_strerror_ (errno));
 #endif
-      return MHD_SC_THREAD_MAIN_LAUNCH_FAILURE;
-    }
+    return MHD_SC_THREAD_MAIN_LAUNCH_FAILURE;
+  }
 
   /* Setup worker threads */
   /* FIXME: why no thread pool if we have no listen socket? */
   if ( (1 < daemon->threading_mode) &&
-       (MHD_INVALID_SOCKET != daemon->listen_socket) &&
-       (MHD_SC_OK != (sc = setup_thread_pool (daemon))) )
+       (MHD_INVALID_SOCKET != daemon->listen_socket) &&
+       (MHD_SC_OK != (sc = setup_thread_pool (daemon))) )
     return sc;
 
   /* make sure we know our listen port (if any) */
diff --git a/src/lib/init.c b/src/lib/init.c
index b23bdadf..5dcb02c4 100644
--- a/src/lib/init.c
+++ b/src/lib/init.c
@@ -36,7 +36,7 @@ volatile unsigned int global_init_count = 0;
 /**
  * Global initialisation mutex
  */
-MHD_MUTEX_STATIC_DEFN_INIT_(global_init_mutex_);
+MHD_MUTEX_STATIC_DEFN_INIT_ (global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
 
 #endif
@@ -59,21 +59,21 @@ static int mhd_winsock_inited_ = 0;
  */
 static void
 mhd_panic_std (void *cls,
-              const char *file,
-              unsigned int line,
-              const char *reason)
+               const char *file,
+               unsigned int line,
+               const char *reason)
 {
-  (void)cls; /* Mute compiler warning. */
+  (void) cls; /* Mute compiler warning. */
 #ifdef HAVE_MESSAGES
   fprintf (stderr,
-           _("Fatal error in GNU libmicrohttpd %s:%u: %s\n"),
-          file,
+           _ ("Fatal error in GNU libmicrohttpd %s:%u: %s\n"),
+           file,
            line,
            reason);
 #else  /* ! HAVE_MESSAGES */
-  (void)file;   /* Mute compiler warning. */
-  (void)line;   /* Mute compiler warning. */
-  (void)reason; /* Mute compiler warning. */
+  (void) file;   /* Mute compiler warning. */
+  (void) line;   /* Mute compiler warning. */
+  (void) reason; /* Mute compiler warning. */
 #endif
   abort ();
 }
@@ -93,13 +93,13 @@ MHD_init (void)
     mhd_panic = &mhd_panic_std;
 
 #if defined(_WIN32) && ! defined(__CYGWIN__)
-  if (0 != WSAStartup (MAKEWORD(2, 2),
-                      &wsd))
-    MHD_PANIC (_("Failed to initialize winsock\n"));
+  if (0 != WSAStartup (MAKEWORD (2, 2),
+                       &wsd))
+    MHD_PANIC (_ ("Failed to initialize winsock\n"));
   mhd_winsock_inited_ = 1;
-  if ( (2 != LOBYTE(wsd.wVersion)) &&
-       (2 != HIBYTE(wsd.wVersion)) )
-    MHD_PANIC (_("Winsock version 2.2 is not available\n"));
+  if ( (2 != LOBYTE (wsd.wVersion)) &&
+       (2 != HIBYTE (wsd.wVersion)) )
+    MHD_PANIC (_ ("Winsock version 2.2 is not available\n"));
 #endif
   MHD_monotonic_sec_counter_init ();
 #ifdef HAVE_FREEBSD_SENDFILE
@@ -116,14 +116,14 @@ MHD_fini (void)
 {
 #if defined(_WIN32) && ! defined(__CYGWIN__)
   if (mhd_winsock_inited_)
-    WSACleanup();
+    WSACleanup ();
 #endif
   MHD_monotonic_sec_counter_finish ();
 }
 
 #ifdef _AUTOINIT_FUNCS_ARE_SUPPORTED
 
-_SET_INIT_AND_DEINIT_FUNCS(MHD_init, MHD_fini);
+_SET_INIT_AND_DEINIT_FUNCS (MHD_init, MHD_fini);
 
 #else
 
@@ -135,12 +135,12 @@ void
 MHD_check_global_init_ (void)
 {
 #ifdef MHD_MUTEX_STATIC_DEFN_INIT_
-  MHD_mutex_lock_chk_(&global_init_mutex_);
+  MHD_mutex_lock_chk_ (&global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
   if (0 == global_init_count++)
     MHD_init ();
 #ifdef MHD_MUTEX_STATIC_DEFN_INIT_
-  MHD_mutex_unlock_chk_(&global_init_mutex_);
+  MHD_mutex_unlock_chk_ (&global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
 }
 #endif
diff --git a/src/lib/init.h b/src/lib/init.h
index fae96159..2d9a9389 100644
--- a/src/lib/init.h
+++ b/src/lib/init.h
@@ -31,7 +31,7 @@
  * Do nothing - global initialisation is
  * performed by library constructor.
  */
-#define MHD_check_global_init_() (void)0
+#define MHD_check_global_init_() (void) 0
 #else  /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */
 /**
  * Check whether global initialisation was performed
diff --git a/src/lib/internal.c b/src/lib/internal.c
index 75eae8a4..04d83624 100644
--- a/src/lib/internal.c
+++ b/src/lib/internal.c
@@ -35,50 +35,50 @@ const char *
 MHD_state_to_string (enum MHD_CONNECTION_STATE state)
 {
   switch (state)
-    {
-    case MHD_CONNECTION_INIT:
-      return "connection init";
-    case MHD_CONNECTION_URL_RECEIVED:
-      return "connection url received";
-    case MHD_CONNECTION_HEADER_PART_RECEIVED:
-      return "header partially received";
-    case MHD_CONNECTION_HEADERS_RECEIVED:
-      return "headers received";
-    case MHD_CONNECTION_HEADERS_PROCESSED:
-      return "headers processed";
-    case MHD_CONNECTION_CONTINUE_SENDING:
-      return "continue sending";
-    case MHD_CONNECTION_CONTINUE_SENT:
-      return "continue sent";
-    case MHD_CONNECTION_BODY_RECEIVED:
-      return "body received";
-    case MHD_CONNECTION_FOOTER_PART_RECEIVED:
-      return "footer partially received";
-    case MHD_CONNECTION_FOOTERS_RECEIVED:
-      return "footers received";
-    case MHD_CONNECTION_HEADERS_SENDING:
-      return "headers sending";
-    case MHD_CONNECTION_HEADERS_SENT:
-      return "headers sent";
-    case MHD_CONNECTION_NORMAL_BODY_READY:
-      return "normal body ready";
-    case MHD_CONNECTION_NORMAL_BODY_UNREADY:
-      return "normal body unready";
-    case MHD_CONNECTION_CHUNKED_BODY_READY:
-      return "chunked body ready";
-    case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
-      return "chunked body unready";
-    case MHD_CONNECTION_BODY_SENT:
-      return "body sent";
-    case MHD_CONNECTION_FOOTERS_SENDING:
-      return "footers sending";
-    case MHD_CONNECTION_FOOTERS_SENT:
-      return "footers sent";
-    case MHD_CONNECTION_CLOSED:
-      return "closed";
-    default:
-      return "unrecognized connection state";
-    }
+  {
+  case MHD_CONNECTION_INIT:
+    return "connection init";
+  case MHD_CONNECTION_URL_RECEIVED:
+    return "connection url received";
+  case MHD_CONNECTION_HEADER_PART_RECEIVED:
+    return "header partially received";
+  case MHD_CONNECTION_HEADERS_RECEIVED:
+    return "headers received";
+  case MHD_CONNECTION_HEADERS_PROCESSED:
+    return "headers processed";
+  case MHD_CONNECTION_CONTINUE_SENDING:
+    return "continue sending";
+  case MHD_CONNECTION_CONTINUE_SENT:
+    return "continue sent";
+  case MHD_CONNECTION_BODY_RECEIVED:
+    return "body received";
+  case MHD_CONNECTION_FOOTER_PART_RECEIVED:
+    return "footer partially received";
+  case MHD_CONNECTION_FOOTERS_RECEIVED:
+    return "footers received";
+  case MHD_CONNECTION_HEADERS_SENDING:
+    return "headers sending";
+  case MHD_CONNECTION_HEADERS_SENT:
+    return "headers sent";
+  case MHD_CONNECTION_NORMAL_BODY_READY:
+    return "normal body ready";
+  case MHD_CONNECTION_NORMAL_BODY_UNREADY:
+    return "normal body unready";
+  case MHD_CONNECTION_CHUNKED_BODY_READY:
+    return "chunked body ready";
+  case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
+    return "chunked body unready";
+  case MHD_CONNECTION_BODY_SENT:
+    return "body sent";
+  case MHD_CONNECTION_FOOTERS_SENDING:
+    return "footers sending";
+  case MHD_CONNECTION_FOOTERS_SENT:
+    return "footers sent";
+  case MHD_CONNECTION_CLOSED:
+    return "closed";
+  default:
+    return "unrecognized connection state";
+  }
 }
 #endif
 #endif
@@ -91,7 +91,7 @@ MHD_state_to_string (enum MHD_CONNECTION_STATE state)
  */
 void
 MHD_DLOG (const struct MHD_Daemon *daemon,
-         enum MHD_StatusCode sc,
+          enum MHD_StatusCode sc,
           const char *format,
           ...)
 {
@@ -100,11 +100,11 @@ MHD_DLOG (const struct MHD_Daemon *daemon,
   if (NULL == daemon->logger)
     return;
   va_start (va,
-           format);
+            format);
   daemon->logger (daemon->logger_cls,
-                 sc,
-                 format,
-                 va);
+                  sc,
+                  format,
+                  va);
   va_end (va);
 }
 #endif
@@ -120,7 +120,7 @@ MHD_unescape_plus (char *arg)
 {
   char *p;
 
-  for (p=strchr (arg, '+'); NULL != p; p = strchr (p + 1, '+'))
+  for (p = strchr (arg, '+'); NULL != p; p = strchr (p + 1, '+'))
     *p = ' ';
 }
 
@@ -141,28 +141,28 @@ MHD_http_unescape (char *val)
   char *wpos = val;
 
   while ('\0' != *rpos)
+  {
+    uint32_t num;
+    switch (*rpos)
     {
-      uint32_t num;
-      switch (*rpos)
-       {
-       case '%':
-          if (2 == MHD_strx_to_uint32_n_ (rpos + 1,
-                                          2,
-                                          &num))
-           {
-             *wpos = (char)((unsigned char) num);
-             wpos++;
-             rpos += 3;
-             break;
-           }
-          /* TODO: add bad sequence handling */
-         /* intentional fall through! */
-       default:
-         *wpos = *rpos;
-         wpos++;
-         rpos++;
-       }
+    case '%':
+      if (2 == MHD_strx_to_uint32_n_ (rpos + 1,
+                                      2,
+                                      &num))
+      {
+        *wpos = (char) ((unsigned char) num);
+        wpos++;
+        rpos += 3;
+        break;
+      }
+    /* TODO: add bad sequence handling */
+    /* intentional fall through! */
+    default:
+      *wpos = *rpos;
+      wpos++;
+      rpos++;
     }
+  }
   *wpos = '\0'; /* add 0-terminator */
   return wpos - val; /* = strlen(val) */
 }
@@ -184,10 +184,10 @@ MHD_http_unescape (char *val)
  */
 bool
 MHD_parse_arguments_ (struct MHD_Request *request,
-                     enum MHD_ValueKind kind,
-                     char *args,
-                     MHD_ArgumentIterator_ cb,
-                     unsigned int *num_headers)
+                      enum MHD_ValueKind kind,
+                      char *args,
+                      MHD_ArgumentIterator_ cb,
+                      unsigned int *num_headers)
 {
   struct MHD_Daemon *daemon = request->daemon;
   char *equals;
@@ -195,88 +195,88 @@ MHD_parse_arguments_ (struct MHD_Request *request,
 
   *num_headers = 0;
   while ( (NULL != args) &&
-         ('\0' != args[0]) )
+          ('\0' != args[0]) )
+  {
+    equals = strchr (args, '=');
+    amper = strchr (args, '&');
+    if (NULL == amper)
     {
-      equals = strchr (args, '=');
-      amper = strchr (args, '&');
-      if (NULL == amper)
-       {
-         /* last argument */
-         if (NULL == equals)
-           {
-             /* last argument, without '=' */
-              MHD_unescape_plus (args);
-             daemon->unescape_cb (daemon->unescape_cb_cls,
-                                  request,
-                                  args);
-             if (! cb (request,
-                       args,
-                       NULL,
-                       kind))
-               return false;
-             (*num_headers)++;
-             break;
-           }
-         /* got 'foo=bar' */
-         equals[0] = '\0';
-         equals++;
-          MHD_unescape_plus (args);
-         daemon->unescape_cb (daemon->unescape_cb_cls,
-                              request,
-                              args);
-          MHD_unescape_plus (equals);
-         daemon->unescape_cb (daemon->unescape_cb_cls,
-                              request,
-                              equals);
-         if (! cb (request,
-                   args,
-                   equals,
-                   kind))
-           return false;
-         (*num_headers)++;
-         break;
-       }
-      /* amper is non-NULL here */
-      amper[0] = '\0';
-      amper++;
-      if ( (NULL == equals) ||
-          (equals >= amper) )
-       {
-         /* got 'foo&bar' or 'foo&bar=val', add key 'foo' with NULL for value 
*/
-          MHD_unescape_plus (args);
-         daemon->unescape_cb (daemon->unescape_cb_cls,
-                              request,
-                              args);
-         if (! cb (request,
-                   args,
-                   NULL,
-                   kind))
-           return false;
-         /* continue with 'bar' */
-         (*num_headers)++;
-         args = amper;
-         continue;
-       }
-      /* equals and amper are non-NULL here, and equals < amper,
-        so we got regular 'foo=value&bar...'-kind of argument */
+      /* last argument */
+      if (NULL == equals)
+      {
+        /* last argument, without '=' */
+        MHD_unescape_plus (args);
+        daemon->unescape_cb (daemon->unescape_cb_cls,
+                             request,
+                             args);
+        if (! cb (request,
+                  args,
+                  NULL,
+                  kind))
+          return false;
+        (*num_headers)++;
+        break;
+      }
+      /* got 'foo=bar' */
       equals[0] = '\0';
       equals++;
       MHD_unescape_plus (args);
       daemon->unescape_cb (daemon->unescape_cb_cls,
-                          request,
-                          args);
+                           request,
+                           args);
       MHD_unescape_plus (equals);
       daemon->unescape_cb (daemon->unescape_cb_cls,
-                          request,
-                          equals);
+                           request,
+                           equals);
+      if (! cb (request,
+                args,
+                equals,
+                kind))
+        return false;
+      (*num_headers)++;
+      break;
+    }
+    /* amper is non-NULL here */
+    amper[0] = '\0';
+    amper++;
+    if ( (NULL == equals) ||
+         (equals >= amper) )
+    {
+      /* got 'foo&bar' or 'foo&bar=val', add key 'foo' with NULL for value */
+      MHD_unescape_plus (args);
+      daemon->unescape_cb (daemon->unescape_cb_cls,
+                           request,
+                           args);
       if (! cb (request,
-               args,
-                        equals,
-               kind))
+                args,
+                NULL,
+                kind))
         return false;
+      /* continue with 'bar' */
       (*num_headers)++;
       args = amper;
+      continue;
     }
+    /* equals and amper are non-NULL here, and equals < amper,
+ so we got regular 'foo=value&bar...'-kind of argument */
+    equals[0] = '\0';
+    equals++;
+    MHD_unescape_plus (args);
+    daemon->unescape_cb (daemon->unescape_cb_cls,
+                         request,
+                         args);
+    MHD_unescape_plus (equals);
+    daemon->unescape_cb (daemon->unescape_cb_cls,
+                         request,
+                         equals);
+    if (! cb (request,
+              args,
+              equals,
+              kind))
+      return false;
+    (*num_headers)++;
+    args = amper;
+  }
   return true;
 }
 
diff --git a/src/lib/internal.h b/src/lib/internal.h
index bd3bd1c6..b5ec3039 100644
--- a/src/lib/internal.h
+++ b/src/lib/internal.h
@@ -58,14 +58,16 @@
  *
  * @param msg error message (const char *)
  */
-#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
msg); BUILTIN_NOT_REACHED; } while (0)
+#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
msg); \
+                            BUILTIN_NOT_REACHED; } while (0)
 #else
 /**
  * Trigger 'panic' action based on fatal errors.
  *
  * @param msg error message (const char *)
  */
-#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
NULL); BUILTIN_NOT_REACHED; } while (0)
+#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
NULL); \
+                            BUILTIN_NOT_REACHED; } while (0)
 #endif
 
 #include "mhd_threads.h"
@@ -82,8 +84,8 @@
  */
 void
 MHD_DLOG (const struct MHD_Daemon *daemon,
-         enum MHD_StatusCode sc,
-         const char *format,
+          enum MHD_StatusCode sc,
+          const char *format,
           ...);
 #endif
 
@@ -93,9 +95,9 @@ MHD_DLOG (const struct MHD_Daemon *daemon,
  * @param fd the FD to close
  */
 #define MHD_fd_close_chk_(fd) do {                      \
-    if ( (0 != close ((fd)) && (EBADF == errno)) )     \
-      MHD_PANIC(_("Failed to close FD.\n"));            \
-  } while(0)
+    if ( (0 != close ((fd)) && (EBADF == errno)) )  \
+      MHD_PANIC (_ ("Failed to close FD.\n"));            \
+} while (0)
 
 /**
  * Should we perform additional sanity checks at runtime (on our internal
@@ -128,10 +130,11 @@ extern MHD_PanicCallback mhd_panic;
 extern void *mhd_panic_cls;
 
 /* If we have Clang or gcc >= 4.5, use __buildin_unreachable() */
-#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ 
>= 5)
-#define BUILTIN_NOT_REACHED __builtin_unreachable()
+#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ 
>= \
+                                             5)
+#define BUILTIN_NOT_REACHED __builtin_unreachable ()
 #elif defined(_MSC_FULL_VER)
-#define BUILTIN_NOT_REACHED __assume(0)
+#define BUILTIN_NOT_REACHED __assume (0)
 #else
 #define BUILTIN_NOT_REACHED
 #endif
@@ -140,7 +143,7 @@ extern void *mhd_panic_cls;
 /**
  * Determine length of static string / macro strings at compile time.
  */
-#define MHD_STATICSTR_LEN_(macro) (sizeof(macro)/sizeof(char) - 1)
+#define MHD_STATICSTR_LEN_(macro) (sizeof(macro) / sizeof(char) - 1)
 #endif /* ! MHD_STATICSTR_LEN_ */
 
 
@@ -1534,8 +1537,8 @@ struct MHD_Daemon
  * @return #MHD_SC_OK on success, otherwise an error code
  */
 typedef enum MHD_StatusCode
-(*ActionCallback) (void *cls,
-                  struct MHD_Request *request);
+(*ActionCallback)(void *cls,
+                  struct MHD_Request *request);
 
 
 /**
@@ -1703,9 +1706,9 @@ struct MHD_Response
  */
 typedef bool
 (*MHD_ArgumentIterator_)(struct MHD_Request *request,
-                        const char *key,
-                        const char *value,
-                        enum MHD_ValueKind kind);
+                         const char *key,
+                         const char *value,
+                         enum MHD_ValueKind kind);
 
 
 /**
@@ -1724,10 +1727,10 @@ typedef bool
  */
 bool
 MHD_parse_arguments_ (struct MHD_Request *request,
-                     enum MHD_ValueKind kind,
-                     char *args,
-                     MHD_ArgumentIterator_ cb,
-                     unsigned int *num_headers);
+                      enum MHD_ValueKind kind,
+                      char *args,
+                      MHD_ArgumentIterator_ cb,
+                      unsigned int *num_headers);
 
 
 
@@ -1740,15 +1743,15 @@ MHD_parse_arguments_ (struct MHD_Request *request,
  * @param element element to insert
  */
 #define DLL_insert(head,tail,element) do { \
-  mhd_assert (NULL == (element)->next); \
-  mhd_assert (NULL == (element)->prev); \
-  (element)->next = (head); \
-  (element)->prev = NULL; \
-  if ((tail) == NULL) \
-    (tail) = element; \
-  else \
-    (head)->prev = element; \
-  (head) = (element); } while (0)
+    mhd_assert (NULL == (element)->next); \
+    mhd_assert (NULL == (element)->prev); \
+    (element)->next = (head); \
+    (element)->prev = NULL; \
+    if ((tail) == NULL) \
+      (tail) = element; \
+    else \
+      (head)->prev = element; \
+    (head) = (element); } while (0)
 
 
 /**
@@ -1760,18 +1763,18 @@ MHD_parse_arguments_ (struct MHD_Request *request,
  * @param element element to remove
  */
 #define DLL_remove(head,tail,element) do { \
-  mhd_assert ( (NULL != (element)->next) || ((element) == (tail)));  \
-  mhd_assert ( (NULL != (element)->prev) || ((element) == (head)));  \
-  if ((element)->prev == NULL) \
-    (head) = (element)->next;  \
-  else \
-    (element)->prev->next = (element)->next; \
-  if ((element)->next == NULL) \
-    (tail) = (element)->prev;  \
-  else \
-    (element)->next->prev = (element)->prev; \
-  (element)->next = NULL; \
-  (element)->prev = NULL; } while (0)
+    mhd_assert ( (NULL != (element)->next) || ((element) == (tail)));  \
+    mhd_assert ( (NULL != (element)->prev) || ((element) == (head)));  \
+    if ((element)->prev == NULL) \
+      (head) = (element)->next;  \
+    else \
+      (element)->prev->next = (element)->next; \
+    if ((element)->next == NULL) \
+      (tail) = (element)->prev;  \
+    else \
+      (element)->next->prev = (element)->prev; \
+    (element)->next = NULL; \
+    (element)->prev = NULL; } while (0)
 
 
 
@@ -1784,15 +1787,15 @@ MHD_parse_arguments_ (struct MHD_Request *request,
  * @param element element to insert
  */
 #define XDLL_insert(head,tail,element) do { \
-  mhd_assert (NULL == (element)->nextX); \
-  mhd_assert (NULL == (element)->prevX); \
-  (element)->nextX = (head); \
-  (element)->prevX = NULL; \
-  if (NULL == (tail)) \
-    (tail) = element; \
-  else \
-    (head)->prevX = element; \
-  (head) = (element); } while (0)
+    mhd_assert (NULL == (element)->nextX); \
+    mhd_assert (NULL == (element)->prevX); \
+    (element)->nextX = (head); \
+    (element)->prevX = NULL; \
+    if (NULL == (tail)) \
+      (tail) = element; \
+    else \
+      (head)->prevX = element; \
+    (head) = (element); } while (0)
 
 
 /**
@@ -1804,18 +1807,18 @@ MHD_parse_arguments_ (struct MHD_Request *request,
  * @param element element to remove
  */
 #define XDLL_remove(head,tail,element) do { \
-  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail)));  \
-  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head)));  \
-  if (NULL == (element)->prevX) \
-    (head) = (element)->nextX;  \
-  else \
-    (element)->prevX->nextX = (element)->nextX; \
-  if (NULL == (element)->nextX) \
-    (tail) = (element)->prevX;  \
-  else \
-    (element)->nextX->prevX = (element)->prevX; \
-  (element)->nextX = NULL; \
-  (element)->prevX = NULL; } while (0)
+    mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail)));  \
+    mhd_assert ( (NULL != (element)->prevX) || ((element) == (head)));  \
+    if (NULL == (element)->prevX) \
+      (head) = (element)->nextX;  \
+    else \
+      (element)->prevX->nextX = (element)->nextX; \
+    if (NULL == (element)->nextX) \
+      (tail) = (element)->prevX;  \
+    else \
+      (element)->nextX->prevX = (element)->prevX; \
+    (element)->nextX = NULL; \
+    (element)->prevX = NULL; } while (0)
 
 
 /**
@@ -1827,13 +1830,13 @@ MHD_parse_arguments_ (struct MHD_Request *request,
  * @param element element to insert
  */
 #define EDLL_insert(head,tail,element) do { \
-  (element)->nextE = (head); \
-  (element)->prevE = NULL; \
-  if ((tail) == NULL) \
-    (tail) = element; \
-  else \
-    (head)->prevE = element; \
-  (head) = (element); } while (0)
+    (element)->nextE = (head); \
+    (element)->prevE = NULL; \
+    if ((tail) == NULL) \
+      (tail) = element; \
+    else \
+      (head)->prevE = element; \
+    (head) = (element); } while (0)
 
 
 /**
@@ -1845,16 +1848,16 @@ MHD_parse_arguments_ (struct MHD_Request *request,
  * @param element element to remove
  */
 #define EDLL_remove(head,tail,element) do { \
-  if ((element)->prevE == NULL) \
-    (head) = (element)->nextE;  \
-  else \
-    (element)->prevE->nextE = (element)->nextE; \
-  if ((element)->nextE == NULL) \
-    (tail) = (element)->prevE;  \
-  else \
-    (element)->nextE->prevE = (element)->prevE; \
-  (element)->nextE = NULL; \
-  (element)->prevE = NULL; } while (0)
+    if ((element)->prevE == NULL) \
+      (head) = (element)->nextE;  \
+    else \
+      (element)->prevE->nextE = (element)->nextE; \
+    if ((element)->nextE == NULL) \
+      (tail) = (element)->prevE;  \
+    else \
+      (element)->nextE->prevE = (element)->prevE; \
+    (element)->nextE = NULL; \
+    (element)->prevE = NULL; } while (0)
 
 
 
diff --git a/src/lib/md5.c b/src/lib/md5.c
index a7eb35fe..3d0f7493 100644
--- a/src/lib/md5.c
+++ b/src/lib/md5.c
@@ -20,21 +20,21 @@
 #include "md5.h"
 #include "mhd_byteorder.h"
 
-#define PUT_64BIT_LE(cp, value) do {                                   \
-       (cp)[7] = (uint8_t)((value) >> 56);                             \
-       (cp)[6] = (uint8_t)((value) >> 48);                             \
-       (cp)[5] = (uint8_t)((value) >> 40);                             \
-       (cp)[4] = (uint8_t)((value) >> 32);                             \
-       (cp)[3] = (uint8_t)((value) >> 24);                             \
-       (cp)[2] = (uint8_t)((value) >> 16);                             \
-       (cp)[1] = (uint8_t)((value) >> 8);                              \
-       (cp)[0] = (uint8_t)((value)); } while (0)
-
-#define PUT_32BIT_LE(cp, value) do {                                   \
-       (cp)[3] = (uint8_t)((value) >> 24);                             \
-       (cp)[2] = (uint8_t)((value) >> 16);                             \
-       (cp)[1] = (uint8_t)((value) >> 8);                              \
-       (cp)[0] = (uint8_t)((value)); } while (0)
+#define PUT_64BIT_LE(cp, value) do {          \
+    (cp)[7] = (uint8_t) ((value) >> 56);       \
+    (cp)[6] = (uint8_t) ((value) >> 48);       \
+    (cp)[5] = (uint8_t) ((value) >> 40);       \
+    (cp)[4] = (uint8_t) ((value) >> 32);       \
+    (cp)[3] = (uint8_t) ((value) >> 24);       \
+    (cp)[2] = (uint8_t) ((value) >> 16);       \
+    (cp)[1] = (uint8_t) ((value) >> 8);        \
+    (cp)[0] = (uint8_t) ((value)); } while (0)
+
+#define PUT_32BIT_LE(cp, value) do {          \
+    (cp)[3] = (uint8_t) ((value) >> 24);       \
+    (cp)[2] = (uint8_t) ((value) >> 16);       \
+    (cp)[1] = (uint8_t) ((value) >> 8);        \
+    (cp)[0] = (uint8_t) ((value)); } while (0)
 
 static uint8_t PADDING[MD5_BLOCK_SIZE] = {
   0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -47,9 +47,9 @@ static uint8_t PADDING[MD5_BLOCK_SIZE] = {
  * initialization constants.
  */
 void
-MHD_MD5Init(struct MD5Context *ctx)
+MHD_MD5Init (struct MD5Context *ctx)
 {
-  if (!ctx)
+  if (! ctx)
     return;
 
   ctx->count = 0;
@@ -64,26 +64,26 @@ MHD_MD5Init(struct MD5Context *ctx)
  * of bytes.
  */
 void
-MHD_MD5Update(struct MD5Context *ctx, const unsigned char *input, size_t len)
+MHD_MD5Update (struct MD5Context *ctx, const unsigned char *input, size_t len)
 {
   size_t have, need;
 
-  if (!ctx || !input)
+  if (! ctx || ! input)
     return;
 
   /* Check how many bytes we already have and how many more we need. */
-  have = (size_t)((ctx->count >> 3) & (MD5_BLOCK_SIZE - 1));
+  have = (size_t) ((ctx->count >> 3) & (MD5_BLOCK_SIZE - 1));
   need = MD5_BLOCK_SIZE - have;
 
   /* Update bitcount */
-  ctx->count += (uint64_t)len << 3;
+  ctx->count += (uint64_t) len << 3;
 
   if (len >= need)
   {
     if (have != 0)
     {
-      memcpy(ctx->buffer + have, input, need);
-      MD5Transform(ctx->state, ctx->buffer);
+      memcpy (ctx->buffer + have, input, need);
+      MD5Transform (ctx->state, ctx->buffer);
       input += need;
       len -= need;
       have = 0;
@@ -92,7 +92,7 @@ MHD_MD5Update(struct MD5Context *ctx, const unsigned char 
*input, size_t len)
     /* Process data in MD5_BLOCK_SIZE-byte chunks. */
     while (len >= MD5_BLOCK_SIZE)
     {
-      MD5Transform(ctx->state, input);
+      MD5Transform (ctx->state, input);
       input += MD5_BLOCK_SIZE;
       len -= MD5_BLOCK_SIZE;
     }
@@ -100,7 +100,7 @@ MHD_MD5Update(struct MD5Context *ctx, const unsigned char 
*input, size_t len)
 
   /* Handle any remaining bytes of data. */
   if (len != 0)
-    memcpy(ctx->buffer + have, input, len);
+    memcpy (ctx->buffer + have, input, len);
 }
 
 /*
@@ -108,42 +108,42 @@ MHD_MD5Update(struct MD5Context *ctx, const unsigned char 
*input, size_t len)
  * 1 0* (64-bit count of bits processed, MSB-first)
  */
 void
-MD5Pad(struct MD5Context *ctx)
+MD5Pad (struct MD5Context *ctx)
 {
   uint8_t count[8];
   size_t padlen;
 
-  if (!ctx)
+  if (! ctx)
     return;
 
   /* Convert count to 8 bytes in little endian order. */
-  PUT_64BIT_LE(count, ctx->count);
+  PUT_64BIT_LE (count, ctx->count);
 
   /* Pad out to 56 mod 64. */
-  padlen = MD5_BLOCK_SIZE -
-    ((ctx->count >> 3) & (MD5_BLOCK_SIZE - 1));
+  padlen = MD5_BLOCK_SIZE
+           - ((ctx->count >> 3) & (MD5_BLOCK_SIZE - 1));
   if (padlen < 1 + 8)
     padlen += MD5_BLOCK_SIZE;
-  MHD_MD5Update(ctx, PADDING, padlen - 8);             /* padlen - 8 <= 64 */
-  MHD_MD5Update(ctx, count, 8);
+  MHD_MD5Update (ctx, PADDING, padlen - 8);    /* padlen - 8 <= 64 */
+  MHD_MD5Update (ctx, count, 8);
 }
 
 /*
  * Final wrapup--call MD5Pad, fill in digest and zero out ctx.
  */
 void
-MHD_MD5Final(unsigned char digest[MD5_DIGEST_SIZE], struct MD5Context *ctx)
+MHD_MD5Final (unsigned char digest[MD5_DIGEST_SIZE], struct MD5Context *ctx)
 {
   int i;
 
-  if (!ctx || !digest)
+  if (! ctx || ! digest)
     return;
 
-  MD5Pad(ctx);
+  MD5Pad (ctx);
   for (i = 0; i < 4; i++)
-    PUT_32BIT_LE(digest + i * 4, ctx->state[i]);
+    PUT_32BIT_LE (digest + i * 4, ctx->state[i]);
 
-  memset(ctx, 0, sizeof(*ctx));
+  memset (ctx, 0, sizeof(*ctx));
 }
 
 
@@ -151,13 +151,13 @@ MHD_MD5Final(unsigned char digest[MD5_DIGEST_SIZE], 
struct MD5Context *ctx)
 
 /* #define F1(x, y, z) (x & y | ~x & z) */
 #define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
+#define F2(x, y, z) F1 (z, x, y)
 #define F3(x, y, z) (x ^ y ^ z)
 #define F4(x, y, z) (y ^ (x | ~z))
 
 /* This is the central step in the MD5 algorithm. */
 #define MD5STEP(f, w, x, y, z, data, s) \
-       ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+  (w += f (x, y, z) + data,  w = w << s | w >> (32 - s),  w += x)
 
 /*
  * The core of the MD5 algorithm, this alters an existing MD5 hash to
@@ -165,20 +165,20 @@ MHD_MD5Final(unsigned char digest[MD5_DIGEST_SIZE], 
struct MD5Context *ctx)
  * the data and converts bytes into longwords for this routine.
  */
 void
-MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_SIZE])
+MD5Transform (uint32_t state[4], const uint8_t block[MD5_BLOCK_SIZE])
 {
   uint32_t a, b, c, d, in[MD5_BLOCK_SIZE / 4];
 
 #if _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
-  memcpy(in, block, sizeof(in));
+  memcpy (in, block, sizeof(in));
 #else
   for (a = 0; a < MD5_BLOCK_SIZE / 4; a++)
   {
-    in[a] = (uint32_t)(
-      (uint32_t)(block[a * 4 + 0]) |
-      (uint32_t)(block[a * 4 + 1]) << 8 |
-      (uint32_t)(block[a * 4 + 2]) << 16 |
-      (uint32_t)(block[a * 4 + 3]) << 24);
+    in[a] = (uint32_t) (
+      (uint32_t) (block[a * 4 + 0])
+      | (uint32_t) (block[a * 4 + 1]) << 8
+        | (uint32_t) (block[a * 4 + 2]) << 16
+        | (uint32_t) (block[a * 4 + 3]) << 24);
   }
 #endif
 
@@ -187,73 +187,73 @@ MD5Transform(uint32_t state[4], const uint8_t 
block[MD5_BLOCK_SIZE])
   c = state[2];
   d = state[3];
 
-  MD5STEP(F1, a, b, c, d, in[0]  + 0xd76aa478, 7);
-  MD5STEP(F1, d, a, b, c, in[1]  + 0xe8c7b756, 12);
-  MD5STEP(F1, c, d, a, b, in[2]  + 0x242070db, 17);
-  MD5STEP(F1, b, c, d, a, in[3]  + 0xc1bdceee, 22);
-  MD5STEP(F1, a, b, c, d, in[4]  + 0xf57c0faf, 7);
-  MD5STEP(F1, d, a, b, c, in[5]  + 0x4787c62a, 12);
-  MD5STEP(F1, c, d, a, b, in[6]  + 0xa8304613, 17);
-  MD5STEP(F1, b, c, d, a, in[7]  + 0xfd469501, 22);
-  MD5STEP(F1, a, b, c, d, in[8]  + 0x698098d8, 7);
-  MD5STEP(F1, d, a, b, c, in[9]  + 0x8b44f7af, 12);
-  MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
-  MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
-  MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
-  MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
-  MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
-  MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
-
-  MD5STEP(F2, a, b, c, d, in[1]  + 0xf61e2562, 5);
-  MD5STEP(F2, d, a, b, c, in[6]  + 0xc040b340, 9);
-  MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
-  MD5STEP(F2, b, c, d, a, in[0]  + 0xe9b6c7aa, 20);
-  MD5STEP(F2, a, b, c, d, in[5]  + 0xd62f105d, 5);
-  MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
-  MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
-  MD5STEP(F2, b, c, d, a, in[4]  + 0xe7d3fbc8, 20);
-  MD5STEP(F2, a, b, c, d, in[9]  + 0x21e1cde6, 5);
-  MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
-  MD5STEP(F2, c, d, a, b, in[3]  + 0xf4d50d87, 14);
-  MD5STEP(F2, b, c, d, a, in[8]  + 0x455a14ed, 20);
-  MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
-  MD5STEP(F2, d, a, b, c, in[2]  + 0xfcefa3f8, 9);
-  MD5STEP(F2, c, d, a, b, in[7]  + 0x676f02d9, 14);
-  MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-
-  MD5STEP(F3, a, b, c, d, in[5]  + 0xfffa3942, 4);
-  MD5STEP(F3, d, a, b, c, in[8]  + 0x8771f681, 11);
-  MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
-  MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
-  MD5STEP(F3, a, b, c, d, in[1]  + 0xa4beea44, 4);
-  MD5STEP(F3, d, a, b, c, in[4]  + 0x4bdecfa9, 11);
-  MD5STEP(F3, c, d, a, b, in[7]  + 0xf6bb4b60, 16);
-  MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
-  MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
-  MD5STEP(F3, d, a, b, c, in[0]  + 0xeaa127fa, 11);
-  MD5STEP(F3, c, d, a, b, in[3]  + 0xd4ef3085, 16);
-  MD5STEP(F3, b, c, d, a, in[6]  + 0x04881d05, 23);
-  MD5STEP(F3, a, b, c, d, in[9]  + 0xd9d4d039, 4);
-  MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
-  MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
-  MD5STEP(F3, b, c, d, a, in[2]  + 0xc4ac5665, 23);
-
-  MD5STEP(F4, a, b, c, d, in[0]  + 0xf4292244, 6);
-  MD5STEP(F4, d, a, b, c, in[7]  + 0x432aff97, 10);
-  MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
-  MD5STEP(F4, b, c, d, a, in[5]  + 0xfc93a039, 21);
-  MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
-  MD5STEP(F4, d, a, b, c, in[3]  + 0x8f0ccc92, 10);
-  MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
-  MD5STEP(F4, b, c, d, a, in[1]  + 0x85845dd1, 21);
-  MD5STEP(F4, a, b, c, d, in[8]  + 0x6fa87e4f, 6);
-  MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
-  MD5STEP(F4, c, d, a, b, in[6]  + 0xa3014314, 15);
-  MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
-  MD5STEP(F4, a, b, c, d, in[4]  + 0xf7537e82, 6);
-  MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
-  MD5STEP(F4, c, d, a, b, in[2]  + 0x2ad7d2bb, 15);
-  MD5STEP(F4, b, c, d, a, in[9]  + 0xeb86d391, 21);
+  MD5STEP (F1, a, b, c, d, in[0]  + 0xd76aa478, 7);
+  MD5STEP (F1, d, a, b, c, in[1]  + 0xe8c7b756, 12);
+  MD5STEP (F1, c, d, a, b, in[2]  + 0x242070db, 17);
+  MD5STEP (F1, b, c, d, a, in[3]  + 0xc1bdceee, 22);
+  MD5STEP (F1, a, b, c, d, in[4]  + 0xf57c0faf, 7);
+  MD5STEP (F1, d, a, b, c, in[5]  + 0x4787c62a, 12);
+  MD5STEP (F1, c, d, a, b, in[6]  + 0xa8304613, 17);
+  MD5STEP (F1, b, c, d, a, in[7]  + 0xfd469501, 22);
+  MD5STEP (F1, a, b, c, d, in[8]  + 0x698098d8, 7);
+  MD5STEP (F1, d, a, b, c, in[9]  + 0x8b44f7af, 12);
+  MD5STEP (F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+  MD5STEP (F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+  MD5STEP (F1, a, b, c, d, in[12] + 0x6b901122, 7);
+  MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
+  MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
+  MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+  MD5STEP (F2, a, b, c, d, in[1]  + 0xf61e2562, 5);
+  MD5STEP (F2, d, a, b, c, in[6]  + 0xc040b340, 9);
+  MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+  MD5STEP (F2, b, c, d, a, in[0]  + 0xe9b6c7aa, 20);
+  MD5STEP (F2, a, b, c, d, in[5]  + 0xd62f105d, 5);
+  MD5STEP (F2, d, a, b, c, in[10] + 0x02441453, 9);
+  MD5STEP (F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+  MD5STEP (F2, b, c, d, a, in[4]  + 0xe7d3fbc8, 20);
+  MD5STEP (F2, a, b, c, d, in[9]  + 0x21e1cde6, 5);
+  MD5STEP (F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+  MD5STEP (F2, c, d, a, b, in[3]  + 0xf4d50d87, 14);
+  MD5STEP (F2, b, c, d, a, in[8]  + 0x455a14ed, 20);
+  MD5STEP (F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+  MD5STEP (F2, d, a, b, c, in[2]  + 0xfcefa3f8, 9);
+  MD5STEP (F2, c, d, a, b, in[7]  + 0x676f02d9, 14);
+  MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+  MD5STEP (F3, a, b, c, d, in[5]  + 0xfffa3942, 4);
+  MD5STEP (F3, d, a, b, c, in[8]  + 0x8771f681, 11);
+  MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+  MD5STEP (F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+  MD5STEP (F3, a, b, c, d, in[1]  + 0xa4beea44, 4);
+  MD5STEP (F3, d, a, b, c, in[4]  + 0x4bdecfa9, 11);
+  MD5STEP (F3, c, d, a, b, in[7]  + 0xf6bb4b60, 16);
+  MD5STEP (F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+  MD5STEP (F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+  MD5STEP (F3, d, a, b, c, in[0]  + 0xeaa127fa, 11);
+  MD5STEP (F3, c, d, a, b, in[3]  + 0xd4ef3085, 16);
+  MD5STEP (F3, b, c, d, a, in[6]  + 0x04881d05, 23);
+  MD5STEP (F3, a, b, c, d, in[9]  + 0xd9d4d039, 4);
+  MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+  MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+  MD5STEP (F3, b, c, d, a, in[2]  + 0xc4ac5665, 23);
+
+  MD5STEP (F4, a, b, c, d, in[0]  + 0xf4292244, 6);
+  MD5STEP (F4, d, a, b, c, in[7]  + 0x432aff97, 10);
+  MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+  MD5STEP (F4, b, c, d, a, in[5]  + 0xfc93a039, 21);
+  MD5STEP (F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+  MD5STEP (F4, d, a, b, c, in[3]  + 0x8f0ccc92, 10);
+  MD5STEP (F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+  MD5STEP (F4, b, c, d, a, in[1]  + 0x85845dd1, 21);
+  MD5STEP (F4, a, b, c, d, in[8]  + 0x6fa87e4f, 6);
+  MD5STEP (F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+  MD5STEP (F4, c, d, a, b, in[6]  + 0xa3014314, 15);
+  MD5STEP (F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+  MD5STEP (F4, a, b, c, d, in[4]  + 0xf7537e82, 6);
+  MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+  MD5STEP (F4, c, d, a, b, in[2]  + 0x2ad7d2bb, 15);
+  MD5STEP (F4, b, c, d, a, in[9]  + 0xeb86d391, 21);
 
   state[0] += a;
   state[1] += b;
diff --git a/src/lib/md5.h b/src/lib/md5.h
index 7a6f84e6..8e95b29b 100644
--- a/src/lib/md5.h
+++ b/src/lib/md5.h
@@ -20,45 +20,47 @@
 
 #include "platform.h"
 
-#define        MD5_BLOCK_SIZE              64
-#define        MD5_DIGEST_SIZE             16
-#define        MD5_DIGEST_STRING_LENGTH    (MD5_DIGEST_SIZE * 2 + 1)
+#define MD5_BLOCK_SIZE              64
+#define MD5_DIGEST_SIZE             16
+#define MD5_DIGEST_STRING_LENGTH    (MD5_DIGEST_SIZE * 2 + 1)
 
 struct MD5Context
 {
-  uint32_t state[4];                   /* state */
-  uint64_t count;                      /* number of bits, mod 2^64 */
-  uint8_t buffer[MD5_BLOCK_SIZE];      /* input buffer */
+  uint32_t state[4];      /* state */
+  uint64_t count;     /* number of bits, mod 2^64 */
+  uint8_t buffer[MD5_BLOCK_SIZE]; /* input buffer */
 };
 
 /*
  * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
  * initialization constants.
  */
-void MHD_MD5Init(struct MD5Context *ctx);
+void MHD_MD5Init (struct MD5Context *ctx);
 
 /*
  * Update context to reflect the concatenation of another buffer full
  * of bytes.
  */
-void MHD_MD5Update(struct MD5Context *ctx, const unsigned char *input, size_t 
len);
+void MHD_MD5Update (struct MD5Context *ctx, const unsigned char *input, size_t
+                    len);
 
 /*
  * Pad pad to 64-byte boundary with the bit pattern
  * 1 0* (64-bit count of bits processed, MSB-first)
  */
-void MD5Pad(struct MD5Context *ctx);
+void MD5Pad (struct MD5Context *ctx);
 
 /*
  * Final wrapup--call MD5Pad, fill in digest and zero out ctx.
  */
-void MHD_MD5Final(unsigned char digest[MD5_DIGEST_SIZE], struct MD5Context 
*ctx);
+void MHD_MD5Final (unsigned char digest[MD5_DIGEST_SIZE], struct
+                   MD5Context *ctx);
 
 /*
  * The core of the MD5 algorithm, this alters an existing MD5 hash to
  * reflect the addition of 16 longwords of new data.  MHD_MD5Update blocks
  * the data and converts bytes into longwords for this routine.
  */
-void MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_SIZE]);
+void MD5Transform (uint32_t state[4], const uint8_t block[MD5_BLOCK_SIZE]);
 
 #endif /* !MHD_MD5_H */
diff --git a/src/lib/memorypool.c b/src/lib/memorypool.c
index 8ef1e2d1..9f7472e1 100644
--- a/src/lib/memorypool.c
+++ b/src/lib/memorypool.c
@@ -25,11 +25,11 @@
 #include "memorypool.h"
 
 /* define MAP_ANONYMOUS for Mac OS X */
-#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
+#if defined(MAP_ANON) && ! defined(MAP_ANONYMOUS)
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 #ifndef MAP_FAILED
-#define MAP_FAILED ((void*)-1)
+#define MAP_FAILED ((void*) -1)
 #endif
 
 /**
@@ -40,7 +40,7 @@
 /**
  * Round up 'n' to a multiple of ALIGN_SIZE.
  */
-#define ROUND_TO_ALIGN(n) ((n+(ALIGN_SIZE-1)) & (~(ALIGN_SIZE-1)))
+#define ROUND_TO_ALIGN(n) ((n + (ALIGN_SIZE - 1)) & (~(ALIGN_SIZE - 1)))
 
 
 /**
@@ -110,11 +110,11 @@ MHD_pool_create (size_t max)
   if (max <= 32 * 1024)
     pool->memory = MAP_FAILED;
   else
-#if defined(MAP_ANONYMOUS) && !defined(_WIN32)
+#if defined(MAP_ANONYMOUS) && ! defined(_WIN32)
     pool->memory = mmap (NULL,
                          max,
                          PROT_READ | PROT_WRITE,
-                        MAP_PRIVATE | MAP_ANONYMOUS,
+                         MAP_PRIVATE | MAP_ANONYMOUS,
                          -1,
                          0);
 #elif defined(_WIN32)
@@ -128,19 +128,19 @@ MHD_pool_create (size_t max)
 #endif
   if ( (MAP_FAILED == pool->memory) ||
        (NULL == pool->memory))
+  {
+    pool->memory = malloc (max);
+    if (NULL == pool->memory)
     {
-      pool->memory = malloc (max);
-      if (NULL == pool->memory)
-        {
-          free (pool);
-          return NULL;
-        }
-      pool->is_mmap = false;
+      free (pool);
+      return NULL;
     }
+    pool->is_mmap = false;
+  }
   else
-    {
-      pool->is_mmap = true;
-    }
+  {
+    pool->is_mmap = true;
+  }
   pool->pos = 0;
   pool->end = max;
   pool->size = max;
@@ -161,7 +161,7 @@ MHD_pool_destroy (struct MemoryPool *pool)
   if (! pool->is_mmap)
     free (pool->memory);
   else
-#if defined(MAP_ANONYMOUS) && !defined(_WIN32)
+#if defined(MAP_ANONYMOUS) && ! defined(_WIN32)
     munmap (pool->memory,
             pool->size);
 #elif defined(_WIN32)
@@ -201,7 +201,7 @@ MHD_pool_get_free (struct MemoryPool *pool)
  */
 void *
 MHD_pool_allocate (struct MemoryPool *pool,
-                  size_t size,
+                   size_t size,
                    int from_end)
 {
   void *ret;
@@ -214,15 +214,15 @@ MHD_pool_allocate (struct MemoryPool *pool,
        (pool->pos + asize < pool->pos))
     return NULL;
   if (from_end == MHD_YES)
-    {
-      ret = &pool->memory[pool->end - asize];
-      pool->end -= asize;
-    }
+  {
+    ret = &pool->memory[pool->end - asize];
+    pool->end -= asize;
+  }
   else
-    {
-      ret = &pool->memory[pool->pos];
-      pool->pos += asize;
-    }
+  {
+    ret = &pool->memory[pool->pos];
+    pool->pos += asize;
+  }
   return ret;
 }
 
@@ -247,8 +247,8 @@ MHD_pool_allocate (struct MemoryPool *pool,
 void *
 MHD_pool_reallocate (struct MemoryPool *pool,
                      void *old,
-                    size_t old_size,
-                    size_t new_size)
+                     size_t old_size,
+                     size_t new_size)
 {
   void *ret;
   size_t asize;
@@ -263,35 +263,35 @@ MHD_pool_reallocate (struct MemoryPool *pool,
 
   if ( (pool->pos >= old_size) &&
        (&pool->memory[pool->pos - old_size] == old) )
+  {
+    /* was the previous allocation - optimize! */
+    if (pool->pos + asize - old_size <= pool->end)
     {
-      /* was the previous allocation - optimize! */
-      if (pool->pos + asize - old_size <= pool->end)
-        {
-          /* fits */
-          pool->pos += asize - old_size;
-          if (asize < old_size)      /* shrinking - zero again! */
-            memset (&pool->memory[pool->pos],
-                    0,
-                    old_size - asize);
-          return old;
-        }
-      /* does not fit */
-      return NULL;
+      /* fits */
+      pool->pos += asize - old_size;
+      if (asize < old_size)          /* shrinking - zero again! */
+        memset (&pool->memory[pool->pos],
+                0,
+                old_size - asize);
+      return old;
     }
+    /* does not fit */
+    return NULL;
+  }
   if (asize <= old_size)
     return old;                 /* cannot shrink, no need to move */
   if ((pool->pos + asize >= pool->pos) &&
       (pool->pos + asize <= pool->end))
-    {
-      /* fits */
-      ret = &pool->memory[pool->pos];
-      if (0 != old_size)
-        memmove (ret,
-                 old,
-                 old_size);
-      pool->pos += asize;
-      return ret;
-    }
+  {
+    /* fits */
+    ret = &pool->memory[pool->pos];
+    if (0 != old_size)
+      memmove (ret,
+               old,
+               old_size);
+    pool->pos += asize;
+    return ret;
+  }
   /* does not fit */
   return NULL;
 }
@@ -312,19 +312,19 @@ MHD_pool_reallocate (struct MemoryPool *pool,
  */
 void *
 MHD_pool_reset (struct MemoryPool *pool,
-               void *keep,
-               size_t copy_bytes,
+                void *keep,
+                size_t copy_bytes,
                 size_t new_size)
 {
   if ( (NULL != keep) &&
        (keep != pool->memory) )
-    {
-      if (0 != copy_bytes)
-        memmove (pool->memory,
-                 keep,
-                 copy_bytes);
-      keep = pool->memory;
-    }
+  {
+    if (0 != copy_bytes)
+      memmove (pool->memory,
+               keep,
+               copy_bytes);
+    keep = pool->memory;
+  }
   pool->end = pool->size;
   /* technically not needed, but safer to zero out */
   if (pool->size > copy_bytes)
diff --git a/src/lib/memorypool.h b/src/lib/memorypool.h
index 36136af8..774b05ba 100644
--- a/src/lib/memorypool.h
+++ b/src/lib/memorypool.h
@@ -70,7 +70,7 @@ MHD_pool_destroy (struct MemoryPool *pool);
  */
 void *
 MHD_pool_allocate (struct MemoryPool *pool,
-                  size_t size,
+                   size_t size,
                    int from_end);
 
 
@@ -93,9 +93,9 @@ MHD_pool_allocate (struct MemoryPool *pool,
  */
 void *
 MHD_pool_reallocate (struct MemoryPool *pool,
-                    void *old,
-                    size_t old_size,
-                    size_t new_size);
+                     void *old,
+                     size_t old_size,
+                     size_t new_size);
 
 
 /**
@@ -123,8 +123,8 @@ MHD_pool_get_free (struct MemoryPool *pool);
  */
 void *
 MHD_pool_reset (struct MemoryPool *pool,
-               void *keep,
-               size_t copy_bytes,
+                void *keep,
+                size_t copy_bytes,
                 size_t new_size);
 
 #endif
diff --git a/src/lib/mhd_assert.h b/src/lib/mhd_assert.h
index c720ce5c..e99632d0 100644
--- a/src/lib/mhd_assert.h
+++ b/src/lib/mhd_assert.h
@@ -28,21 +28,21 @@
 
 #include "mhd_options.h"
 #ifdef NDEBUG
-#  define mhd_assert(ignore) ((void)0)
+#  define mhd_assert(ignore) ((void) 0)
 #else  /* _DEBUG */
 #  ifdef HAVE_ASSERT
 #    include <assert.h>
-#    define mhd_assert(CHK) assert(CHK)
+#    define mhd_assert(CHK) assert (CHK)
 #  else  /* ! HAVE_ASSERT */
 #    include <stdio.h>
 #    include <stdlib.h>
 #    define mhd_assert(CHK) \
-       do { \
-           if (!(CHK)) { \
-             fprintf(stderr, "%s:%u Assertion failed: %s\nProgram aborted.\n", 
\
-                     __FILE__, (unsigned)__LINE__, #CHK); \
-             fflush(stderr); abort(); } \
-          } while(0)
+  do { \
+    if (! (CHK)) { \
+      fprintf (stderr, "%s:%u Assertion failed: %s\nProgram aborted.\n", \
+               __FILE__, (unsigned) __LINE__, #CHK); \
+      fflush (stderr); abort (); } \
+  } while (0)
 #  endif /* ! HAVE_ASSERT */
 #endif /* _DEBUG */
 
diff --git a/src/lib/mhd_byteorder.h b/src/lib/mhd_byteorder.h
index 66689804..230ae803 100644
--- a/src/lib/mhd_byteorder.h
+++ b/src/lib/mhd_byteorder.h
@@ -71,7 +71,8 @@
 #if defined(__BYTE_ORDER__)
 #if defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
-#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == 
__ORDER_LITTLE_ENDIAN__
+#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == \
+  __ORDER_LITTLE_ENDIAN__
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
 #elif defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
 #define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN
@@ -106,36 +107,40 @@
 /* Byte order specification didn't detected in system headers */
 /* Try some guessing */
 
-#if   (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \
-      (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN))
+#if   (defined(__BIG_ENDIAN__) && ! defined(__LITTLE_ENDIAN__)) || \
+  (defined(_BIG_ENDIAN) && ! defined(_LITTLE_ENDIAN))
 /* Seems that we are on big endian platform */
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
-#elif (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
-      (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN))
+#elif (defined(__LITTLE_ENDIAN__) && ! defined(__BIG_ENDIAN__)) || \
+  (defined(_LITTLE_ENDIAN) && ! defined(_BIG_ENDIAN))
 /* Seems that we are on little endian platform */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
-#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || 
defined(__x86_64) || \
-      defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) 
|| \
-      defined(__i386__) || defined(__i486__) || defined(__i586__) || 
defined(__i686__) || \
-      defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__)
+#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || \
+  defined(__x86_64) || \
+  defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) || \
+  defined(__i386__) || defined(__i486__) || defined(__i586__) || \
+  defined(__i686__) || \
+  defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__)
 /* x86 family is little endian */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
 #elif defined(__ARMEB__) || defined(__THUMBEB__) ||  defined(__AARCH64EB__) || 
\
-      defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
+  defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
 /* Looks like we are on ARM/MIPS in big endian mode */
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
 #elif defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \
-      defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
+  defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
 /* Looks like we are on ARM/MIPS in little endian mode */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
-#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || 
defined(__hppa) || \
-      defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \
-      defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__)
+#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || \
+  defined(__hppa) || \
+  defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \
+  defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__)
 /* Looks like we are on big endian platform */
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
-#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || 
defined(__ia64) || \
-      defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \
-      defined(__BFIN__) || defined(bfin) || defined(BFIN)
+#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
+  defined(__ia64) || \
+  defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \
+  defined(__BFIN__) || defined(bfin) || defined(BFIN)
 /* Looks like we are on little endian platform */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
 #elif defined(_WIN32)
@@ -151,9 +156,11 @@
 #ifdef _MHD_BYTE_ORDER
 /* Some safety checks */
 #if defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN
-#error Configure detected big endian byte order but headers specify different 
byte order
-#elif !defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
-#error Configure did not detect big endian byte order but headers specify big 
endian byte order
+#error \
+  Configure detected big endian byte order but headers specify different byte 
order
+#elif ! defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
+#error \
+  Configure did not detect big endian byte order but headers specify big 
endian byte order
 #endif /* !WORDS_BIGENDIAN && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN */
 #endif /* _MHD_BYTE_ORDER */
 
diff --git a/src/lib/mhd_compat.c b/src/lib/mhd_compat.c
index 3abdc367..6f6c6f9c 100644
--- a/src/lib/mhd_compat.c
+++ b/src/lib/mhd_compat.c
@@ -25,7 +25,7 @@
  */
 
 #include "mhd_compat.h"
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 #include <stdint.h>
 #include <time.h>
 #ifndef HAVE_SNPRINTF
@@ -38,7 +38,7 @@
 #include <string.h> /* for memset() */
 #endif /* ! HAVE_CALLOC */
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 
 #ifndef HAVE_SNPRINTF
 /* Emulate snprintf function on W32 */
@@ -61,16 +61,16 @@ W32_snprintf (char *__restrict s,
                       format,
                       args);
     va_end (args);
-    if ((int)n == ret)
+    if ((int) n == ret)
       s[n - 1] = 0;
     if (ret >= 0)
       return ret;
   }
-  va_start(args,
-           format);
+  va_start (args,
+            format);
   ret = _vscprintf (format,
                     args);
-  va_end(args);
+  va_end (args);
   if ( (0 <= ret) &&
        (0 != n) &&
        (NULL == s) )
@@ -85,30 +85,30 @@ W32_snprintf (char *__restrict s,
 #ifndef HAVE_CALLOC
 
 #ifdef __has_builtin
-#  if __has_builtin(__builtin_mul_overflow)
+#  if __has_builtin (__builtin_mul_overflow)
 #    define MHD_HAVE_NUL_OVERFLOW 1
 #  endif
-#elif __GNUC__+0 >= 5
+#elif __GNUC__ + 0 >= 5
 #  define MHD_HAVE_NUL_OVERFLOW 1
 #endif /* __GNUC__ >= 5 */
 
 
-void *MHD_calloc_(size_t nelem, size_t elsize)
+void *MHD_calloc_ (size_t nelem, size_t elsize)
 {
   size_t alloc_size;
   void *ptr;
 #ifdef MHD_HAVE_NUL_OVERFLOW
-  if (__builtin_mul_overflow(nelem, elsize, &alloc_size) || 0 == alloc_size)
+  if (__builtin_mul_overflow (nelem, elsize, &alloc_size) ||(0 == alloc_size))
     return NULL;
 #else  /* ! MHD_HAVE_NUL_OVERFLOW */
   alloc_size = nelem * elsize;
-  if (0 == alloc_size || elsize != alloc_size / nelem)
+  if ((0 == alloc_size)||(elsize != alloc_size / nelem))
     return NULL;
 #endif /* ! MHD_HAVE_NUL_OVERFLOW */
   ptr = malloc (alloc_size);
   if (NULL == ptr)
     return NULL;
-  memset(ptr, 0, alloc_size);
+  memset (ptr, 0, alloc_size);
   return ptr;
 }
 #endif /* ! HAVE_CALLOC */
diff --git a/src/lib/mhd_compat.h b/src/lib/mhd_compat.h
index b4e2c66c..6b38a03e 100644
--- a/src/lib/mhd_compat.h
+++ b/src/lib/mhd_compat.h
@@ -40,8 +40,8 @@
 #include <string.h>
 #endif /* HAVE_STRING_H */
 
- /* MHD_strerror_ is strerror */
-#define MHD_strerror_(errnum) strerror((errnum))
+/* MHD_strerror_ is strerror */
+#define MHD_strerror_(errnum) strerror ((errnum))
 
 /* Platform-independent snprintf name */
 #if defined(HAVE_SNPRINTF)
@@ -49,10 +49,12 @@
 #else  /* ! HAVE_SNPRINTF */
 #if defined(_WIN32) && ! defined(__CYGWIN__)
 /* Emulate snprintf function on W32 */
-int W32_snprintf(char *__restrict s, size_t n, const char *__restrict format, 
...);
+int W32_snprintf (char *__restrict s, size_t n, const char *__restrict format,
+                  ...);
 #define MHD_snprintf_ W32_snprintf
 #else  /* ! _WIN32 || __CYGWIN__ */
-#error Your platform does not support snprintf() and MHD does not know how to 
emulate it on your platform.
+#error \
+  Your platform does not support snprintf() and MHD does not know how to 
emulate it on your platform.
 #endif /* ! _WIN32 || __CYGWIN__ */
 #endif /* ! HAVE_SNPRINTF */
 
@@ -61,14 +63,14 @@ int W32_snprintf(char *__restrict s, size_t n, const char 
*__restrict format, ..
  * Generate pseudo random number at least 30-bit wide.
  * @return pseudo random number at least 30-bit wide.
  */
-#define MHD_random_() random()
+#define MHD_random_() random ()
 #else  /* HAVE_RANDOM */
 #ifdef HAVE_RAND
 /**
  * Generate pseudo random number at least 30-bit wide.
  * @return pseudo random number at least 30-bit wide.
  */
-#define MHD_random_() ( (((long)rand()) << 15) + (long)rand() )
+#define MHD_random_() ( (((long) rand ()) << 15) + (long) rand () )
 #endif /* HAVE_RAND */
 #endif /* HAVE_RANDOM */
 
@@ -76,12 +78,12 @@ int W32_snprintf(char *__restrict s, size_t n, const char 
*__restrict format, ..
 /**
  * MHD_calloc_ is platform-independent calloc()
  */
-#define MHD_calloc_(n,s) calloc((n),(s))
+#define MHD_calloc_(n,s) calloc ((n),(s))
 #else  /* ! HAVE_CALLOC */
 /**
  * MHD_calloc_ is platform-independent calloc()
  */
-void *MHD_calloc_(size_t nelem, size_t elsize);
+void *MHD_calloc_ (size_t nelem, size_t elsize);
 #endif /* ! HAVE_CALLOC */
 
 #endif /* MHD_COMPAT_H */
diff --git a/src/lib/mhd_itc.c b/src/lib/mhd_itc.c
index 8aeee576..6c81ef62 100644
--- a/src/lib/mhd_itc.c
+++ b/src/lib/mhd_itc.c
@@ -34,7 +34,7 @@
 
 
 #if defined(_MHD_ITC_PIPE)
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
 
 #ifndef HAVE_PIPE2_FUNC
 /**
@@ -48,7 +48,7 @@ MHD_itc_nonblocking_ (struct MHD_itc_ itc)
 {
   unsigned int i;
 
-  for (i=0;i<2;i++)
+  for (i = 0; i<2; i++)
   {
     int flags;
 
@@ -63,7 +63,7 @@ MHD_itc_nonblocking_ (struct MHD_itc_ itc)
                       flags | O_NONBLOCK)) )
       return 0;
   }
-  return !0;
+  return ! 0;
 }
 #endif /* ! HAVE_PIPE2_FUNC */
 #endif /* !_WIN32 || __CYGWIN__ */
diff --git a/src/lib/mhd_itc.h b/src/lib/mhd_itc.h
index 01331f13..8e303ef9 100644
--- a/src/lib/mhd_itc.h
+++ b/src/lib/mhd_itc.h
@@ -41,8 +41,9 @@
 #  include <stdlib.h>
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
-     "Abnormal termination at %d line in file %s: %s\n", \
-     (int)__LINE__, __FILE__, msg); abort();} while(0)
+                                       "Abnormal termination at %d line in 
file %s: %s\n", \
+                                       (int) __LINE__, __FILE__, msg); abort 
(); \
+} while (0)
 #endif /* ! MHD_PANIC */
 
 #if defined(_MHD_ITC_EVENTFD)
@@ -63,12 +64,13 @@
  * @param itc the itc to initialise
  * @return non-zero if succeeded, zero otherwise
  */
-#define MHD_itc_init_(itc) (-1 != ((itc).fd = eventfd (0, EFD_CLOEXEC | 
EFD_NONBLOCK)))
+#define MHD_itc_init_(itc) (-1 != ((itc).fd = eventfd (0, EFD_CLOEXEC \
+                                                       | EFD_NONBLOCK)))
 
 /**
  * Get description string of last errno for itc operations.
  */
-#define MHD_itc_last_strerror_() strerror(errno)
+#define MHD_itc_last_strerror_() strerror (errno)
 
 /**
  * Internal static const helper for MHD_itc_activate_()
@@ -82,7 +84,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_activate_(itc, str) \
-  ((write((itc).fd, (const void*)&_MHD_itc_wr_data, 8) > 0) || (EAGAIN == 
errno))
+  ((write ((itc).fd, (const void*) &_MHD_itc_wr_data, 8) > 0) || (EAGAIN == \
+                                                                  errno))
 
 /**
  * Return read FD of @a itc which can be used for poll(), select() etc.
@@ -104,8 +107,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_clear_(itc)                  \
   do { uint64_t __b; int __r;                \
-       __r = read((itc).fd, &__b, sizeof(__b)); \
-       (void)__r; } while(0)
+       __r = read ((itc).fd, &__b, sizeof(__b)); \
+       (void) __r; } while (0)
 
 /**
  * Destroy previously initialised ITC.  Note that close()
@@ -155,20 +158,20 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #ifdef HAVE_PIPE2_FUNC
-#  define MHD_itc_init_(itc) (!pipe2((itc).fd, O_CLOEXEC | O_NONBLOCK))
+#  define MHD_itc_init_(itc) (! pipe2 ((itc).fd, O_CLOEXEC | O_NONBLOCK))
 #else  /* ! HAVE_PIPE2_FUNC */
 #  define MHD_itc_init_(itc)              \
-     ( (!pipe((itc).fd)) ?                \
-         (MHD_itc_nonblocking_((itc)) ?   \
-           (!0) :                         \
-           (MHD_itc_destroy_((itc)), 0) ) \
-         : (0) )
+  ( (! pipe ((itc).fd)) ?                \
+    (MHD_itc_nonblocking_ ((itc)) ?   \
+     (! 0) :                         \
+     (MHD_itc_destroy_ ((itc)), 0) ) \
+    : (0) )
 #endif /* ! HAVE_PIPE2_FUNC */
 
 /**
  * Get description string of last errno for itc operations.
  */
-#define MHD_itc_last_strerror_() strerror(errno)
+#define MHD_itc_last_strerror_() strerror (errno)
 
 /**
  * Activate signal on @a itc
@@ -177,7 +180,7 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_activate_(itc, str) \
-  ((write((itc).fd[1], (const void*)(str), 1) > 0) || (EAGAIN == errno))
+  ((write ((itc).fd[1], (const void*) (str), 1) > 0) || (EAGAIN == errno))
 
 
 /**
@@ -200,8 +203,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_clear_(itc) do                      \
   { long __b;                                       \
-    while(0 < read((itc).fd[0], &__b, sizeof(__b))) \
-    {} } while(0)
+    while (0 < read ((itc).fd[0], &__b, sizeof(__b))) \
+    {} } while (0)
 
 /**
  * Destroy previously initialised ITC
@@ -210,8 +213,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_destroy_(itc)      \
   ( (0 == close ((itc).fd[0])) ?   \
-      (0 == close ((itc).fd[1])) : \
-      ((close ((itc).fd[1])), 0) )
+    (0 == close ((itc).fd[1])) : \
+    ((close ((itc).fd[1])), 0) )
 
 /**
  * Check whether ITC has valid value.
@@ -231,14 +234,14 @@ static const uint64_t _MHD_itc_wr_data = 1;
 #define MHD_itc_set_invalid_(itc) ((itc).fd[0] = (itc).fd[1] = -1)
 
 #ifndef HAVE_PIPE2_FUNC
-  /**
-   * Change itc FD options to be non-blocking.
-   *
-   * @param fd the FD to manipulate
-   * @return non-zero if succeeded, zero otherwise
-   */
-  int
-  MHD_itc_nonblocking_ (struct MHD_itc_ itc);
+/**
+ * Change itc FD options to be non-blocking.
+ *
+ * @param fd the FD to manipulate
+ * @return non-zero if succeeded, zero otherwise
+ */
+int
+MHD_itc_nonblocking_ (struct MHD_itc_ itc);
 #endif /* ! HAVE_PIPE2_FUNC */
 
 
@@ -255,20 +258,20 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #ifdef MHD_socket_pair_nblk_
-#  define MHD_itc_init_(itc) MHD_socket_pair_nblk_((itc).sk)
+#  define MHD_itc_init_(itc) MHD_socket_pair_nblk_ ((itc).sk)
 #else  /* ! MHD_socket_pair_nblk_ */
 #  define MHD_itc_init_(itc)            \
-     (MHD_socket_pair_((itc).sk) ?      \
-       (MHD_itc_nonblocking_((itc)) ?   \
-         (!0) :                         \
-         (MHD_itc_destroy_((itc)), 0) ) \
-       : (0))
+  (MHD_socket_pair_ ((itc).sk) ?      \
+   (MHD_itc_nonblocking_ ((itc)) ?   \
+    (! 0) :                         \
+    (MHD_itc_destroy_ ((itc)), 0) ) \
+   : (0))
 #endif /* ! MHD_socket_pair_nblk_ */
 
 /**
  * Get description string of last error for itc operations.
  */
-#define MHD_itc_last_strerror_() MHD_socket_last_strerr_()
+#define MHD_itc_last_strerror_() MHD_socket_last_strerr_ ()
 
 /**
  * Activate signal on @a itc
@@ -277,8 +280,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_activate_(itc, str)          \
-  ((MHD_send_((itc).sk[1], (str), 1) > 0) || \
-   (MHD_SCKT_ERR_IS_EAGAIN_(MHD_socket_get_error_())))
+  ((MHD_send_ ((itc).sk[1], (str), 1) > 0) || \
+   (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ())))
 
 /**
  * Return read FD of @a itc which can be used for poll(), select() etc.
@@ -300,10 +303,10 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_clear_(itc) do      \
   { long __b;                       \
-    while(0 < recv((itc).sk[0],     \
-                   (char*)&__b,     \
-                   sizeof(__b), 0)) \
-    {} } while(0)
+    while (0 < recv ((itc).sk[0],     \
+                     (char*) &__b,     \
+                     sizeof(__b), 0)) \
+    {} } while (0)
 
 /**
  * Destroy previously initialised ITC
@@ -311,9 +314,9 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_destroy_(itc)          \
-  ( MHD_socket_close_((itc).sk[0]) ?   \
-      MHD_socket_close_((itc).sk[1]) : \
-      ((void)MHD_socket_close_((itc).sk[1]), 0) )
+  (MHD_socket_close_ ((itc).sk[0]) ?   \
+   MHD_socket_close_ ((itc).sk[1]) : \
+   ((void) MHD_socket_close_ ((itc).sk[1]), 0) )
 
 
 /**
@@ -331,10 +334,12 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * Set @a itc to invalid value.
  * @param itc the itc to set
  */
-#define MHD_itc_set_invalid_(itc) ((itc).sk[0] = (itc).sk[1] = 
MHD_INVALID_SOCKET)
+#define MHD_itc_set_invalid_(itc) ((itc).sk[0] = (itc).sk[1] = \
+                                     MHD_INVALID_SOCKET)
 
 #ifndef MHD_socket_pair_nblk_
-#  define MHD_itc_nonblocking_(pip) (MHD_socket_nonblocking_((pip).sk[0]) && 
MHD_socket_nonblocking_((pip).sk[1]))
+#  define MHD_itc_nonblocking_(pip) (MHD_socket_nonblocking_ ((pip).sk[0]) && \
+                                     MHD_socket_nonblocking_ ((pip).sk[1]))
 #endif /* ! MHD_socket_pair_nblk_ */
 
 #endif /* _MHD_ITC_SOCKETPAIR */
@@ -345,9 +350,9 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @param itc the itc to destroy
  */
 #define MHD_itc_destroy_chk_(itc) do {          \
-    if (!MHD_itc_destroy_(itc))                 \
-      MHD_PANIC(_("Failed to destroy ITC.\n")); \
-  } while(0)
+    if (! MHD_itc_destroy_ (itc))                 \
+      MHD_PANIC (_ ("Failed to destroy ITC.\n")); \
+} while (0)
 
 /**
  * Check whether ITC has invalid value.
@@ -358,6 +363,6 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return boolean true if @a itc has invalid value,
  *         boolean false otherwise.
  */
-#define MHD_ITC_IS_INVALID_(itc)  (! MHD_ITC_IS_VALID_(itc))
+#define MHD_ITC_IS_INVALID_(itc)  (! MHD_ITC_IS_VALID_ (itc))
 
 #endif /* MHD_ITC_H */
diff --git a/src/lib/mhd_itc_types.h b/src/lib/mhd_itc_types.h
index 04966d36..36d4218b 100644
--- a/src/lib/mhd_itc_types.h
+++ b/src/lib/mhd_itc_types.h
@@ -32,7 +32,7 @@
 #include "mhd_options.h"
 
 /* Force socketpair on native W32 */
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(_MHD_ITC_SOCKETPAIR)
+#if defined(_WIN32) && ! defined(__CYGWIN__) && ! defined(_MHD_ITC_SOCKETPAIR)
 #error _MHD_ITC_SOCKETPAIR is not defined on naitive W32 platform
 #endif /* _WIN32 && !__CYGWIN__ && !_MHD_ITC_SOCKETPAIR */
 
diff --git a/src/lib/mhd_limits.h b/src/lib/mhd_limits.h
index 41d33a8f..87b41447 100644
--- a/src/lib/mhd_limits.h
+++ b/src/lib/mhd_limits.h
@@ -32,17 +32,17 @@
 #include <limits.h>
 #endif /* HAVE_LIMITS_H */
 
-#define MHD_UNSIGNED_TYPE_MAX_(type) ((type)-1)
+#define MHD_UNSIGNED_TYPE_MAX_(type) ((type) - 1)
 /* Assume 8 bits per byte, no padding bits. */
 #define MHD_SIGNED_TYPE_MAX_(type) \
-        ( (type)((( ((type)1) << (sizeof(type)*8 - 2)) - 1)*2 + 1) )
-#define MHD_TYPE_IS_SIGNED_(type) (((type)0)>((type)-1))
+  ( (type) ((( ((type) 1) << (sizeof(type) * 8 - 2)) - 1) * 2 + 1) )
+#define MHD_TYPE_IS_SIGNED_(type) (((type) 0)>((type) - 1))
 
 #ifndef UINT_MAX
 #ifdef __UINT_MAX__
 #define UINT_MAX __UINT_MAX__
 #else  /* ! __UINT_MAX__ */
-#define UINT_MAX MHD_UNSIGNED_TYPE_MAX_(unsigned int)
+#define UINT_MAX MHD_UNSIGNED_TYPE_MAX_ (unsigned int)
 #endif /* ! __UINT_MAX__ */
 #endif /* !UINT_MAX */
 
@@ -50,19 +50,19 @@
 #ifdef __LONG_MAX__
 #define LONG_MAX __LONG_MAX__
 #else  /* ! __LONG_MAX__ */
-#define LONG_MAX MHD_SIGNED_TYPE_MAX(long)
+#define LONG_MAX MHD_SIGNED_TYPE_MAX (long)
 #endif /* ! __LONG_MAX__ */
 #endif /* !OFF_T_MAX */
 
 #ifndef ULLONG_MAX
-#define ULLONG_MAX MHD_UNSIGNED_TYPE_MAX_(MHD_UNSIGNED_LONG_LONG)
+#define ULLONG_MAX MHD_UNSIGNED_TYPE_MAX_ (MHD_UNSIGNED_LONG_LONG)
 #endif /* !ULLONG_MAX */
 
 #ifndef INT32_MAX
 #ifdef __INT32_MAX__
 #define INT32_MAX __INT32_MAX__
 #else  /* ! __INT32_MAX__ */
-#define INT32_MAX ((int32_t)0x7FFFFFFF)
+#define INT32_MAX ((int32_t) 0x7FFFFFFF)
 #endif /* ! __INT32_MAX__ */
 #endif /* !INT32_MAX */
 
@@ -70,7 +70,7 @@
 #ifdef __UINT32_MAX__
 #define UINT32_MAX __UINT32_MAX__
 #else  /* ! __UINT32_MAX__ */
-#define UINT32_MAX ((int32_t)0xFFFFFFFF)
+#define UINT32_MAX ((int32_t) 0xFFFFFFFF)
 #endif /* ! __UINT32_MAX__ */
 #endif /* !UINT32_MAX */
 
@@ -78,7 +78,7 @@
 #ifdef __UINT64_MAX__
 #define UINT64_MAX __UINT64_MAX__
 #else  /* ! __UINT64_MAX__ */
-#define UINT64_MAX ((uint64_t)0xFFFFFFFFFFFFFFFF)
+#define UINT64_MAX ((uint64_t) 0xFFFFFFFFFFFFFFFF)
 #endif /* ! __UINT64_MAX__ */
 #endif /* !UINT64_MAX */
 
@@ -86,7 +86,7 @@
 #ifdef __INT64_MAX__
 #define INT64_MAX __INT64_MAX__
 #else  /* ! __INT64_MAX__ */
-#define INT64_MAX ((int64_t)0x7FFFFFFFFFFFFFFF)
+#define INT64_MAX ((int64_t) 0x7FFFFFFFFFFFFFFF)
 #endif /* ! __UINT64_MAX__ */
 #endif /* !INT64_MAX */
 
@@ -96,8 +96,8 @@
 #elif defined(UINTPTR_MAX)
 #define SIZE_MAX UINTPTR_MAX
 #else  /* ! __SIZE_MAX__ */
-#define SIZE_MAX MHD_UNSIGNED_TYPE_MAX_(size_t)
-#endif /* ! __SIZE_MAX__ */ 
+#define SIZE_MAX MHD_UNSIGNED_TYPE_MAX_ (size_t)
+#endif /* ! __SIZE_MAX__ */
 #endif /* !SIZE_MAX */
 
 #ifndef SSIZE_MAX
@@ -108,7 +108,7 @@
 #elif defined(INTPTR_MAX)
 #define SSIZE_MAX INTPTR_MAX
 #else
-#define SSIZE_MAN MHD_SIGNED_TYPE_MAX_(ssize_t)
+#define SSIZE_MAN MHD_SIGNED_TYPE_MAX_ (ssize_t)
 #endif
 #endif /* ! SSIZE_MAX */
 
@@ -120,19 +120,19 @@
 #elif defined(__APPLE__) && defined(__MACH__)
 #define OFF_T_MAX INT64_MAX
 #else
-#define OFF_T_MAX MHD_SIGNED_TYPE_MAX_(off_t)
+#define OFF_T_MAX MHD_SIGNED_TYPE_MAX_ (off_t)
 #endif
 #endif /* !OFF_T_MAX */
 
-#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX)
-#define OFF64_T_MAX MHD_SIGNED_TYPE_MAX_(uint64_t)
+#if defined(_LARGEFILE64_SOURCE) && ! defined(OFF64_T_MAX)
+#define OFF64_T_MAX MHD_SIGNED_TYPE_MAX_ (uint64_t)
 #endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */
 
 #ifndef TIME_T_MAX
 #define TIME_T_MAX ((time_t)              \
-       ( MHD_TYPE_IS_SIGNED_(time_t) ?    \
-           MHD_SIGNED_TYPE_MAX_(time_t) : \
-           MHD_UNSIGNED_TYPE_MAX_(time_t)))
+                    (MHD_TYPE_IS_SIGNED_ (time_t) ?    \
+                     MHD_SIGNED_TYPE_MAX_ (time_t) : \
+                     MHD_UNSIGNED_TYPE_MAX_ (time_t)))
 #endif /* !TIME_T_MAX */
 
 #ifndef TIMEVAL_TV_SEC_MAX
diff --git a/src/lib/mhd_locks.h b/src/lib/mhd_locks.h
index 21db56c4..8c9b0844 100644
--- a/src/lib/mhd_locks.h
+++ b/src/lib/mhd_locks.h
@@ -59,14 +59,15 @@
 #  include <stdlib.h>
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
-     "Abnormal termination at %d line in file %s: %s\n", \
-     (int)__LINE__, __FILE__, msg); abort();} while(0)
+                                       "Abnormal termination at %d line in 
file %s: %s\n", \
+                                       (int) __LINE__, __FILE__, msg); abort 
(); \
+} while (0)
 #endif /* ! MHD_PANIC */
 
 #if defined(MHD_PTHREAD_MUTEX_)
-  typedef pthread_mutex_t MHD_mutex_;
+typedef pthread_mutex_t MHD_mutex_;
 #elif defined(MHD_W32_MUTEX_)
-  typedef CRITICAL_SECTION MHD_mutex_;
+typedef CRITICAL_SECTION MHD_mutex_;
 #endif
 
 #if defined(MHD_PTHREAD_MUTEX_)
@@ -75,14 +76,15 @@
  * @param pmutex pointer to the mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_init_(pmutex) (!(pthread_mutex_init((pmutex), NULL)))
+#define MHD_mutex_init_(pmutex) (! (pthread_mutex_init ((pmutex), NULL)))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Initialise new mutex.
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_init_(pmutex) 
(InitializeCriticalSectionAndSpinCount((pmutex),16))
+#define MHD_mutex_init_(pmutex) (InitializeCriticalSectionAndSpinCount ( \
+                                   (pmutex),16))
 #endif
 
 #if defined(MHD_PTHREAD_MUTEX_)
@@ -90,7 +92,8 @@
 /**
  *  Define static mutex and statically initialise it.
  */
-#    define MHD_MUTEX_STATIC_DEFN_INIT_(m) static MHD_mutex_ m = 
PTHREAD_MUTEX_INITIALIZER
+#    define MHD_MUTEX_STATIC_DEFN_INIT_(m) static MHD_mutex_ m = \
+  PTHREAD_MUTEX_INITIALIZER
 #  endif /* PTHREAD_MUTEX_INITIALIZER */
 #endif
 
@@ -100,14 +103,14 @@
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_destroy_(pmutex) (!(pthread_mutex_destroy((pmutex))))
+#define MHD_mutex_destroy_(pmutex) (! (pthread_mutex_destroy ((pmutex))))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Destroy previously initialised mutex.
  * @param pmutex pointer to mutex
  * @return Always nonzero
  */
-#define MHD_mutex_destroy_(pmutex) (DeleteCriticalSection((pmutex)), !0)
+#define MHD_mutex_destroy_(pmutex) (DeleteCriticalSection ((pmutex)), ! 0)
 #endif
 
 /**
@@ -116,9 +119,9 @@
  * @param pmutex pointer to mutex
  */
 #define MHD_mutex_destroy_chk_(pmutex) do {       \
-    if (!MHD_mutex_destroy_(pmutex))              \
-      MHD_PANIC(_("Failed to destroy mutex.\n")); \
-  } while(0)
+    if (! MHD_mutex_destroy_ (pmutex))              \
+      MHD_PANIC (_ ("Failed to destroy mutex.\n")); \
+} while (0)
 
 
 #if defined(MHD_PTHREAD_MUTEX_)
@@ -129,7 +132,7 @@
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_lock_(pmutex) (!(pthread_mutex_lock((pmutex))))
+#define MHD_mutex_lock_(pmutex) (! (pthread_mutex_lock ((pmutex))))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Acquire lock on previously initialised mutex.
@@ -138,7 +141,7 @@
  * @param pmutex pointer to mutex
  * @return Always nonzero
  */
-#define MHD_mutex_lock_(pmutex) (EnterCriticalSection((pmutex)), !0)
+#define MHD_mutex_lock_(pmutex) (EnterCriticalSection ((pmutex)), ! 0)
 #endif
 
 /**
@@ -149,9 +152,9 @@
  * @param pmutex pointer to mutex
  */
 #define MHD_mutex_lock_chk_(pmutex) do {       \
-    if (!MHD_mutex_lock_(pmutex))              \
-      MHD_PANIC(_("Failed to lock mutex.\n")); \
-  } while(0)
+    if (! MHD_mutex_lock_ (pmutex))              \
+      MHD_PANIC (_ ("Failed to lock mutex.\n")); \
+} while (0)
 
 #if defined(MHD_PTHREAD_MUTEX_)
 /**
@@ -159,14 +162,14 @@
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_unlock_(pmutex) (!(pthread_mutex_unlock((pmutex))))
+#define MHD_mutex_unlock_(pmutex) (! (pthread_mutex_unlock ((pmutex))))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Unlock previously initialised and locked mutex.
  * @param pmutex pointer to mutex
  * @return Always nonzero
  */
-#define MHD_mutex_unlock_(pmutex) (LeaveCriticalSection((pmutex)), !0)
+#define MHD_mutex_unlock_(pmutex) (LeaveCriticalSection ((pmutex)), ! 0)
 #endif
 
 /**
@@ -175,9 +178,9 @@
  * @param pmutex pointer to mutex
  */
 #define MHD_mutex_unlock_chk_(pmutex) do {       \
-    if (!MHD_mutex_unlock_(pmutex))              \
-      MHD_PANIC(_("Failed to unlock mutex.\n")); \
-  } while(0)
+    if (! MHD_mutex_unlock_ (pmutex))              \
+      MHD_PANIC (_ ("Failed to unlock mutex.\n")); \
+} while (0)
 
 
 #endif /* ! MHD_LOCKS_H */
diff --git a/src/lib/mhd_mono_clock.c b/src/lib/mhd_mono_clock.c
index 97dbfb9f..eee911fb 100644
--- a/src/lib/mhd_mono_clock.c
+++ b/src/lib/mhd_mono_clock.c
@@ -76,7 +76,8 @@ static clockid_t mono_clock_id = _MHD_UNWANTED_CLOCK;
 #endif /* HAVE_CLOCK_GETTIME */
 
 /* sync clocks; reduce chance of value wrap */
-#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GET_TIME) || 
defined(HAVE_GETHRTIME)
+#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GET_TIME) || \
+  defined(HAVE_GETHRTIME)
 static time_t mono_clock_start;
 #endif /* HAVE_CLOCK_GETTIME || HAVE_CLOCK_GET_TIME || HAVE_GETHRTIME */
 static time_t sys_clock_start;
@@ -124,9 +125,9 @@ enum _MHD_mono_clock_source
    */
   _MHD_CLOCK_GETTICKCOUNT64,
 
-   /**
-    * QueryPerformanceCounter() / QueryPerformanceFrequency()
-    */
+  /**
+   * QueryPerformanceCounter() / QueryPerformanceFrequency()
+   */
   _MHD_CLOCK_PERFCOUNTER
 };
 
@@ -153,8 +154,8 @@ MHD_monotonic_sec_counter_init (void)
   /* just a little syntactic trick to get the
      various following ifdef's to work out nicely */
   if (0)
-    {
-    }
+  {
+  }
   else
 #ifdef HAVE_CLOCK_GETTIME
 #ifdef CLOCK_MONOTONIC_COARSE
@@ -163,11 +164,11 @@ MHD_monotonic_sec_counter_init (void)
   /* but preferred since it's fast */
   if (0 == clock_gettime (CLOCK_MONOTONIC_COARSE,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC_COARSE;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC_COARSE;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_MONOTONIC_COARSE */
 #ifdef CLOCK_MONOTONIC_FAST
@@ -175,11 +176,11 @@ MHD_monotonic_sec_counter_init (void)
   /* Can be affected by frequency adjustment, but preferred since it's fast */
   if (0 == clock_gettime (CLOCK_MONOTONIC_FAST,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC_FAST;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC_FAST;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_MONOTONIC_COARSE */
 #ifdef CLOCK_MONOTONIC_RAW
@@ -187,11 +188,11 @@ MHD_monotonic_sec_counter_init (void)
   /* Not affected by frequency adjustment, but don't count time in suspend */
   if (0 == clock_gettime (CLOCK_MONOTONIC_RAW,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC_RAW;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC_RAW;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_MONOTONIC_RAW */
 #ifdef CLOCK_BOOTTIME
@@ -200,11 +201,11 @@ MHD_monotonic_sec_counter_init (void)
   /* but can be slower value-getting than other clocks */
   if (0 == clock_gettime (CLOCK_BOOTTIME,
                           &ts))
-    {
-      mono_clock_id = CLOCK_BOOTTIME;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_BOOTTIME;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_BOOTTIME */
 #ifdef CLOCK_MONOTONIC
@@ -213,11 +214,11 @@ MHD_monotonic_sec_counter_init (void)
   /* On Linux it's not truly monotonic as it doesn't count time in suspend */
   if (0 == clock_gettime (CLOCK_MONOTONIC,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_BOOTTIME */
 #endif /* HAVE_CLOCK_GETTIME */
@@ -225,15 +226,15 @@ MHD_monotonic_sec_counter_init (void)
   /* Darwin-specific monotonic clock */
   /* Should be monotonic as clock_set_time function always unconditionally */
   /* failed on latest kernels */
-  if ( (KERN_SUCCESS == host_get_clock_service (mach_host_self(),
+  if ( (KERN_SUCCESS == host_get_clock_service (mach_host_self (),
                                                 SYSTEM_CLOCK,
                                                 &mono_clock_service)) &&
        (KERN_SUCCESS == clock_get_time (mono_clock_service,
                                         &cur_time)) )
-    {
-      mono_clock_start = cur_time.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GET_TIME;
-    }
+  {
+    mono_clock_start = cur_time.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GET_TIME;
+  }
   else
 #endif /* HAVE_CLOCK_GET_TIME */
 #ifdef _WIN32
@@ -241,25 +242,25 @@ MHD_monotonic_sec_counter_init (void)
   /* W32 Vista or later specific monotonic clock */
   /* Available since Vista, ~15ms accuracy */
   if (1)
-    {
-      tick_start = GetTickCount64 ();
-      mono_clock_source = _MHD_CLOCK_GETTICKCOUNT64;
-    }
+  {
+    tick_start = GetTickCount64 ();
+    mono_clock_source = _MHD_CLOCK_GETTICKCOUNT64;
+  }
   else
 #else  /* _WIN32_WINNT < 0x0600 */
   /* W32 specific monotonic clock */
   /* Available on Windows 2000 and later */
   if (1)
-    {
-      LARGE_INTEGER freq;
-      LARGE_INTEGER perf_counter;
-
-      QueryPerformanceFrequency (&freq); /* never fail on XP and later */
-      QueryPerformanceCounter (&perf_counter); /* never fail on XP and later */
-      perf_freq = freq.QuadPart;
-      perf_start = perf_counter.QuadPart;
-      mono_clock_source = _MHD_CLOCK_PERFCOUNTER;
-    }
+  {
+    LARGE_INTEGER freq;
+    LARGE_INTEGER perf_counter;
+
+    QueryPerformanceFrequency (&freq);   /* never fail on XP and later */
+    QueryPerformanceCounter (&perf_counter);   /* never fail on XP and later */
+    perf_freq = freq.QuadPart;
+    perf_start = perf_counter.QuadPart;
+    mono_clock_source = _MHD_CLOCK_PERFCOUNTER;
+  }
   else
 #endif /* _WIN32_WINNT < 0x0600 */
 #endif /* _WIN32 */
@@ -269,11 +270,11 @@ MHD_monotonic_sec_counter_init (void)
   /* Not preferred due to be potentially resource-hungry */
   if (0 == clock_gettime (CLOCK_HIGHRES,
                           &ts))
-    {
-      mono_clock_id = CLOCK_HIGHRES;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_HIGHRES;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_HIGHRES */
 #endif /* HAVE_CLOCK_GETTIME */
@@ -281,26 +282,26 @@ MHD_monotonic_sec_counter_init (void)
   /* HP-UX and Solaris monotonic clock */
   /* Not preferred due to be potentially resource-hungry */
   if (1)
-    {
-      hrtime_start = gethrtime ();
-      mono_clock_source = _MHD_CLOCK_GETHRTIME;
-    }
+  {
+    hrtime_start = gethrtime ();
+    mono_clock_source = _MHD_CLOCK_GETHRTIME;
+  }
   else
 #endif /* HAVE_GETHRTIME */
-    {
-      /* no suitable clock source was found */
-      mono_clock_source = _MHD_CLOCK_NO_SOURCE;
-    }
+  {
+    /* no suitable clock source was found */
+    mono_clock_source = _MHD_CLOCK_NO_SOURCE;
+  }
 
 #ifdef HAVE_CLOCK_GET_TIME
   if ( (_MHD_CLOCK_GET_TIME != mono_clock_source) &&
        (_MHD_INVALID_CLOCK_SERV != mono_clock_service) )
-    {
-      /* clock service was initialised but clock_get_time failed */
-      mach_port_deallocate (mach_task_self(),
-                            mono_clock_service);
-      mono_clock_service = _MHD_INVALID_CLOCK_SERV;
-    }
+  {
+    /* clock service was initialised but clock_get_time failed */
+    mach_port_deallocate (mach_task_self (),
+                          mono_clock_service);
+    mono_clock_service = _MHD_INVALID_CLOCK_SERV;
+  }
 #else
   (void) mono_clock_source; /* avoid compiler warning */
 #endif /* HAVE_CLOCK_GET_TIME */
@@ -317,11 +318,11 @@ MHD_monotonic_sec_counter_finish (void)
 {
 #ifdef HAVE_CLOCK_GET_TIME
   if (_MHD_INVALID_CLOCK_SERV != mono_clock_service)
-    {
-      mach_port_deallocate (mach_task_self(),
-                            mono_clock_service);
-      mono_clock_service = _MHD_INVALID_CLOCK_SERV;
-    }
+  {
+    mach_port_deallocate (mach_task_self (),
+                          mono_clock_service);
+    mono_clock_service = _MHD_INVALID_CLOCK_SERV;
+  }
 #endif /* HAVE_CLOCK_GET_TIME */
 }
 
@@ -340,37 +341,38 @@ MHD_monotonic_sec_counter (void)
   struct timespec ts;
 
   if ( (_MHD_UNWANTED_CLOCK != mono_clock_id) &&
-       (0 == clock_gettime (mono_clock_id ,
+       (0 == clock_gettime (mono_clock_id,
                             &ts)) )
     return ts.tv_sec - mono_clock_start;
 #endif /* HAVE_CLOCK_GETTIME */
 #ifdef HAVE_CLOCK_GET_TIME
   if (_MHD_INVALID_CLOCK_SERV != mono_clock_service)
-    {
-      mach_timespec_t cur_time;
+  {
+    mach_timespec_t cur_time;
 
-      if (KERN_SUCCESS == clock_get_time(mono_clock_service,
-                                         &cur_time))
-        return cur_time.tv_sec - mono_clock_start;
-    }
+    if (KERN_SUCCESS == clock_get_time (mono_clock_service,
+                                        &cur_time))
+      return cur_time.tv_sec - mono_clock_start;
+  }
 #endif /* HAVE_CLOCK_GET_TIME */
 #if defined(_WIN32)
 #if _WIN32_WINNT >= 0x0600
   if (1)
-    return (time_t)(((uint64_t)(GetTickCount64() - tick_start)) / 1000);
+    return (time_t) (((uint64_t) (GetTickCount64 () - tick_start)) / 1000);
 #else  /* _WIN32_WINNT < 0x0600 */
   if (0 != perf_freq)
-    {
-      LARGE_INTEGER perf_counter;
+  {
+    LARGE_INTEGER perf_counter;
 
-      QueryPerformanceCounter (&perf_counter); /* never fail on XP and later */
-      return (time_t)(((uint64_t)(perf_counter.QuadPart - perf_start)) / 
perf_freq);
-    }
+    QueryPerformanceCounter (&perf_counter);   /* never fail on XP and later */
+    return (time_t) (((uint64_t) (perf_counter.QuadPart - perf_start))
+                     / perf_freq);
+  }
 #endif /* _WIN32_WINNT < 0x0600 */
 #endif /* _WIN32 */
 #ifdef HAVE_GETHRTIME
   if (1)
-    return (time_t)(((uint64_t) (gethrtime () - hrtime_start)) / 1000000000);
+    return (time_t) (((uint64_t) (gethrtime () - hrtime_start)) / 1000000000);
 #endif /* HAVE_GETHRTIME */
 
   return time (NULL) - sys_clock_start;
diff --git a/src/lib/mhd_mono_clock.h b/src/lib/mhd_mono_clock.h
index f4722af2..92485e00 100644
--- a/src/lib/mhd_mono_clock.h
+++ b/src/lib/mhd_mono_clock.h
@@ -37,14 +37,14 @@
  * Initialise monotonic seconds counter.
  */
 void
-MHD_monotonic_sec_counter_init(void);
+MHD_monotonic_sec_counter_init (void);
 
 
 /**
  * Deinitialise monotonic seconds counter by freeing any allocated resources
  */
 void
-MHD_monotonic_sec_counter_finish(void);
+MHD_monotonic_sec_counter_finish (void);
 
 
 /**
@@ -55,6 +55,6 @@ MHD_monotonic_sec_counter_finish(void);
  * @return number of seconds from some fixed moment
  */
 time_t
-MHD_monotonic_sec_counter(void);
+MHD_monotonic_sec_counter (void);
 
 #endif /* MHD_MONO_CLOCK_H */
diff --git a/src/lib/mhd_sockets.c b/src/lib/mhd_sockets.c
index 356d288f..248b9a68 100644
--- a/src/lib/mhd_sockets.c
+++ b/src/lib/mhd_sockets.c
@@ -37,10 +37,10 @@
  * @param err the WinSock error code.
  * @return pointer to string description of specified WinSock error.
  */
-const char* MHD_W32_strerror_winsock_(int err)
+const char*MHD_W32_strerror_winsock_ (int err)
 {
   switch (err)
-    {
+  {
   case 0:
     return "No error";
   case WSA_INVALID_HANDLE:
@@ -233,7 +233,7 @@ const char* MHD_W32_strerror_winsock_(int err)
     return "Invalid QoS shaping rate object";
   case WSA_QOS_RESERVED_PETYPE:
     return "Reserved policy QoS element type";
-    }
+  }
   return "Unknown winsock error";
 }
 
@@ -246,113 +246,114 @@ const char* MHD_W32_strerror_winsock_(int err)
  * @return non-zero if succeeded, zero otherwise
  */
 int
-MHD_W32_socket_pair_(SOCKET sockets_pair[2], int non_blk)
+MHD_W32_socket_pair_ (SOCKET sockets_pair[2], int non_blk)
 {
   int i;
 
   if (! sockets_pair)
-    {
-      WSASetLastError (WSAEFAULT);
-      return 0;
-    }
+  {
+    WSASetLastError (WSAEFAULT);
+    return 0;
+  }
 
 #define PAIRMAXTRYIES 800
   for (i = 0; i < PAIRMAXTRYIES; i++)
+  {
+    struct sockaddr_in listen_addr;
+    SOCKET listen_s;
+    static const int c_addinlen = sizeof(struct sockaddr_in);   /* help 
compiler to optimize */
+    int addr_len = c_addinlen;
+    unsigned long on_val = 1;
+    unsigned long off_val = 0;
+
+    listen_s = socket (AF_INET,
+                       SOCK_STREAM,
+                       IPPROTO_TCP);
+    if (INVALID_SOCKET == listen_s)
+      break;   /* can't create even single socket */
+
+    listen_addr.sin_family = AF_INET;
+    listen_addr.sin_port = 0;   /* same as htons(0) */
+    listen_addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
+    if ( ((0 == bind (listen_s,
+                      (struct sockaddr*) &listen_addr,
+                      c_addinlen)) &&
+          (0 == listen (listen_s,
+                        1) ) &&
+          (0 == getsockname (listen_s,
+                             (struct sockaddr*) &listen_addr,
+                             &addr_len))) )
     {
-      struct sockaddr_in listen_addr;
-      SOCKET listen_s;
-      static const int c_addinlen = sizeof(struct sockaddr_in); /* help 
compiler to optimize */
-      int addr_len = c_addinlen;
-      unsigned long on_val = 1;
-      unsigned long off_val = 0;
-
-      listen_s = socket (AF_INET,
-                         SOCK_STREAM,
-                         IPPROTO_TCP);
-      if (INVALID_SOCKET == listen_s)
-        break; /* can't create even single socket */
-
-      listen_addr.sin_family = AF_INET;
-      listen_addr.sin_port = 0; /* same as htons(0) */
-      listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-      if ( (0 == bind (listen_s,
-                       (struct sockaddr*) &listen_addr,
-                       c_addinlen) &&
-            (0 == listen (listen_s,
-                          1) ) &&
-            (0 == getsockname (listen_s,
-                               (struct sockaddr*) &listen_addr,
-                               &addr_len))) )
-        {
-          SOCKET client_s = socket(AF_INET,
-                                   SOCK_STREAM,
-                                   IPPROTO_TCP);
-          struct sockaddr_in accepted_from_addr;
-          struct sockaddr_in client_addr;
-          SOCKET server_s;
-
-          if (INVALID_SOCKET == client_s)
-            {
-              /* try again */
-              closesocket (listen_s);
-              continue;
-            }
-
-          if ( (0 != ioctlsocket (client_s,
-                                  FIONBIO,
-                                  &on_val)) ||
-               ( (0 != connect (client_s,
-                                (struct sockaddr*) &listen_addr,
-                                c_addinlen)) &&
-                 (WSAGetLastError() != WSAEWOULDBLOCK)) )
-            {
-              /* try again */
-              closesocket (listen_s);
-              closesocket (client_s);
-              continue;
-            }
-
-          addr_len = c_addinlen;
-          server_s = accept (listen_s,
-                             (struct sockaddr*) &accepted_from_addr,
-                             &addr_len);
-          if (INVALID_SOCKET == server_s)
-            {
-              /* try again */
-              closesocket (listen_s);
-              closesocket (client_s);
-              continue;
-            }
-
-          addr_len = c_addinlen;
-          if ( (0 == getsockname (client_s,
-                                  (struct sockaddr*) &client_addr,
-                                  &addr_len)) &&
-               (accepted_from_addr.sin_family == client_addr.sin_family) &&
-               (accepted_from_addr.sin_port == client_addr.sin_port) &&
-               (accepted_from_addr.sin_addr.s_addr == 
client_addr.sin_addr.s_addr) &&
-               ( (0 != non_blk) ?
-                    (0 == ioctlsocket(server_s,
-                                      FIONBIO,
-                                      &on_val)) :
-                    (0 == ioctlsocket(client_s,
-                                      FIONBIO,
-                                      &off_val)) ) )
-            {
-              closesocket (listen_s);
-              sockets_pair[0] = server_s;
-              sockets_pair[1] = client_s;
-              return !0;
-            }
-          closesocket (server_s);
-          closesocket (client_s);
-        }
-      closesocket(listen_s);
+      SOCKET client_s = socket (AF_INET,
+                                SOCK_STREAM,
+                                IPPROTO_TCP);
+      struct sockaddr_in accepted_from_addr;
+      struct sockaddr_in client_addr;
+      SOCKET server_s;
+
+      if (INVALID_SOCKET == client_s)
+      {
+        /* try again */
+        closesocket (listen_s);
+        continue;
+      }
+
+      if ( (0 != ioctlsocket (client_s,
+                              FIONBIO,
+                              &on_val)) ||
+           ( (0 != connect (client_s,
+                            (struct sockaddr*) &listen_addr,
+                            c_addinlen)) &&
+             (WSAGetLastError () != WSAEWOULDBLOCK)) )
+      {
+        /* try again */
+        closesocket (listen_s);
+        closesocket (client_s);
+        continue;
+      }
+
+      addr_len = c_addinlen;
+      server_s = accept (listen_s,
+                         (struct sockaddr*) &accepted_from_addr,
+                         &addr_len);
+      if (INVALID_SOCKET == server_s)
+      {
+        /* try again */
+        closesocket (listen_s);
+        closesocket (client_s);
+        continue;
+      }
+
+      addr_len = c_addinlen;
+      if ( (0 == getsockname (client_s,
+                              (struct sockaddr*) &client_addr,
+                              &addr_len)) &&
+           (accepted_from_addr.sin_family == client_addr.sin_family) &&
+           (accepted_from_addr.sin_port == client_addr.sin_port) &&
+           (accepted_from_addr.sin_addr.s_addr ==
+            client_addr.sin_addr.s_addr) &&
+           ( (0 != non_blk) ?
+             (0 == ioctlsocket (server_s,
+                                FIONBIO,
+                                &on_val)) :
+             (0 == ioctlsocket (client_s,
+                                FIONBIO,
+                                &off_val)) ) )
+      {
+        closesocket (listen_s);
+        sockets_pair[0] = server_s;
+        sockets_pair[1] = client_s;
+        return ! 0;
+      }
+      closesocket (server_s);
+      closesocket (client_s);
     }
+    closesocket (listen_s);
+  }
 
   sockets_pair[0] = INVALID_SOCKET;
   sockets_pair[1] = INVALID_SOCKET;
-  WSASetLastError(WSAECONNREFUSED);
+  WSASetLastError (WSAECONNREFUSED);
 
   return 0;
 }
@@ -383,9 +384,9 @@ MHD_add_to_fd_set_ (MHD_socket fd,
                                          set,
                                          fd_setsize))
     return 0;
-  MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_(fd,
-                                    set,
-                                    fd_setsize);
+  MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_ (fd,
+                                     set,
+                                     fd_setsize);
   if ( (NULL != max_fd) &&
        ( (fd > *max_fd) ||
          (MHD_INVALID_SOCKET == *max_fd) ) )
@@ -424,7 +425,7 @@ MHD_socket_nonblocking_ (MHD_socket sock)
                         &flags))
     return 0;
 #endif /* MHD_WINSOCK_SOCKETS */
-  return !0;
+  return ! 0;
 }
 
 
@@ -452,12 +453,12 @@ MHD_socket_noninheritable_ (MHD_socket sock)
                     flags | FD_CLOEXEC)) )
     return 0;
 #elif defined(MHD_WINSOCK_SOCKETS)
-  if (! SetHandleInformation ((HANDLE)sock,
+  if (! SetHandleInformation ((HANDLE) sock,
                               HANDLE_FLAG_INHERIT,
                               0))
     return 0;
 #endif /* MHD_WINSOCK_SOCKETS */
-  return !0;
+  return ! 0;
 }
 
 
@@ -477,7 +478,7 @@ MHD_socket_create_listen_ (int pf)
   fd = socket (pf,
                SOCK_STREAM | SOCK_CLOEXEC,
                0);
-  cloexec_set = !0;
+  cloexec_set = ! 0;
 #elif defined(MHD_WINSOCK_SOCKETS) && defined (WSA_FLAG_NO_HANDLE_INHERIT)
   fd = WSASocketW (pf,
                    SOCK_STREAM,
@@ -485,27 +486,27 @@ MHD_socket_create_listen_ (int pf)
                    NULL,
                    0,
                    WSA_FLAG_NO_HANDLE_INHERIT);
-  cloexec_set = !0;
+  cloexec_set = ! 0;
 #else  /* !SOCK_CLOEXEC */
   fd = MHD_INVALID_SOCKET;
 #endif /* !SOCK_CLOEXEC */
   if (MHD_INVALID_SOCKET == fd)
-    {
-      fd = socket (pf,
-                   SOCK_STREAM,
-                   0);
-      cloexec_set = 0;
-    }
+  {
+    fd = socket (pf,
+                 SOCK_STREAM,
+                 0);
+    cloexec_set = 0;
+  }
   if (MHD_INVALID_SOCKET == fd)
     return MHD_INVALID_SOCKET;
 #ifdef MHD_socket_nosignal_
-  if(! MHD_socket_nosignal_(fd))
-    {
-      const int err = MHD_socket_get_error_ ();
-      (void) MHD_socket_close_ (fd);
-      MHD_socket_fset_error_ (err);
-      return MHD_INVALID_SOCKET;
-    }
+  if (! MHD_socket_nosignal_ (fd))
+  {
+    const int err = MHD_socket_get_error_ ();
+    (void) MHD_socket_close_ (fd);
+    MHD_socket_fset_error_ (err);
+    return MHD_INVALID_SOCKET;
+  }
 #endif /* MHD_socket_nosignal_ */
   if (! cloexec_set)
     (void) MHD_socket_noninheritable_ (fd);
diff --git a/src/lib/mhd_sockets.h b/src/lib/mhd_sockets.h
index 9be34144..ebe40275 100644
--- a/src/lib/mhd_sockets.h
+++ b/src/lib/mhd_sockets.h
@@ -36,8 +36,8 @@
 
 #include <errno.h>
 
-#if !defined(MHD_POSIX_SOCKETS) && !defined(MHD_WINSOCK_SOCKETS)
-#  if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(MHD_POSIX_SOCKETS) && ! defined(MHD_WINSOCK_SOCKETS)
+#  if ! defined(_WIN32) || defined(__CYGWIN__)
 #    define MHD_POSIX_SOCKETS 1
 #  else  /* defined(_WIN32) && !defined(__CYGWIN__) */
 #    define MHD_WINSOCK_SOCKETS 1
@@ -92,7 +92,7 @@
 #    include <sys/epoll.h>
 #  endif
 #  ifdef HAVE_NETINET_TCP_H
-     /* for TCP_FASTOPEN and TCP_CORK */
+/* for TCP_FASTOPEN and TCP_CORK */
 #    include <netinet/tcp.h>
 #  endif
 #  ifdef HAVE_STRING_H
@@ -111,10 +111,10 @@
 #endif
 
 #include <stddef.h>
-#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
+#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
 #  include <stdint.h>
 #  define _SSIZE_T_DEFINED
-   typedef intptr_t ssize_t;
+typedef intptr_t ssize_t;
 #endif /* !_SSIZE_T_DEFINED */
 
 #include "mhd_limits.h"
@@ -123,7 +123,7 @@
 #  define _MHD_SYS_DEFAULT_FD_SETSIZE FD_SETSIZE
 #else  /* ! _MHD_FD_SETSIZE_IS_DEFAULT */
 #  include "sysfdsetsize.h"
-#  define _MHD_SYS_DEFAULT_FD_SETSIZE get_system_fdsetsize_value()
+#  define _MHD_SYS_DEFAULT_FD_SETSIZE get_system_fdsetsize_value ()
 #endif /* ! _MHD_FD_SETSIZE_IS_DEFAULT */
 
 #ifndef MHD_PANIC
@@ -131,8 +131,9 @@
 #  include <stdlib.h>
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
-     "Abnormal termination at %d line in file %s: %s\n", \
-     (int)__LINE__, __FILE__, msg); abort();} while(0)
+                                       "Abnormal termination at %d line in 
file %s: %s\n", \
+                                       (int) __LINE__, __FILE__, msg); abort 
(); \
+} while (0)
 #endif /* ! MHD_PANIC */
 
 #ifndef MHD_SOCKET_DEFINED
@@ -140,10 +141,10 @@
  * MHD_socket is type for socket FDs
  */
 #  if defined(MHD_POSIX_SOCKETS)
-     typedef int MHD_socket;
+typedef int MHD_socket;
 #    define MHD_INVALID_SOCKET (-1)
 #  elif defined(MHD_WINSOCK_SOCKETS)
-     typedef SOCKET MHD_socket;
+typedef SOCKET MHD_socket;
 #    define MHD_INVALID_SOCKET (INVALID_SOCKET)
 #  endif /* MHD_WINSOCK_SOCKETS */
 
@@ -168,17 +169,18 @@
 #  define MAYBE_MSG_NOSIGNAL 0
 #endif /* ! MSG_NOSIGNAL */
 
-#if !defined(SHUT_WR) && defined(SD_SEND)
+#if ! defined(SHUT_WR) && defined(SD_SEND)
 #  define SHUT_WR SD_SEND
 #endif
-#if !defined(SHUT_RD) && defined(SD_RECEIVE)
+#if ! defined(SHUT_RD) && defined(SD_RECEIVE)
 #  define SHUT_RD SD_RECEIVE
 #endif
-#if !defined(SHUT_RDWR) && defined(SD_BOTH)
+#if ! defined(SHUT_RDWR) && defined(SD_BOTH)
 #  define SHUT_RDWR SD_BOTH
 #endif
 
-#if HAVE_ACCEPT4+0 != 0 && (defined(HAVE_SOCK_NONBLOCK) || 
defined(SOCK_CLOEXEC))
+#if HAVE_ACCEPT4 + 0 != 0 && (defined(HAVE_SOCK_NONBLOCK) || \
+  defined(SOCK_CLOEXEC))
 #  define USE_ACCEPT4 1
 #endif
 
@@ -198,25 +200,25 @@
  * MHD_SCKT_OPT_BOOL_ is type for bool parameters for setsockopt()/getsockopt()
  */
 #ifdef MHD_POSIX_SOCKETS
-  typedef int MHD_SCKT_OPT_BOOL_;
+typedef int MHD_SCKT_OPT_BOOL_;
 #else /* MHD_WINSOCK_SOCKETS */
-  typedef BOOL MHD_SCKT_OPT_BOOL_;
+typedef BOOL MHD_SCKT_OPT_BOOL_;
 #endif /* MHD_WINSOCK_SOCKETS */
 
 /**
  * MHD_SCKT_SEND_SIZE_ is type used to specify size for send and recv
  * functions
  */
-#if !defined(MHD_WINSOCK_SOCKETS)
-  typedef size_t MHD_SCKT_SEND_SIZE_;
+#if ! defined(MHD_WINSOCK_SOCKETS)
+typedef size_t MHD_SCKT_SEND_SIZE_;
 #else
-  typedef int MHD_SCKT_SEND_SIZE_;
+typedef int MHD_SCKT_SEND_SIZE_;
 #endif
 
 /**
  * MHD_SCKT_SEND_MAX_SIZE_ is maximum send()/recv() size value.
  */
-#if !defined(MHD_WINSOCK_SOCKETS)
+#if ! defined(MHD_WINSOCK_SOCKETS)
 #  define MHD_SCKT_SEND_MAX_SIZE_ SSIZE_MAX
 #else
 #  define MHD_SCKT_SEND_MAX_SIZE_ INT_MAX
@@ -232,10 +234,10 @@
  *         counted as success, only EBADF counts as an error!),
  *         boolean false otherwise.
  */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_close_(fd) ((0 == close((fd))) || (EBADF != errno))
+#if ! defined(MHD_WINSOCK_SOCKETS)
+#  define MHD_socket_close_(fd) ((0 == close ((fd))) || (EBADF != errno))
 #else
-#  define MHD_socket_close_(fd) (0 == closesocket((fd)))
+#  define MHD_socket_close_(fd) (0 == closesocket ((fd)))
 #endif
 
 /**
@@ -244,9 +246,9 @@
  * @param fd socket to close
  */
 #define MHD_socket_close_chk_(fd) do {        \
-    if (!MHD_socket_close_(fd))               \
-      MHD_PANIC(_("Close socket failed.\n")); \
-  } while(0)
+    if (! MHD_socket_close_ (fd))               \
+      MHD_PANIC (_ ("Close socket failed.\n")); \
+} while (0)
 
 
 /**
@@ -257,7 +259,8 @@
  * @return ssize_t type value
  */
 #define MHD_send_(s,b,l) \
-  ((ssize_t)send((s),(const void*)(b),((MHD_SCKT_SEND_SIZE_)l), 
MAYBE_MSG_NOSIGNAL))
+  ((ssize_t) send ((s),(const void*) (b),((MHD_SCKT_SEND_SIZE_) l), \
+                   MAYBE_MSG_NOSIGNAL))
 
 
 /**
@@ -268,7 +271,7 @@
  * @return ssize_t type value
  */
 #define MHD_recv_(s,b,l) \
-  ((ssize_t)recv((s),(void*)(b),((MHD_SCKT_SEND_SIZE_)l), 0))
+  ((ssize_t) recv ((s),(void*) (b),((MHD_SCKT_SEND_SIZE_) l), 0))
 
 
 /**
@@ -281,11 +284,18 @@
  *         boolean false otherwise.
  */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ((fd) < 
((MHD_socket)setsize))
+#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ((fd) < \
+                                                            ((MHD_socket) \
+                                                             setsize))
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ( 
((void*)(pset)==(void*)0) || \
-                                                             
(((fd_set*)(pset))->fd_count < ((unsigned)setsize)) || \
-                                                             
(FD_ISSET((fd),(pset))) )
+#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ( ((void*) (pset)== 
\
+                                                              (void*) 0) || \
+                                                             (((fd_set*) 
(pset)) \
+                                                              ->fd_count < \
+                                                              ((unsigned) \
+                                                               setsize)) || \
+                                                             (FD_ISSET ((fd), \
+                                                                        
(pset))) )
 #endif
 
 /**
@@ -296,7 +306,9 @@
  * @return boolean true if FD can be added to fd_set,
  *         boolean false otherwise.
  */
-#define MHD_SCKT_FD_FITS_FDSET_(fd,pset) 
MHD_SCKT_FD_FITS_FDSET_SETSIZE_((fd),(pset),FD_SETSIZE)
+#define MHD_SCKT_FD_FITS_FDSET_(fd,pset) MHD_SCKT_FD_FITS_FDSET_SETSIZE_ 
((fd), \
+                                                                          
(pset), \
+                                                                          
FD_SETSIZE)
 
 /**
  * Add FD to fd_set with specified FD_SETSIZE.
@@ -307,34 +319,35 @@
  *        system definition of FD_SET() is not used.
  */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_(fd,pset,setsize) 
FD_SET((fd),(pset))
+#  define MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_(fd,pset,setsize) FD_SET ((fd), \
+                                                                     (pset))
 #elif defined(MHD_WINSOCK_SOCKETS)
 #  define MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_(fd,pset,setsize)                   
  \
-        do {                                                                   
  \
-           u_int _i_ = 0;                                                      
  \
-           fd_set* const _s_ = (fd_set*)(pset);                                
  \
-           while((_i_ < _s_->fd_count) && ((fd) != _s_->fd_array[_i_])) 
{++_i_;} \
-           if ((_i_ == _s_->fd_count)) {_s_->fd_array[_s_->fd_count++] = 
(fd);}  \
-        } while(0)
+  do {                                                                     \
+    u_int _i_ = 0;                                                        \
+    fd_set*const _s_ = (fd_set*) (pset);                                  \
+    while ((_i_ < _s_->fd_count) && ((fd) != _s_->fd_array [_i_])) {++_i_;} \
+    if ((_i_ == _s_->fd_count)) {_s_->fd_array [_s_->fd_count ++] = (fd);}  \
+  } while (0)
 #endif
 
- /* MHD_SYS_select_ is wrapper macro for system select() function */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_SYS_select_(n,r,w,e,t) select((n),(r),(w),(e),(t))
+/* MHD_SYS_select_ is wrapper macro for system select() function */
+#if ! defined(MHD_WINSOCK_SOCKETS)
+#  define MHD_SYS_select_(n,r,w,e,t) select ((n),(r),(w),(e),(t))
 #else
 #  define MHD_SYS_select_(n,r,w,e,t) \
-( ( (((void*)(r) == (void*)0) || ((fd_set*)(r))->fd_count == 0) &&  \
-    (((void*)(w) == (void*)0) || ((fd_set*)(w))->fd_count == 0) &&  \
-    (((void*)(e) == (void*)0) || ((fd_set*)(e))->fd_count == 0) ) ? \
-  ( ((void*)(t) == (void*)0) ? 0 :                                  \
-    (Sleep(((struct timeval*)(t))->tv_sec * 1000 +                  \
-           ((struct timeval*)(t))->tv_usec / 1000), 0) ) :          \
-  (select((int)0,(r),(w),(e),(t))) )
+  ( ( (((void*) (r) == (void*) 0) || ((fd_set*) (r))->fd_count == 0) &&  \
+      (((void*) (w) == (void*) 0) || ((fd_set*) (w))->fd_count == 0) &&  \
+      (((void*) (e) == (void*) 0) || ((fd_set*) (e))->fd_count == 0) ) ? \
+    ( ((void*) (t) == (void*) 0) ? 0 :                                  \
+      (Sleep (((struct timeval*) (t))->tv_sec * 1000                    \
+              + ((struct timeval*) (t))->tv_usec / 1000), 0) ) :          \
+    (select ((int) 0,(r),(w),(e),(t))) )
 #endif
 
 #if defined(HAVE_POLL)
 /* MHD_sys_poll_ is wrapper macro for system poll() function */
-#  if !defined(MHD_WINSOCK_SOCKETS)
+#  if ! defined(MHD_WINSOCK_SOCKETS)
 #    define MHD_sys_poll_ poll
 #  else  /* MHD_WINSOCK_SOCKETS */
 #    define MHD_sys_poll_ WSAPoll
@@ -363,16 +376,19 @@
 #  elif defined(__linux__)
 #    define MHD_POLL_EVENTS_ERR_DISC POLLPRI
 #  else /* ! __linux__ */
-#    define MHD_POLL_EVENTS_ERR_DISC (MHD_POLLPRI_OR_ZERO | 
MHD_POLLRDBAND_OR_ZERO)
+#    define MHD_POLL_EVENTS_ERR_DISC (MHD_POLLPRI_OR_ZERO \
+                                      | MHD_POLLRDBAND_OR_ZERO)
 #  endif /* ! __linux__ */
 /* MHD_POLL_REVENTS_ERR_DISC is 'revents' mask for errors and disconnect.
  * Note: Out-of-band data is treated as error. */
 #  define MHD_POLL_REVENTS_ERR_DISC \
-     (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO | 
POLLERR | POLLHUP)
+  (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO \
+   | POLLERR | POLLHUP)
 /* MHD_POLL_REVENTS_ERRROR is 'revents' mask for errors.
  * Note: Out-of-band data is treated as error. */
 #  define MHD_POLL_REVENTS_ERRROR \
-     (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO | 
POLLERR)
+  (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO \
+   | POLLERR)
 #endif /* HAVE_POLL */
 
 #define MHD_SCKT_MISSING_ERR_CODE_ 31450
@@ -506,30 +522,30 @@
 #if defined(MHD_POSIX_SOCKETS)
 #  define MHD_socket_get_error_() (errno)
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_get_error_() WSAGetLastError()
+#  define MHD_socket_get_error_() WSAGetLastError ()
 #endif
 
 #ifdef MHD_WINSOCK_SOCKETS
-  /* POSIX-W32 sockets compatibility functions */
+/* POSIX-W32 sockets compatibility functions */
 
 /**
  * Return pointer to string description of specified WinSock error
  * @param err the WinSock error code.
  * @return pointer to string description of specified WinSock error.
  */
-  const char* MHD_W32_strerror_winsock_(int err);
+const char*MHD_W32_strerror_winsock_ (int err);
 #endif /* MHD_WINSOCK_SOCKETS */
 
 /* MHD_socket_last_strerr_ is description string of specified socket error 
code */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_socket_strerr_(err) strerror((err))
+#  define MHD_socket_strerr_(err) strerror ((err))
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_strerr_(err) MHD_W32_strerror_winsock_((err))
+#  define MHD_socket_strerr_(err) MHD_W32_strerror_winsock_ ((err))
 #endif
 
 /* MHD_socket_last_strerr_ is description string of last errno (non-W32) /
  *                            description string of last socket error (W32) */
-#define MHD_socket_last_strerr_() MHD_socket_strerr_(MHD_socket_get_error_())
+#define MHD_socket_last_strerr_() MHD_socket_strerr_ (MHD_socket_get_error_ ())
 
 /**
  * MHD_socket_fset_error_() set socket system native error code.
@@ -537,7 +553,7 @@
 #if defined(MHD_POSIX_SOCKETS)
 #  define MHD_socket_fset_error_(err) (errno = (err))
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_fset_error_(err) (WSASetLastError((err)))
+#  define MHD_socket_fset_error_(err) (WSASetLastError ((err)))
 #endif
 
 /**
@@ -549,7 +565,8 @@
  *         and error was not set.
  */
 #define MHD_socket_try_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ != (err)) 
? \
-                                         (MHD_socket_fset_error_((err)), !0) : 
0 )
+                                         (MHD_socket_fset_error_ ((err)), ! 0) 
: \
+                                         0)
 
 /**
  * MHD_socket_set_error_() set socket system native error code to
@@ -562,7 +579,8 @@
                                          (errno = ENOSYS) : (errno = (err)) )
 #  elif defined(EOPNOTSUPP)
 #    define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) 
? \
-                                         (errno = EOPNOTSUPP) : (errno = 
(err)) )
+                                         (errno = EOPNOTSUPP) : (errno = \
+                                                                   (err)) )
 #  elif defined (EFAULT)
 #    define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) 
? \
                                          (errno = EFAULT) : (errno = (err)) )
@@ -570,13 +588,14 @@
 #    define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) 
? \
                                          (errno = EINVAL) : (errno = (err)) )
 #  else  /* !EOPNOTSUPP && !EFAULT && !EINVAL */
-#    warning No suitable replacement for missing socket error code is found. 
Edit this file and add replacement code which is defined on system.
+#    warning \
+  No suitable replacement for missing socket error code is found. Edit this 
file and add replacement code which is defined on system.
 #    define MHD_socket_set_error_(err) (errno = (err))
 #  endif /* !EOPNOTSUPP && !EFAULT && !EINVAL*/
 #elif defined(MHD_WINSOCK_SOCKETS)
 #  define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) ? 
\
-                                       (WSASetLastError((WSAEOPNOTSUPP))) : \
-                                       (WSASetLastError((err))) )
+                                       (WSASetLastError ((WSAEOPNOTSUPP))) : \
+                                       (WSASetLastError ((err))) )
 #endif
 
 /**
@@ -600,7 +619,8 @@
  *         last socket error equals to MHD_SCKT_E*_ @a code;
  *         boolean false otherwise
  */
-#define MHD_SCKT_LAST_ERR_IS_(code) MHD_SCKT_ERR_IS_(MHD_socket_get_error_() 
,(code))
+#define MHD_SCKT_LAST_ERR_IS_(code) MHD_SCKT_ERR_IS_ (MHD_socket_get_error_ 
(), \
+                                                      (code))
 
 /* Specific error code checks */
 
@@ -610,7 +630,7 @@
  * @return boolean true if @a err is equal to sockets' EINTR code;
  *         boolean false otherwise.
  */
-#define MHD_SCKT_ERR_IS_EINTR_(err) MHD_SCKT_ERR_IS_((err),MHD_SCKT_EINTR_)
+#define MHD_SCKT_ERR_IS_EINTR_(err) MHD_SCKT_ERR_IS_ ((err),MHD_SCKT_EINTR_)
 
 /**
  * Check whether given socket error is equal to system's
@@ -619,10 +639,12 @@
  *         boolean false otherwise.
  */
 #if MHD_SCKT_EAGAIN_ == MHD_SCKT_EWOULDBLOCK_
-#  define MHD_SCKT_ERR_IS_EAGAIN_(err) MHD_SCKT_ERR_IS_((err),MHD_SCKT_EAGAIN_)
+#  define MHD_SCKT_ERR_IS_EAGAIN_(err) MHD_SCKT_ERR_IS_ 
((err),MHD_SCKT_EAGAIN_)
 #else  /* MHD_SCKT_EAGAIN_ != MHD_SCKT_EWOULDBLOCK_ */
-#  define MHD_SCKT_ERR_IS_EAGAIN_(err) ( 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_EAGAIN_) || \
-                                         
MHD_SCKT_ERR_IS_((err),MHD_SCKT_EWOULDBLOCK_) )
+#  define MHD_SCKT_ERR_IS_EAGAIN_(err) (MHD_SCKT_ERR_IS_ ((err), \
+                                                          MHD_SCKT_EAGAIN_) || 
\
+                                        MHD_SCKT_ERR_IS_ ((err), \
+                                                          
MHD_SCKT_EWOULDBLOCK_) )
 #endif /* MHD_SCKT_EAGAIN_ != MHD_SCKT_EWOULDBLOCK_ */
 
 /**
@@ -630,10 +652,17 @@
  * @return boolean true if @a err is any kind of "low resource" error,
  *         boolean false otherwise.
  */
-#define MHD_SCKT_ERR_IS_LOW_RESOURCES_(err) ( 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_EMFILE_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ENFILE_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ENOMEM_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ENOBUFS_) )
+#define MHD_SCKT_ERR_IS_LOW_RESOURCES_(err) (MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_EMFILE_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ENFILE_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ENOMEM_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ENOBUFS_) )
 
 /**
  * Check whether is given socket error is type of "incoming connection
@@ -642,9 +671,11 @@
  *         boolean false otherwise.
  */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNABORTED_)
+#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) MHD_SCKT_ERR_IS_ ((err), \
+                                                                       
MHD_SCKT_ECONNABORTED_)
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNRESET_)
+#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) MHD_SCKT_ERR_IS_ ((err), \
+                                                                       
MHD_SCKT_ECONNRESET_)
 #endif
 
 /**
@@ -653,8 +684,11 @@
  * @return boolean true is @a err match described socket error code,
  *         boolean false otherwise.
  */
-#define MHD_SCKT_ERR_IS_REMOTE_DISCNN_(err) ( 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNRESET_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNABORTED_))
+#define MHD_SCKT_ERR_IS_REMOTE_DISCNN_(err) (MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ECONNRESET_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ECONNABORTED_))
 
 /* Specific error code set */
 
@@ -663,12 +697,16 @@
  * available on platform.
  */
 #if MHD_SCKT_MISSING_ERR_CODE_ != MHD_SCKT_ENOMEM_
-#  define MHD_socket_set_error_to_ENOMEM() 
MHD_socket_set_error_(MHD_SCKT_ENOMEM_)
+#  define MHD_socket_set_error_to_ENOMEM() MHD_socket_set_error_ ( \
+    MHD_SCKT_ENOMEM_)
 #elif MHD_SCKT_MISSING_ERR_CODE_ != MHD_SCKT_ENOBUFS_
-#  define MHD_socket_set_error_to_ENOMEM() 
MHD_socket_set_error_(MHD_SCKT_ENOBUFS_)
+#  define MHD_socket_set_error_to_ENOMEM() MHD_socket_set_error_ ( \
+    MHD_SCKT_ENOBUFS_)
 #else
-#  warning No suitable replacement for ENOMEM error codes is found. Edit this 
file and add replacement code which is defined on system.
-#  define MHD_socket_set_error_to_ENOMEM() 
MHD_socket_set_error_(MHD_SCKT_ENOMEM_)
+#  warning \
+  No suitable replacement for ENOMEM error codes is found. Edit this file and 
add replacement code which is defined on system.
+#  define MHD_socket_set_error_to_ENOMEM() MHD_socket_set_error_ ( \
+    MHD_SCKT_ENOMEM_)
 #endif
 
 /* Socket functions */
@@ -680,22 +718,26 @@
 #endif /* AF_UNIX */
 
 #if defined(MHD_POSIX_SOCKETS) && defined(MHD_SCKT_LOCAL)
-#  define MHD_socket_pair_(fdarr) (!socketpair(MHD_SCKT_LOCAL, SOCK_STREAM, 0, 
(fdarr)))
+#  define MHD_socket_pair_(fdarr) (! socketpair (MHD_SCKT_LOCAL, SOCK_STREAM, 
0, \
+                                                 (fdarr)))
 #  if defined(HAVE_SOCK_NONBLOCK)
-#    define MHD_socket_pair_nblk_(fdarr) (!socketpair(MHD_SCKT_LOCAL, 
SOCK_STREAM | SOCK_NONBLOCK, 0, (fdarr)))
+#    define MHD_socket_pair_nblk_(fdarr) (! socketpair (MHD_SCKT_LOCAL, \
+                                                        SOCK_STREAM \
+                                                        | SOCK_NONBLOCK, 0, \
+                                                        (fdarr)))
 #  endif /* HAVE_SOCK_NONBLOCK*/
 #elif defined(MHD_WINSOCK_SOCKETS)
-   /**
-    * Create pair of mutually connected TCP/IP sockets on loopback address
-    * @param sockets_pair array to receive resulted sockets
-    * @param non_blk if set to non-zero value, sockets created in non-blocking 
mode
-    *                otherwise sockets will be in blocking mode
-    * @return non-zero if succeeded, zero otherwise
-    */
-   int MHD_W32_socket_pair_(SOCKET sockets_pair[2], int non_blk);
-
-#  define MHD_socket_pair_(fdarr) MHD_W32_socket_pair_((fdarr), 0)
-#  define MHD_socket_pair_nblk_(fdarr) MHD_W32_socket_pair_((fdarr), 1)
+/**
+ * Create pair of mutually connected TCP/IP sockets on loopback address
+ * @param sockets_pair array to receive resulted sockets
+ * @param non_blk if set to non-zero value, sockets created in non-blocking 
mode
+ *                otherwise sockets will be in blocking mode
+ * @return non-zero if succeeded, zero otherwise
+ */
+int MHD_W32_socket_pair_ (SOCKET sockets_pair[2], int non_blk);
+
+#  define MHD_socket_pair_(fdarr) MHD_W32_socket_pair_ ((fdarr), 0)
+#  define MHD_socket_pair_nblk_(fdarr) MHD_W32_socket_pair_ ((fdarr), 1)
 #endif
 
 /**
@@ -737,7 +779,7 @@ MHD_socket_noninheritable_ (MHD_socket sock);
 
 
 #if defined(SOL_SOCKET) && defined(SO_NOSIGPIPE)
-   static const int _MHD_socket_int_one = 1;
+static const int _MHD_socket_int_one = 1;
 /**
  * Change socket options to no signal on remote disconnect.
  *
@@ -745,7 +787,8 @@ MHD_socket_noninheritable_ (MHD_socket sock);
  * @return non-zero if succeeded, zero otherwise
  */
 #  define MHD_socket_nosignal_(sock) \
-    
(!setsockopt((sock),SOL_SOCKET,SO_NOSIGPIPE,&_MHD_socket_int_one,sizeof(_MHD_socket_int_one)))
+  (! setsockopt ((sock),SOL_SOCKET,SO_NOSIGPIPE,&_MHD_socket_int_one, \
+                 sizeof(_MHD_socket_int_one)))
 #endif /* SOL_SOCKET && SO_NOSIGPIPE */
 
 /**
diff --git a/src/lib/mhd_str.c b/src/lib/mhd_str.c
index d0b03ead..6f2d7b98 100644
--- a/src/lib/mhd_str.c
+++ b/src/lib/mhd_str.c
@@ -117,8 +117,8 @@ _MHD_static_inline bool
 isasciixdigit (char c)
 {
   return isasciidigit (c) ||
-    ( (c >= 'A') && (c <= 'F') ) ||
-    ( (c >= 'a') && (c <= 'f') );
+         ( (c >= 'A') && (c <= 'F') ) ||
+         ( (c >= 'a') && (c <= 'f') );
 }
 
 
@@ -181,7 +181,7 @@ _MHD_static_inline int
 todigitvalue (char c)
 {
   if (isasciidigit (c))
-    return (unsigned char)(c - '0');
+    return (unsigned char) (c - '0');
 
   return -1;
 }
@@ -198,11 +198,11 @@ _MHD_static_inline int
 toxdigitvalue (char c)
 {
   if (isasciidigit (c))
-    return (unsigned char)(c - '0');
+    return (unsigned char) (c - '0');
   if ( (c >= 'A') && (c <= 'F') )
-    return (unsigned char)(c - 'A' + 10);
+    return (unsigned char) (c - 'A' + 10);
   if ( (c >= 'a') && (c <= 'f') )
-    return (unsigned char)(c - 'a' + 10);
+    return (unsigned char) (c - 'a' + 10);
 
   return -1;
 }
@@ -216,7 +216,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is lower case letter,
  *         boolean false otherwise
  */
-#define isasciilower(c) (((char)(c)) >= 'a' && ((char)(c)) <= 'z')
+#define isasciilower(c) (((char) (c)) >= 'a' && ((char) (c)) <= 'z')
 
 
 /**
@@ -226,7 +226,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is upper case letter,
  *         boolean false otherwise
  */
-#define isasciiupper(c) (((char)(c)) >= 'A' && ((char)(c)) <= 'Z')
+#define isasciiupper(c) (((char) (c)) >= 'A' && ((char) (c)) <= 'Z')
 
 
 /**
@@ -236,7 +236,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is letter, boolean false
  *         otherwise
  */
-#define isasciialpha(c) (isasciilower(c) || isasciiupper(c))
+#define isasciialpha(c) (isasciilower (c) || isasciiupper (c))
 
 
 /**
@@ -246,7 +246,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is decimal digit, boolean false
  *         otherwise
  */
-#define isasciidigit(c) (((char)(c)) >= '0' && ((char)(c)) <= '9')
+#define isasciidigit(c) (((char) (c)) >= '0' && ((char) (c)) <= '9')
 
 
 /**
@@ -256,9 +256,9 @@ toxdigitvalue (char c)
  * @return boolean true if character is hexadecimal digit,
  *         boolean false otherwise
  */
-#define isasciixdigit(c) (isasciidigit((c)) || \
-                          (((char)(c)) >= 'A' && ((char)(c)) <= 'F') || \
-                          (((char)(c)) >= 'a' && ((char)(c)) <= 'f') )
+#define isasciixdigit(c) (isasciidigit ((c)) || \
+                          (((char) (c)) >= 'A' && ((char) (c)) <= 'F') || \
+                          (((char) (c)) >= 'a' && ((char) (c)) <= 'f') )
 
 
 /**
@@ -268,7 +268,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is decimal digit or letter,
  *         boolean false otherwise
  */
-#define isasciialnum(c) (isasciialpha(c) || isasciidigit(c))
+#define isasciialnum(c) (isasciialpha (c) || isasciidigit (c))
 
 
 /**
@@ -280,7 +280,8 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return converted to lower case character
  */
-#define toasciilower(c) ((isasciiupper(c)) ? (((char)(c)) - 'A' + 'a') : 
((char)(c)))
+#define toasciilower(c) ((isasciiupper (c)) ? (((char) (c)) - 'A' + 'a') : \
+                         ((char) (c)))
 
 
 /**
@@ -292,7 +293,8 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return converted to upper case character
  */
-#define toasciiupper(c) ((isasciilower(c)) ? (((char)(c)) - 'a' + 'A') : 
((char)(c)))
+#define toasciiupper(c) ((isasciilower (c)) ? (((char) (c)) - 'a' + 'A') : \
+                         ((char) (c)))
 
 
 /**
@@ -301,7 +303,8 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return value of hexadecimal digit or -1 if @ c is not hexadecimal digit
  */
-#define todigitvalue(c) (isasciidigit(c) ? (int)(((char)(c)) - '0') : 
(int)(-1))
+#define todigitvalue(c) (isasciidigit (c) ? (int) (((char) (c)) - '0') : \
+                         (int) (-1))
 
 
 /**
@@ -309,11 +312,12 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return value of hexadecimal digit or -1 if @ c is not hexadecimal digit
  */
-#define toxdigitvalue(c) ( isasciidigit(c) ? (int)(((char)(c)) - '0') : \
-                           ( (((char)(c)) >= 'A' && ((char)(c)) <= 'F') ? \
-                             (int)(((unsigned char)(c)) - 'A' + 10) : \
-                             ( (((char)(c)) >= 'a' && ((char)(c)) <= 'f') ? \
-                               (int)(((unsigned char)(c)) - 'a' + 10) : 
(int)(-1) )))
+#define toxdigitvalue(c) (isasciidigit (c) ? (int) (((char) (c)) - '0') : \
+                          ( (((char) (c)) >= 'A' && ((char) (c)) <= 'F') ? \
+                            (int) (((unsigned char) (c)) - 'A' + 10) : \
+                            ( (((char) (c)) >= 'a' && ((char) (c)) <= 'f') ? \
+                              (int) (((unsigned char) (c)) - 'a' + 10) : \
+                              (int) (-1) )))
 #endif /* !INLINE_FUNC */
 
 
@@ -326,19 +330,19 @@ toxdigitvalue (char c)
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_ (const char * str1,
-                         const char * str2)
+MHD_str_equal_caseless_ (const char *str1,
+                         const char *str2)
 {
   while (0 != (*str1))
-    {
-      const char c1 = *str1;
-      const char c2 = *str2;
-      if ( (c1 != c2) &&
-           (toasciilower (c1) != toasciilower (c2)) )
-        return 0;
-      str1++;
-      str2++;
-    }
+  {
+    const char c1 = *str1;
+    const char c2 = *str2;
+    if ( (c1 != c2) &&
+         (toasciilower (c1) != toasciilower (c2)) )
+      return 0;
+    str1++;
+    str2++;
+  }
   return 0 == (*str2);
 }
 #endif /* ! MHD_FAVOR_SMALL_CODE */
@@ -356,23 +360,23 @@ MHD_str_equal_caseless_ (const char * str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_n_ (const char * const str1,
-                           const char * const str2,
+MHD_str_equal_caseless_n_ (const char *const str1,
+                           const char *const str2,
                            size_t maxlen)
 {
   size_t i;
 
   for (i = 0; i < maxlen; ++i)
-    {
-      const char c1 = str1[i];
-      const char c2 = str2[i];
-      if (0 == c2)
-        return 0 == c1;
-      if ( (c1 != c2) &&
-           (toasciilower (c1) != toasciilower (c2)) )
-        return 0;
-    }
-  return !0;
+  {
+    const char c1 = str1[i];
+    const char c2 = str2[i];
+    if (0 == c2)
+      return 0 == c1;
+    if ( (c1 != c2) &&
+         (toasciilower (c1) != toasciilower (c2)) )
+      return 0;
+  }
+  return ! 0;
 }
 
 
@@ -390,46 +394,49 @@ MHD_str_equal_caseless_n_ (const char * const str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 bool
-MHD_str_has_token_caseless_ (const char * str,
-                             const char * const token,
+MHD_str_has_token_caseless_ (const char *str,
+                             const char *const token,
                              size_t token_len)
 {
   if (0 == token_len)
     return false;
 
   while (0 != *str)
+  {
+    size_t i;
+    /* Skip all whitespaces and empty tokens. */
+    while (' ' == *str || '\t' == *str || ',' == *str)
+      str++;
+
+    /* Check for token match. */
+    i = 0;
+    while (1)
     {
-      size_t i;
-      /* Skip all whitespaces and empty tokens. */
-      while (' ' == *str || '\t' == *str || ',' == *str) str++;
-
-      /* Check for token match. */
-      i = 0;
-      while (1)
-        {
-          const char sc = *(str++);
-          const char tc = token[i++];
-
-          if (0 == sc)
-            return false;
-          if ( (sc != tc) &&
-               (toasciilower (sc) != toasciilower (tc)) )
-            break;
-          if (i >= token_len)
-            {
-              /* Check whether substring match token fully or
-               * has additional unmatched chars at tail. */
-              while (' ' == *str || '\t' == *str) str++;
-              /* End of (sub)string? */
-              if (0 == *str || ',' == *str)
-                return true;
-              /* Unmatched chars at end of substring. */
-              break;
-            }
-        }
-       /* Find next substring. */
-      while (0 != *str && ',' != *str) str++;
+      const char sc = *(str++);
+      const char tc = token[i++];
+
+      if (0 == sc)
+        return false;
+      if ( (sc != tc) &&
+           (toasciilower (sc) != toasciilower (tc)) )
+        break;
+      if (i >= token_len)
+      {
+        /* Check whether substring match token fully or
+         * has additional unmatched chars at tail. */
+        while (' ' == *str || '\t' == *str)
+          str++;
+        /* End of (sub)string? */
+        if ((0 == *str) ||(',' == *str) )
+          return true;
+        /* Unmatched chars at end of substring. */
+        break;
+      }
     }
+    /* Find next substring. */
+    while (0 != *str && ',' != *str)
+      str++;
+  }
   return false;
 }
 
@@ -450,25 +457,25 @@ size_t
 MHD_str_to_uint64_ (const char *str,
                     uint64_t *out_val)
 {
-  const char * const start = str;
+  const char *const start = str;
   uint64_t res;
 
-  if (!str || !out_val || !isasciidigit(str[0]))
+  if (! str || ! out_val || ! isasciidigit (str[0]))
     return 0;
 
   res = 0;
   do
-    {
-      const int digit = (unsigned char)(*str) - '0';
-      if ( (res > (UINT64_MAX / 10)) ||
-           ( (res == (UINT64_MAX / 10)) &&
-             ((uint64_t)digit > (UINT64_MAX % 10)) ) )
-        return 0;
-
-      res *= 10;
-      res += digit;
-      str++;
-    } while (isasciidigit (*str));
+  {
+    const int digit = (unsigned char) (*str) - '0';
+    if ( (res > (UINT64_MAX / 10)) ||
+         ( (res == (UINT64_MAX / 10)) &&
+           ((uint64_t) digit > (UINT64_MAX % 10)) ) )
+      return 0;
+
+    res *= 10;
+    res += digit;
+    str++;
+  } while (isasciidigit (*str));
 
   *out_val = res;
   return str - start;
@@ -489,34 +496,34 @@ MHD_str_to_uint64_ (const char *str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_str_to_uint64_n_ (const char * str,
+MHD_str_to_uint64_n_ (const char *str,
                       size_t maxlen,
                       uint64_t *out_val)
 {
   uint64_t res;
   size_t i;
 
-  if (!str || !maxlen || !out_val || !isasciidigit (str[0]))
+  if (! str || ! maxlen || ! out_val || ! isasciidigit (str[0]))
     return 0;
 
   res = 0;
   i = 0;
   do
-    {
-      const int digit = (unsigned char)str[i] - '0';
+  {
+    const int digit = (unsigned char) str[i] - '0';
 
-      if ( (res > (UINT64_MAX / 10)) ||
-           ( (res == (UINT64_MAX / 10)) &&
-             ((uint64_t)digit > (UINT64_MAX % 10)) ) )
-        return 0;
+    if ( (res > (UINT64_MAX / 10)) ||
+         ( (res == (UINT64_MAX / 10)) &&
+           ((uint64_t) digit > (UINT64_MAX % 10)) ) )
+      return 0;
 
-      res *= 10;
-      res += digit;
-      i++;
-    } while ( (i < maxlen) &&
-              isasciidigit (str[i]) );
+    res *= 10;
+    res += digit;
+    i++;
+  } while ( (i < maxlen) &&
+            isasciidigit (str[i]) );
 
-  *out_val= res;
+  *out_val = res;
   return i;
 }
 
@@ -532,31 +539,32 @@ MHD_str_to_uint64_n_ (const char * str,
  *         then possible to store in uint32_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint32_ (const char * str,
+MHD_strx_to_uint32_ (const char *str,
                      uint32_t *out_val)
 {
-  const char * const start = str;
+  const char *const start = str;
   uint32_t res;
   int digit;
 
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   digit = toxdigitvalue (*str);
   while (digit >= 0)
+  {
+    if ( (res < (UINT32_MAX / 16)) ||
+         ((res == (UINT32_MAX / 16)) &&( (uint32_t) digit <= (UINT32_MAX
+                                                              % 16)) ) )
     {
-      if ( (res < (UINT32_MAX / 16)) ||
-           (res == (UINT32_MAX / 16) && (uint32_t)digit <= (UINT32_MAX % 16)) )
-        {
-          res *= 16;
-          res += digit;
-        }
-      else
-        return 0;
-      str++;
-      digit = toxdigitvalue (*str);
+      res *= 16;
+      res += digit;
     }
+    else
+      return 0;
+    str++;
+    digit = toxdigitvalue (*str);
+  }
 
   if (str - start > 0)
     *out_val = res;
@@ -585,21 +593,22 @@ MHD_strx_to_uint32_n_ (const char *str,
   size_t i;
   uint32_t res;
   int digit;
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   i = 0;
   while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0)
-    {
-      if ( (res > (UINT32_MAX / 16)) ||
-           (res == (UINT32_MAX / 16) && (uint32_t)digit > (UINT32_MAX % 16)) )
-        return 0;
+  {
+    if ( (res > (UINT32_MAX / 16)) ||
+         ((res == (UINT32_MAX / 16)) &&( (uint32_t) digit > (UINT32_MAX
+                                                             % 16)) ) )
+      return 0;
 
-      res *= 16;
-      res += digit;
-      i++;
-    }
+    res *= 16;
+    res += digit;
+    i++;
+  }
 
   if (i)
     *out_val = res;
@@ -621,27 +630,28 @@ size_t
 MHD_strx_to_uint64_ (const char *str,
                      uint64_t *out_val)
 {
-  const char * const start = str;
+  const char *const start = str;
   uint64_t res;
   int digit;
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   digit = toxdigitvalue (*str);
   while (digit >= 0)
+  {
+    if ( (res < (UINT64_MAX / 16)) ||
+         ((res == (UINT64_MAX / 16)) &&( (uint64_t) digit <= (UINT64_MAX
+                                                              % 16)) ) )
     {
-      if ( (res < (UINT64_MAX / 16)) ||
-           (res == (UINT64_MAX / 16) && (uint64_t)digit <= (UINT64_MAX % 16)) )
-        {
-          res *= 16;
-          res += digit;
-        }
-      else
-        return 0;
-      str++;
-      digit = toxdigitvalue (*str);
+      res *= 16;
+      res += digit;
     }
+    else
+      return 0;
+    str++;
+    digit = toxdigitvalue (*str);
+  }
 
   if (str - start > 0)
     *out_val = res;
@@ -663,28 +673,29 @@ MHD_strx_to_uint64_ (const char *str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint64_n_ (const char * str,
+MHD_strx_to_uint64_n_ (const char *str,
                        size_t maxlen,
                        uint64_t *out_val)
 {
   size_t i;
   uint64_t res;
   int digit;
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   i = 0;
   while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0)
-    {
-      if ( (res > (UINT64_MAX / 16)) ||
-           (res == (UINT64_MAX / 16) && (uint64_t)digit > (UINT64_MAX % 16)) )
-        return 0;
+  {
+    if ( (res > (UINT64_MAX / 16)) ||
+         ((res == (UINT64_MAX / 16)) &&( (uint64_t) digit > (UINT64_MAX
+                                                             % 16)) ) )
+      return 0;
 
-      res *= 16;
-      res += digit;
-      i++;
-    }
+    res *= 16;
+    res += digit;
+    i++;
+  }
 
   if (i)
     *out_val = res;
@@ -713,7 +724,7 @@ MHD_strx_to_uint64_n_ (const char * str,
 size_t
 MHD_str_to_uvalue_n_ (const char *str,
                       size_t maxlen,
-                      void * out_val,
+                      void *out_val,
                       size_t val_size,
                       uint64_t max_val,
                       int base)
@@ -725,34 +736,34 @@ MHD_str_to_uvalue_n_ (const char *str,
   const uint64_t max_v_mod_b = max_val % base;
   /* 'digit->value' must be function, not macro */
   int (*const dfunc)(char) = (base == 16) ?
-                              toxdigitvalue : todigitvalue;
+                             toxdigitvalue : todigitvalue;
 
-  if ( !str || !out_val ||
-       (base != 16 && base != 10) )
+  if ( ! str || ! out_val ||
+       ((base != 16)&&(base != 10)) )
     return 0;
 
   res = 0;
   i = 0;
   while (maxlen > i && 0 <= (digit = dfunc (str[i])))
-    {
-      if ( ((max_v_div_b) < res) ||
-          ((max_v_div_b) == res && (max_v_mod_b) < (uint64_t)digit) )
-        return 0;
+  {
+    if ( ((max_v_div_b) < res) ||
+         (( (max_v_div_b) == res) &&( (max_v_mod_b) < (uint64_t) digit) ) )
+      return 0;
 
-      res *= base;
-      res += digit;
-      i++;
-    }
+    res *= base;
+    res += digit;
+    i++;
+  }
 
   if (i)
-    {
-      if (8 == val_size)
-        *(uint64_t*)out_val = res;
-      else if (4 == val_size)
-        *(uint32_t*)out_val = (uint32_t)res;
-      else
-        return 0;
-    }
+  {
+    if (8 == val_size)
+      *(uint64_t*) out_val = res;
+    else if (4 == val_size)
+      *(uint32_t*) out_val = (uint32_t) res;
+    else
+      return 0;
+  }
   return i;
 }
 #endif /* MHD_FAVOR_SMALL_CODE */
diff --git a/src/lib/mhd_str.h b/src/lib/mhd_str.h
index 410cc36e..f0f6511d 100644
--- a/src/lib/mhd_str.h
+++ b/src/lib/mhd_str.h
@@ -42,7 +42,7 @@
 /**
  * Determine length of static string / macro strings at compile time.
  */
-#define MHD_STATICSTR_LEN_(macro) (sizeof(macro)/sizeof(char) - 1)
+#define MHD_STATICSTR_LEN_(macro) (sizeof(macro) / sizeof(char) - 1)
 #endif /* ! MHD_STATICSTR_LEN_ */
 
 /*
@@ -58,11 +58,12 @@
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_ (const char * str1,
-                 const char * str2);
+MHD_str_equal_caseless_ (const char *str1,
+                         const char *str2);
 #else  /* MHD_FAVOR_SMALL_CODE */
 /* Reuse MHD_str_equal_caseless_n_() to reduce size */
-#define MHD_str_equal_caseless_(s1,s2) MHD_str_equal_caseless_n_((s1),(s2), 
SIZE_MAX)
+#define MHD_str_equal_caseless_(s1,s2) MHD_str_equal_caseless_n_ ((s1),(s2), \
+                                                                  SIZE_MAX)
 #endif /* MHD_FAVOR_SMALL_CODE */
 
 
@@ -77,9 +78,9 @@ MHD_str_equal_caseless_ (const char * str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_n_ (const char * const str1,
-                  const char * const str2,
-                  size_t maxlen);
+MHD_str_equal_caseless_n_ (const char *const str1,
+                           const char *const str2,
+                           size_t maxlen);
 
 
 /**
@@ -96,8 +97,8 @@ MHD_str_equal_caseless_n_ (const char * const str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 bool
-MHD_str_has_token_caseless_ (const char * str,
-                             const char * const token,
+MHD_str_has_token_caseless_ (const char *str,
+                             const char *const token,
                              size_t token_len);
 
 /**
@@ -111,7 +112,7 @@ MHD_str_has_token_caseless_ (const char * str,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 #define MHD_str_has_s_token_caseless_(str,tkn) \
-    MHD_str_has_token_caseless_((str),(tkn),MHD_STATICSTR_LEN_(tkn))
+  MHD_str_has_token_caseless_ ((str),(tkn),MHD_STATICSTR_LEN_ (tkn))
 
 #ifndef MHD_FAVOR_SMALL_CODE
 /* Use individual function for each case to improve speed */
@@ -126,13 +127,13 @@ MHD_str_has_token_caseless_ (const char * str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_str_to_uint64_ (const char * str,
-                    uint64_t * out_val);
+MHD_str_to_uint64_ (const char *str,
+                    uint64_t *out_val);
 
 /**
  * Convert not more then @a maxlen decimal US-ASCII digits in string to
  * number in uint64_t.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * @param str string to convert
  * @param maxlen maximum number of characters to process
@@ -142,9 +143,9 @@ MHD_str_to_uint64_ (const char * str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_str_to_uint64_n_ (const char * str,
+MHD_str_to_uint64_n_ (const char *str,
                       size_t maxlen,
-                      uint64_t * out_val);
+                      uint64_t *out_val);
 
 
 /**
@@ -152,19 +153,19 @@ MHD_str_to_uint64_n_ (const char * str,
  * Conversion stopped at first non-digit character.
  * @param str string to convert
  * @param out_val pointer to uint32_t to store result of conversion
- * @return non-zero number of characters processed on succeed, 
+ * @return non-zero number of characters processed on succeed,
  *         zero if no digit is found, resulting value is larger
  *         then possible to store in uint32_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint32_ (const char * str,
-                     uint32_t * out_val);
+MHD_strx_to_uint32_ (const char *str,
+                     uint32_t *out_val);
 
 
 /**
  * Convert not more then @a maxlen hexadecimal US-ASCII digits in string
  * to number in uint32_t.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * @param str string to convert
  * @param maxlen maximum number of characters to process
@@ -174,9 +175,9 @@ MHD_strx_to_uint32_ (const char * str,
  *         then possible to store in uint32_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint32_n_ (const char * str,
-                      size_t maxlen,
-                      uint32_t * out_val);
+MHD_strx_to_uint32_n_ (const char *str,
+                       size_t maxlen,
+                       uint32_t *out_val);
 
 
 /**
@@ -184,19 +185,19 @@ MHD_strx_to_uint32_n_ (const char * str,
  * Conversion stopped at first non-digit character.
  * @param str string to convert
  * @param out_val pointer to uint64_t to store result of conversion
- * @return non-zero number of characters processed on succeed, 
+ * @return non-zero number of characters processed on succeed,
  *         zero if no digit is found, resulting value is larger
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint64_ (const char * str,
-                     uint64_t * out_val);
+MHD_strx_to_uint64_ (const char *str,
+                     uint64_t *out_val);
 
 
 /**
  * Convert not more then @a maxlen hexadecimal US-ASCII digits in string
  * to number in uint64_t.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * @param str string to convert
  * @param maxlen maximum number of characters to process
@@ -206,9 +207,9 @@ MHD_strx_to_uint64_ (const char * str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint64_n_ (const char * str,
+MHD_strx_to_uint64_n_ (const char *str,
                        size_t maxlen,
-                       uint64_t * out_val);
+                       uint64_t *out_val);
 
 #else  /* MHD_FAVOR_SMALL_CODE */
 /* Use one universal function and macros to reduce size */
@@ -216,7 +217,7 @@ MHD_strx_to_uint64_n_ (const char * str,
 /**
  * Generic function for converting not more then @a maxlen
  * hexadecimal or decimal US-ASCII digits in string to number.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * To be used only within macro.
  * @param str the string to convert
@@ -230,36 +231,44 @@ MHD_strx_to_uint64_n_ (const char * str,
  *         then @ max_val or @a out_val is NULL
  */
 size_t
-MHD_str_to_uvalue_n_ (const char * str,
+MHD_str_to_uvalue_n_ (const char *str,
                       size_t maxlen,
-                      void * out_val,
+                      void *out_val,
                       size_t val_size,
                       uint64_t max_val,
                       int base);
 
-#define MHD_str_to_uint64_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,10)
+#define MHD_str_to_uint64_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                       sizeof(uint64_t), \
+                                                       UINT64_MAX,10)
 
-#define MHD_str_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,10)
+#define MHD_str_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                            sizeof(uint64_t), \
+                                                            UINT64_MAX,10)
 
-#define MHD_strx_to_sizet_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(size_t),SIZE_MAX,16)
+#define MHD_strx_to_sizet_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                       
sizeof(size_t),SIZE_MAX, \
+                                                       16)
 
-#define MHD_strx_to_sizet_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(size_t),SIZE_MAX,16)
+#define MHD_strx_to_sizet_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                            sizeof(size_t), \
+                                                            SIZE_MAX,16)
 
-#define MHD_strx_to_uint32_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(uint32_t),UINT32_MAX,16)
+#define MHD_strx_to_uint32_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                        sizeof(uint32_t), \
+                                                        UINT32_MAX,16)
 
-#define MHD_strx_to_uint32_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(uint32_t),UINT32_MAX,16)
+#define MHD_strx_to_uint32_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                             sizeof(uint32_t), 
\
+                                                             UINT32_MAX,16)
 
-#define MHD_strx_to_uint64_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,16)
+#define MHD_strx_to_uint64_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                        sizeof(uint64_t), \
+                                                        UINT64_MAX,16)
 
-#define MHD_strx_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,16)
+#define MHD_strx_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                             sizeof(uint64_t), 
\
+                                                             UINT64_MAX,16)
 
 #endif /* MHD_FAVOR_SMALL_CODE */
 
diff --git a/src/lib/mhd_threads.c b/src/lib/mhd_threads.c
index 6578e4b1..a90090f4 100644
--- a/src/lib/mhd_threads.c
+++ b/src/lib/mhd_threads.c
@@ -46,12 +46,14 @@
 #else  /* MHD_USE_THREAD_NAME_ */
 
 #if defined(MHD_USE_POSIX_THREADS)
-#if defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD) || 
defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
+#if defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD) || \
+  defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
 #  define MHD_USE_THREAD_ATTR_SETNAME 1
 #endif /* HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD || 
HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI */
 
-#if defined(HAVE_PTHREAD_SETNAME_NP_GNU) || 
defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) \
-    || defined(HAVE_PTHREAD_SETNAME_NP_NETBSD)
+#if defined(HAVE_PTHREAD_SETNAME_NP_GNU) || \
+  defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) \
+  || defined(HAVE_PTHREAD_SETNAME_NP_NETBSD)
 
 /**
  * Set thread name
@@ -61,25 +63,25 @@
  * @return non-zero on success, zero otherwise
  */
 static int
-MHD_set_thread_name_(const MHD_thread_ID_ thread_id,
-                     const char *thread_name)
+MHD_set_thread_name_ (const MHD_thread_ID_ thread_id,
+                      const char *thread_name)
 {
   if (NULL == thread_name)
     return 0;
 
 #if defined(HAVE_PTHREAD_SETNAME_NP_GNU)
-  return !pthread_setname_np (thread_id, thread_name);
+  return ! pthread_setname_np (thread_id, thread_name);
 #elif defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD)
   /* FreeBSD and OpenBSD use different name and void return type */
   pthread_set_name_np (thread_id, thread_name);
-  return !0;
+  return ! 0;
 #elif defined(HAVE_PTHREAD_SETNAME_NP_NETBSD)
   /* NetBSD use 3 arguments: second argument is string in printf-like format,
    *                         third argument is single argument for printf;
    * OSF1 use 3 arguments too, but last one always must be zero (NULL).
    * MHD doesn't use '%' in thread names, so both form are used in same way.
    */
-  return !pthread_setname_np (thread_id, thread_name, 0);
+  return ! pthread_setname_np (thread_id, thread_name, 0);
 #endif /* HAVE_PTHREAD_SETNAME_NP_NETBSD */
 }
 
@@ -90,10 +92,10 @@ MHD_set_thread_name_(const MHD_thread_ID_ thread_id,
  * @param n name to set
  * @return non-zero on success, zero otherwise
  */
-#define MHD_set_cur_thread_name_(n) MHD_set_thread_name_(pthread_self(),(n))
+#define MHD_set_cur_thread_name_(n) MHD_set_thread_name_ (pthread_self (),(n))
 #else  /* __QNXNTO__ */
 /* Special case for QNX Neutrino - using zero for thread ID sets name faster. 
*/
-#define MHD_set_cur_thread_name_(n) MHD_set_thread_name_(0,(n))
+#define MHD_set_cur_thread_name_(n) MHD_set_thread_name_ (0,(n))
 #endif /* __QNXNTO__ */
 #elif defined(HAVE_PTHREAD_SETNAME_NP_DARWIN)
 
@@ -102,7 +104,7 @@ MHD_set_thread_name_(const MHD_thread_ID_ thread_id,
  * @param n name to set
  * @return non-zero on success, zero otherwise
  */
-#define MHD_set_cur_thread_name_(n) (!(pthread_setname_np((n))))
+#define MHD_set_cur_thread_name_(n) (! (pthread_setname_np ((n))))
 #endif /* HAVE_PTHREAD_SETNAME_NP_DARWIN */
 
 #elif defined(MHD_USE_W32_THREADS)
@@ -117,8 +119,8 @@ MHD_set_thread_name_(const MHD_thread_ID_ thread_id,
  * @return non-zero on success, zero otherwise
  */
 static int
-MHD_set_thread_name_(const MHD_thread_ID_ thread_id,
-                     const char *thread_name)
+MHD_set_thread_name_ (const MHD_thread_ID_ thread_id,
+                      const char *thread_name)
 {
   static const DWORD VC_SETNAME_EXC = 0x406D1388;
 #pragma pack(push,8)
@@ -149,7 +151,7 @@ MHD_set_thread_name_(const MHD_thread_ID_ thread_id,
   __except (EXCEPTION_EXECUTE_HANDLER)
   {}
 
-  return !0;
+  return ! 0;
 }
 
 
@@ -158,7 +160,7 @@ MHD_set_thread_name_(const MHD_thread_ID_ thread_id,
  * @param n name to set
  * @return non-zero on success, zero otherwise
  */
-#define MHD_set_cur_thread_name_(n) MHD_set_thread_name_(-1,(n))
+#define MHD_set_cur_thread_name_(n) MHD_set_thread_name_ (-1,(n))
 #endif /* _MSC_FULL_VER */
 #endif /* MHD_USE_W32_THREADS */
 
@@ -184,21 +186,21 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
   int res;
 
   if (0 != stack_size)
+  {
+    pthread_attr_t attr;
+    res = pthread_attr_init (&attr);
+    if (0 == res)
     {
-      pthread_attr_t attr;
-      res = pthread_attr_init (&attr);
+      res = pthread_attr_setstacksize (&attr,
+                                       stack_size);
       if (0 == res)
-        {
-          res = pthread_attr_setstacksize (&attr,
-                                           stack_size);
-          if (0 == res)
-              res = pthread_create (&(thread->handle),
-                                    &attr,
-                                    start_routine,
-                                    arg);
-          pthread_attr_destroy (&attr);
-        }
+        res = pthread_create (&(thread->handle),
+                              &attr,
+                              start_routine,
+                              arg);
+      pthread_attr_destroy (&attr);
     }
+  }
   else
     res = pthread_create (&(thread->handle),
                           NULL,
@@ -208,28 +210,28 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
   if (0 != res)
     errno = res;
 
-  return !res;
+  return ! res;
 #elif defined(MHD_USE_W32_THREADS)
 #if SIZE_MAX != UINT_MAX
   if (stack_size > UINT_MAX)
-    {
-      errno = EINVAL;
-      return 0;
-    }
+  {
+    errno = EINVAL;
+    return 0;
+  }
 #endif /* SIZE_MAX != UINT_MAX */
 
   thread->handle = (MHD_thread_handle_)
-                     _beginthreadex (NULL,
-                                     (unsigned int) stack_size,
-                                     start_routine,
-                                     arg,
-                                     0,
-                                     NULL);
-
-  if ((MHD_thread_handle_)-1 == thread->handle)
+                   _beginthreadex (NULL,
+                                   (unsigned int) stack_size,
+                                   start_routine,
+                                   arg,
+                                   0,
+                                   NULL);
+
+  if ((MHD_thread_handle_) - 1 == thread->handle)
     return 0;
 
-  return !0;
+  return ! 0;
 #endif
 }
 
@@ -258,21 +260,21 @@ struct MHD_named_helper_param_
 static MHD_THRD_RTRN_TYPE_ MHD_THRD_CALL_SPEC_
 named_thread_starter (void *data)
 {
-  struct MHD_named_helper_param_ * const param =
-      (struct MHD_named_helper_param_ *) data;
-  void * arg;
+  struct MHD_named_helper_param_ *const param =
+    (struct MHD_named_helper_param_ *) data;
+  void *arg;
   MHD_THREAD_START_ROUTINE_ thr_func;
 
   if (NULL == data)
-    return (MHD_THRD_RTRN_TYPE_)0;
+    return (MHD_THRD_RTRN_TYPE_) 0;
 
   MHD_set_cur_thread_name_ (param->name);
 
   arg = param->arg;
   thr_func = param->start_routine;
-  free(data);
+  free (data);
 
-  return thr_func(arg);
+  return thr_func (arg);
 }
 #endif /* ! MHD_USE_THREAD_ATTR_SETNAME */
 
@@ -289,7 +291,7 @@ named_thread_starter (void *data)
  */
 int
 MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
-                          const char* thread_name,
+                          const char*thread_name,
                           size_t stack_size,
                           MHD_THREAD_START_ROUTINE_ start_routine,
                           void *arg)
@@ -300,41 +302,41 @@ MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
 
   res = pthread_attr_init (&attr);
   if (0 == res)
-    {
+  {
 #if defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD)
-  /* NetBSD use 3 arguments: second argument is string in printf-like format,
-   *                         third argument is single argument for printf;
-   * OSF1 use 3 arguments too, but last one always must be zero (NULL).
-   * MHD doesn't use '%' in thread names, so both form are used in same way.
-   */
-      res = pthread_attr_setname_np (&attr, thread_name, 0);
+    /* NetBSD use 3 arguments: second argument is string in printf-like format,
+     *                         third argument is single argument for printf;
+     * OSF1 use 3 arguments too, but last one always must be zero (NULL).
+     * MHD doesn't use '%' in thread names, so both form are used in same way.
+     */
+    res = pthread_attr_setname_np (&attr, thread_name, 0);
 #elif defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
-      res = pthread_attr_setname_np (&attr, thread_name);
+    res = pthread_attr_setname_np (&attr, thread_name);
 #else
 #error No pthread_attr_setname_np() function.
 #endif
-      if (res == 0 && 0 != stack_size)
-        res = pthread_attr_setstacksize (&attr,
-                                         stack_size);
-      if (0 == res)
-          res = pthread_create (&(thread->handle),
-                                &attr,
-                                start_routine,
-                                arg);
-      pthread_attr_destroy (&attr);
-    }
+    if ((res == 0) &&(0 != stack_size) )
+      res = pthread_attr_setstacksize (&attr,
+                                       stack_size);
+    if (0 == res)
+      res = pthread_create (&(thread->handle),
+                            &attr,
+                            start_routine,
+                            arg);
+    pthread_attr_destroy (&attr);
+  }
   if (0 != res)
     errno = res;
 
-  return !res;
+  return ! res;
 #else  /* ! MHD_USE_THREAD_ATTR_SETNAME */
   struct MHD_named_helper_param_ *param;
 
   if (NULL == thread_name)
-    {
-      errno = EINVAL;
-      return 0;
-    }
+  {
+    errno = EINVAL;
+    return 0;
+  }
 
   param = malloc (sizeof (struct MHD_named_helper_param_));
   if (NULL == param)
@@ -347,16 +349,16 @@ MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
   /* Set thread name in thread itself to avoid problems with
    * threads which terminated before name is set in other thread.
    */
-  if (! MHD_create_thread_(thread,
-                           stack_size,
-                           &named_thread_starter,
-                           (void*)param))
-    {
-      free (param);
-      return 0;
-    }
+  if (! MHD_create_thread_ (thread,
+                            stack_size,
+                            &named_thread_starter,
+                            (void*) param))
+  {
+    free (param);
+    return 0;
+  }
 
-  return !0;
+  return ! 0;
 #endif /* ! MHD_USE_THREAD_ATTR_SETNAME */
 }
 
diff --git a/src/lib/mhd_threads.h b/src/lib/mhd_threads.h
index 6d69b9ed..79520d53 100644
--- a/src/lib/mhd_threads.h
+++ b/src/lib/mhd_threads.h
@@ -58,23 +58,26 @@
 
 #ifndef MHD_NO_THREAD_NAMES
 #  if defined(MHD_USE_POSIX_THREADS)
-#    if defined(HAVE_PTHREAD_SETNAME_NP_GNU) || 
defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) || \
-        defined(HAVE_PTHREAD_SETNAME_NP_DARWIN) || 
defined(HAVE_PTHREAD_SETNAME_NP_NETBSD) || \
-        defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD) || 
defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
+#    if defined(HAVE_PTHREAD_SETNAME_NP_GNU) || \
+  defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) || \
+  defined(HAVE_PTHREAD_SETNAME_NP_DARWIN) || \
+  defined(HAVE_PTHREAD_SETNAME_NP_NETBSD) || \
+  defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD) || \
+  defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
 #      define MHD_USE_THREAD_NAME_
 #    endif /* HAVE_PTHREAD_SETNAME_NP */
 #  elif defined(MHD_USE_W32_THREADS)
 #    ifdef _MSC_FULL_VER
-       /* Thread names only available with VC compiler */
+/* Thread names only available with VC compiler */
 #      define MHD_USE_THREAD_NAME_
 #    endif /* _MSC_FULL_VER */
 #  endif
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
-  typedef pthread_t MHD_thread_handle_;
+typedef pthread_t MHD_thread_handle_;
 #elif defined(MHD_USE_W32_THREADS)
-  typedef HANDLE MHD_thread_handle_;
+typedef HANDLE MHD_thread_handle_;
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -86,9 +89,9 @@
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
-  typedef pthread_t MHD_thread_ID_;
+typedef pthread_t MHD_thread_ID_;
 #elif defined(MHD_USE_W32_THREADS)
-  typedef DWORD MHD_thread_ID_;
+typedef DWORD MHD_thread_ID_;
 #endif
 
 /* Depending on implementation, pthread_create() MAY set thread ID into
@@ -100,27 +103,27 @@
  * to save some resources. */
 #if defined(MHD_USE_POSIX_THREADS)
 #  ifdef MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD
-  union _MHD_thread_handle_ID_
-  {
-    MHD_thread_handle_  handle; /**< To be used in other threads */
-    MHD_thread_ID_      ID;     /**< To be used in thread itself */
-  };
-  typedef union _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
+union _MHD_thread_handle_ID_
+{
+  MHD_thread_handle_ handle;    /**< To be used in other threads */
+  MHD_thread_ID_ ID;            /**< To be used in thread itself */
+};
+typedef union _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
 #  else  /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
-  struct _MHD_thread_handle_ID_
-  {
-    MHD_thread_handle_  handle; /**< To be used in other threads */
-    MHD_thread_ID_      ID;     /**< To be used in thread itself */
-  };
-  typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
+struct _MHD_thread_handle_ID_
+{
+  MHD_thread_handle_ handle;    /**< To be used in other threads */
+  MHD_thread_ID_ ID;            /**< To be used in thread itself */
+};
+typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
 #  endif /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
 #elif defined(MHD_USE_W32_THREADS)
-  struct _MHD_thread_handle_ID_
-  {
-    MHD_thread_handle_  handle; /**< To be used in other threads */
-    MHD_thread_ID_      ID;     /**< To be used in thread itself */
-  };
-  typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
+struct _MHD_thread_handle_ID_
+{
+  MHD_thread_handle_ handle;    /**< To be used in other threads */
+  MHD_thread_ID_ ID;            /**< To be used in thread itself */
+};
+typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -129,14 +132,17 @@
  * @param thread handle to watch
  * @return nonzero on success, zero otherwise
  */
-#define MHD_join_thread_(thread) (!pthread_join((thread), NULL))
+#define MHD_join_thread_(thread) (! pthread_join ((thread), NULL))
 #elif defined(MHD_USE_W32_THREADS)
 /**
  * Wait until specified thread is ended and free thread handle on success.
  * @param thread handle to watch
  * @return nonzero on success, zero otherwise
  */
-#define MHD_join_thread_(thread) (WAIT_OBJECT_0 == 
WaitForSingleObject((thread), INFINITE) ? (CloseHandle((thread)), !0) : 0)
+#define MHD_join_thread_(thread) (WAIT_OBJECT_0 == WaitForSingleObject ( \
+                                    (thread), INFINITE) ? (CloseHandle ( \
+                                                             (thread)), ! 0) : 
\
+                                  0)
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -145,14 +151,14 @@
  * @param ID thread ID to match
  * @return nonzero on match, zero otherwise
  */
-#define MHD_thread_ID_match_current_(ID) (pthread_equal((ID), pthread_self()))
+#define MHD_thread_ID_match_current_(ID) (pthread_equal ((ID), pthread_self 
()))
 #elif defined(MHD_USE_W32_THREADS)
 /**
  * Check whether provided thread ID match current thread.
  * @param ID thread ID to match
  * @return nonzero on match, zero otherwise
  */
-#define MHD_thread_ID_match_current_(ID) (GetCurrentThreadId() == (ID))
+#define MHD_thread_ID_match_current_(ID) (GetCurrentThreadId () == (ID))
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -161,20 +167,22 @@
  * Initialise thread ID.
  * @param thread_handle_ID_ptr pointer to thread handle-ID
  */
-#define MHD_thread_init_(thread_handle_ID_ptr) (void)0
+#define MHD_thread_init_(thread_handle_ID_ptr) (void) 0
 #  else  /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
 /**
  * Initialise thread ID.
  * @param thread_handle_ID_ptr pointer to thread handle-ID
  */
-#define MHD_thread_init_(thread_handle_ID_ptr) 
((thread_handle_ID_ptr)->ID=pthread_self())
+#define MHD_thread_init_(thread_handle_ID_ptr) ((thread_handle_ID_ptr)->ID = \
+                                                  pthread_self ())
 #  endif /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
 #elif defined(MHD_USE_W32_THREADS)
 /**
  * Initialise thread ID.
  * @param thread_handle_ID_ptr pointer to thread handle-ID
  */
-#define MHD_thread_init_(thread_handle_ID_ptr) 
((thread_handle_ID_ptr)->ID=GetCurrentThreadId())
+#define MHD_thread_init_(thread_handle_ID_ptr) ((thread_handle_ID_ptr)->ID = \
+                                                  GetCurrentThreadId ())
 #endif
 
 /**
@@ -205,7 +213,7 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
                     void *arg);
 
 #ifndef MHD_USE_THREAD_NAME_
-#define MHD_create_named_thread_(t,n,s,r,a) MHD_create_thread_((t),(s),(r),(a))
+#define MHD_create_named_thread_(t,n,s,r,a) MHD_create_thread_ 
((t),(s),(r),(a))
 #else  /* MHD_USE_THREAD_NAME_ */
 /**
  * Create a named thread and set the attributes according to our options.
@@ -219,7 +227,7 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
  */
 int
 MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
-                          const char* thread_name,
+                          const char*thread_name,
                           size_t stack_size,
                           MHD_THREAD_START_ROUTINE_ start_routine,
                           void *arg);
diff --git a/src/lib/reason_phrase.c b/src/lib/reason_phrase.c
index 97ace0a3..e3692837 100644
--- a/src/lib/reason_phrase.c
+++ b/src/lib/reason_phrase.c
@@ -27,7 +27,7 @@
 #include "internal.h"
 
 #ifndef NULL
-#define NULL ((void*)0)
+#define NULL ((void*) 0)
 #endif
 
 static const char *const invalid_hundred[] = {
diff --git a/src/lib/request.c b/src/lib/request.c
index 02cce55c..5b932bfa 100644
--- a/src/lib/request.c
+++ b/src/lib/request.c
@@ -40,9 +40,9 @@
  */
 unsigned int
 MHD_request_get_values (struct MHD_Request *request,
-                       enum MHD_ValueKind kind,
-                       MHD_KeyValueIterator iterator,
-                       void *iterator_cls)
+                        enum MHD_ValueKind kind,
+                        MHD_KeyValueIterator iterator,
+                        void *iterator_cls)
 {
   int ret;
   struct MHD_HTTP_Header *pos;
@@ -51,18 +51,18 @@ MHD_request_get_values (struct MHD_Request *request,
   for (pos = request->headers_received;
        NULL != pos;
        pos = pos->next)
+  {
+    if (0 != (pos->kind & kind))
     {
-      if (0 != (pos->kind & kind))
-       {
-         ret++;
-         if ( (NULL != iterator) &&
-              (MHD_YES != iterator (iterator_cls,
-                                    pos->kind,
-                                    pos->header,
-                                    pos->value)) )
-           return ret;
-       }
+      ret++;
+      if ( (NULL != iterator) &&
+           (MHD_YES != iterator (iterator_cls,
+                                 pos->kind,
+                                 pos->header,
+                                 pos->value)) )
+        return ret;
     }
+  }
   return ret;
 }
 
@@ -94,9 +94,9 @@ MHD_request_get_values (struct MHD_Request *request,
  */
 enum MHD_Bool
 MHD_request_set_value (struct MHD_Request *request,
-                      enum MHD_ValueKind kind,
-                      const char *key,
-                      const char *value)
+                       enum MHD_ValueKind kind,
+                       const char *key,
+                       const char *value)
 {
   struct MHD_HTTP_Header *pos;
 
@@ -111,15 +111,15 @@ MHD_request_set_value (struct MHD_Request *request,
   pos->next = NULL;
   /* append 'pos' to the linked list of headers */
   if (NULL == request->headers_received_tail)
-    {
-      request->headers_received = pos;
-      request->headers_received_tail = pos;
-    }
+  {
+    request->headers_received = pos;
+    request->headers_received_tail = pos;
+  }
   else
-    {
-      request->headers_received_tail->next = pos;
-      request->headers_received_tail = pos;
-    }
+  {
+    request->headers_received_tail->next = pos;
+    request->headers_received_tail = pos;
+  }
   return MHD_YES;
 }
 
@@ -136,27 +136,25 @@ MHD_request_set_value (struct MHD_Request *request,
  */
 const char *
 MHD_request_lookup_value (struct MHD_Request *request,
-                         enum MHD_ValueKind kind,
-                         const char *key)
+                          enum MHD_ValueKind kind,
+                          const char *key)
 {
   struct MHD_HTTP_Header *pos;
 
   for (pos = request->headers_received;
        NULL != pos;
        pos = pos->next)
-    {
-      if ((0 != (pos->kind & kind)) &&
-         ( (key == pos->header) ||
-           ( (NULL != pos->header) &&
-             (NULL != key) &&
-             (MHD_str_equal_caseless_(key,
-                                      pos->header)))))
-       return pos->value;
-    }
+  {
+    if ((0 != (pos->kind & kind)) &&
+        ( (key == pos->header) ||
+          ( (NULL != pos->header) &&
+            (NULL != key) &&
+            (MHD_str_equal_caseless_ (key,
+                                      pos->header)))))
+      return pos->value;
+  }
   return NULL;
 }
 
 
 /* end of request.c */
-
-
diff --git a/src/lib/request_info.c b/src/lib/request_info.c
index 5f481d98..51aae075 100644
--- a/src/lib/request_info.c
+++ b/src/lib/request_info.c
@@ -42,11 +42,11 @@
  */
 enum MHD_Bool
 MHD_request_get_information_sz (struct MHD_Request *request,
-                               enum MHD_RequestInformationType info_type,
-                               union MHD_RequestInformation *return_value,
-                               size_t return_value_size)
+                                enum MHD_RequestInformationType info_type,
+                                union MHD_RequestInformation *return_value,
+                                size_t return_value_size)
 {
-#define CHECK_SIZE(type) if (sizeof(type) < return_value_size) \
+#define CHECK_SIZE(type) if (sizeof(type) < return_value_size)  \
     return MHD_NO
 
   switch (info_type)
@@ -70,8 +70,8 @@ MHD_request_get_information_sz (struct MHD_Request *request,
   case MHD_REQUEST_INFORMATION_HEADER_SIZE:
     CHECK_SIZE (size_t);
     if ( (MHD_REQUEST_HEADERS_RECEIVED > request->state) ||
-        (MHD_REQUEST_CLOSED == request->state) )
-        return MHD_NO; /* invalid, too early! */
+         (MHD_REQUEST_CLOSED == request->state) )
+      return MHD_NO;   /* invalid, too early! */
     return_value->header_size = request->header_size;
     return MHD_YES;
 
diff --git a/src/lib/request_resume.c b/src/lib/request_resume.c
index a69107b9..be513f53 100644
--- a/src/lib/request_resume.c
+++ b/src/lib/request_resume.c
@@ -45,21 +45,23 @@ MHD_request_resume (struct MHD_Request *request)
   struct MHD_Daemon *daemon = request->daemon;
 
   if (daemon->disallow_suspend_resume)
-    MHD_PANIC (_("Cannot resume connections without enabling 
MHD_ALLOW_SUSPEND_RESUME!\n"));
+    MHD_PANIC (_ (
+                 "Cannot resume connections without enabling 
MHD_ALLOW_SUSPEND_RESUME!\n"));
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   request->connection->resuming = true;
   daemon->resuming = true;
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_itc_activate_ (daemon->itc,
-                            "r")) )
-    {
+                             "r")) )
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               MHD_SC_ITC_USE_FAILED,
-                _("Failed to signal resume via inter-thread communication 
channel."));
+    MHD_DLOG (daemon,
+              MHD_SC_ITC_USE_FAILED,
+              _ (
+                "Failed to signal resume via inter-thread communication 
channel."));
 #endif
-    }
+  }
 }
 
 
@@ -80,115 +82,118 @@ MHD_resume_suspended_connections_ (struct MHD_Daemon 
*daemon)
   struct MHD_Connection *pos;
   struct MHD_Connection *prev = NULL;
   bool ret;
-  const bool used_thr_p_c = (MHD_TM_THREAD_PER_CONNECTION == 
daemon->threading_mode);
+  const bool used_thr_p_c = (MHD_TM_THREAD_PER_CONNECTION ==
+                             daemon->threading_mode);
 
   mhd_assert (NULL == daemon->worker_pool);
   ret = false;
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 
   if (daemon->resuming)
-    {
-      prev = daemon->suspended_connections_tail;
-      /* During shutdown check for resuming is forced. */
-      mhd_assert((NULL != prev) || (daemon->shutdown));
-    }
+  {
+    prev = daemon->suspended_connections_tail;
+    /* During shutdown check for resuming is forced. */
+    mhd_assert ((NULL != prev) || (daemon->shutdown));
+  }
 
   daemon->resuming = false;
 
   while (NULL != (pos = prev))
-    {
+  {
 #ifdef UPGRADE_SUPPORT
-      struct MHD_UpgradeResponseHandle * const urh = pos->request.urh;
+    struct MHD_UpgradeResponseHandle *const urh = pos->request.urh;
 #else  /* ! UPGRADE_SUPPORT */
-      static const void * const urh = NULL;
+    static const void *const urh = NULL;
 #endif /* ! UPGRADE_SUPPORT */
-      prev = pos->prev;
-      if ( (! pos->resuming)
+    prev = pos->prev;
+    if ( (! pos->resuming)
 #ifdef UPGRADE_SUPPORT
-          || ( (NULL != urh) &&
-               ( (! urh->was_closed) ||
-                 (! urh->clean_ready) ) )
+         || ( (NULL != urh) &&
+              ( (! urh->was_closed) ||
+                (! urh->clean_ready) ) )
 #endif /* UPGRADE_SUPPORT */
          )
-        continue;
-      ret = true;
-      mhd_assert (pos->suspended);
-      DLL_remove (daemon->suspended_connections_head,
-                  daemon->suspended_connections_tail,
+      continue;
+    ret = true;
+    mhd_assert (pos->suspended);
+    DLL_remove (daemon->suspended_connections_head,
+                daemon->suspended_connections_tail,
+                pos);
+    pos->suspended = false;
+    if (NULL == urh)
+    {
+      DLL_insert (daemon->connections_head,
+                  daemon->connections_tail,
                   pos);
-      pos->suspended = false;
-      if (NULL == urh)
-        {
-          DLL_insert (daemon->connections_head,
-                      daemon->connections_tail,
-                      pos);
-          if (! used_thr_p_c)
-            {
-              /* Reset timeout timer on resume. */
-              if (0 != pos->connection_timeout)
-                pos->last_activity = MHD_monotonic_sec_counter();
-
-              if (pos->connection_timeout == 
daemon->connection_default_timeout)
-                XDLL_insert (daemon->normal_timeout_head,
-                             daemon->normal_timeout_tail,
-                             pos);
-              else
-                XDLL_insert (daemon->manual_timeout_head,
-                             daemon->manual_timeout_tail,
-                             pos);
-            }
+      if (! used_thr_p_c)
+      {
+        /* Reset timeout timer on resume. */
+        if (0 != pos->connection_timeout)
+          pos->last_activity = MHD_monotonic_sec_counter ();
+
+        if (pos->connection_timeout == daemon->connection_default_timeout)
+          XDLL_insert (daemon->normal_timeout_head,
+                       daemon->normal_timeout_tail,
+                       pos);
+        else
+          XDLL_insert (daemon->manual_timeout_head,
+                       daemon->manual_timeout_tail,
+                       pos);
+      }
 #ifdef EPOLL_SUPPORT
-          if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
-            {
-              if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-                MHD_PANIC ("Resumed connection was already in EREADY set\n");
-              /* we always mark resumed connections as ready, as we
-                 might have missed the edge poll event during suspension */
-              EDLL_insert (daemon->eready_head,
-                           daemon->eready_tail,
-                           pos);
-              pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL | \
-                  MHD_EPOLL_STATE_READ_READY | MHD_EPOLL_STATE_WRITE_READY;
-              pos->epoll_state &= ~MHD_EPOLL_STATE_SUSPENDED;
-            }
+      if (MHD_ELS_EPOLL == daemon->event_loop_syscall)
+      {
+        if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
+          MHD_PANIC ("Resumed connection was already in EREADY set\n");
+        /* we always mark resumed connections as ready, as we
+           might have missed the edge poll event during suspension */
+        EDLL_insert (daemon->eready_head,
+                     daemon->eready_tail,
+                     pos);
+        pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL   \
+                            | MHD_EPOLL_STATE_READ_READY
+                            | MHD_EPOLL_STATE_WRITE_READY;
+        pos->epoll_state &= ~MHD_EPOLL_STATE_SUSPENDED;
+      }
 #endif
-        }
+    }
 #ifdef UPGRADE_SUPPORT
-      else
-        {
-          struct MHD_Response *response = pos->request.response;
-
-          /* Data forwarding was finished (for TLS connections) AND
-           * application was closed upgraded connection.
-           * Insert connection into cleanup list. */
-          if ( (NULL != response) &&
-               (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode) &&
-               (NULL != response->termination_cb) )
-            response->termination_cb (response->termination_cb_cls,
-                                      MHD_REQUEST_TERMINATED_COMPLETED_OK,
-                                      &pos->request.client_context);
-          DLL_insert (daemon->cleanup_head,
-                      daemon->cleanup_tail,
-                      pos);
-
-        }
-#endif /* UPGRADE_SUPPORT */
-      pos->resuming = false;
+    else
+    {
+      struct MHD_Response *response = pos->request.response;
+
+      /* Data forwarding was finished (for TLS connections) AND
+       * application was closed upgraded connection.
+       * Insert connection into cleanup list. */
+      if ( (NULL != response) &&
+           (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_mode) &&
+           (NULL != response->termination_cb) )
+        response->termination_cb (response->termination_cb_cls,
+                                  MHD_REQUEST_TERMINATED_COMPLETED_OK,
+                                  &pos->request.client_context);
+      DLL_insert (daemon->cleanup_head,
+                  daemon->cleanup_tail,
+                  pos);
+
     }
+#endif /* UPGRADE_SUPPORT */
+    pos->resuming = false;
+  }
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
   if ( (used_thr_p_c) &&
        (ret) )
-    { /* Wake up suspended connections. */
-      if (! MHD_itc_activate_(daemon->itc,
-                              "w"))
-       {
+  {   /* Wake up suspended connections. */
+    if (! MHD_itc_activate_ (daemon->itc,
+                             "w"))
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   MHD_SC_ITC_USE_FAILED,
-                   _("Failed to signal resume of connection via inter-thread 
communication channel."));
+      MHD_DLOG (daemon,
+                MHD_SC_ITC_USE_FAILED,
+                _ (
+                  "Failed to signal resume of connection via inter-thread 
communication channel."));
 #endif
-       }
     }
+  }
   return ret;
 }
 
diff --git a/src/lib/request_resume.h b/src/lib/request_resume.h
index d23ff9e8..dad43467 100644
--- a/src/lib/request_resume.h
+++ b/src/lib/request_resume.h
@@ -38,6 +38,6 @@
  */
 bool
 MHD_resume_suspended_connections_ (struct MHD_Daemon *daemon)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 #endif
diff --git a/src/lib/response.c b/src/lib/response.c
index ff23c7fd..47dd98d6 100644
--- a/src/lib/response.c
+++ b/src/lib/response.c
@@ -38,9 +38,9 @@
  */
 static bool
 add_response_entry (struct MHD_Response *response,
-                   enum MHD_ValueKind kind,
-                   const char *header,
-                   const char *content)
+                    enum MHD_ValueKind kind,
+                    const char *header,
+                    const char *content)
 {
   struct MHD_HTTP_Header *hdr;
 
@@ -58,16 +58,16 @@ add_response_entry (struct MHD_Response *response,
   if (NULL == (hdr = malloc (sizeof (struct MHD_HTTP_Header))))
     return false;
   if (NULL == (hdr->header = strdup (header)))
-    {
-      free (hdr);
-      return false;
-    }
+  {
+    free (hdr);
+    return false;
+  }
   if (NULL == (hdr->value = strdup (content)))
-    {
-      free (hdr->header);
-      free (hdr);
-      return false;
-    }
+  {
+    free (hdr->header);
+    free (hdr);
+    return false;
+  }
   hdr->kind = kind;
   hdr->next = response->first_header;
   response->first_header = hdr;
@@ -91,22 +91,22 @@ MHD_response_queue_for_destroy (struct MHD_Response 
*response)
 
   MHD_mutex_lock_chk_ (&response->mutex);
   if (0 != --(response->reference_count))
-    {
-      MHD_mutex_unlock_chk_ (&response->mutex);
-      return;
-    }
+  {
+    MHD_mutex_unlock_chk_ (&response->mutex);
+    return;
+  }
   MHD_mutex_unlock_chk_ (&response->mutex);
   MHD_mutex_destroy_chk_ (&response->mutex);
   if (NULL != response->crfc)
     response->crfc (response->crc_cls);
   while (NULL != response->first_header)
-    {
-      pos = response->first_header;
-      response->first_header = pos->next;
-      free (pos->header);
-      free (pos->value);
-      free (pos);
-    }
+  {
+    pos = response->first_header;
+    response->first_header = pos->next;
+    free (pos->header);
+    free (pos->value);
+    free (pos);
+  }
   free (response);
 }
 
@@ -124,12 +124,12 @@ MHD_response_queue_for_destroy (struct MHD_Response 
*response)
 enum MHD_Bool
 MHD_response_add_header (struct MHD_Response *response,
                          const char *header,
-                        const char *content)
+                         const char *content)
 {
   return add_response_entry (response,
-                            MHD_HEADER_KIND,
-                            header,
-                            content) ? MHD_YES : MHD_NO;
+                             MHD_HEADER_KIND,
+                             header,
+                             content) ? MHD_YES : MHD_NO;
 }
 
 
@@ -149,9 +149,9 @@ MHD_response_add_trailer (struct MHD_Response *response,
                           const char *content)
 {
   return add_response_entry (response,
-                            MHD_FOOTER_KIND,
-                            footer,
-                            content) ? MHD_YES : MHD_NO;
+                             MHD_FOOTER_KIND,
+                             footer,
+                             content) ? MHD_YES : MHD_NO;
 }
 
 
@@ -167,7 +167,7 @@ MHD_response_add_trailer (struct MHD_Response *response,
 enum MHD_Bool
 MHD_response_del_header (struct MHD_Response *response,
                          const char *header,
-                        const char *content)
+                         const char *content)
 {
   struct MHD_HTTP_Header *pos;
   struct MHD_HTTP_Header *prev;
@@ -175,24 +175,24 @@ MHD_response_del_header (struct MHD_Response *response,
   prev = NULL;
   pos = response->first_header;
   while (NULL != pos)
+  {
+    if ((0 == strcmp (header,
+                      pos->header)) &&
+        (0 == strcmp (content,
+                      pos->value)))
     {
-      if ((0 == strcmp (header,
-                        pos->header)) &&
-          (0 == strcmp (content,
-                        pos->value)))
-        {
-          free (pos->header);
-          free (pos->value);
-          if (NULL == prev)
-            response->first_header = pos->next;
-          else
-            prev->next = pos->next;
-          free (pos);
-          return MHD_YES;
-        }
-      prev = pos;
-      pos = pos->next;
+      free (pos->header);
+      free (pos->value);
+      if (NULL == prev)
+        response->first_header = pos->next;
+      else
+        prev->next = pos->next;
+      free (pos);
+      return MHD_YES;
     }
+    prev = pos;
+    pos = pos->next;
+  }
   return MHD_NO;
 }
 
@@ -210,7 +210,7 @@ MHD_response_del_header (struct MHD_Response *response,
 unsigned int
 MHD_response_get_headers (struct MHD_Response *response,
                           MHD_KeyValueIterator iterator,
-                         void *iterator_cls)
+                          void *iterator_cls)
 {
   unsigned int numHeaders = 0;
   struct MHD_HTTP_Header *pos;
@@ -218,15 +218,15 @@ MHD_response_get_headers (struct MHD_Response *response,
   for (pos = response->first_header;
        NULL != pos;
        pos = pos->next)
-    {
-      numHeaders++;
-      if ( (NULL != iterator) &&
-          (MHD_YES != iterator (iterator_cls,
-                                pos->kind,
-                                pos->header,
-                                pos->value)) )
-        break;
-    }
+  {
+    numHeaders++;
+    if ( (NULL != iterator) &&
+         (MHD_YES != iterator (iterator_cls,
+                               pos->kind,
+                               pos->header,
+                               pos->value)) )
+      break;
+  }
   return numHeaders;
 }
 
@@ -241,18 +241,18 @@ MHD_response_get_headers (struct MHD_Response *response,
  */
 const char *
 MHD_response_get_header (struct MHD_Response *response,
-                        const char *key)
+                         const char *key)
 {
   struct MHD_HTTP_Header *pos;
 
   for (pos = response->first_header;
        NULL != pos;
        pos = pos->next)
-    {
-      if (MHD_str_equal_caseless_ (pos->header,
-                                  key))
-        return pos->value;
-    }
+  {
+    if (MHD_str_equal_caseless_ (pos->header,
+                                 key))
+      return pos->value;
+  }
   return NULL;
 }
 
diff --git a/src/lib/response_for_upgrade.c b/src/lib/response_for_upgrade.c
index 0d843b8e..ef66b029 100644
--- a/src/lib/response_for_upgrade.c
+++ b/src/lib/response_for_upgrade.c
@@ -57,21 +57,21 @@
  */
 struct MHD_Response *
 MHD_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
-                         void *upgrade_handler_cls)
+                          void *upgrade_handler_cls)
 {
 #ifdef UPGRADE_SUPPORT
   struct MHD_Response *response;
 
   mhd_assert (NULL != upgrade_handler);
   response = MHD_calloc_ (1,
-                         sizeof (struct MHD_Response));
+                          sizeof (struct MHD_Response));
   if (NULL == response)
     return NULL;
   if (! MHD_mutex_init_ (&response->mutex))
-    {
-      free (response);
-      return NULL;
-    }
+  {
+    free (response);
+    return NULL;
+  }
   response->upgrade_handler = upgrade_handler;
   response->upgrade_handler_cls = upgrade_handler_cls;
   response->status_code = MHD_HTTP_SWITCHING_PROTOCOLS;
@@ -81,10 +81,10 @@ MHD_response_for_upgrade (MHD_UpgradeHandler 
upgrade_handler,
       MHD_response_add_header (response,
                                MHD_HTTP_HEADER_CONNECTION,
                                "Upgrade"))
-    {
-      MHD_response_queue_for_destroy (response);
-      return NULL;
-    }
+  {
+    MHD_response_queue_for_destroy (response);
+    return NULL;
+  }
   return response;
 #else
   return NULL;
diff --git a/src/lib/response_from_buffer.c b/src/lib/response_from_buffer.c
index a53537b0..a65a0298 100644
--- a/src/lib/response_from_buffer.c
+++ b/src/lib/response_from_buffer.c
@@ -39,44 +39,44 @@
  */
 struct MHD_Response *
 MHD_response_from_buffer (enum MHD_HTTP_StatusCode sc,
-                         size_t size,
-                         void *buffer,
-                         enum MHD_ResponseMemoryMode mode)
+                          size_t size,
+                          void *buffer,
+                          enum MHD_ResponseMemoryMode mode)
 {
   struct MHD_Response *response;
   void *tmp;
 
   mhd_assert ( (NULL != buffer) ||
-              (0 == size) );
+               (0 == size) );
   if (NULL ==
       (response = MHD_calloc_ (1,
-                              sizeof (struct MHD_Response))))
+                               sizeof (struct MHD_Response))))
     return NULL;
   response->fd = -1;
   if (! MHD_mutex_init_ (&response->mutex))
-    {
-      free (response);
-      return NULL;
-    }
+  {
+    free (response);
+    return NULL;
+  }
   if ( (MHD_RESPMEM_MUST_COPY == mode) &&
        (size > 0) )
+  {
+    if (NULL == (tmp = malloc (size)))
     {
-      if (NULL == (tmp = malloc (size)))
-        {
-          MHD_mutex_destroy_chk_ (&response->mutex);
-          free (response);
-          return NULL;
-        }
-      memcpy (tmp,
-             buffer,
-             size);
-      buffer = tmp;
+      MHD_mutex_destroy_chk_ (&response->mutex);
+      free (response);
+      return NULL;
     }
+    memcpy (tmp,
+            buffer,
+            size);
+    buffer = tmp;
+  }
   if (MHD_RESPMEM_PERSISTENT != mode)
-    {
-      response->crfc = &free;
-      response->crc_cls = buffer;
-    }
+  {
+    response->crfc = &free;
+    response->crc_cls = buffer;
+  }
   response->status_code = sc;
   response->reference_count = 1;
   response->total_size = size;
diff --git a/src/lib/response_from_callback.c b/src/lib/response_from_callback.c
index 1fd65bf0..e00033ce 100644
--- a/src/lib/response_from_callback.c
+++ b/src/lib/response_from_callback.c
@@ -44,11 +44,11 @@
  */
 struct MHD_Response *
 MHD_response_from_callback (enum MHD_HTTP_StatusCode sc,
-                           uint64_t size,
-                           size_t block_size,
-                           MHD_ContentReaderCallback crc,
-                           void *crc_cls,
-                           MHD_ContentReaderFreeCallback crfc)
+                            uint64_t size,
+                            size_t block_size,
+                            MHD_ContentReaderCallback crc,
+                            void *crc_cls,
+                            MHD_ContentReaderFreeCallback crfc)
 {
   struct MHD_Response *response;
 
@@ -56,8 +56,8 @@ MHD_response_from_callback (enum MHD_HTTP_StatusCode sc,
   mhd_assert (0 != block_size);
   if (NULL ==
       (response = MHD_calloc_ (1,
-                              sizeof (struct MHD_Response) +
-                              block_size)))
+                               sizeof (struct MHD_Response)
+                               + block_size)))
     return NULL;
   response->fd = -1;
   response->status_code = sc;
diff --git a/src/lib/response_from_fd.c b/src/lib/response_from_fd.c
index ac0a54d1..ffeb2b91 100644
--- a/src/lib/response_from_fd.c
+++ b/src/lib/response_from_fd.c
@@ -57,34 +57,34 @@ file_reader (void *cls,
              size_t max)
 {
   struct MHD_Response *response = cls;
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
   ssize_t n;
 #else  /* _WIN32 && !__CYGWIN__ */
   const HANDLE fh = (HANDLE) _get_osfhandle (response->fd);
 #endif /* _WIN32 && !__CYGWIN__ */
-  const int64_t offset64 = (int64_t)(pos + response->fd_off);
+  const int64_t offset64 = (int64_t) (pos + response->fd_off);
 
   if (offset64 < 0)
     return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is 
not possible */
 
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
   if (max > SSIZE_MAX)
     max = SSIZE_MAX; /* Clamp to maximum return value. */
 
 #if defined(HAVE_PREAD64)
   n = pread64 (response->fd,
-              buf,
-              max,
-              offset64);
+               buf,
+               max,
+               offset64);
 #elif defined(HAVE_PREAD)
   if ( (sizeof(off_t) < sizeof (uint64_t)) &&
-       (offset64 > (uint64_t)INT32_MAX) )
+       (offset64 > (uint64_t) INT32_MAX) )
     return MHD_CONTENT_READER_END_WITH_ERROR; /* Read at required position is 
not possible. */
 
   n = pread (response->fd,
-            buf,
-            max,
-            (off_t) offset64);
+             buf,
+             max,
+             (off_t) offset64);
 #else  /* ! HAVE_PREAD */
 #if defined(HAVE_LSEEK64)
   if (lseek64 (response->fd,
@@ -93,7 +93,7 @@ file_reader (void *cls,
     return MHD_CONTENT_READER_END_WITH_ERROR; /* can't seek to required 
position */
 #else  /* ! HAVE_LSEEK64 */
   if ( (sizeof(off_t) < sizeof (uint64_t)) &&
-       (offset64 > (uint64_t)INT32_MAX) )
+       (offset64 > (uint64_t) INT32_MAX) )
     return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is 
not possible */
 
   if (lseek (response->fd,
@@ -115,25 +115,25 @@ file_reader (void *cls,
   if (INVALID_HANDLE_VALUE == fh)
     return MHD_CONTENT_READER_END_WITH_ERROR; /* Value of 'response->fd' is 
not valid. */
   else
-    {
-      OVERLAPPED f_ol = {0, 0, {{0, 0}}, 0}; /* Initialize to zero. */
-      ULARGE_INTEGER pos_uli;
-      DWORD toRead = (max > INT32_MAX) ? INT32_MAX : (DWORD) max;
-      DWORD resRead;
-
-      pos_uli.QuadPart = (uint64_t) offset64; /* Simple transformation 64bit 
-> 2x32bit. */
-      f_ol.Offset = pos_uli.LowPart;
-      f_ol.OffsetHigh = pos_uli.HighPart;
-      if (! ReadFile (fh,
-                     (void*)buf,
-                     toRead,
-                     &resRead,
-                     &f_ol))
-        return MHD_CONTENT_READER_END_WITH_ERROR; /* Read error. */
-      if (0 == resRead)
-        return MHD_CONTENT_READER_END_OF_STREAM;
-      return (ssize_t) resRead;
-    }
+  {
+    OVERLAPPED f_ol = {0, 0, {{0, 0}}, 0};   /* Initialize to zero. */
+    ULARGE_INTEGER pos_uli;
+    DWORD toRead = (max > INT32_MAX) ? INT32_MAX : (DWORD) max;
+    DWORD resRead;
+
+    pos_uli.QuadPart = (uint64_t) offset64;   /* Simple transformation 64bit 
-> 2x32bit. */
+    f_ol.Offset = pos_uli.LowPart;
+    f_ol.OffsetHigh = pos_uli.HighPart;
+    if (! ReadFile (fh,
+                    (void*) buf,
+                    toRead,
+                    &resRead,
+                    &f_ol))
+      return MHD_CONTENT_READER_END_WITH_ERROR;   /* Read error. */
+    if (0 == resRead)
+      return MHD_CONTENT_READER_END_OF_STREAM;
+    return (ssize_t) resRead;
+  }
 #endif /* _WIN32 && !__CYGWIN__ */
 }
 
@@ -174,18 +174,18 @@ free_callback (void *cls)
  */
 struct MHD_Response *
 MHD_response_from_fd (enum MHD_HTTP_StatusCode sc,
-                     int fd,
-                     uint64_t offset,
-                     uint64_t size)
+                      int fd,
+                      uint64_t offset,
+                      uint64_t size)
 {
   struct MHD_Response *response;
 
   mhd_assert (-1 != fd);
-#if !defined(HAVE___LSEEKI64) && !defined(HAVE_LSEEK64)
+#if ! defined(HAVE___LSEEKI64) && ! defined(HAVE_LSEEK64)
   if ( (sizeof (uint64_t) > sizeof (off_t)) &&
-       ( (size > (uint64_t)INT32_MAX) ||
-         (offset > (uint64_t)INT32_MAX) ||
-         ((size + offset) >= (uint64_t)INT32_MAX) ) )
+       ( (size > (uint64_t) INT32_MAX) ||
+         (offset > (uint64_t) INT32_MAX) ||
+         ((size + offset) >= (uint64_t) INT32_MAX) ) )
     return NULL;
 #endif
   if ( ((int64_t) size < 0) ||
@@ -194,11 +194,11 @@ MHD_response_from_fd (enum MHD_HTTP_StatusCode sc,
     return NULL;
 
   response = MHD_response_from_callback (sc,
-                                        size,
-                                        MHD_FILE_READ_BLOCK_SIZE,
-                                        &file_reader,
-                                        NULL,
-                                        &free_callback);
+                                         size,
+                                         MHD_FILE_READ_BLOCK_SIZE,
+                                         &file_reader,
+                                         NULL,
+                                         &free_callback);
   if (NULL == response)
     return NULL;
   response->fd = fd;
@@ -208,4 +208,3 @@ MHD_response_from_fd (enum MHD_HTTP_StatusCode sc,
 }
 
 /* end of response_from_fd.c */
-
diff --git a/src/lib/response_options.c b/src/lib/response_options.c
index 406d1d32..e349627a 100644
--- a/src/lib/response_options.c
+++ b/src/lib/response_options.c
@@ -49,8 +49,9 @@ MHD_response_option_v10_only (struct MHD_Response *response)
  */
 void
 MHD_response_option_termination_callback (struct MHD_Response *response,
-                                         MHD_RequestTerminationCallback 
termination_cb,
-                                         void *termination_cb_cls)
+                                          MHD_RequestTerminationCallback
+                                          termination_cb,
+                                          void *termination_cb_cls)
 {
   /* Q: should we assert termination_cb non-NULL? */
   response->termination_cb = termination_cb;
diff --git a/src/lib/sysfdsetsize.c b/src/lib/sysfdsetsize.c
index fe7fba75..4929b3d2 100644
--- a/src/lib/sysfdsetsize.c
+++ b/src/lib/sysfdsetsize.c
@@ -56,7 +56,7 @@
 #include <sys/socket.h>
 #endif /* HAVE_SYS_SOCKET_H */
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #endif /* !WIN32_LEAN_AND_MEAN */
diff --git a/src/lib/tsearch.c b/src/lib/tsearch.c
index fe5fcd5b..e43d758f 100644
--- a/src/lib/tsearch.c
+++ b/src/lib/tsearch.c
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 
 
-typedef        struct node
+typedef struct node
 {
   const void   *key;
   struct node  *llink;
@@ -24,35 +24,35 @@ typedef     struct node
 /*     $NetBSD: tsearch.c,v 1.5 2005/11/29 03:12:00 christos Exp $     */
 /* find or insert datum into search tree */
 void *
-tsearch (const void *vkey,             /* key to be located */
-         void **vrootp,                        /* address of tree root */
+tsearch (const void *vkey,    /* key to be located */
+         void **vrootp,     /* address of tree root */
          int (*compar)(const void *, const void *))
 {
   node_t *q;
-  node_t **rootp = (node_t **)vrootp;
+  node_t **rootp = (node_t **) vrootp;
 
   if (NULL == rootp)
     return NULL;
 
   while (*rootp != NULL)
-    {  /* Knuth's T1: */
-      int r;
+  {   /* Knuth's T1: */
+    int r;
 
-      if ((r = (*compar)(vkey, (*rootp)->key)) == 0)   /* T2: */
-        return *rootp;         /* we found it! */
+    if ((r = (*compar)(vkey, (*rootp)->key)) == 0)    /* T2: */
+      return *rootp;      /* we found it! */
 
-      rootp = (r < 0) ?
-        &(*rootp)->llink :             /* T3: follow left branch */
-        &(*rootp)->rlink;              /* T4: follow right branch */
-    }
+    rootp = (r < 0) ?
+            &(*rootp)->llink : /* T3: follow left branch */
+            &(*rootp)->rlink; /* T4: follow right branch */
+  }
 
-  q = malloc (sizeof(node_t));         /* T5: key not found */
+  q = malloc (sizeof(node_t));    /* T5: key not found */
   if (q)
-    {                          /* make new node */
-      *rootp = q;                      /* link new node to old */
-      q->key = vkey;           /* initialize new node */
-      q->llink = q->rlink = NULL;
-    }
+  {         /* make new node */
+    *rootp = q;       /* link new node to old */
+    q->key = vkey;      /* initialize new node */
+    q->llink = q->rlink = NULL;
+  }
   return q;
 }
 
@@ -61,24 +61,24 @@ tsearch (const void *vkey,          /* key to be located */
 /* find a node, or return NULL */
 void *
 tfind (const void *vkey,         /* key to be found */
-       void * const *vrootp,     /* address of the tree root */
+       void *const *vrootp,      /* address of the tree root */
        int (*compar)(const void *, const void *))
 {
-  node_t * const *rootp = (node_t * const*)vrootp;
+  node_t *const *rootp = (node_t *const*) vrootp;
 
   if (NULL == rootp)
     return NULL;
 
   while (*rootp != NULL)
-    {          /* T1: */
-      int r;
-
-      if ((r = (*compar)(vkey, (*rootp)->key)) == 0)   /* T2: */
-        return *rootp;         /* key found */
-      rootp = (r < 0) ?
-        &(*rootp)->llink :             /* T3: follow left branch */
-        &(*rootp)->rlink;              /* T4: follow right branch */
-    }
+  {     /* T1: */
+    int r;
+
+    if ((r = (*compar)(vkey, (*rootp)->key)) == 0)    /* T2: */
+      return *rootp;      /* key found */
+    rootp = (r < 0) ?
+            &(*rootp)->llink : /* T3: follow left branch */
+            &(*rootp)->rlink; /* T4: follow right branch */
+  }
   return NULL;
 }
 
@@ -92,51 +92,51 @@ tfind (const void *vkey,         /* key to be found */
  * compar: function to carry out node comparisons
  */
 void *
-tdelete (const void * __restrict vkey,
-         void ** __restrict vrootp,
+tdelete (const void *__restrict vkey,
+         void **__restrict vrootp,
          int (*compar)(const void *, const void *))
 {
-  node_t **rootp = (node_t **)vrootp;
+  node_t **rootp = (node_t **) vrootp;
   node_t *p;
   node_t *q;
   node_t *r;
   int cmp;
 
-  if (rootp == NULL || (p = *rootp) == NULL)
+  if ((rootp == NULL)||((p = *rootp) == NULL))
     return NULL;
 
   while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0)
-    {
-      p = *rootp;
-      rootp = (cmp < 0) ?
-        &(*rootp)->llink :             /* follow llink branch */
-        &(*rootp)->rlink;              /* follow rlink branch */
-      if (*rootp == NULL)
-        return NULL;           /* key not found */
-    }
-  r = (*rootp)->rlink;                 /* D1: */
-  if ((q = (*rootp)->llink) == NULL)   /* Left NULL? */
-    {
+  {
+    p = *rootp;
+    rootp = (cmp < 0) ?
+            &(*rootp)->llink : /* follow llink branch */
+            &(*rootp)->rlink; /* follow rlink branch */
+    if (*rootp == NULL)
+      return NULL;      /* key not found */
+  }
+  r = (*rootp)->rlink;      /* D1: */
+  if ((q = (*rootp)->llink) == NULL)  /* Left NULL? */
+  {
+    q = r;
+  }
+  else if (r != NULL)
+  {       /* Right link is NULL? */
+    if (r->llink == NULL)
+    {       /* D2: Find successor */
+      r->llink = q;
       q = r;
     }
-  else if (r != NULL)
-    {                  /* Right link is NULL? */
-      if (r->llink == NULL)
-        {              /* D2: Find successor */
-          r->llink = q;
-          q = r;
-        }
-      else
-        {                      /* D3: Find NULL link */
-          for (q = r->llink; q->llink != NULL; q = r->llink)
-            r = q;
-          r->llink = q->rlink;
-          q->llink = (*rootp)->llink;
-          q->rlink = (*rootp)->rlink;
-        }
+    else
+    {         /* D3: Find NULL link */
+      for (q = r->llink; q->llink != NULL; q = r->llink)
+        r = q;
+      r->llink = q->rlink;
+      q->llink = (*rootp)->llink;
+      q->rlink = (*rootp)->rlink;
     }
-  free(*rootp);                                /* D4: Free node */
-  *rootp = q;                          /* link parent to new node */
+  }
+  free (*rootp);       /* D4: Free node */
+  *rootp = q;       /* link parent to new node */
   return p;
 }
 
diff --git a/src/lib/tsearch.h b/src/lib/tsearch.h
index aa186495..0cfe16a7 100644
--- a/src/lib/tsearch.h
+++ b/src/lib/tsearch.h
@@ -14,22 +14,22 @@ extern "C" {
 #endif /* __cplusplus */
 
 
-void   *
-tdelete (const void * __restrict,
-         void ** __restrict,
-         int (*)(const void *, const void *));
+void  *
+  tdelete (const void *__restrict,
+           void **__restrict,
+           int (*)(const void *, const void *));
 
 
-void   *
-tfind (const void *,
-       void * const *,
-       int (*)(const void *, const void *));
+void  *
+  tfind (const void *,
+         void *const *,
+         int (*)(const void *, const void *));
 
 
-void   *
-tsearch (const void *,
-         void **,
-         int (*)(const void *, const void *));
+void  *
+  tsearch (const void *,
+           void **,
+           int (*)(const void *, const void *));
 
 #if defined(__cplusplus)
 };
diff --git a/src/lib/upgrade_process.c b/src/lib/upgrade_process.c
index 75924eee..353f2753 100644
--- a/src/lib/upgrade_process.c
+++ b/src/lib/upgrade_process.c
@@ -41,59 +41,62 @@ MHD_upgrade_response_handle_process_ (struct 
MHD_UpgradeResponseHandle *urh)
    * pointers to 'connection' and 'daemon' are not changed
    * during this processing, so no need to chain dereference
    * each time. */
-  struct MHD_Connection * const connection = urh->connection;
-  struct MHD_Daemon * const daemon = connection->daemon;
+  struct MHD_Connection *const connection = urh->connection;
+  struct MHD_Daemon *const daemon = connection->daemon;
   /* Prevent data races: use same value of 'was_closed' throughout
    * this function. If 'was_closed' changed externally in the middle
    * of processing - it will be processed on next iteration. */
   bool was_closed;
   struct MHD_TLS_Plugin *tls = daemon->tls_api;
-  
+
   if (daemon->shutdown)
-    {
-      /* Daemon shutting down, application will not receive any more data. */
+  {
+    /* Daemon shutting down, application will not receive any more data. */
 #ifdef HAVE_MESSAGES
-      if (! urh->was_closed)
-        {
-          MHD_DLOG (daemon,
-                   MHD_SC_DAEMON_ALREADY_SHUTDOWN,
-                    _("Initiated daemon shutdown while \"upgraded\" connection 
was not closed.\n"));
-        }
-#endif
-      urh->was_closed = true;
+    if (! urh->was_closed)
+    {
+      MHD_DLOG (daemon,
+                MHD_SC_DAEMON_ALREADY_SHUTDOWN,
+                _ (
+                  "Initiated daemon shutdown while \"upgraded\" connection was 
not closed.\n"));
     }
+#endif
+    urh->was_closed = true;
+  }
   was_closed = urh->was_closed;
   if (was_closed)
+  {
+    /* Application was closed connections: no more data
+     * can be forwarded to application socket. */
+    if (0 < urh->in_buffer_used)
     {
-      /* Application was closed connections: no more data
-       * can be forwarded to application socket. */
-      if (0 < urh->in_buffer_used)
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                   MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
-                    _("Failed to forward to application " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                        " bytes of data received from remote side: application 
shut down socket\n"),
-                    (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used);
+      MHD_DLOG (daemon,
+                MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
+                _ (
+                  "Failed to forward to application "
+                  MHD_UNSIGNED_LONG_LONG_PRINTF \
+                  " bytes of data received from remote side: application shut 
down socket\n"),
+                (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used);
 #endif
 
-        }
-      /* If application signaled MHD about socket closure then
-       * check for any pending data even if socket is not marked
-       * as 'ready' (signal may arrive after poll()/select()).
-       * Socketpair for forwarding is always in non-blocking mode
-       * so no risk that recv() will block the thread. */
-      if (0 != urh->out_buffer_size)
-        urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
-      /* Discard any data received form remote. */
-      urh->in_buffer_used = 0;
-      /* Do not try to push data to application. */
-      urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-      /* Reading from remote client is not required anymore. */
-      urh->in_buffer_size = 0;
-      urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-      connection->tls_read_ready = false;
     }
+    /* If application signaled MHD about socket closure then
+     * check for any pending data even if socket is not marked
+     * as 'ready' (signal may arrive after poll()/select()).
+     * Socketpair for forwarding is always in non-blocking mode
+     * so no risk that recv() will block the thread. */
+    if (0 != urh->out_buffer_size)
+      urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
+    /* Discard any data received form remote. */
+    urh->in_buffer_used = 0;
+    /* Do not try to push data to application. */
+    urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+    /* Reading from remote client is not required anymore. */
+    urh->in_buffer_size = 0;
+    urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+    connection->tls_read_ready = false;
+  }
 
   /* On some platforms (W32, possibly Darwin) failed send() (send() will always
    * fail after remote disconnect was detected) may discard data in system
@@ -114,245 +117,249 @@ MHD_upgrade_response_handle_process_ (struct 
MHD_UpgradeResponseHandle *urh)
   if ( ( (0 != (MHD_EPOLL_STATE_READ_READY & urh->app.celi)) ||
          (connection->tls_read_ready) ) &&
        (urh->in_buffer_used < urh->in_buffer_size) )
-    {
-      ssize_t res;
-      size_t buf_size;
+  {
+    ssize_t res;
+    size_t buf_size;
 
-      buf_size = urh->in_buffer_size - urh->in_buffer_used;
-      if (buf_size > SSIZE_MAX)
-        buf_size = SSIZE_MAX;
+    buf_size = urh->in_buffer_size - urh->in_buffer_used;
+    if (buf_size > SSIZE_MAX)
+      buf_size = SSIZE_MAX;
 
-      connection->tls_read_ready = false;
-      res = tls->recv (tls->cls,
-                      connection->tls_cs,
-                      &urh->in_buffer[urh->in_buffer_used],
-                      buf_size);
-      if (0 >= res)
-        {
-         // FIXME: define GNUTLS-independent error codes!
-          if (GNUTLS_E_INTERRUPTED != res)
-            {
-              urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-              if (GNUTLS_E_AGAIN != res)
-                {
-                  /* Unrecoverable error on socket was detected or
-                   * socket was disconnected/shut down. */
-                  /* Stop trying to read from this TLS socket. */
-                  urh->in_buffer_size = 0;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          urh->in_buffer_used += res;
-          if (buf_size > (size_t)res)
-            urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-          else if (0 < tls->check_record_pending (tls->cls,
-                                                 connection->tls_cs))
-            connection->tls_read_ready = true;
-        }
-      if (MHD_EPOLL_STATE_ERROR ==
-          ((MHD_EPOLL_STATE_ERROR | MHD_EPOLL_STATE_READ_READY) & 
urh->app.celi))
+    connection->tls_read_ready = false;
+    res = tls->recv (tls->cls,
+                     connection->tls_cs,
+                     &urh->in_buffer[urh->in_buffer_used],
+                     buf_size);
+    if (0 >= res)
+    {
+      // FIXME: define GNUTLS-independent error codes!
+      if (GNUTLS_E_INTERRUPTED != res)
+      {
+        urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+        if (GNUTLS_E_AGAIN != res)
         {
-          /* Unrecoverable error on socket was detected and all
-           * pending data was read from system buffers. */
+          /* Unrecoverable error on socket was detected or
+           * socket was disconnected/shut down. */
           /* Stop trying to read from this TLS socket. */
           urh->in_buffer_size = 0;
         }
+      }
     }
+    else   /* 0 < res */
+    {
+      urh->in_buffer_used += res;
+      if (buf_size > (size_t) res)
+        urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+      else if (0 < tls->check_record_pending (tls->cls,
+                                              connection->tls_cs))
+        connection->tls_read_ready = true;
+    }
+    if (MHD_EPOLL_STATE_ERROR ==
+        ((MHD_EPOLL_STATE_ERROR | MHD_EPOLL_STATE_READ_READY) & urh->app.celi))
+    {
+      /* Unrecoverable error on socket was detected and all
+       * pending data was read from system buffers. */
+      /* Stop trying to read from this TLS socket. */
+      urh->in_buffer_size = 0;
+    }
+  }
 
   /*
    * handle reading from application
    */
   if ( (0 != (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) &&
        (urh->out_buffer_used < urh->out_buffer_size) )
-    {
-      ssize_t res;
-      size_t buf_size;
+  {
+    ssize_t res;
+    size_t buf_size;
 
-      buf_size = urh->out_buffer_size - urh->out_buffer_used;
-      if (buf_size > MHD_SCKT_SEND_MAX_SIZE_)
-        buf_size = MHD_SCKT_SEND_MAX_SIZE_;
+    buf_size = urh->out_buffer_size - urh->out_buffer_used;
+    if (buf_size > MHD_SCKT_SEND_MAX_SIZE_)
+      buf_size = MHD_SCKT_SEND_MAX_SIZE_;
 
-      res = MHD_recv_ (urh->mhd.socket,
-                       &urh->out_buffer[urh->out_buffer_used],
-                       buf_size);
-      if (0 >= res)
-        {
-          const int err = MHD_socket_get_error_ ();
-          if ((0 == res) ||
-              ((! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
-               (! MHD_SCKT_ERR_IS_LOW_RESOURCES_(err))))
-            {
-              urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-              if ((0 == res) ||
-                  (was_closed) ||
-                  (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
-                  (! MHD_SCKT_ERR_IS_EAGAIN_ (err)))
-                {
-                  /* Socket disconnect/shutdown was detected;
-                   * Application signaled about closure of 'upgraded' socket;
-                   * or persistent / unrecoverable error. */
-                  /* Do not try to pull more data from application. */
-                  urh->out_buffer_size = 0;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          urh->out_buffer_used += res;
-          if (buf_size > (size_t)res)
-            urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-        }
-      if ( (0 == (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) &&
-           ( (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
-             (was_closed) ) )
+    res = MHD_recv_ (urh->mhd.socket,
+                     &urh->out_buffer[urh->out_buffer_used],
+                     buf_size);
+    if (0 >= res)
+    {
+      const int err = MHD_socket_get_error_ ();
+      if ((0 == res) ||
+          ((! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
+           (! MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err))))
+      {
+        urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
+        if ((0 == res) ||
+            (was_closed) ||
+            (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
+            (! MHD_SCKT_ERR_IS_EAGAIN_ (err)))
         {
-          /* Unrecoverable error on socket was detected and all
-           * pending data was read from system buffers. */
+          /* Socket disconnect/shutdown was detected;
+           * Application signaled about closure of 'upgraded' socket;
+           * or persistent / unrecoverable error. */
           /* Do not try to pull more data from application. */
           urh->out_buffer_size = 0;
         }
+      }
+    }
+    else   /* 0 < res */
+    {
+      urh->out_buffer_used += res;
+      if (buf_size > (size_t) res)
+        urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
     }
+    if ( (0 == (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) &&
+         ( (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
+           (was_closed) ) )
+    {
+      /* Unrecoverable error on socket was detected and all
+       * pending data was read from system buffers. */
+      /* Do not try to pull more data from application. */
+      urh->out_buffer_size = 0;
+    }
+  }
 
   /*
    * handle writing to remote HTTPS client
    */
   if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->app.celi)) &&
        (urh->out_buffer_used > 0) )
-    {
-      ssize_t res;
-      size_t data_size;
+  {
+    ssize_t res;
+    size_t data_size;
 
-      data_size = urh->out_buffer_used;
-      if (data_size > SSIZE_MAX)
-        data_size = SSIZE_MAX;
+    data_size = urh->out_buffer_used;
+    if (data_size > SSIZE_MAX)
+      data_size = SSIZE_MAX;
 
-      res = tls->send (tls->cls,
-                      connection->tls_cs,
-                      urh->out_buffer,
-                      data_size);
-      if (0 >= res)
+    res = tls->send (tls->cls,
+                     connection->tls_cs,
+                     urh->out_buffer,
+                     data_size);
+    if (0 >= res)
+    {
+      // FIXME: define GNUTLS-independent error codes!
+      if (GNUTLS_E_INTERRUPTED != res)
+      {
+        urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+        if (GNUTLS_E_INTERRUPTED != res)
         {
-         // FIXME: define GNUTLS-independent error codes!
-          if (GNUTLS_E_INTERRUPTED != res)
-            {
-              urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-              if (GNUTLS_E_INTERRUPTED != res)
-                {
-                  /* TLS connection shut down or
-                   * persistent / unrecoverable error. */
+          /* TLS connection shut down or
+           * persistent / unrecoverable error. */
 #ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                           MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
-                            _("Failed to forward to remote client " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                                " bytes of data received from application: 
%s\n"),
-                            (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used,
-                            tls->strerror (tls->cls,
-                                          res));
+          MHD_DLOG (daemon,
+                    MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
+                    _ (
+                      "Failed to forward to remote client "
+                      MHD_UNSIGNED_LONG_LONG_PRINTF \
+                      " bytes of data received from application: %s\n"),
+                    (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used,
+                    tls->strerror (tls->cls,
+                                   res));
 #endif
-                  /* Discard any data unsent to remote. */
-                  urh->out_buffer_used = 0;
-                  /* Do not try to pull more data from application. */
-                  urh->out_buffer_size = 0;
-                  urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          const size_t next_out_buffer_used = urh->out_buffer_used - res;
-          if (0 != next_out_buffer_used)
-            {
-              memmove (urh->out_buffer,
-                       &urh->out_buffer[res],
-                       next_out_buffer_used);
-              if (data_size > (size_t)res)
-                urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-            }
-          urh->out_buffer_used = next_out_buffer_used;
-        }
-      if ( (0 == urh->out_buffer_used) &&
-           (0 != (MHD_EPOLL_STATE_ERROR & urh->app.celi)) )
-        {
-          /* Unrecoverable error on socket was detected and all
-           * pending data was sent to remote. */
-          /* Do not try to send to remote anymore. */
-          urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+          /* Discard any data unsent to remote. */
+          urh->out_buffer_used = 0;
           /* Do not try to pull more data from application. */
           urh->out_buffer_size = 0;
           urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
         }
+      }
     }
+    else   /* 0 < res */
+    {
+      const size_t next_out_buffer_used = urh->out_buffer_used - res;
+      if (0 != next_out_buffer_used)
+      {
+        memmove (urh->out_buffer,
+                 &urh->out_buffer[res],
+                 next_out_buffer_used);
+        if (data_size > (size_t) res)
+          urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      }
+      urh->out_buffer_used = next_out_buffer_used;
+    }
+    if ( (0 == urh->out_buffer_used) &&
+         (0 != (MHD_EPOLL_STATE_ERROR & urh->app.celi)) )
+    {
+      /* Unrecoverable error on socket was detected and all
+       * pending data was sent to remote. */
+      /* Do not try to send to remote anymore. */
+      urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      /* Do not try to pull more data from application. */
+      urh->out_buffer_size = 0;
+      urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
+    }
+  }
 
   /*
    * handle writing to application
    */
   if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->mhd.celi)) &&
-         (urh->in_buffer_used > 0) )
-    {
-      ssize_t res;
-      size_t data_size;
+       (urh->in_buffer_used > 0) )
+  {
+    ssize_t res;
+    size_t data_size;
 
-      data_size = urh->in_buffer_used;
-      if (data_size > MHD_SCKT_SEND_MAX_SIZE_)
-        data_size = MHD_SCKT_SEND_MAX_SIZE_;
+    data_size = urh->in_buffer_used;
+    if (data_size > MHD_SCKT_SEND_MAX_SIZE_)
+      data_size = MHD_SCKT_SEND_MAX_SIZE_;
 
-      res = MHD_send_ (urh->mhd.socket,
-                       urh->in_buffer,
-                       data_size);
-      if (0 >= res)
+    res = MHD_send_ (urh->mhd.socket,
+                     urh->in_buffer,
+                     data_size);
+    if (0 >= res)
+    {
+      const int err = MHD_socket_get_error_ ();
+      if ( (! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
+           (! MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err)) )
+      {
+        urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+        if (! MHD_SCKT_ERR_IS_EAGAIN_ (err))
         {
-          const int err = MHD_socket_get_error_ ();
-          if ( (! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
-               (! MHD_SCKT_ERR_IS_LOW_RESOURCES_(err)) )
-            {
-              urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-              if (! MHD_SCKT_ERR_IS_EAGAIN_ (err))
-                {
-                  /* Socketpair connection shut down or
-                   * persistent / unrecoverable error. */
+          /* Socketpair connection shut down or
+           * persistent / unrecoverable error. */
 #ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                           MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
-                            _("Failed to forward to application " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                                " bytes of data received from remote side: 
%s\n"),
-                            (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used,
-                            MHD_socket_strerr_ (err));
+          MHD_DLOG (daemon,
+                    MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
+                    _ (
+                      "Failed to forward to application "
+                      MHD_UNSIGNED_LONG_LONG_PRINTF \
+                      " bytes of data received from remote side: %s\n"),
+                    (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used,
+                    MHD_socket_strerr_ (err));
 #endif
-                  /* Discard any data received form remote. */
-                  urh->in_buffer_used = 0;
-                  /* Reading from remote client is not required anymore. */
-                  urh->in_buffer_size = 0;
-                  urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-                  connection->tls_read_ready = false;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          const size_t next_in_buffer_used = urh->in_buffer_used - res;
-          if (0 != next_in_buffer_used)
-            {
-              memmove (urh->in_buffer,
-                       &urh->in_buffer[res],
-                       next_in_buffer_used);
-              if (data_size > (size_t)res)
-                urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-            }
-          urh->in_buffer_used = next_in_buffer_used;
-        }
-      if ( (0 == urh->in_buffer_used) &&
-           (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) )
-        {
-          /* Do not try to push data to application. */
-          urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+          /* Discard any data received form remote. */
+          urh->in_buffer_used = 0;
           /* Reading from remote client is not required anymore. */
           urh->in_buffer_size = 0;
           urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
           connection->tls_read_ready = false;
         }
+      }
+    }
+    else   /* 0 < res */
+    {
+      const size_t next_in_buffer_used = urh->in_buffer_used - res;
+      if (0 != next_in_buffer_used)
+      {
+        memmove (urh->in_buffer,
+                 &urh->in_buffer[res],
+                 next_in_buffer_used);
+        if (data_size > (size_t) res)
+          urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      }
+      urh->in_buffer_used = next_in_buffer_used;
+    }
+    if ( (0 == urh->in_buffer_used) &&
+         (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) )
+    {
+      /* Do not try to push data to application. */
+      urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      /* Reading from remote client is not required anymore. */
+      urh->in_buffer_size = 0;
+      urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+      connection->tls_read_ready = false;
     }
+  }
 
   /* Check whether data is present in TLS buffers
    * and incoming forward buffer have some space. */
@@ -364,24 +371,26 @@ MHD_upgrade_response_handle_process_ (struct 
MHD_UpgradeResponseHandle *urh)
   if ( (daemon->shutdown) &&
        ( (0 != urh->out_buffer_size) ||
          (0 != urh->out_buffer_used) ) )
-    {
-      /* Daemon shutting down, discard any remaining forward data. */
+  {
+    /* Daemon shutting down, discard any remaining forward data. */
 #ifdef HAVE_MESSAGES
-      if (0 < urh->out_buffer_used)
-        MHD_DLOG (daemon,
-                 MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
-                  _("Failed to forward to remote client " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                      " bytes of data received from application: daemon shut 
down\n"),
-                  (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used);
+    if (0 < urh->out_buffer_used)
+      MHD_DLOG (daemon,
+                MHD_SC_UPGRADE_FORWARD_INCOMPLETE,
+                _ (
+                  "Failed to forward to remote client "
+                  MHD_UNSIGNED_LONG_LONG_PRINTF \
+                  " bytes of data received from application: daemon shut 
down\n"),
+                (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used);
 #endif
-      /* Discard any data unsent to remote. */
-      urh->out_buffer_used = 0;
-      /* Do not try to sent to remote anymore. */
-      urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-      /* Do not try to pull more data from application. */
-      urh->out_buffer_size = 0;
-      urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-    }
+    /* Discard any data unsent to remote. */
+    urh->out_buffer_used = 0;
+    /* Do not try to sent to remote anymore. */
+    urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+    /* Do not try to pull more data from application. */
+    urh->out_buffer_size = 0;
+    urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
+  }
 }
 #endif /* HTTPS_SUPPORT  && UPGRADE_SUPPORT */
 
diff --git a/src/lib/upgrade_process.h b/src/lib/upgrade_process.h
index 36a7ddff..8b0d4119 100644
--- a/src/lib/upgrade_process.h
+++ b/src/lib/upgrade_process.h
@@ -36,7 +36,7 @@
  */
 void
 MHD_upgrade_response_handle_process_ (struct MHD_UpgradeResponseHandle *urh)
-  MHD_NONNULL(1);
+MHD_NONNULL (1);
 
 
 #endif
diff --git a/src/lib/version.c b/src/lib/version.c
index 472a8c04..5bf4ab01 100644
--- a/src/lib/version.c
+++ b/src/lib/version.c
@@ -40,13 +40,13 @@ MHD_get_version (void)
   static char ver[12] = "\0\0\0\0\0\0\0\0\0\0\0";
   if (0 == ver[0])
   {
-    int res = MHD_snprintf_(ver,
-                            sizeof(ver),
-                            "%x.%x.%x",
-                            (((int)MHD_VERSION >> 24) & 0xFF),
-                            (((int)MHD_VERSION >> 16) & 0xFF),
-                            (((int)MHD_VERSION >> 8) & 0xFF));
-    if (0 >= res || sizeof(ver) <= res)
+    int res = MHD_snprintf_ (ver,
+                             sizeof(ver),
+                             "%x.%x.%x",
+                             (((int) MHD_VERSION >> 24) & 0xFF),
+                             (((int) MHD_VERSION >> 16) & 0xFF),
+                             (((int) MHD_VERSION >> 8) & 0xFF));
+    if ((0 >= res)||(sizeof(ver) <= res))
       return "0.0.0"; /* Can't return real version*/
   }
   return ver;
@@ -66,141 +66,142 @@ MHD_get_version (void)
  * @ingroup specialized
  */
 _MHD_EXTERN enum MHD_Bool
-MHD_is_feature_supported(enum MHD_Feature feature)
+MHD_is_feature_supported (enum MHD_Feature feature)
 {
-  switch(feature)
-    {
-    case MHD_FEATURE_MESSAGES:
+  switch (feature)
+  {
+  case MHD_FEATURE_MESSAGES:
 #ifdef HAVE_MESSAGES
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_TLS:
+  case MHD_FEATURE_TLS:
 #ifdef HTTPS_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else  /* ! HTTPS_SUPPORT */
-      return MHD_NO;
+    return MHD_NO;
 #endif  /* ! HTTPS_SUPPORT */
-    case MHD_FEATURE_HTTPS_CERT_CALLBACK:
+  case MHD_FEATURE_HTTPS_CERT_CALLBACK:
 #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_MAJOR >= 3
-      return MHD_YES;
+    return MHD_YES;
 #else  /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */
-    case MHD_FEATURE_IPv6:
+  case MHD_FEATURE_IPv6:
 #ifdef HAVE_INET6
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_IPv6_ONLY:
+  case MHD_FEATURE_IPv6_ONLY:
 #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_POLL:
+  case MHD_FEATURE_POLL:
 #ifdef HAVE_POLL
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_EPOLL:
+  case MHD_FEATURE_EPOLL:
 #ifdef EPOLL_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET:
+  case MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET:
 #ifdef HAVE_LISTEN_SHUTDOWN
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_SOCKETPAIR:
+  case MHD_FEATURE_SOCKETPAIR:
 #ifdef _MHD_ITC_SOCKETPAIR
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_TCP_FASTOPEN:
+  case MHD_FEATURE_TCP_FASTOPEN:
 #ifdef TCP_FASTOPEN
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_BASIC_AUTH:
+  case MHD_FEATURE_BASIC_AUTH:
 #ifdef BAUTH_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_DIGEST_AUTH:
+  case MHD_FEATURE_DIGEST_AUTH:
 #ifdef DAUTH_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_POSTPROCESSOR:
+  case MHD_FEATURE_POSTPROCESSOR:
 #ifdef HAVE_POSTPROCESSOR
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_HTTPS_KEY_PASSWORD:
+  case MHD_FEATURE_HTTPS_KEY_PASSWORD:
 #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_NUMBER >= 0x030111
-      return MHD_YES;
+    return MHD_YES;
 #else  /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */
-    case MHD_FEATURE_LARGE_FILE:
+  case MHD_FEATURE_LARGE_FILE:
 #if defined(HAVE_PREAD64) || defined(_WIN32)
-      return MHD_YES;
+    return MHD_YES;
 #elif defined(HAVE_PREAD)
-      return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
+    return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
 #elif defined(HAVE_LSEEK64)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
+    return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
 #endif
-    case MHD_FEATURE_THREAD_NAMES:
+  case MHD_FEATURE_THREAD_NAMES:
 #if defined(MHD_USE_THREAD_NAME_)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_UPGRADE:
+  case MHD_FEATURE_UPGRADE:
 #if defined(UPGRADE_SUPPORT)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_RESPONSES_SHARED_FD:
+  case MHD_FEATURE_RESPONSES_SHARED_FD:
 #if defined(HAVE_PREAD64) || defined(HAVE_PREAD) || defined(_WIN32)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_AUTODETECT_BIND_PORT:
+  case MHD_FEATURE_AUTODETECT_BIND_PORT:
 #ifdef MHD_USE_GETSOCKNAME
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE:
-#if defined(MHD_WINSOCK_SOCKETS) || defined(MHD_socket_nosignal_) || defined 
(MSG_NOSIGNAL)
-      return MHD_YES;
+  case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE:
+#if defined(MHD_WINSOCK_SOCKETS) || defined(MHD_socket_nosignal_) || \
+    defined (MSG_NOSIGNAL)
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_SENDFILE:
+  case MHD_FEATURE_SENDFILE:
 #ifdef _MHD_HAVE_SENDFILE
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
 
-    }
+  }
   return MHD_NO;
 }
diff --git a/src/microhttpd/base64.c b/src/microhttpd/base64.c
index 3dc7a142..d7d1ec92 100644
--- a/src/microhttpd/base64.c
+++ b/src/microhttpd/base64.c
@@ -9,45 +9,46 @@
 #include "base64.h"
 
 static const char base64_digits[] =
-  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
-    0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
-    14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26,
-    27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
-    45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+  0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+  14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26,
+  27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+  45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
 
 char *
-BASE64Decode(const char* src)
+BASE64Decode (const char*src)
 {
   size_t in_len = strlen (src);
-  char* dest;
-  char* result;
+  char*dest;
+  char*result;
 
   if (in_len % 4)
-    {
-      /* Wrong base64 string length */
-      return NULL;
-    }
-  result = dest = malloc(in_len / 4 * 3 + 1);
+  {
+    /* Wrong base64 string length */
+    return NULL;
+  }
+  result = dest = malloc (in_len / 4 * 3 + 1);
   if (NULL == result)
     return NULL; /* out of memory */
-  while (*src) {
-    char a = base64_digits[(unsigned char)*(src++)];
-    char b = base64_digits[(unsigned char)*(src++)];
-    char c = base64_digits[(unsigned char)*(src++)];
-    char d = base64_digits[(unsigned char)*(src++)];
+  while (*src)
+  {
+    char a = base64_digits[(unsigned char) *(src++)];
+    char b = base64_digits[(unsigned char) *(src++)];
+    char c = base64_digits[(unsigned char) *(src++)];
+    char d = base64_digits[(unsigned char) *(src++)];
     *(dest++) = (a << 2) | ((b & 0x30) >> 4);
-    if (c == (char)-1)
+    if (c == (char) -1)
       break;
     *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2);
-    if (d == (char)-1)
+    if (d == (char) -1)
       break;
     *(dest++) = ((c & 0x03) << 6) | d;
   }
diff --git a/src/microhttpd/base64.h b/src/microhttpd/base64.h
index ba96ca0c..65042c0b 100644
--- a/src/microhttpd/base64.h
+++ b/src/microhttpd/base64.h
@@ -12,6 +12,6 @@
 #include "platform.h"
 
 char *
-BASE64Decode(const char* src);
+BASE64Decode (const char*src);
 
 #endif /* !BASE64_H */
diff --git a/src/microhttpd/connection.h b/src/microhttpd/connection.h
index a9df9998..74ebafcb 100644
--- a/src/microhttpd/connection.h
+++ b/src/microhttpd/connection.h
@@ -153,7 +153,7 @@ MHD_connection_close_ (struct MHD_Connection *connection,
 void
 MHD_connection_finish_forward_ (struct MHD_Connection *connection);
 #else  /* ! HTTPS_SUPPORT */
-#define MHD_connection_finish_forward_(conn) (void)conn
+#define MHD_connection_finish_forward_(conn) (void) conn
 #endif /* ! HTTPS_SUPPORT */
 
 
diff --git a/src/microhttpd/connection_https.c 
b/src/microhttpd/connection_https.c
index 8202329b..108e1fc6 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -59,22 +59,22 @@ recv_tls_adapter (struct MHD_Connection *connection,
                             i);
   if ( (GNUTLS_E_AGAIN == res) ||
        (GNUTLS_E_INTERRUPTED == res) )
-    {
+  {
 #ifdef EPOLL_SUPPORT
-      if (GNUTLS_E_AGAIN == res)
-        connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
+    if (GNUTLS_E_AGAIN == res)
+      connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
 #endif
-      /* Any network errors means that buffer is empty. */
-      connection->tls_read_ready = false;
-      return MHD_ERR_AGAIN_;
-    }
+    /* Any network errors means that buffer is empty. */
+    connection->tls_read_ready = false;
+    return MHD_ERR_AGAIN_;
+  }
   if (res < 0)
-    {
-      /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication
-         disrupted); interpret as a hard error */
-      connection->tls_read_ready = false;
-      return MHD_ERR_NOTCONN_;
-    }
+  {
+    /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication
+       disrupted); interpret as a hard error */
+    connection->tls_read_ready = false;
+    return MHD_ERR_NOTCONN_;
+  }
 
 #ifdef EPOLL_SUPPORT
   /* Unlike non-TLS connections, do not reset "read-ready" if
@@ -83,8 +83,9 @@ recv_tls_adapter (struct MHD_Connection *connection,
 #endif /* EPOLL_SUPPORT */
 
   /* Check whether TLS buffers still have some unread data. */
-  connection->tls_read_ready = ( ((size_t)res == i) &&
-                                 (0 != gnutls_record_check_pending 
(connection->tls_session)) );
+  connection->tls_read_ready = ( ((size_t) res == i) &&
+                                 (0 != gnutls_record_check_pending (
+                                    connection->tls_session)) );
   return res;
 }
 
@@ -113,19 +114,19 @@ send_tls_adapter (struct MHD_Connection *connection,
                             i);
   if ( (GNUTLS_E_AGAIN == res) ||
        (GNUTLS_E_INTERRUPTED == res) )
-    {
+  {
 #ifdef EPOLL_SUPPORT
-      if (GNUTLS_E_AGAIN == res)
-        connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
+    if (GNUTLS_E_AGAIN == res)
+      connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
 #endif
-      return MHD_ERR_AGAIN_;
-    }
+    return MHD_ERR_AGAIN_;
+  }
   if (res < 0)
-    {
-      /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication
-         disrupted); interpret as a hard error */
-      return MHD_ERR_NOTCONN_;
-    }
+  {
+    /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication
+       disrupted); interpret as a hard error */
+    return MHD_ERR_NOTCONN_;
+  }
 #ifdef EPOLL_SUPPORT
   /* Unlike non-TLS connections, do not reset "write-ready" if
    * sent amount smaller than provided amount, as TLS
@@ -151,32 +152,32 @@ MHD_run_tls_handshake_ (struct MHD_Connection *connection)
 
   if ((MHD_TLS_CONN_INIT == connection->tls_state) ||
       (MHD_TLS_CONN_HANDSHAKING == connection->tls_state))
+  {
+    ret = gnutls_handshake (connection->tls_session);
+    if (ret == GNUTLS_E_SUCCESS)
     {
-      ret = gnutls_handshake (connection->tls_session);
-      if (ret == GNUTLS_E_SUCCESS)
-       {
-         /* set connection TLS state to enable HTTP processing */
-         connection->tls_state = MHD_TLS_CONN_CONNECTED;
-         MHD_update_last_activity_ (connection);
-         return true;
-       }
-      if ( (GNUTLS_E_AGAIN == ret) ||
-          (GNUTLS_E_INTERRUPTED == ret) )
-       {
-          connection->tls_state = MHD_TLS_CONN_HANDSHAKING;
-         /* handshake not done */
-         return false;
-       }
-      /* handshake failed */
-      connection->tls_state = MHD_TLS_CONN_TLS_FAILED;
-#ifdef HAVE_MESSAGES
-      MHD_DLOG (connection->daemon,
-               _("Error: received handshake message out of context\n"));
-#endif
-      MHD_connection_close_ (connection,
-                             MHD_REQUEST_TERMINATED_WITH_ERROR);
+      /* set connection TLS state to enable HTTP processing */
+      connection->tls_state = MHD_TLS_CONN_CONNECTED;
+      MHD_update_last_activity_ (connection);
+      return true;
+    }
+    if ( (GNUTLS_E_AGAIN == ret) ||
+         (GNUTLS_E_INTERRUPTED == ret) )
+    {
+      connection->tls_state = MHD_TLS_CONN_HANDSHAKING;
+      /* handshake not done */
       return false;
     }
+    /* handshake failed */
+    connection->tls_state = MHD_TLS_CONN_TLS_FAILED;
+#ifdef HAVE_MESSAGES
+    MHD_DLOG (connection->daemon,
+              _ ("Error: received handshake message out of context\n"));
+#endif
+    MHD_connection_close_ (connection,
+                           MHD_REQUEST_TERMINATED_WITH_ERROR);
+    return false;
+  }
   return true;
 }
 
@@ -205,23 +206,23 @@ bool
 MHD_tls_connection_shutdown (struct MHD_Connection *connection)
 {
   if (MHD_TLS_CONN_WR_CLOSED > connection->tls_state)
+  {
+    const int res =
+      gnutls_bye (connection->tls_session, GNUTLS_SHUT_WR);
+    if (GNUTLS_E_SUCCESS == res)
+    {
+      connection->tls_state = MHD_TLS_CONN_WR_CLOSED;
+      return true;
+    }
+    if ((GNUTLS_E_AGAIN == res) ||
+        (GNUTLS_E_INTERRUPTED == res))
     {
-      const int res =
-          gnutls_bye (connection->tls_session, GNUTLS_SHUT_WR);
-      if (GNUTLS_E_SUCCESS == res)
-        {
-          connection->tls_state = MHD_TLS_CONN_WR_CLOSED;
-          return true;
-        }
-      if ((GNUTLS_E_AGAIN == res) ||
-          (GNUTLS_E_INTERRUPTED == res))
-        {
-          connection->tls_state = MHD_TLS_CONN_WR_CLOSING;
-          return true;
-        }
-      else
-        connection->tls_state = MHD_TLS_CONN_TLS_FAILED;
+      connection->tls_state = MHD_TLS_CONN_WR_CLOSING;
+      return true;
     }
+    else
+      connection->tls_state = MHD_TLS_CONN_TLS_FAILED;
+  }
   return false;
 }
 
diff --git a/src/microhttpd/connection_https.h 
b/src/microhttpd/connection_https.h
index e91a84d3..142c8da8 100644
--- a/src/microhttpd/connection_https.h
+++ b/src/microhttpd/connection_https.h
@@ -35,7 +35,7 @@
  *
  * @param connection which callbacks should be modified
  */
-void 
+void
 MHD_set_https_callbacks (struct MHD_Connection *connection);
 
 
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index fb4abd5d..97e0ec30 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -115,7 +115,7 @@ close_all_connections (struct MHD_Daemon *daemon);
  */
 static int
 MHD_epoll (struct MHD_Daemon *daemon,
-          int may_block);
+           int may_block);
 
 #endif /* EPOLL_SUPPORT */
 
@@ -130,21 +130,21 @@ MHD_epoll (struct MHD_Daemon *daemon,
  */
 static void
 mhd_panic_std (void *cls,
-              const char *file,
-              unsigned int line,
-              const char *reason)
+               const char *file,
+               unsigned int line,
+               const char *reason)
 {
-  (void)cls; /* Mute compiler warning. */
+  (void) cls; /* Mute compiler warning. */
 #ifdef HAVE_MESSAGES
   fprintf (stderr,
-           _("Fatal error in GNU libmicrohttpd %s:%u: %s\n"),
-          file,
+           _ ("Fatal error in GNU libmicrohttpd %s:%u: %s\n"),
+           file,
            line,
            reason);
 #else  /* ! HAVE_MESSAGES */
-  (void)file;   /* Mute compiler warning. */
-  (void)line;   /* Mute compiler warning. */
-  (void)reason; /* Mute compiler warning. */
+  (void) file;   /* Mute compiler warning. */
+  (void) line;   /* Mute compiler warning. */
+  (void) reason; /* Mute compiler warning. */
 #endif
   abort ();
 }
@@ -164,7 +164,7 @@ void *mhd_panic_cls = NULL;
  * Globally initialise library.
  */
 void
-MHD_init(void);
+MHD_init (void);
 
 
 #if defined(MHD_WINSOCK_SOCKETS)
@@ -179,7 +179,7 @@ static int mhd_winsock_inited_ = 0;
  * Do nothing - global initialisation is
  * performed by library constructor.
  */
-#define MHD_check_global_init_() (void)0
+#define MHD_check_global_init_() (void) 0
 #else  /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */
 /**
  * Track global initialisation
@@ -191,7 +191,7 @@ volatile int global_init_count = 0;
 /**
  * Global initialisation mutex
  */
-MHD_MUTEX_STATIC_DEFN_INIT_(global_init_mutex_);
+MHD_MUTEX_STATIC_DEFN_INIT_ (global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
 #endif
 
@@ -205,14 +205,14 @@ MHD_check_global_init_ (void)
 {
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
 #ifdef MHD_MUTEX_STATIC_DEFN_INIT_
-  MHD_mutex_lock_chk_(&global_init_mutex_);
+  MHD_mutex_lock_chk_ (&global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
 #endif
   if (0 == global_init_count++)
     MHD_init ();
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
 #ifdef MHD_MUTEX_STATIC_DEFN_INIT_
-  MHD_mutex_unlock_chk_(&global_init_mutex_);
+  MHD_mutex_unlock_chk_ (&global_init_mutex_);
 #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */
 #endif
 }
@@ -227,9 +227,9 @@ MHD_default_logger_ (void *cls,
                      const char *fm,
                      va_list ap)
 {
-  vfprintf ((FILE*)cls, fm, ap);
+  vfprintf ((FILE*) cls, fm, ap);
 #ifdef _DEBUG
-  fflush ((FILE*)cls);
+  fflush ((FILE*) cls);
 #endif /* _DEBUG */
 }
 
@@ -308,7 +308,7 @@ static void
 MHD_ip_count_lock (struct MHD_Daemon *daemon)
 {
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-  MHD_mutex_lock_chk_(&daemon->per_ip_connection_mutex);
+  MHD_mutex_lock_chk_ (&daemon->per_ip_connection_mutex);
 #else
   (void) daemon;
 #endif
@@ -324,7 +324,7 @@ static void
 MHD_ip_count_unlock (struct MHD_Daemon *daemon)
 {
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-  MHD_mutex_unlock_chk_(&daemon->per_ip_connection_mutex);
+  MHD_mutex_unlock_chk_ (&daemon->per_ip_connection_mutex);
 #else
   (void) daemon;
 #endif
@@ -361,37 +361,37 @@ MHD_ip_addr_compare (const void *a1,
  */
 static int
 MHD_ip_addr_to_key (const struct sockaddr *addr,
-                   socklen_t addrlen,
-                   struct MHD_IPCount *key)
+                    socklen_t addrlen,
+                    struct MHD_IPCount *key)
 {
-  memset(key,
-         0,
-         sizeof(*key));
+  memset (key,
+          0,
+          sizeof(*key));
 
   /* IPv4 addresses */
   if (sizeof (struct sockaddr_in) == addrlen)
-    {
-      const struct sockaddr_in *addr4 = (const struct sockaddr_in*) addr;
+  {
+    const struct sockaddr_in *addr4 = (const struct sockaddr_in*) addr;
 
-      key->family = AF_INET;
-      memcpy (&key->addr.ipv4,
-              &addr4->sin_addr,
-              sizeof(addr4->sin_addr));
-      return MHD_YES;
-    }
+    key->family = AF_INET;
+    memcpy (&key->addr.ipv4,
+            &addr4->sin_addr,
+            sizeof(addr4->sin_addr));
+    return MHD_YES;
+  }
 
 #if HAVE_INET6
   /* IPv6 addresses */
   if (sizeof (struct sockaddr_in6) == addrlen)
-    {
-      const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6*) addr;
+  {
+    const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6*) addr;
 
-      key->family = AF_INET6;
-      memcpy (&key->addr.ipv6,
-              &addr6->sin6_addr,
-              sizeof(addr6->sin6_addr));
-      return MHD_YES;
-    }
+    key->family = AF_INET6;
+    memcpy (&key->addr.ipv6,
+            &addr6->sin6_addr,
+            sizeof(addr6->sin6_addr));
+    return MHD_YES;
+  }
 #endif
 
   /* Some other address */
@@ -412,8 +412,8 @@ MHD_ip_addr_to_key (const struct sockaddr *addr,
  */
 static int
 MHD_ip_limit_add (struct MHD_Daemon *daemon,
-                 const struct sockaddr *addr,
-                 socklen_t addrlen)
+                  const struct sockaddr *addr,
+                  socklen_t addrlen)
 {
   struct MHD_IPCount *key;
   void **nodep;
@@ -432,30 +432,30 @@ MHD_ip_limit_add (struct MHD_Daemon *daemon,
   if (MHD_NO == MHD_ip_addr_to_key (addr,
                                     addrlen,
                                     key))
-    {
-      /* Allow unhandled address types through */
-      free (key);
-      return MHD_YES;
-    }
+  {
+    /* Allow unhandled address types through */
+    free (key);
+    return MHD_YES;
+  }
   MHD_ip_count_lock (daemon);
 
   /* Search for the IP address */
   if (NULL == (nodep = tsearch (key,
-                               &daemon->per_ip_connection_count,
-                               &MHD_ip_addr_compare)))
-    {
+                                &daemon->per_ip_connection_count,
+                                &MHD_ip_addr_compare)))
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("Failed to add IP connection count node\n"));
+    MHD_DLOG (daemon,
+              _ ("Failed to add IP connection count node\n"));
 #endif
-      MHD_ip_count_unlock (daemon);
-      free (key);
-      return MHD_NO;
-    }
+    MHD_ip_count_unlock (daemon);
+    free (key);
+    return MHD_NO;
+  }
   node = *nodep;
   /* If we got an existing node back, free the one we created */
   if (node != key)
-    free(key);
+    free (key);
   key = (struct MHD_IPCount *) node;
   /* Test if there is room for another connection; if so,
    * increment count */
@@ -478,8 +478,8 @@ MHD_ip_limit_add (struct MHD_Daemon *daemon,
  */
 static void
 MHD_ip_limit_del (struct MHD_Daemon *daemon,
-                 const struct sockaddr *addr,
-                 socklen_t addrlen)
+                  const struct sockaddr *addr,
+                  socklen_t addrlen)
 {
   struct MHD_IPCount search_key;
   struct MHD_IPCount *found_key;
@@ -499,27 +499,27 @@ MHD_ip_limit_del (struct MHD_Daemon *daemon,
 
   /* Search for the IP address */
   if (NULL == (nodep = tfind (&search_key,
-                             &daemon->per_ip_connection_count,
-                             &MHD_ip_addr_compare)))
-    {
-      /* Something's wrong if we couldn't find an IP address
-       * that was previously added */
-      MHD_PANIC (_("Failed to find previously-added IP address\n"));
-    }
+                              &daemon->per_ip_connection_count,
+                              &MHD_ip_addr_compare)))
+  {
+    /* Something's wrong if we couldn't find an IP address
+     * that was previously added */
+    MHD_PANIC (_ ("Failed to find previously-added IP address\n"));
+  }
   found_key = (struct MHD_IPCount *) *nodep;
   /* Validate existing count for IP address */
   if (0 == found_key->count)
-    {
-      MHD_PANIC (_("Previously-added IP address had counter of zero\n"));
-    }
+  {
+    MHD_PANIC (_ ("Previously-added IP address had counter of zero\n"));
+  }
   /* Remove the node entirely if count reduces to 0 */
   if (0 == --found_key->count)
-    {
-      tdelete (found_key,
-              &daemon->per_ip_connection_count,
-              &MHD_ip_addr_compare);
-      free (found_key);
-    }
+  {
+    tdelete (found_key,
+             &daemon->per_ip_connection_count,
+             &MHD_ip_addr_compare);
+    free (found_key);
+  }
 
   MHD_ip_count_unlock (daemon);
 }
@@ -541,103 +541,104 @@ MHD_init_daemon_certificate (struct MHD_Daemon *daemon)
 
 #if GNUTLS_VERSION_MAJOR >= 3
   if (NULL != daemon->cert_callback)
-    {
-      gnutls_certificate_set_retrieve_function2 (daemon->x509_cred,
-                                                 daemon->cert_callback);
-    }
+  {
+    gnutls_certificate_set_retrieve_function2 (daemon->x509_cred,
+                                               daemon->cert_callback);
+  }
 #endif
 #if GNUTLS_VERSION_NUMBER >= 0x030603
   else if (NULL != daemon->cert_callback2)
-    {
-      gnutls_certificate_set_retrieve_function3 (daemon->x509_cred,
-                                                 daemon->cert_callback2);
-    }
+  {
+    gnutls_certificate_set_retrieve_function3 (daemon->x509_cred,
+                                               daemon->cert_callback2);
+  }
 #endif
 
   if (NULL != daemon->https_mem_trust)
+  {
+    size_t paramlen;
+    paramlen = strlen (daemon->https_mem_trust);
+    if (UINT_MAX < paramlen)
     {
-      size_t paramlen;
-      paramlen = strlen (daemon->https_mem_trust);
-      if (UINT_MAX < paramlen)
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG(daemon,
-                   "Too long trust certificate\n");
+      MHD_DLOG (daemon,
+                "Too long trust certificate\n");
 #endif
-          return -1;
-        }
-      cert.data = (unsigned char *) daemon->https_mem_trust;
-      cert.size = (unsigned int) paramlen;
-      if (gnutls_certificate_set_x509_trust_mem (daemon->x509_cred,
-                                                 &cert,
-                                                GNUTLS_X509_FMT_PEM) < 0)
-       {
+      return -1;
+    }
+    cert.data = (unsigned char *) daemon->https_mem_trust;
+    cert.size = (unsigned int) paramlen;
+    if (gnutls_certificate_set_x509_trust_mem (daemon->x509_cred,
+                                               &cert,
+                                               GNUTLS_X509_FMT_PEM) < 0)
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG(daemon,
-                  "Bad trust certificate format\n");
+      MHD_DLOG (daemon,
+                "Bad trust certificate format\n");
 #endif
-         return -1;
-       }
+      return -1;
     }
+  }
 
   if (daemon->have_dhparams)
-    {
-      gnutls_certificate_set_dh_params (daemon->x509_cred,
-                                        daemon->https_mem_dhparams);
-    }
+  {
+    gnutls_certificate_set_dh_params (daemon->x509_cred,
+                                      daemon->https_mem_dhparams);
+  }
   /* certificate & key loaded from memory */
   if ( (NULL != daemon->https_mem_cert) &&
        (NULL != daemon->https_mem_key) )
-    {
-      size_t param1len;
-      size_t param2len;
+  {
+    size_t param1len;
+    size_t param2len;
 
-      param1len = strlen (daemon->https_mem_key);
-      param2len = strlen (daemon->https_mem_cert);
-      if ( (UINT_MAX < param1len) ||
-           (UINT_MAX < param2len) )
-        {
+    param1len = strlen (daemon->https_mem_key);
+    param2len = strlen (daemon->https_mem_cert);
+    if ( (UINT_MAX < param1len) ||
+         (UINT_MAX < param2len) )
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG(daemon,
-                   "Too long key or certificate\n");
+      MHD_DLOG (daemon,
+                "Too long key or certificate\n");
 #endif
-          return -1;
-        }
-      key.data = (unsigned char *) daemon->https_mem_key;
-      key.size = (unsigned int)param1len;
-      cert.data = (unsigned char *) daemon->https_mem_cert;
-      cert.size = (unsigned int)param2len;
+      return -1;
+    }
+    key.data = (unsigned char *) daemon->https_mem_key;
+    key.size = (unsigned int) param1len;
+    cert.data = (unsigned char *) daemon->https_mem_cert;
+    cert.size = (unsigned int) param2len;
 
-      if (NULL != daemon->https_key_password) {
+    if (NULL != daemon->https_key_password)
+    {
 #if GNUTLS_VERSION_NUMBER >= 0x030111
-        ret = gnutls_certificate_set_x509_key_mem2 (daemon->x509_cred,
-                                                    &cert,
-                                                    &key,
-                                                    GNUTLS_X509_FMT_PEM,
-                                                    daemon->https_key_password,
-                                                    0);
+      ret = gnutls_certificate_set_x509_key_mem2 (daemon->x509_cred,
+                                                  &cert,
+                                                  &key,
+                                                  GNUTLS_X509_FMT_PEM,
+                                                  daemon->https_key_password,
+                                                  0);
 #else
 #ifdef HAVE_MESSAGES
-       MHD_DLOG (daemon,
-                  _("Failed to setup x509 certificate/key: pre 3.X.X version " 
\
-                    "of GnuTLS does not support setting key password"));
+      MHD_DLOG (daemon,
+                _ ("Failed to setup x509 certificate/key: pre 3.X.X version " \
+                   "of GnuTLS does not support setting key password"));
 #endif
-       return -1;
+      return -1;
 #endif
-      }
-      else
-        ret = gnutls_certificate_set_x509_key_mem (daemon->x509_cred,
-                                                   &cert,
-                                                   &key,
-                                                   GNUTLS_X509_FMT_PEM);
+    }
+    else
+      ret = gnutls_certificate_set_x509_key_mem (daemon->x509_cred,
+                                                 &cert,
+                                                 &key,
+                                                 GNUTLS_X509_FMT_PEM);
 #ifdef HAVE_MESSAGES
-      if (0 != ret)
-        MHD_DLOG (daemon,
-                  "GnuTLS failed to setup x509 certificate/key: %s\n",
-                  gnutls_strerror (ret));
+    if (0 != ret)
+      MHD_DLOG (daemon,
+                "GnuTLS failed to setup x509 certificate/key: %s\n",
+                gnutls_strerror (ret));
 #endif
-      return ret;
-    }
+    return ret;
+  }
 #if GNUTLS_VERSION_MAJOR >= 3
   if (NULL != daemon->cert_callback)
     return 0;
@@ -663,25 +664,25 @@ static int
 MHD_TLS_init (struct MHD_Daemon *daemon)
 {
   switch (daemon->cred_type)
-    {
-    case GNUTLS_CRD_CERTIFICATE:
-      if (0 !=
-          gnutls_certificate_allocate_credentials (&daemon->x509_cred))
-        return GNUTLS_E_MEMORY_ERROR;
-      return MHD_init_daemon_certificate (daemon);
-    case GNUTLS_CRD_PSK:
-      if (0 !=
-          gnutls_psk_allocate_server_credentials (&daemon->psk_cred))
-        return GNUTLS_E_MEMORY_ERROR;
-      return 0;
-    default:
+  {
+  case GNUTLS_CRD_CERTIFICATE:
+    if (0 !=
+        gnutls_certificate_allocate_credentials (&daemon->x509_cred))
+      return GNUTLS_E_MEMORY_ERROR;
+    return MHD_init_daemon_certificate (daemon);
+  case GNUTLS_CRD_PSK:
+    if (0 !=
+        gnutls_psk_allocate_server_credentials (&daemon->psk_cred))
+      return GNUTLS_E_MEMORY_ERROR;
+    return 0;
+  default:
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Error: invalid credentials type %d specified.\n"),
-                daemon->cred_type);
+    MHD_DLOG (daemon,
+              _ ("Error: invalid credentials type %d specified.\n"),
+              daemon->cred_type);
 #endif
-      return -1;
-    }
+    return -1;
+  }
 }
 #endif /* HTTPS_SUPPORT */
 
@@ -761,55 +762,55 @@ urh_to_fdset (struct MHD_UpgradeResponseHandle *urh,
   /* Do not add to 'es' only if socket is closed
    * or not used anymore. */
   if (MHD_INVALID_SOCKET != conn_sckt)
-    {
-      if ( (urh->in_buffer_used < urh->in_buffer_size) &&
-           (! MHD_add_to_fd_set_ (conn_sckt,
-                                  rs,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      if ( (0 != urh->out_buffer_used) &&
-           (! MHD_add_to_fd_set_ (conn_sckt,
-                                  ws,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      /* Do not monitor again for errors if error was detected before as
-       * error state is remembered. */
-      if ((0 == (urh->app.celi & MHD_EPOLL_STATE_ERROR)) &&
-          ((0 != urh->in_buffer_size) ||
-           (0 != urh->out_buffer_size) ||
-           (0 != urh->out_buffer_used)))
-        MHD_add_to_fd_set_ (conn_sckt,
-                            es,
-                            max_fd,
-                            fd_setsize);
-    }
+  {
+    if ( (urh->in_buffer_used < urh->in_buffer_size) &&
+         (! MHD_add_to_fd_set_ (conn_sckt,
+                                rs,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    if ( (0 != urh->out_buffer_used) &&
+         (! MHD_add_to_fd_set_ (conn_sckt,
+                                ws,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    /* Do not monitor again for errors if error was detected before as
+     * error state is remembered. */
+    if ((0 == (urh->app.celi & MHD_EPOLL_STATE_ERROR)) &&
+        ((0 != urh->in_buffer_size) ||
+         (0 != urh->out_buffer_size) ||
+         (0 != urh->out_buffer_used)))
+      MHD_add_to_fd_set_ (conn_sckt,
+                          es,
+                          max_fd,
+                          fd_setsize);
+  }
   if (MHD_INVALID_SOCKET != mhd_sckt)
-    {
-      if ( (urh->out_buffer_used < urh->out_buffer_size) &&
-           (! MHD_add_to_fd_set_ (mhd_sckt,
-                                  rs,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      if ( (0 != urh->in_buffer_used) &&
-           (! MHD_add_to_fd_set_ (mhd_sckt,
-                                  ws,
-                                  max_fd,
-                                  fd_setsize)) )
-        res = false;
-      /* Do not monitor again for errors if error was detected before as
-       * error state is remembered. */
-      if ((0 == (urh->mhd.celi & MHD_EPOLL_STATE_ERROR)) &&
-          ((0 != urh->out_buffer_size) ||
-           (0 != urh->in_buffer_size) ||
-           (0 != urh->in_buffer_used)))
-        MHD_add_to_fd_set_ (mhd_sckt,
-                            es,
-                            max_fd,
-                            fd_setsize);
-    }
+  {
+    if ( (urh->out_buffer_used < urh->out_buffer_size) &&
+         (! MHD_add_to_fd_set_ (mhd_sckt,
+                                rs,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    if ( (0 != urh->in_buffer_used) &&
+         (! MHD_add_to_fd_set_ (mhd_sckt,
+                                ws,
+                                max_fd,
+                                fd_setsize)) )
+      res = false;
+    /* Do not monitor again for errors if error was detected before as
+     * error state is remembered. */
+    if ((0 == (urh->mhd.celi & MHD_EPOLL_STATE_ERROR)) &&
+        ((0 != urh->out_buffer_size) ||
+         (0 != urh->in_buffer_size) ||
+         (0 != urh->in_buffer_used)))
+      MHD_add_to_fd_set_ (mhd_sckt,
+                          es,
+                          max_fd,
+                          fd_setsize);
+  }
 
   return res;
 }
@@ -838,23 +839,23 @@ urh_from_fdset (struct MHD_UpgradeResponseHandle *urh,
   urh->mhd.celi &= (~MHD_EPOLL_STATE_READ_READY & 
~MHD_EPOLL_STATE_WRITE_READY);
 
   if (MHD_INVALID_SOCKET != conn_sckt)
-    {
-      if (FD_ISSET (conn_sckt, rs))
-        urh->app.celi |= MHD_EPOLL_STATE_READ_READY;
-      if (FD_ISSET (conn_sckt, ws))
-        urh->app.celi |= MHD_EPOLL_STATE_WRITE_READY;
-      if (FD_ISSET (conn_sckt, es))
-        urh->app.celi |= MHD_EPOLL_STATE_ERROR;
-    }
+  {
+    if (FD_ISSET (conn_sckt, rs))
+      urh->app.celi |= MHD_EPOLL_STATE_READ_READY;
+    if (FD_ISSET (conn_sckt, ws))
+      urh->app.celi |= MHD_EPOLL_STATE_WRITE_READY;
+    if (FD_ISSET (conn_sckt, es))
+      urh->app.celi |= MHD_EPOLL_STATE_ERROR;
+  }
   if ((MHD_INVALID_SOCKET != mhd_sckt))
-    {
-      if (FD_ISSET (mhd_sckt, rs))
-        urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
-      if (FD_ISSET (mhd_sckt, ws))
-        urh->mhd.celi |= MHD_EPOLL_STATE_WRITE_READY;
-      if (FD_ISSET (mhd_sckt, es))
-        urh->mhd.celi |= MHD_EPOLL_STATE_ERROR;
-    }
+  {
+    if (FD_ISSET (mhd_sckt, rs))
+      urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
+    if (FD_ISSET (mhd_sckt, ws))
+      urh->mhd.celi |= MHD_EPOLL_STATE_WRITE_READY;
+    if (FD_ISSET (mhd_sckt, es))
+      urh->mhd.celi |= MHD_EPOLL_STATE_ERROR;
+  }
 }
 
 #ifdef HAVE_POLL
@@ -869,7 +870,7 @@ urh_from_fdset (struct MHD_UpgradeResponseHandle *urh,
  */
 static void
 urh_update_pollfd (struct MHD_UpgradeResponseHandle *urh,
-                  struct pollfd p[2])
+                   struct pollfd p[2])
 {
   p[0].events = 0;
   p[1].events = 0;
@@ -910,12 +911,12 @@ urh_update_pollfd (struct MHD_UpgradeResponseHandle *urh,
  */
 static void
 urh_to_pollfd (struct MHD_UpgradeResponseHandle *urh,
-              struct pollfd p[2])
+               struct pollfd p[2])
 {
   p[0].fd = urh->connection->socket_fd;
   p[1].fd = urh->mhd.socket;
   urh_update_pollfd (urh,
-                    p);
+                     p);
 }
 
 
@@ -926,7 +927,7 @@ urh_to_pollfd (struct MHD_UpgradeResponseHandle *urh,
  */
 static void
 urh_from_pollfd (struct MHD_UpgradeResponseHandle *urh,
-                struct pollfd p[2])
+                 struct pollfd p[2])
 {
   /* Reset read/write ready, preserve error state. */
   urh->app.celi &= (~MHD_EPOLL_STATE_READ_READY & 
~MHD_EPOLL_STATE_WRITE_READY);
@@ -998,85 +999,85 @@ internal_get_fdset2 (struct MHD_Daemon *daemon,
    * or INFO_WRITE sockets will not fit 'except_fd_set'. */
   /* Start from oldest connections. Make sense for W32 FDSETs. */
   for (pos = daemon->connections_tail; NULL != pos; pos = posn)
-    {
-      posn = pos->prev;
+  {
+    posn = pos->prev;
 
-      switch (pos->event_loop_info)
-       {
-       case MHD_EVENT_LOOP_INFO_READ:
-         if (! MHD_add_to_fd_set_ (pos->socket_fd,
-                                    read_fd_set,
-                                    max_fd,
-                                    fd_setsize))
-           result = MHD_NO;
+    switch (pos->event_loop_info)
+    {
+    case MHD_EVENT_LOOP_INFO_READ:
+      if (! MHD_add_to_fd_set_ (pos->socket_fd,
+                                read_fd_set,
+                                max_fd,
+                                fd_setsize))
+        result = MHD_NO;
 #ifdef MHD_POSIX_SOCKETS
-          MHD_add_to_fd_set_ (pos->socket_fd,
-                              except_fd_set,
-                              max_fd,
-                              fd_setsize);
+      MHD_add_to_fd_set_ (pos->socket_fd,
+                          except_fd_set,
+                          max_fd,
+                          fd_setsize);
 #endif /* MHD_POSIX_SOCKETS */
-         break;
-       case MHD_EVENT_LOOP_INFO_WRITE:
-         if (! MHD_add_to_fd_set_ (pos->socket_fd,
-                                    write_fd_set,
-                                    max_fd,
-                                    fd_setsize))
-           result = MHD_NO;
+      break;
+    case MHD_EVENT_LOOP_INFO_WRITE:
+      if (! MHD_add_to_fd_set_ (pos->socket_fd,
+                                write_fd_set,
+                                max_fd,
+                                fd_setsize))
+        result = MHD_NO;
 #ifdef MHD_POSIX_SOCKETS
-          MHD_add_to_fd_set_ (pos->socket_fd,
-                              except_fd_set,
-                              max_fd,
-                              fd_setsize);
+      MHD_add_to_fd_set_ (pos->socket_fd,
+                          except_fd_set,
+                          max_fd,
+                          fd_setsize);
 #endif /* MHD_POSIX_SOCKETS */
-         break;
-       case MHD_EVENT_LOOP_INFO_BLOCK:
-         if ( (NULL == except_fd_set) ||
-             ! MHD_add_to_fd_set_ (pos->socket_fd,
-                                   except_fd_set,
-                                    max_fd,
-                                    fd_setsize))
-            result = MHD_NO;
-         break;
-       case MHD_EVENT_LOOP_INFO_CLEANUP:
-         /* this should never happen */
-         break;
-       }
+      break;
+    case MHD_EVENT_LOOP_INFO_BLOCK:
+      if ( (NULL == except_fd_set) ||
+           ! MHD_add_to_fd_set_ (pos->socket_fd,
+                                 except_fd_set,
+                                 max_fd,
+                                 fd_setsize))
+        result = MHD_NO;
+      break;
+    case MHD_EVENT_LOOP_INFO_CLEANUP:
+      /* this should never happen */
+      break;
     }
+  }
 #ifdef MHD_WINSOCK_SOCKETS
   /* W32 use limited array for fd_set so add INFO_READ/INFO_WRITE sockets
    * only after INFO_BLOCK sockets to ensure that INFO_BLOCK sockets will
    * not be pushed out. */
   for (pos = daemon->connections_tail; NULL != pos; pos = posn)
-    {
-      posn = pos->prev;
-      MHD_add_to_fd_set_ (pos->socket_fd,
-                          except_fd_set,
-                          max_fd,
-                          fd_setsize);
-    }
+  {
+    posn = pos->prev;
+    MHD_add_to_fd_set_ (pos->socket_fd,
+                        except_fd_set,
+                        max_fd,
+                        fd_setsize);
+  }
 #endif /* MHD_WINSOCK_SOCKETS */
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   {
     struct MHD_UpgradeResponseHandle *urh;
 
     for (urh = daemon->urh_tail; NULL != urh; urh = urh->prev)
-      {
-        if (MHD_NO ==
-            urh_to_fdset (urh,
-                          read_fd_set,
-                          write_fd_set,
-                          except_fd_set,
-                          max_fd,
-                          fd_setsize))
-          result = MHD_NO;
-      }
+    {
+      if (MHD_NO ==
+          urh_to_fdset (urh,
+                        read_fd_set,
+                        write_fd_set,
+                        except_fd_set,
+                        max_fd,
+                        fd_setsize))
+        result = MHD_NO;
+    }
   }
 #endif
 #if DEBUG_CONNECT
 #ifdef HAVE_MESSAGES
   if (NULL != max_fd)
     MHD_DLOG (daemon,
-              _("Maximum socket in select set: %d\n"),
+              _ ("Maximum socket in select set: %d\n"),
               *max_fd);
 #endif
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
@@ -1118,11 +1119,11 @@ internal_get_fdset2 (struct MHD_Daemon *daemon,
  */
 int
 MHD_get_fdset2 (struct MHD_Daemon *daemon,
-               fd_set *read_fd_set,
-               fd_set *write_fd_set,
-               fd_set *except_fd_set,
-               MHD_socket *max_fd,
-               unsigned int fd_setsize)
+                fd_set *read_fd_set,
+                fd_set *write_fd_set,
+                fd_set *except_fd_set,
+                MHD_socket *max_fd,
+                unsigned int fd_setsize)
 {
   fd_set es;
 
@@ -1134,38 +1135,38 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon,
     return MHD_NO;
 
   if (NULL == except_fd_set)
-    { /* Workaround to maintain backward compatibility. */
+  {   /* Workaround to maintain backward compatibility. */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("MHD_get_fdset2() called with except_fd_set "
-                  "set to NULL. Such behavior is unsupported.\n"));
+    MHD_DLOG (daemon,
+              _ ("MHD_get_fdset2() called with except_fd_set "
+                 "set to NULL. Such behavior is unsupported.\n"));
 #endif
-      FD_ZERO (&es);
-      except_fd_set = &es;
-    }
+    FD_ZERO (&es);
+    except_fd_set = &es;
+  }
 
 #ifdef EPOLL_SUPPORT
   if (0 != (daemon->options & MHD_USE_EPOLL))
-    {
-      if (daemon->shutdown)
-        return MHD_NO;
+  {
+    if (daemon->shutdown)
+      return MHD_NO;
 
-      /* we're in epoll mode, use the epoll FD as a stand-in for
-         the entire event set */
+    /* we're in epoll mode, use the epoll FD as a stand-in for
+       the entire event set */
 
-      return MHD_add_to_fd_set_ (daemon->epoll_fd,
-                                 read_fd_set,
-                                 max_fd,
-                                 fd_setsize) ? MHD_YES : MHD_NO;
-    }
+    return MHD_add_to_fd_set_ (daemon->epoll_fd,
+                               read_fd_set,
+                               max_fd,
+                               fd_setsize) ? MHD_YES : MHD_NO;
+  }
 #endif
 
   return internal_get_fdset2 (daemon,
-                             read_fd_set,
+                              read_fd_set,
                               write_fd_set,
-                             except_fd_set,
+                              except_fd_set,
                               max_fd,
-                             fd_setsize);
+                              fd_setsize);
 }
 
 
@@ -1197,37 +1198,37 @@ call_handlers (struct MHD_Connection *con,
   if (con->tls_read_ready)
     read_ready = true;
 #endif /* HTTPS_SUPPORT */
-  if (!force_close)
+  if (! force_close)
+  {
+    if ( (MHD_EVENT_LOOP_INFO_READ == con->event_loop_info) &&
+         read_ready)
     {
-      if ( (MHD_EVENT_LOOP_INFO_READ == con->event_loop_info) &&
-          read_ready)
-        {
-          MHD_connection_handle_read (con);
-          ret = MHD_connection_handle_idle (con);
-          states_info_processed = true;
-        }
-      /* No need to check value of 'ret' here as closed connection
-       * cannot be in MHD_EVENT_LOOP_INFO_WRITE state. */
-      if ( (MHD_EVENT_LOOP_INFO_WRITE == con->event_loop_info) &&
-          write_ready)
-        {
-          MHD_connection_handle_write (con);
-          ret = MHD_connection_handle_idle (con);
-          states_info_processed = true;
-        }
+      MHD_connection_handle_read (con);
+      ret = MHD_connection_handle_idle (con);
+      states_info_processed = true;
     }
-  else
+    /* No need to check value of 'ret' here as closed connection
+     * cannot be in MHD_EVENT_LOOP_INFO_WRITE state. */
+    if ( (MHD_EVENT_LOOP_INFO_WRITE == con->event_loop_info) &&
+         write_ready)
     {
-      MHD_connection_close_ (con,
-                             MHD_REQUEST_TERMINATED_WITH_ERROR);
-      return MHD_connection_handle_idle (con);
+      MHD_connection_handle_write (con);
+      ret = MHD_connection_handle_idle (con);
+      states_info_processed = true;
     }
+  }
+  else
+  {
+    MHD_connection_close_ (con,
+                           MHD_REQUEST_TERMINATED_WITH_ERROR);
+    return MHD_connection_handle_idle (con);
+  }
 
-  if (!states_info_processed)
-    { /* Connection is not read or write ready, but external conditions
+  if (! states_info_processed)
+  {   /* Connection is not read or write ready, but external conditions
        * may be changed and need to be processed. */
-      ret = MHD_connection_handle_idle (con);
-    }
+    ret = MHD_connection_handle_idle (con);
+  }
   /* Fast track for fast connections. */
   /* If full request was read by single read_handler() invocation
      and headers were completely prepared by single 
MHD_connection_handle_idle()
@@ -1239,23 +1240,23 @@ call_handlers (struct MHD_Connection *con,
   /* No need to check 'ret' as connection is always in
    * MHD_CONNECTION_CLOSED state if 'ret' is equal 'MHD_NO'. */
   else if (on_fasttrack && con->sk_nonblck)
+  {
+    if (MHD_CONNECTION_HEADERS_SENDING == con->state)
     {
-      if (MHD_CONNECTION_HEADERS_SENDING == con->state)
-        {
-          MHD_connection_handle_write (con);
-          /* Always call 'MHD_connection_handle_idle()' after each read/write. 
*/
-          ret = MHD_connection_handle_idle (con);
-        }
-      /* If all headers were sent by single write_handler() and
-       * response body is prepared by single MHD_connection_handle_idle()
-       * call - continue. */
-      if ((MHD_CONNECTION_NORMAL_BODY_READY == con->state) ||
-          (MHD_CONNECTION_CHUNKED_BODY_READY == con->state))
-        {
-          MHD_connection_handle_write (con);
-          ret = MHD_connection_handle_idle (con);
-        }
+      MHD_connection_handle_write (con);
+      /* Always call 'MHD_connection_handle_idle()' after each read/write. */
+      ret = MHD_connection_handle_idle (con);
+    }
+    /* If all headers were sent by single write_handler() and
+     * response body is prepared by single MHD_connection_handle_idle()
+     * call - continue. */
+    if ((MHD_CONNECTION_NORMAL_BODY_READY == con->state) ||
+        (MHD_CONNECTION_CHUNKED_BODY_READY == con->state))
+    {
+      MHD_connection_handle_write (con);
+      ret = MHD_connection_handle_idle (con);
     }
+  }
 
   /* All connection's data and states are processed for this turn.
    * If connection already has more data to be processed - use
@@ -1267,15 +1268,15 @@ call_handlers (struct MHD_Connection *con,
    * without space in read buffer will be marked as 'info block'. */
   if ( (! con->daemon->data_already_pending) &&
        (0 == (con->daemon->options & MHD_USE_THREAD_PER_CONNECTION)) )
-    {
-      if (MHD_EVENT_LOOP_INFO_BLOCK == con->event_loop_info)
-        con->daemon->data_already_pending = true;
+  {
+    if (MHD_EVENT_LOOP_INFO_BLOCK == con->event_loop_info)
+      con->daemon->data_already_pending = true;
 #ifdef HTTPS_SUPPORT
-      else if ( (con->tls_read_ready) &&
-                (MHD_EVENT_LOOP_INFO_READ == con->event_loop_info) )
-        con->daemon->data_already_pending = true;
+    else if ( (con->tls_read_ready) &&
+              (MHD_EVENT_LOOP_INFO_READ == con->event_loop_info) )
+      con->daemon->data_already_pending = true;
 #endif /* HTTPS_SUPPORT */
-    }
+  }
   return ret;
 }
 
@@ -1330,55 +1331,58 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
    * pointers to 'connection' and 'daemon' are not changed
    * during this processing, so no need to chain dereference
    * each time. */
-  struct MHD_Connection * const connection = urh->connection;
-  struct MHD_Daemon * const daemon = connection->daemon;
+  struct MHD_Connection *const connection = urh->connection;
+  struct MHD_Daemon *const daemon = connection->daemon;
   /* Prevent data races: use same value of 'was_closed' throughout
    * this function. If 'was_closed' changed externally in the middle
    * of processing - it will be processed on next iteration. */
   bool was_closed;
   if (daemon->shutdown)
-    {
-      /* Daemon shutting down, application will not receive any more data. */
+  {
+    /* Daemon shutting down, application will not receive any more data. */
 #ifdef HAVE_MESSAGES
-      if (! urh->was_closed)
-        {
-          MHD_DLOG (daemon,
-                    _("Initiated daemon shutdown while \"upgraded\" connection 
was not closed.\n"));
-        }
-#endif
-      urh->was_closed = true;
+    if (! urh->was_closed)
+    {
+      MHD_DLOG (daemon,
+                _ (
+                  "Initiated daemon shutdown while \"upgraded\" connection was 
not closed.\n"));
     }
+#endif
+    urh->was_closed = true;
+  }
   was_closed = urh->was_closed;
   if (was_closed)
+  {
+    /* Application was closed connections: no more data
+     * can be forwarded to application socket. */
+    if (0 < urh->in_buffer_used)
     {
-      /* Application was closed connections: no more data
-       * can be forwarded to application socket. */
-      if (0 < urh->in_buffer_used)
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Failed to forward to application " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                        " bytes of data received from remote side: application 
shut down socket\n"),
-                    (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used);
-#endif
-
-        }
-      /* If application signaled MHD about socket closure then
-       * check for any pending data even if socket is not marked
-       * as 'ready' (signal may arrive after poll()/select()).
-       * Socketpair for forwarding is always in non-blocking mode
-       * so no risk that recv() will block the thread. */
-      if (0 != urh->out_buffer_size)
-        urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
-      /* Discard any data received form remote. */
-      urh->in_buffer_used = 0;
-      /* Do not try to push data to application. */
-      urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-      /* Reading from remote client is not required anymore. */
-      urh->in_buffer_size = 0;
-      urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-      connection->tls_read_ready = false;
-    }
+      MHD_DLOG (daemon,
+                _ (
+                  "Failed to forward to application "
+                  MHD_UNSIGNED_LONG_LONG_PRINTF \
+                  " bytes of data received from remote side: application shut 
down socket\n"),
+                (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used);
+#endif
+
+    }
+    /* If application signaled MHD about socket closure then
+     * check for any pending data even if socket is not marked
+     * as 'ready' (signal may arrive after poll()/select()).
+     * Socketpair for forwarding is always in non-blocking mode
+     * so no risk that recv() will block the thread. */
+    if (0 != urh->out_buffer_size)
+      urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
+    /* Discard any data received form remote. */
+    urh->in_buffer_used = 0;
+    /* Do not try to push data to application. */
+    urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+    /* Reading from remote client is not required anymore. */
+    urh->in_buffer_size = 0;
+    urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+    connection->tls_read_ready = false;
+  }
 
   /* On some platforms (W32, possibly Darwin) failed send() (send() will always
    * fail after remote disconnect was detected) may discard data in system
@@ -1399,237 +1403,241 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
   if ( ( (0 != (MHD_EPOLL_STATE_READ_READY & urh->app.celi)) ||
          (connection->tls_read_ready) ) &&
        (urh->in_buffer_used < urh->in_buffer_size) )
-    {
-      ssize_t res;
-      size_t buf_size;
+  {
+    ssize_t res;
+    size_t buf_size;
 
-      buf_size = urh->in_buffer_size - urh->in_buffer_used;
-      if (buf_size > SSIZE_MAX)
-        buf_size = SSIZE_MAX;
+    buf_size = urh->in_buffer_size - urh->in_buffer_used;
+    if (buf_size > SSIZE_MAX)
+      buf_size = SSIZE_MAX;
 
-      connection->tls_read_ready = false;
-      res = gnutls_record_recv (connection->tls_session,
-                                &urh->in_buffer[urh->in_buffer_used],
-                                buf_size);
-      if (0 >= res)
-        {
-          if (GNUTLS_E_INTERRUPTED != res)
-            {
-              urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-              if (GNUTLS_E_AGAIN != res)
-                {
-                  /* Unrecoverable error on socket was detected or
-                   * socket was disconnected/shut down. */
-                  /* Stop trying to read from this TLS socket. */
-                  urh->in_buffer_size = 0;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          urh->in_buffer_used += res;
-          if (buf_size > (size_t)res)
-            urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-          else if (0 < gnutls_record_check_pending (connection->tls_session))
-            connection->tls_read_ready = true;
-        }
-      if (MHD_EPOLL_STATE_ERROR ==
-          ((MHD_EPOLL_STATE_ERROR | MHD_EPOLL_STATE_READ_READY) & 
urh->app.celi))
+    connection->tls_read_ready = false;
+    res = gnutls_record_recv (connection->tls_session,
+                              &urh->in_buffer[urh->in_buffer_used],
+                              buf_size);
+    if (0 >= res)
+    {
+      if (GNUTLS_E_INTERRUPTED != res)
+      {
+        urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+        if (GNUTLS_E_AGAIN != res)
         {
-          /* Unrecoverable error on socket was detected and all
-           * pending data was read from system buffers. */
+          /* Unrecoverable error on socket was detected or
+           * socket was disconnected/shut down. */
           /* Stop trying to read from this TLS socket. */
           urh->in_buffer_size = 0;
         }
+      }
+    }
+    else   /* 0 < res */
+    {
+      urh->in_buffer_used += res;
+      if (buf_size > (size_t) res)
+        urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+      else if (0 < gnutls_record_check_pending (connection->tls_session))
+        connection->tls_read_ready = true;
+    }
+    if (MHD_EPOLL_STATE_ERROR ==
+        ((MHD_EPOLL_STATE_ERROR | MHD_EPOLL_STATE_READ_READY) & urh->app.celi))
+    {
+      /* Unrecoverable error on socket was detected and all
+       * pending data was read from system buffers. */
+      /* Stop trying to read from this TLS socket. */
+      urh->in_buffer_size = 0;
     }
+  }
 
   /*
    * handle reading from application
    */
   if ( (0 != (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) &&
        (urh->out_buffer_used < urh->out_buffer_size) )
-    {
-      ssize_t res;
-      size_t buf_size;
+  {
+    ssize_t res;
+    size_t buf_size;
 
-      buf_size = urh->out_buffer_size - urh->out_buffer_used;
-      if (buf_size > MHD_SCKT_SEND_MAX_SIZE_)
-        buf_size = MHD_SCKT_SEND_MAX_SIZE_;
+    buf_size = urh->out_buffer_size - urh->out_buffer_used;
+    if (buf_size > MHD_SCKT_SEND_MAX_SIZE_)
+      buf_size = MHD_SCKT_SEND_MAX_SIZE_;
 
-      res = MHD_recv_ (urh->mhd.socket,
-                       &urh->out_buffer[urh->out_buffer_used],
-                       buf_size);
-      if (0 >= res)
-        {
-          const int err = MHD_socket_get_error_ ();
-          if ((0 == res) ||
-              ((! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
-               (! MHD_SCKT_ERR_IS_LOW_RESOURCES_(err))))
-            {
-              urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-              if ((0 == res) ||
-                  (was_closed) ||
-                  (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
-                  (! MHD_SCKT_ERR_IS_EAGAIN_ (err)))
-                {
-                  /* Socket disconnect/shutdown was detected;
-                   * Application signaled about closure of 'upgraded' socket;
-                   * or persistent / unrecoverable error. */
-                  /* Do not try to pull more data from application. */
-                  urh->out_buffer_size = 0;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          urh->out_buffer_used += res;
-          if (buf_size > (size_t)res)
-            urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-        }
-      if ( (0 == (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) &&
-           ( (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
-             (was_closed) ) )
+    res = MHD_recv_ (urh->mhd.socket,
+                     &urh->out_buffer[urh->out_buffer_used],
+                     buf_size);
+    if (0 >= res)
+    {
+      const int err = MHD_socket_get_error_ ();
+      if ((0 == res) ||
+          ((! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
+           (! MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err))))
+      {
+        urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
+        if ((0 == res) ||
+            (was_closed) ||
+            (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
+            (! MHD_SCKT_ERR_IS_EAGAIN_ (err)))
         {
-          /* Unrecoverable error on socket was detected and all
-           * pending data was read from system buffers. */
+          /* Socket disconnect/shutdown was detected;
+           * Application signaled about closure of 'upgraded' socket;
+           * or persistent / unrecoverable error. */
           /* Do not try to pull more data from application. */
           urh->out_buffer_size = 0;
         }
+      }
     }
-
-  /*
-   * handle writing to remote HTTPS client
+    else   /* 0 < res */
+    {
+      urh->out_buffer_used += res;
+      if (buf_size > (size_t) res)
+        urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
+    }
+    if ( (0 == (MHD_EPOLL_STATE_READ_READY & urh->mhd.celi)) &&
+         ( (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) ||
+           (was_closed) ) )
+    {
+      /* Unrecoverable error on socket was detected and all
+       * pending data was read from system buffers. */
+      /* Do not try to pull more data from application. */
+      urh->out_buffer_size = 0;
+    }
+  }
+
+  /*
+   * handle writing to remote HTTPS client
    */
   if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->app.celi)) &&
        (urh->out_buffer_used > 0) )
-    {
-      ssize_t res;
-      size_t data_size;
+  {
+    ssize_t res;
+    size_t data_size;
 
-      data_size = urh->out_buffer_used;
-      if (data_size > SSIZE_MAX)
-        data_size = SSIZE_MAX;
+    data_size = urh->out_buffer_used;
+    if (data_size > SSIZE_MAX)
+      data_size = SSIZE_MAX;
 
-      res = gnutls_record_send (connection->tls_session,
-                                urh->out_buffer,
-                                data_size);
-      if (0 >= res)
-        {
-          if (GNUTLS_E_INTERRUPTED != res)
-            {
-              urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-              if (GNUTLS_E_AGAIN != res)
-                {
-                  /* TLS connection shut down or
-                   * persistent / unrecoverable error. */
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                            _("Failed to forward to remote client " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                                " bytes of data received from application: 
%s\n"),
-                            (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used,
-                            gnutls_strerror(res));
-#endif
-                  /* Discard any data unsent to remote. */
-                  urh->out_buffer_used = 0;
-                  /* Do not try to pull more data from application. */
-                  urh->out_buffer_size = 0;
-                  urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          const size_t next_out_buffer_used = urh->out_buffer_used - res;
-          if (0 != next_out_buffer_used)
-            {
-              memmove (urh->out_buffer,
-                       &urh->out_buffer[res],
-                       next_out_buffer_used);
-              if (data_size > (size_t)res)
-                urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-            }
-          urh->out_buffer_used = next_out_buffer_used;
-        }
-      if ( (0 == urh->out_buffer_used) &&
-           (0 != (MHD_EPOLL_STATE_ERROR & urh->app.celi)) )
+    res = gnutls_record_send (connection->tls_session,
+                              urh->out_buffer,
+                              data_size);
+    if (0 >= res)
+    {
+      if (GNUTLS_E_INTERRUPTED != res)
+      {
+        urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+        if (GNUTLS_E_AGAIN != res)
         {
-          /* Unrecoverable error on socket was detected and all
-           * pending data was sent to remote. */
-          /* Do not try to send to remote anymore. */
-          urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+          /* TLS connection shut down or
+           * persistent / unrecoverable error. */
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (daemon,
+                    _ (
+                      "Failed to forward to remote client "
+                      MHD_UNSIGNED_LONG_LONG_PRINTF \
+                      " bytes of data received from application: %s\n"),
+                    (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used,
+                    gnutls_strerror (res));
+#endif
+          /* Discard any data unsent to remote. */
+          urh->out_buffer_used = 0;
           /* Do not try to pull more data from application. */
           urh->out_buffer_size = 0;
           urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
         }
+      }
+    }
+    else   /* 0 < res */
+    {
+      const size_t next_out_buffer_used = urh->out_buffer_used - res;
+      if (0 != next_out_buffer_used)
+      {
+        memmove (urh->out_buffer,
+                 &urh->out_buffer[res],
+                 next_out_buffer_used);
+        if (data_size > (size_t) res)
+          urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      }
+      urh->out_buffer_used = next_out_buffer_used;
+    }
+    if ( (0 == urh->out_buffer_used) &&
+         (0 != (MHD_EPOLL_STATE_ERROR & urh->app.celi)) )
+    {
+      /* Unrecoverable error on socket was detected and all
+       * pending data was sent to remote. */
+      /* Do not try to send to remote anymore. */
+      urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      /* Do not try to pull more data from application. */
+      urh->out_buffer_size = 0;
+      urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
     }
+  }
 
   /*
    * handle writing to application
    */
   if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->mhd.celi)) &&
-         (urh->in_buffer_used > 0) )
-    {
-      ssize_t res;
-      size_t data_size;
+       (urh->in_buffer_used > 0) )
+  {
+    ssize_t res;
+    size_t data_size;
 
-      data_size = urh->in_buffer_used;
-      if (data_size > MHD_SCKT_SEND_MAX_SIZE_)
-        data_size = MHD_SCKT_SEND_MAX_SIZE_;
+    data_size = urh->in_buffer_used;
+    if (data_size > MHD_SCKT_SEND_MAX_SIZE_)
+      data_size = MHD_SCKT_SEND_MAX_SIZE_;
 
-      res = MHD_send_ (urh->mhd.socket,
-                       urh->in_buffer,
-                       data_size);
-      if (0 >= res)
-        {
-          const int err = MHD_socket_get_error_ ();
-          if ( (! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
-               (! MHD_SCKT_ERR_IS_LOW_RESOURCES_(err)) )
-            {
-              urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-              if (! MHD_SCKT_ERR_IS_EAGAIN_ (err))
-                {
-                  /* Socketpair connection shut down or
-                   * persistent / unrecoverable error. */
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                            _("Failed to forward to application " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                                " bytes of data received from remote side: 
%s\n"),
-                            (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used,
-                            MHD_socket_strerr_ (err));
-#endif
-                  /* Discard any data received form remote. */
-                  urh->in_buffer_used = 0;
-                  /* Reading from remote client is not required anymore. */
-                  urh->in_buffer_size = 0;
-                  urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
-                  connection->tls_read_ready = false;
-                }
-            }
-        }
-      else /* 0 < res */
-        {
-          const size_t next_in_buffer_used = urh->in_buffer_used - res;
-          if (0 != next_in_buffer_used)
-            {
-              memmove (urh->in_buffer,
-                       &urh->in_buffer[res],
-                       next_in_buffer_used);
-              if (data_size > (size_t)res)
-                urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-            }
-          urh->in_buffer_used = next_in_buffer_used;
-        }
-      if ( (0 == urh->in_buffer_used) &&
-           (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) )
+    res = MHD_send_ (urh->mhd.socket,
+                     urh->in_buffer,
+                     data_size);
+    if (0 >= res)
+    {
+      const int err = MHD_socket_get_error_ ();
+      if ( (! MHD_SCKT_ERR_IS_EINTR_ (err)) &&
+           (! MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err)) )
+      {
+        urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+        if (! MHD_SCKT_ERR_IS_EAGAIN_ (err))
         {
-          /* Do not try to push data to application. */
-          urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+          /* Socketpair connection shut down or
+           * persistent / unrecoverable error. */
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (daemon,
+                    _ (
+                      "Failed to forward to application "
+                      MHD_UNSIGNED_LONG_LONG_PRINTF \
+                      " bytes of data received from remote side: %s\n"),
+                    (MHD_UNSIGNED_LONG_LONG) urh->in_buffer_used,
+                    MHD_socket_strerr_ (err));
+#endif
+          /* Discard any data received form remote. */
+          urh->in_buffer_used = 0;
           /* Reading from remote client is not required anymore. */
           urh->in_buffer_size = 0;
           urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
           connection->tls_read_ready = false;
         }
+      }
+    }
+    else   /* 0 < res */
+    {
+      const size_t next_in_buffer_used = urh->in_buffer_used - res;
+      if (0 != next_in_buffer_used)
+      {
+        memmove (urh->in_buffer,
+                 &urh->in_buffer[res],
+                 next_in_buffer_used);
+        if (data_size > (size_t) res)
+          urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      }
+      urh->in_buffer_used = next_in_buffer_used;
+    }
+    if ( (0 == urh->in_buffer_used) &&
+         (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) )
+    {
+      /* Do not try to push data to application. */
+      urh->mhd.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+      /* Reading from remote client is not required anymore. */
+      urh->in_buffer_size = 0;
+      urh->app.celi &= ~MHD_EPOLL_STATE_READ_READY;
+      connection->tls_read_ready = false;
     }
+  }
 
   /* Check whether data is present in TLS buffers
    * and incoming forward buffer have some space. */
@@ -1641,23 +1649,25 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
   if ( (daemon->shutdown) &&
        ( (0 != urh->out_buffer_size) ||
          (0 != urh->out_buffer_used) ) )
-    {
-      /* Daemon shutting down, discard any remaining forward data. */
+  {
+    /* Daemon shutting down, discard any remaining forward data. */
 #ifdef HAVE_MESSAGES
-      if (0 < urh->out_buffer_used)
-        MHD_DLOG (daemon,
-                  _("Failed to forward to remote client " 
MHD_UNSIGNED_LONG_LONG_PRINTF \
-                      " bytes of data received from application: daemon shut 
down\n"),
-                  (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used);
-#endif
-      /* Discard any data unsent to remote. */
-      urh->out_buffer_used = 0;
-      /* Do not try to sent to remote anymore. */
-      urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
-      /* Do not try to pull more data from application. */
-      urh->out_buffer_size = 0;
-      urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
-    }
+    if (0 < urh->out_buffer_used)
+      MHD_DLOG (daemon,
+                _ (
+                  "Failed to forward to remote client "
+                  MHD_UNSIGNED_LONG_LONG_PRINTF \
+                  " bytes of data received from application: daemon shut 
down\n"),
+                (MHD_UNSIGNED_LONG_LONG) urh->out_buffer_used);
+#endif
+    /* Discard any data unsent to remote. */
+    urh->out_buffer_used = 0;
+    /* Do not try to sent to remote anymore. */
+    urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
+    /* Do not try to pull more data from application. */
+    urh->out_buffer_size = 0;
+    urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY;
+  }
 }
 #endif /* HTTPS_SUPPORT  && UPGRADE_SUPPORT */
 
@@ -1682,128 +1692,128 @@ thread_main_connection_upgrade (struct MHD_Connection 
*con)
      until the application tells us that it is done
      with the socket; */
   if ( (0 != (daemon->options & MHD_USE_TLS)) &&
-      (0 == (daemon->options & MHD_USE_POLL)))
-    {
-      while ( (0 != urh->in_buffer_size) ||
-              (0 != urh->out_buffer_size) ||
-              (0 != urh->in_buffer_used) ||
-              (0 != urh->out_buffer_used) )
-        {
-          /* use select */
-          fd_set rs;
-          fd_set ws;
-          fd_set es;
-          MHD_socket max_fd;
-          int num_ready;
-          bool result;
-
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          max_fd = MHD_INVALID_SOCKET;
-          result = urh_to_fdset (urh,
-                                 &rs,
-                                 &ws,
-                                 &es,
-                                 &max_fd,
-                                 FD_SETSIZE);
-          if (! result)
-            {
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (con->daemon,
-                        _("Error preparing select\n"));
-#endif
-              break;
-            }
-          /* FIXME: does this check really needed? */
-          if (MHD_INVALID_SOCKET != max_fd)
-            {
-              struct timeval* tvp;
-              struct timeval tv;
-              if ( (con->tls_read_ready) &&
-                   (urh->in_buffer_used < urh->in_buffer_size))
-                { /* No need to wait if incoming data is already pending in 
TLS buffers. */
-                  tv.tv_sec = 0;
-                  tv.tv_usec = 0;
-                  tvp = &tv;
-                }
-              else
-                tvp = NULL;
-              num_ready = MHD_SYS_select_ (max_fd + 1,
-                                           &rs,
-                                           &ws,
-                                           &es,
-                                           tvp);
-            }
-          else
-            num_ready = 0;
-          if (num_ready < 0)
-            {
-              const int err = MHD_socket_get_error_();
-
-              if (MHD_SCKT_ERR_IS_EINTR_(err))
-                continue;
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (con->daemon,
-                        _("Error during select (%d): `%s'\n"),
-                        err,
-                        MHD_socket_strerr_ (err));
-#endif
-              break;
-            }
-          urh_from_fdset (urh,
-                          &rs,
-                          &ws,
-                          &es);
-          process_urh (urh);
+       (0 == (daemon->options & MHD_USE_POLL)))
+  {
+    while ( (0 != urh->in_buffer_size) ||
+            (0 != urh->out_buffer_size) ||
+            (0 != urh->in_buffer_used) ||
+            (0 != urh->out_buffer_used) )
+    {
+      /* use select */
+      fd_set rs;
+      fd_set ws;
+      fd_set es;
+      MHD_socket max_fd;
+      int num_ready;
+      bool result;
+
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      max_fd = MHD_INVALID_SOCKET;
+      result = urh_to_fdset (urh,
+                             &rs,
+                             &ws,
+                             &es,
+                             &max_fd,
+                             FD_SETSIZE);
+      if (! result)
+      {
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (con->daemon,
+                  _ ("Error preparing select\n"));
+#endif
+        break;
+      }
+      /* FIXME: does this check really needed? */
+      if (MHD_INVALID_SOCKET != max_fd)
+      {
+        struct timeval*tvp;
+        struct timeval tv;
+        if ( (con->tls_read_ready) &&
+             (urh->in_buffer_used < urh->in_buffer_size))
+        {         /* No need to wait if incoming data is already pending in 
TLS buffers. */
+          tv.tv_sec = 0;
+          tv.tv_usec = 0;
+          tvp = &tv;
         }
+        else
+          tvp = NULL;
+        num_ready = MHD_SYS_select_ (max_fd + 1,
+                                     &rs,
+                                     &ws,
+                                     &es,
+                                     tvp);
+      }
+      else
+        num_ready = 0;
+      if (num_ready < 0)
+      {
+        const int err = MHD_socket_get_error_ ();
+
+        if (MHD_SCKT_ERR_IS_EINTR_ (err))
+          continue;
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (con->daemon,
+                  _ ("Error during select (%d): `%s'\n"),
+                  err,
+                  MHD_socket_strerr_ (err));
+#endif
+        break;
+      }
+      urh_from_fdset (urh,
+                      &rs,
+                      &ws,
+                      &es);
+      process_urh (urh);
     }
+  }
 #ifdef HAVE_POLL
   else if (0 != (daemon->options & MHD_USE_TLS))
-    {
-      /* use poll() */
-      struct pollfd p[2];
-      memset (p,
-              0,
-              sizeof (p));
-      p[0].fd = urh->connection->socket_fd;
-      p[1].fd = urh->mhd.socket;
+  {
+    /* use poll() */
+    struct pollfd p[2];
+    memset (p,
+            0,
+            sizeof (p));
+    p[0].fd = urh->connection->socket_fd;
+    p[1].fd = urh->mhd.socket;
+
+    while ( (0 != urh->in_buffer_size) ||
+            (0 != urh->out_buffer_size) ||
+            (0 != urh->in_buffer_used) ||
+            (0 != urh->out_buffer_used) )
+    {
+      int timeout;
+
+      urh_update_pollfd (urh, p);
+
+      if ( (con->tls_read_ready) &&
+           (urh->in_buffer_used < urh->in_buffer_size))
+        timeout = 0;     /* No need to wait if incoming data is already 
pending in TLS buffers. */
+      else
+        timeout = -1;
 
-      while ( (0 != urh->in_buffer_size) ||
-              (0 != urh->out_buffer_size) ||
-              (0 != urh->in_buffer_used) ||
-              (0 != urh->out_buffer_used) )
-        {
-          int timeout;
-
-          urh_update_pollfd(urh, p);
-
-          if ( (con->tls_read_ready) &&
-               (urh->in_buffer_used < urh->in_buffer_size))
-            timeout = 0; /* No need to wait if incoming data is already 
pending in TLS buffers. */
-          else
-            timeout = -1;
-
-          if (MHD_sys_poll_ (p,
-                             2,
-                             timeout) < 0)
-            {
-              const int err = MHD_socket_get_error_ ();
-
-              if (MHD_SCKT_ERR_IS_EINTR_ (err))
-                continue;
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (con->daemon,
-                        _("Error during poll: `%s'\n"),
-                        MHD_socket_strerr_ (err));
-#endif
-              break;
-            }
-          urh_from_pollfd (urh,
-                           p);
-          process_urh (urh);
-        }
+      if (MHD_sys_poll_ (p,
+                         2,
+                         timeout) < 0)
+      {
+        const int err = MHD_socket_get_error_ ();
+
+        if (MHD_SCKT_ERR_IS_EINTR_ (err))
+          continue;
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (con->daemon,
+                  _ ("Error during poll: `%s'\n"),
+                  MHD_socket_strerr_ (err));
+#endif
+        break;
+      }
+      urh_from_pollfd (urh,
+                       p);
+      process_urh (urh);
     }
+  }
   /* end POLL */
 #endif
   /* end HTTPS */
@@ -1854,346 +1864,348 @@ thread_main_handle_connection (void *data)
   const bool use_poll = 0;
 #endif /* ! HAVE_POLL */
   bool was_suspended = false;
-  MHD_thread_init_(&(con->pid));
+  MHD_thread_init_ (&(con->pid));
 
   while ( (! daemon->shutdown) &&
-         (MHD_CONNECTION_CLOSED != con->state) )
-    {
-      const time_t timeout = daemon->connection_timeout;
+          (MHD_CONNECTION_CLOSED != con->state) )
+  {
+    const time_t timeout = daemon->connection_timeout;
 #ifdef UPGRADE_SUPPORT
-      struct MHD_UpgradeResponseHandle * const urh = con->urh;
+    struct MHD_UpgradeResponseHandle *const urh = con->urh;
 #else  /* ! UPGRADE_SUPPORT */
-      static const void * const urh = NULL;
+    static const void *const urh = NULL;
 #endif /* ! UPGRADE_SUPPORT */
 
-      if ( (con->suspended) &&
-           (NULL == urh) )
+    if ( (con->suspended) &&
+         (NULL == urh) )
+    {
+      /* Connection was suspended, wait for resume. */
+      was_suspended = true;
+      if (! use_poll)
+      {
+        FD_ZERO (&rs);
+        if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
+                                  &rs,
+                                  NULL,
+                                  FD_SETSIZE))
         {
-          /* Connection was suspended, wait for resume. */
-          was_suspended = true;
-          if (! use_poll)
-            {
-              FD_ZERO (&rs);
-              if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
-                                        &rs,
-                                        NULL,
-                                        FD_SETSIZE))
-                {
   #ifdef HAVE_MESSAGES
-                  MHD_DLOG (con->daemon,
-                            _("Failed to add FD to fd_set\n"));
+          MHD_DLOG (con->daemon,
+                    _ ("Failed to add FD to fd_set\n"));
   #endif
-                  goto exit;
-                }
-              if (0 > MHD_SYS_select_ (MHD_itc_r_fd_ (daemon->itc) + 1,
-                                       &rs,
-                                       NULL,
-                                       NULL,
-                                       NULL))
-                {
-                  const int err = MHD_socket_get_error_();
-
-                  if (MHD_SCKT_ERR_IS_EINTR_(err))
-                    continue;
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (con->daemon,
-                            _("Error during select (%d): `%s'\n"),
-                            err,
-                            MHD_socket_strerr_ (err));
-#endif
-                  break;
-                }
-            }
-#ifdef HAVE_POLL
-          else /* use_poll */
-            {
-              p[0].events = POLLIN;
-              p[0].fd = MHD_itc_r_fd_ (daemon->itc);
-              p[0].revents = 0;
-              if (0 > MHD_sys_poll_ (p,
-                                     1,
-                                     -1))
-                {
-                  if (MHD_SCKT_LAST_ERR_IS_(MHD_SCKT_EINTR_))
-                    continue;
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (con->daemon,
-                            _("Error during poll: `%s'\n"),
-                            MHD_socket_last_strerr_ ());
-#endif
-                  break;
-                }
-            }
-#endif /* HAVE_POLL */
-          MHD_itc_clear_ (daemon->itc);
-          continue; /* Check again for resume. */
-        } /* End of "suspended" branch. */
+          goto exit;
+        }
+        if (0 > MHD_SYS_select_ (MHD_itc_r_fd_ (daemon->itc) + 1,
+                                 &rs,
+                                 NULL,
+                                 NULL,
+                                 NULL))
+        {
+          const int err = MHD_socket_get_error_ ();
 
-      if (was_suspended)
+          if (MHD_SCKT_ERR_IS_EINTR_ (err))
+            continue;
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (con->daemon,
+                    _ ("Error during select (%d): `%s'\n"),
+                    err,
+                    MHD_socket_strerr_ (err));
+#endif
+          break;
+        }
+      }
+#ifdef HAVE_POLL
+      else     /* use_poll */
+      {
+        p[0].events = POLLIN;
+        p[0].fd = MHD_itc_r_fd_ (daemon->itc);
+        p[0].revents = 0;
+        if (0 > MHD_sys_poll_ (p,
+                               1,
+                               -1))
         {
-          MHD_update_last_activity_ (con); /* Reset timeout timer. */
-          /* Process response queued during suspend and update states. */
-          MHD_connection_handle_idle (con);
-          was_suspended = false;
+          if (MHD_SCKT_LAST_ERR_IS_ (MHD_SCKT_EINTR_))
+            continue;
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (con->daemon,
+                    _ ("Error during poll: `%s'\n"),
+                    MHD_socket_last_strerr_ ());
+#endif
+          break;
         }
+      }
+#endif /* HAVE_POLL */
+      MHD_itc_clear_ (daemon->itc);
+      continue;     /* Check again for resume. */
+    }     /* End of "suspended" branch. */
 
-      tvp = NULL;
+    if (was_suspended)
+    {
+      MHD_update_last_activity_ (con);     /* Reset timeout timer. */
+      /* Process response queued during suspend and update states. */
+      MHD_connection_handle_idle (con);
+      was_suspended = false;
+    }
 
-      if ( (MHD_EVENT_LOOP_INFO_BLOCK == con->event_loop_info)
+    tvp = NULL;
+
+    if ( (MHD_EVENT_LOOP_INFO_BLOCK == con->event_loop_info)
 #ifdef HTTPS_SUPPORT
-           || ( (con->tls_read_ready) &&
-                (MHD_EVENT_LOOP_INFO_READ == con->event_loop_info) )
+         || ( (con->tls_read_ready) &&
+              (MHD_EVENT_LOOP_INFO_READ == con->event_loop_info) )
 #endif /* HTTPS_SUPPORT */
          )
-       {
-         /* do not block: more data may be inside of TLS buffers waiting or
-          * application must provide response data */
-         tv.tv_sec = 0;
-         tv.tv_usec = 0;
-         tvp = &tv;
-       }
-      if ( (NULL == tvp) &&
-           (timeout > 0) )
-       {
-         now = MHD_monotonic_sec_counter();
-         if (now - con->last_activity > timeout)
-           tv.tv_sec = 0;
-          else
-            {
-              const time_t seconds_left = timeout - (now - con->last_activity);
-#if !defined(_WIN32) || defined(__CYGWIN__)
-              tv.tv_sec = seconds_left;
+    {
+      /* do not block: more data may be inside of TLS buffers waiting or
+       * application must provide response data */
+      tv.tv_sec = 0;
+      tv.tv_usec = 0;
+      tvp = &tv;
+    }
+    if ( (NULL == tvp) &&
+         (timeout > 0) )
+    {
+      now = MHD_monotonic_sec_counter ();
+      if (now - con->last_activity > timeout)
+        tv.tv_sec = 0;
+      else
+      {
+        const time_t seconds_left = timeout - (now - con->last_activity);
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+        tv.tv_sec = seconds_left;
 #else  /* _WIN32 && !__CYGWIN__ */
-              if (seconds_left > TIMEVAL_TV_SEC_MAX)
-                tv.tv_sec = TIMEVAL_TV_SEC_MAX;
-              else
-                tv.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) seconds_left;
+        if (seconds_left > TIMEVAL_TV_SEC_MAX)
+          tv.tv_sec = TIMEVAL_TV_SEC_MAX;
+        else
+          tv.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) seconds_left;
 #endif /* _WIN32 && ! __CYGWIN__  */
-            }
-         tv.tv_usec = 0;
-         tvp = &tv;
-       }
-      if (! use_poll)
-       {
-         /* use select */
-         bool err_state = false;
-
-         FD_ZERO (&rs);
-         FD_ZERO (&ws);
-          FD_ZERO (&es);
-         maxsock = MHD_INVALID_SOCKET;
-         switch (con->event_loop_info)
-           {
-           case MHD_EVENT_LOOP_INFO_READ:
-             if (! MHD_add_to_fd_set_ (con->socket_fd,
-                                        &rs,
-                                        &maxsock,
-                                        FD_SETSIZE))
-               err_state = true;
-             break;
-           case MHD_EVENT_LOOP_INFO_WRITE:
-             if (! MHD_add_to_fd_set_ (con->socket_fd,
-                                        &ws,
-                                        &maxsock,
-                                        FD_SETSIZE))
-                err_state = true;
-             break;
-           case MHD_EVENT_LOOP_INFO_BLOCK:
-             if (! MHD_add_to_fd_set_ (con->socket_fd,
-                                        &es,
-                                        &maxsock,
-                                        FD_SETSIZE))
-               err_state = true;
-             break;
-           case MHD_EVENT_LOOP_INFO_CLEANUP:
-             /* how did we get here!? */
-             goto exit;
-           }
+      }
+      tv.tv_usec = 0;
+      tvp = &tv;
+    }
+    if (! use_poll)
+    {
+      /* use select */
+      bool err_state = false;
+
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      maxsock = MHD_INVALID_SOCKET;
+      switch (con->event_loop_info)
+      {
+      case MHD_EVENT_LOOP_INFO_READ:
+        if (! MHD_add_to_fd_set_ (con->socket_fd,
+                                  &rs,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = true;
+        break;
+      case MHD_EVENT_LOOP_INFO_WRITE:
+        if (! MHD_add_to_fd_set_ (con->socket_fd,
+                                  &ws,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = true;
+        break;
+      case MHD_EVENT_LOOP_INFO_BLOCK:
+        if (! MHD_add_to_fd_set_ (con->socket_fd,
+                                  &es,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = true;
+        break;
+      case MHD_EVENT_LOOP_INFO_CLEANUP:
+        /* how did we get here!? */
+        goto exit;
+      }
 #if WINDOWS
-          if (MHD_ITC_IS_VALID_(daemon->itc) )
-            {
-              if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
-                                        &rs,
-                                        &maxsock,
-                                        FD_SETSIZE))
-                err_state = 1;
-            }
-#endif
-            if (err_state)
-              {
-#ifdef HAVE_MESSAGES
-                MHD_DLOG (con->daemon,
-                          _("Failed to add FD to fd_set\n"));
-#endif
-                goto exit;
-              }
-
-         num_ready = MHD_SYS_select_ (maxsock + 1,
-                                       &rs,
-                                       &ws,
-                                       &es,
-                                       tvp);
-         if (num_ready < 0)
-           {
-             const int err = MHD_socket_get_error_();
-
-             if (MHD_SCKT_ERR_IS_EINTR_(err))
-               continue;
-#ifdef HAVE_MESSAGES
-             MHD_DLOG (con->daemon,
-                       _("Error during select (%d): `%s'\n"),
-                       err,
-                       MHD_socket_strerr_ (err));
-#endif
-             break;
-           }
+      if (MHD_ITC_IS_VALID_ (daemon->itc) )
+      {
+        if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
+                                  &rs,
+                                  &maxsock,
+                                  FD_SETSIZE))
+          err_state = 1;
+      }
+#endif
+      if (err_state)
+      {
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (con->daemon,
+                  _ ("Failed to add FD to fd_set\n"));
+#endif
+        goto exit;
+      }
+
+      num_ready = MHD_SYS_select_ (maxsock + 1,
+                                   &rs,
+                                   &ws,
+                                   &es,
+                                   tvp);
+      if (num_ready < 0)
+      {
+        const int err = MHD_socket_get_error_ ();
+
+        if (MHD_SCKT_ERR_IS_EINTR_ (err))
+          continue;
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (con->daemon,
+                  _ ("Error during select (%d): `%s'\n"),
+                  err,
+                  MHD_socket_strerr_ (err));
+#endif
+        break;
+      }
 #if WINDOWS
-          /* Clear ITC before other processing so additional
-           * signals will trigger select() again */
-          if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
-               (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
-                          &rs)) )
-            MHD_itc_clear_ (daemon->itc);
-#endif
-          if (MHD_NO ==
-              call_handlers (con,
-                             FD_ISSET (con->socket_fd,
-                                       &rs),
-                             FD_ISSET (con->socket_fd,
-                                       &ws),
-                             FD_ISSET (con->socket_fd,
-                                       &es)) )
-            goto exit;
-       }
+      /* Clear ITC before other processing so additional
+       * signals will trigger select() again */
+      if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
+           (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
+                      &rs)) )
+        MHD_itc_clear_ (daemon->itc);
+#endif
+      if (MHD_NO ==
+          call_handlers (con,
+                         FD_ISSET (con->socket_fd,
+                                   &rs),
+                         FD_ISSET (con->socket_fd,
+                                   &ws),
+                         FD_ISSET (con->socket_fd,
+                                   &es)) )
+        goto exit;
+    }
 #ifdef HAVE_POLL
-      else
-       {
-         /* use poll */
-         memset (&p,
-                  0,
-                  sizeof (p));
-         p[0].fd = con->socket_fd;
-         switch (con->event_loop_info)
-           {
-           case MHD_EVENT_LOOP_INFO_READ:
-             p[0].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
-             break;
-           case MHD_EVENT_LOOP_INFO_WRITE:
-             p[0].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
-             break;
-           case MHD_EVENT_LOOP_INFO_BLOCK:
-             p[0].events |= MHD_POLL_EVENTS_ERR_DISC;
-             break;
-           case MHD_EVENT_LOOP_INFO_CLEANUP:
-             /* how did we get here!? */
-             goto exit;
-           }
+    else
+    {
+      /* use poll */
+      memset (&p,
+              0,
+              sizeof (p));
+      p[0].fd = con->socket_fd;
+      switch (con->event_loop_info)
+      {
+      case MHD_EVENT_LOOP_INFO_READ:
+        p[0].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_WRITE:
+        p[0].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_BLOCK:
+        p[0].events |= MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_CLEANUP:
+        /* how did we get here!? */
+        goto exit;
+      }
 #if WINDOWS
-          extra_slot = 0;
-          if (MHD_ITC_IS_VALID_(daemon->itc))
-            {
-              p[1].events |= POLLIN;
-              p[1].fd = MHD_itc_r_fd_ (daemon->itc);
-              p[1].revents = 0;
-              extra_slot = 1;
-            }
-#endif
-         if (MHD_sys_poll_ (p,
+      extra_slot = 0;
+      if (MHD_ITC_IS_VALID_ (daemon->itc))
+      {
+        p[1].events |= POLLIN;
+        p[1].fd = MHD_itc_r_fd_ (daemon->itc);
+        p[1].revents = 0;
+        extra_slot = 1;
+      }
+#endif
+      if (MHD_sys_poll_ (p,
 #if WINDOWS
-                             1 + extra_slot,
+                         1 + extra_slot,
 #else
-                             1,
+                         1,
 #endif
-                             (NULL == tvp) ? -1 : tv.tv_sec * 1000) < 0)
-           {
-             if (MHD_SCKT_LAST_ERR_IS_(MHD_SCKT_EINTR_))
-               continue;
+                         (NULL == tvp) ? -1 : tv.tv_sec * 1000) < 0)
+      {
+        if (MHD_SCKT_LAST_ERR_IS_ (MHD_SCKT_EINTR_))
+          continue;
 #ifdef HAVE_MESSAGES
-             MHD_DLOG (con->daemon,
-                        _("Error during poll: `%s'\n"),
-                       MHD_socket_last_strerr_ ());
+        MHD_DLOG (con->daemon,
+                  _ ("Error during poll: `%s'\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-             break;
-           }
+        break;
+      }
 #if WINDOWS
-          /* Clear ITC before other processing so additional
-           * signals will trigger poll() again */
-          if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
-               (0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
-            MHD_itc_clear_ (daemon->itc);
-#endif
-          if (MHD_NO ==
-              call_handlers (con,
-                             0 != (p[0].revents & POLLIN),
-                             0 != (p[0].revents & POLLOUT),
-                             0 != (p[0].revents & (POLLERR | 
MHD_POLL_REVENTS_ERR_DISC))))
-            goto exit;
-       }
+      /* Clear ITC before other processing so additional
+       * signals will trigger poll() again */
+      if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
+           (0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
+        MHD_itc_clear_ (daemon->itc);
+#endif
+      if (MHD_NO ==
+          call_handlers (con,
+                         (0 != (p[0].revents & POLLIN)),
+                         (0 != (p[0].revents & POLLOUT)),
+                         (0 != (p[0].revents & (POLLERR
+                                                | MHD_POLL_REVENTS_ERR_DISC))) 
))
+        goto exit;
+    }
 #endif
 #ifdef UPGRADE_SUPPORT
-      if (MHD_CONNECTION_UPGRADE == con->state)
-        {
-          /* Normal HTTP processing is finished,
-           * notify application. */
-          if ( (NULL != daemon->notify_completed) &&
-               (con->client_aware) )
-            daemon->notify_completed (daemon->notify_completed_cls,
-                                      con,
-                                      &con->client_context,
-                                      MHD_REQUEST_TERMINATED_COMPLETED_OK);
-          con->client_aware = false;
-
-          thread_main_connection_upgrade (con);
-          /* MHD_connection_finish_forward_() was called by 
thread_main_connection_upgrade(). */
-
-          /* "Upgraded" data will not be used in this thread from this point. 
*/
-          con->urh->clean_ready = true;
-          /* If 'urh->was_closed' set to true, connection will be
-           * moved immediately to cleanup list. Otherwise connection
-           * will stay in suspended list until 'urh' will be marked
-           * with 'was_closed' by application. */
-          MHD_resume_connection(con);
-
-          /* skip usual clean up  */
-          return (MHD_THRD_RTRN_TYPE_) 0;
-        }
-#endif /* UPGRADE_SUPPORT */
+    if (MHD_CONNECTION_UPGRADE == con->state)
+    {
+      /* Normal HTTP processing is finished,
+       * notify application. */
+      if ( (NULL != daemon->notify_completed) &&
+           (con->client_aware) )
+        daemon->notify_completed (daemon->notify_completed_cls,
+                                  con,
+                                  &con->client_context,
+                                  MHD_REQUEST_TERMINATED_COMPLETED_OK);
+      con->client_aware = false;
+
+      thread_main_connection_upgrade (con);
+      /* MHD_connection_finish_forward_() was called by 
thread_main_connection_upgrade(). */
+
+      /* "Upgraded" data will not be used in this thread from this point. */
+      con->urh->clean_ready = true;
+      /* If 'urh->was_closed' set to true, connection will be
+       * moved immediately to cleanup list. Otherwise connection
+       * will stay in suspended list until 'urh' will be marked
+       * with 'was_closed' by application. */
+      MHD_resume_connection (con);
+
+      /* skip usual clean up  */
+      return (MHD_THRD_RTRN_TYPE_) 0;
     }
+#endif /* UPGRADE_SUPPORT */
+  }
 #if DEBUG_CLOSE
 #ifdef HAVE_MESSAGES
   MHD_DLOG (con->daemon,
-            _("Processing thread terminating. Closing connection\n"));
+            _ ("Processing thread terminating. Closing connection\n"));
 #endif
 #endif
   if (MHD_CONNECTION_CLOSED != con->state)
     MHD_connection_close_ (con,
                            (daemon->shutdown) ?
-                           MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
+                           MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN :
                            MHD_REQUEST_TERMINATED_WITH_ERROR);
   MHD_connection_handle_idle (con);
 exit:
   if (NULL != con->response)
-    {
-      MHD_destroy_response (con->response);
-      con->response = NULL;
-    }
+  {
+    MHD_destroy_response (con->response);
+    con->response = NULL;
+  }
 
   if (MHD_INVALID_SOCKET != con->socket_fd)
-    {
-      shutdown (con->socket_fd,
-                SHUT_WR);
-      /* 'socket_fd' can be used in other thread to signal shutdown.
-       * To avoid data races, do not close socket here. Daemon will
-       * use more connections only after cleanup anyway. */
-    }
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  {
+    shutdown (con->socket_fd,
+              SHUT_WR);
+    /* 'socket_fd' can be used in other thread to signal shutdown.
+     * To avoid data races, do not close socket here. Daemon will
+     * use more connections only after cleanup anyway. */
+  }
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_itc_activate_ (daemon->itc, "t")) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to signal thread termination via inter-thread 
communication channel."));
+    MHD_DLOG (daemon,
+              _ (
+                "Failed to signal thread termination via inter-thread 
communication channel."));
 #endif
-    }
+  }
   return (MHD_THRD_RTRN_TYPE_) 0;
 }
 #endif
@@ -2210,8 +2222,8 @@ static void
 MHD_cleanup_connections (struct MHD_Daemon *daemon);
 
 #if defined(HTTPS_SUPPORT)
-#if !defined(MHD_WINSOCK_SOCKETS) && !defined(MHD_socket_nosignal_) && \
-    (GNUTLS_VERSION_NUMBER+0 < 0x030402) && defined(MSG_NOSIGNAL)
+#if ! defined(MHD_WINSOCK_SOCKETS) && ! defined(MHD_socket_nosignal_) && \
+  (GNUTLS_VERSION_NUMBER + 0 < 0x030402) && defined(MSG_NOSIGNAL)
 /**
  * Older version of GnuTLS do not support suppressing of SIGPIPE signal.
  * Use push function replacement with suppressing SIGPIPE signal where 
necessary
@@ -2226,15 +2238,15 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon);
  * for TLS library.
  */
 static ssize_t
-MHD_tls_push_func_(gnutls_transport_ptr_t trnsp,
-                   const void *data,
-                   size_t data_size)
+MHD_tls_push_func_ (gnutls_transport_ptr_t trnsp,
+                    const void *data,
+                    size_t data_size)
 {
 #if (MHD_SCKT_SEND_MAX_SIZE_ < SSIZE_MAX) || (0 == SSIZE_MAX)
   if (data_size > MHD_SCKT_SEND_MAX_SIZE_)
     data_size = MHD_SCKT_SEND_MAX_SIZE_;
 #endif /* (MHD_SCKT_SEND_MAX_SIZE_ < SSIZE_MAX) || (0 == SSIZE_MAX) */
-  return MHD_send_ ((MHD_socket)(intptr_t)(trnsp), data, data_size);
+  return MHD_send_ ((MHD_socket) (intptr_t) (trnsp), data, data_size);
 }
 #endif /* MHD_TLSLIB_DONT_SUPPRESS_SIGPIPE */
 
@@ -2249,8 +2261,8 @@ MHD_tls_push_func_(gnutls_transport_ptr_t trnsp,
  */
 static int
 psk_gnutls_adapter (gnutls_session_t session,
-                   const char *username,
-                   gnutls_datum_t *key)
+                    const char *username,
+                    gnutls_datum_t *key)
 {
   struct MHD_Connection *connection;
   struct MHD_Daemon *daemon;
@@ -2262,7 +2274,7 @@ psk_gnutls_adapter (gnutls_session_t session,
   {
 #ifdef HAVE_MESSAGES
     /* Cannot use our logger, we don't even have "daemon" */
-    MHD_PANIC (_("Internal server error. This should be impossible.\n"));
+    MHD_PANIC (_ ("Internal server error. This should be impossible.\n"));
 #endif
     return -1;
   }
@@ -2272,46 +2284,47 @@ psk_gnutls_adapter (gnutls_session_t session,
   {
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-             _("PSK not supported by this server.\n"));
+              _ ("PSK not supported by this server.\n"));
 #endif
     return -1;
   }
   if (0 != daemon->cred_callback (daemon->cred_callback_cls,
-                                 connection,
-                                 username,
-                                 &app_psk,
-                                 &app_psk_size))
+                                  connection,
+                                  username,
+                                  &app_psk,
+                                  &app_psk_size))
     return -1;
   if (NULL == (key->data = gnutls_malloc (app_psk_size)))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("PSK authentication failed: gnutls_malloc failed to allocate 
memory\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "PSK authentication failed: gnutls_malloc failed to allocate 
memory\n"));
 #endif
-      free (app_psk);
-      return -1;
-    }
+    free (app_psk);
+    return -1;
+  }
   if (UINT_MAX < app_psk_size)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("PSK authentication failed: PSK too long\n"));
+    MHD_DLOG (daemon,
+              _ ("PSK authentication failed: PSK too long\n"));
 #endif
-      free (app_psk);
-      return -1;
-    }
-  key->size = (unsigned int)app_psk_size;
+    free (app_psk);
+    return -1;
+  }
+  key->size = (unsigned int) app_psk_size;
   memcpy (key->data,
-         app_psk,
-         app_psk_size);
+          app_psk,
+          app_psk_size);
   free (app_psk);
   return 0;
 #else
 #ifdef HAVE_MESSAGES
-    MHD_DLOG (daemon,
-             _("PSK not supported by this server.\n"));
+  MHD_DLOG (daemon,
+            _ ("PSK not supported by this server.\n"));
 #endif
-    return -1;
+  return -1;
 #endif
 }
 #endif /* HTTPS_SUPPORT */
@@ -2360,71 +2373,71 @@ internal_add_connection (struct MHD_Daemon *daemon,
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   mhd_assert ((NULL == daemon->worker_pool) || (external_add));
   if ((external_add) && (NULL != daemon->worker_pool))
-    {
-      /* have a pool, try to find a pool with capacity; we use the
-         socket as the initial offset into the pool for load
-         balancing */
-      for (i = 0; i < daemon->worker_pool_size; ++i)
-        {
-          struct MHD_Daemon * const worker =
-                &daemon->worker_pool[(i + client_socket) % 
daemon->worker_pool_size];
-          if (worker->connections < worker->connection_limit)
-            return internal_add_connection (worker,
-                                            client_socket,
-                                            addr,
-                                            addrlen,
-                                            true,
-                                            non_blck);
-        }
-      /* all pools are at their connection limit, must refuse */
-      MHD_socket_close_chk_ (client_socket);
+  {
+    /* have a pool, try to find a pool with capacity; we use the
+       socket as the initial offset into the pool for load
+       balancing */
+    for (i = 0; i < daemon->worker_pool_size; ++i)
+    {
+      struct MHD_Daemon *const worker =
+        &daemon->worker_pool[(i + client_socket) % daemon->worker_pool_size];
+      if (worker->connections < worker->connection_limit)
+        return internal_add_connection (worker,
+                                        client_socket,
+                                        addr,
+                                        addrlen,
+                                        true,
+                                        non_blck);
+    }
+    /* all pools are at their connection limit, must refuse */
+    MHD_socket_close_chk_ (client_socket);
 #if ENFILE
-      errno = ENFILE;
+    errno = ENFILE;
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
 #endif
 
-  if ( (! MHD_SCKT_FD_FITS_FDSET_(client_socket,
-                                  NULL)) &&
+  if ( (! MHD_SCKT_FD_FITS_FDSET_ (client_socket,
+                                   NULL)) &&
        (0 == (daemon->options & (MHD_USE_POLL | MHD_USE_EPOLL))) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
-               (int) client_socket,
-               (int) FD_SETSIZE);
+    MHD_DLOG (daemon,
+              _ ("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
+              (int) client_socket,
+              (int) FD_SETSIZE);
 #endif
-      MHD_socket_close_chk_ (client_socket);
+    MHD_socket_close_chk_ (client_socket);
 #if EINVAL
-      errno = EINVAL;
+    errno = EINVAL;
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
 
 #ifdef MHD_socket_nosignal_
   if (! MHD_socket_nosignal_ (client_socket))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to set SO_NOSIGPIPE on accepted socket: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ ("Failed to set SO_NOSIGPIPE on accepted socket: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
 #ifndef MSG_NOSIGNAL
-      /* Cannot use socket as it can produce SIGPIPE. */
+    /* Cannot use socket as it can produce SIGPIPE. */
 #ifdef ENOTSOCK
-      errno = ENOTSOCK;
+    errno = ENOTSOCK;
 #endif /* ENOTSOCK */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* ! MSG_NOSIGNAL */
-    }
+  }
 #endif /* MHD_socket_nosignal_ */
 
 
 #ifdef HAVE_MESSAGES
 #if DEBUG_CONNECT
   MHD_DLOG (daemon,
-            _("Accepted connection on socket %d\n"),
+            _ ("Accepted connection on socket %d\n"),
             client_socket);
 #endif
 #endif
@@ -2432,93 +2445,94 @@ internal_add_connection (struct MHD_Daemon *daemon,
        (MHD_NO == MHD_ip_limit_add (daemon,
                                     addr,
                                     addrlen)) )
-    {
-      /* above connection limit - reject */
+  {
+    /* above connection limit - reject */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Server reached connection limit. Closing inbound 
connection.\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "Server reached connection limit. Closing inbound 
connection.\n"));
 #endif
-      MHD_socket_close_chk_ (client_socket);
+    MHD_socket_close_chk_ (client_socket);
 #if ENFILE
-      errno = ENFILE;
+    errno = ENFILE;
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
 
   /* apply connection acceptance policy if present */
   if ( (NULL != daemon->apc) &&
        (MHD_NO == daemon->apc (daemon->apc_cls,
                                addr,
                                addrlen)) )
-    {
+  {
 #if DEBUG_CLOSE
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Connection rejected by application. Closing 
connection.\n"));
+    MHD_DLOG (daemon,
+              _ ("Connection rejected by application. Closing connection.\n"));
 #endif
 #endif
-      MHD_socket_close_chk_ (client_socket);
-      MHD_ip_limit_del (daemon,
-                        addr,
-                        addrlen);
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
 #if EACCESS
-      errno = EACCESS;
+    errno = EACCESS;
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
 
   if (NULL == (connection = MHD_calloc_ (1, sizeof (struct MHD_Connection))))
-    {
-      eno = errno;
+  {
+    eno = errno;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                "Error allocating memory: %s\n",
-                MHD_strerror_ (errno));
+    MHD_DLOG (daemon,
+              "Error allocating memory: %s\n",
+              MHD_strerror_ (errno));
 #endif
-      MHD_socket_close_chk_ (client_socket);
-      MHD_ip_limit_del (daemon,
-                        addr,
-                        addrlen);
-      errno = eno;
-      return MHD_NO;
-    }
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
+    errno = eno;
+    return MHD_NO;
+  }
   connection->pool = MHD_pool_create (daemon->pool_size);
   if (NULL == connection->pool)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Error allocating memory: %s\n"),
-                MHD_strerror_ (errno));
-#endif
-      MHD_socket_close_chk_ (client_socket);
-      MHD_ip_limit_del (daemon,
-                        addr,
-                        addrlen);
-      free (connection);
+    MHD_DLOG (daemon,
+              _ ("Error allocating memory: %s\n"),
+              MHD_strerror_ (errno));
+#endif
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
+    free (connection);
 #if ENOMEM
-      errno = ENOMEM;
+    errno = ENOMEM;
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
 
   connection->connection_timeout = daemon->connection_timeout;
   if (NULL == (connection->addr = malloc (addrlen)))
-    {
-      eno = errno;
+  {
+    eno = errno;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Error allocating memory: %s\n"),
-                MHD_strerror_ (errno));
-#endif
-      MHD_socket_close_chk_ (client_socket);
-      MHD_ip_limit_del (daemon,
-                        addr,
-                        addrlen);
-      MHD_pool_destroy (connection->pool);
-      free (connection);
-      errno = eno;
-      return MHD_NO;
-    }
+    MHD_DLOG (daemon,
+              _ ("Error allocating memory: %s\n"),
+              MHD_strerror_ (errno));
+#endif
+    MHD_socket_close_chk_ (client_socket);
+    MHD_ip_limit_del (daemon,
+                      addr,
+                      addrlen);
+    MHD_pool_destroy (connection->pool);
+    free (connection);
+    errno = eno;
+    return MHD_NO;
+  }
   memcpy (connection->addr,
           addr,
           addrlen);
@@ -2526,125 +2540,127 @@ internal_add_connection (struct MHD_Daemon *daemon,
   connection->socket_fd = client_socket;
   connection->sk_nonblck = non_blck;
   connection->daemon = daemon;
-  connection->last_activity = MHD_monotonic_sec_counter();
+  connection->last_activity = MHD_monotonic_sec_counter ();
 
   if (0 == (daemon->options & MHD_USE_TLS))
-    {
-      /* set default connection handlers  */
-      MHD_set_http_callbacks_ (connection);
-    }
+  {
+    /* set default connection handlers  */
+    MHD_set_http_callbacks_ (connection);
+  }
   else
-    {
+  {
 #ifdef HTTPS_SUPPORT
-#if (GNUTLS_VERSION_NUMBER+0 >= 0x030500)
-      gnutls_init_flags_t
+#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030500)
+    gnutls_init_flags_t
 #else
-      unsigned int
+    unsigned int
 #endif
-        flags;
+    flags;
 
-      flags = GNUTLS_SERVER;
-#if (GNUTLS_VERSION_NUMBER+0 >= 0x030402)
-      flags |= GNUTLS_NO_SIGNAL;
+    flags = GNUTLS_SERVER;
+#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030402)
+    flags |= GNUTLS_NO_SIGNAL;
 #endif /* GNUTLS_VERSION_NUMBER >= 0x030402 */
 #if GNUTLS_VERSION_MAJOR >= 3
-      flags |= GNUTLS_NONBLOCK;
+    flags |= GNUTLS_NONBLOCK;
 #endif /* GNUTLS_VERSION_MAJOR >= 3*/
-#if (GNUTLS_VERSION_NUMBER+0 >= 0x030603)
-      if (0 != (daemon->options & MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT))
-       flags |= GNUTLS_POST_HANDSHAKE_AUTH;
-#endif
-#if (GNUTLS_VERSION_NUMBER+0 >= 0x030605)
-      if (0 != (daemon->options & MHD_USE_INSECURE_TLS_EARLY_DATA))
-       flags |= GNUTLS_ENABLE_EARLY_DATA;
-#endif
-      connection->tls_state = MHD_TLS_CONN_INIT;
-      MHD_set_https_callbacks (connection);
-      gnutls_init (&connection->tls_session,
-                  flags);
-      gnutls_priority_set (connection->tls_session,
-                          daemon->priority_cache);
-      gnutls_session_set_ptr (connection->tls_session,
-                             connection);
-      switch (daemon->cred_type)
-        {
-          /* set needed credentials for certificate authentication. */
-        case GNUTLS_CRD_CERTIFICATE:
-          gnutls_credentials_set (connection->tls_session,
-                                  GNUTLS_CRD_CERTIFICATE,
-                                  daemon->x509_cred);
-         break;
-        case GNUTLS_CRD_PSK:
-          gnutls_credentials_set (connection->tls_session,
-                                  GNUTLS_CRD_PSK,
-                                  daemon->psk_cred);
-          gnutls_psk_set_server_credentials_function (daemon->psk_cred,
-                                                      &psk_gnutls_adapter);
-          break;
-        default:
+#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030603)
+    if (0 != (daemon->options & MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT))
+      flags |= GNUTLS_POST_HANDSHAKE_AUTH;
+#endif
+#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030605)
+    if (0 != (daemon->options & MHD_USE_INSECURE_TLS_EARLY_DATA))
+      flags |= GNUTLS_ENABLE_EARLY_DATA;
+#endif
+    connection->tls_state = MHD_TLS_CONN_INIT;
+    MHD_set_https_callbacks (connection);
+    gnutls_init (&connection->tls_session,
+                 flags);
+    gnutls_priority_set (connection->tls_session,
+                         daemon->priority_cache);
+    gnutls_session_set_ptr (connection->tls_session,
+                            connection);
+    switch (daemon->cred_type)
+    {
+    /* set needed credentials for certificate authentication. */
+    case GNUTLS_CRD_CERTIFICATE:
+      gnutls_credentials_set (connection->tls_session,
+                              GNUTLS_CRD_CERTIFICATE,
+                              daemon->x509_cred);
+      break;
+    case GNUTLS_CRD_PSK:
+      gnutls_credentials_set (connection->tls_session,
+                              GNUTLS_CRD_PSK,
+                              daemon->psk_cred);
+      gnutls_psk_set_server_credentials_function (daemon->psk_cred,
+                                                  &psk_gnutls_adapter);
+      break;
+    default:
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (connection->daemon,
-                    _("Failed to setup TLS credentials: unknown credential 
type %d\n"),
-                    daemon->cred_type);
-#endif
-          MHD_socket_close_chk_ (client_socket);
-          MHD_ip_limit_del (daemon,
-                            addr,
-                            addrlen);
-          free (connection->addr);
-          free (connection);
-          MHD_PANIC (_("Unknown credential type"));
+      MHD_DLOG (connection->daemon,
+                _ (
+                  "Failed to setup TLS credentials: unknown credential type 
%d\n"),
+                daemon->cred_type);
+#endif
+      MHD_socket_close_chk_ (client_socket);
+      MHD_ip_limit_del (daemon,
+                        addr,
+                        addrlen);
+      free (connection->addr);
+      free (connection);
+      MHD_PANIC (_ ("Unknown credential type"));
 #if EINVAL
-         errno = EINVAL;
+      errno = EINVAL;
 #endif
-         return MHD_NO;
-        }
-#if (GNUTLS_VERSION_NUMBER+0 >= 0x030109) && !defined(_WIN64)
-      gnutls_transport_set_int (connection->tls_session,
-                                (int)(client_socket));
+      return MHD_NO;
+    }
+#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030109) && ! defined(_WIN64)
+    gnutls_transport_set_int (connection->tls_session,
+                              (int) (client_socket));
 #else  /* GnuTLS before 3.1.9 or Win x64 */
-      gnutls_transport_set_ptr (connection->tls_session,
-                                
(gnutls_transport_ptr_t)(intptr_t)(client_socket));
+    gnutls_transport_set_ptr (connection->tls_session,
+                              (gnutls_transport_ptr_t) (intptr_t) 
(client_socket));
 #endif /* GnuTLS before 3.1.9 */
 #ifdef MHD_TLSLIB_NEED_PUSH_FUNC
-      gnutls_transport_set_push_function (connection->tls_session,
-                                          MHD_tls_push_func_);
+    gnutls_transport_set_push_function (connection->tls_session,
+                                        MHD_tls_push_func_);
 #endif /* MHD_TLSLIB_NEED_PUSH_FUNC */
-      if (daemon->https_mem_trust)
-         gnutls_certificate_server_set_request (connection->tls_session,
+    if (daemon->https_mem_trust)
+      gnutls_certificate_server_set_request (connection->tls_session,
                                              GNUTLS_CERT_REQUEST);
 #else  /* ! HTTPS_SUPPORT */
-      eno = EINVAL;
-      goto cleanup;
+    eno = EINVAL;
+    goto cleanup;
 #endif /* ! HTTPS_SUPPORT */
-    }
+  }
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
   /* Firm check under lock. */
   if (daemon->connections >= daemon->connection_limit)
-    {
+  {
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+    MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
-      /* above connection limit - reject */
+    /* above connection limit - reject */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Server reached connection limit. Closing inbound 
connection.\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "Server reached connection limit. Closing inbound 
connection.\n"));
 #endif
 #if ENFILE
-      eno = ENFILE;
+    eno = ENFILE;
 #endif
-      goto cleanup;
-    }
+    goto cleanup;
+  }
   daemon->connections++;
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
-    {
-      XDLL_insert (daemon->normal_timeout_head,
-                   daemon->normal_timeout_tail,
-                   connection);
-    }
+  {
+    XDLL_insert (daemon->normal_timeout_head,
+                 daemon->normal_timeout_tail,
+                 connection);
+  }
   DLL_insert (daemon->connections_head,
               daemon->connections_tail,
               connection);
@@ -2659,80 +2675,82 @@ internal_add_connection (struct MHD_Daemon *daemon,
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   /* attempt to create handler thread */
   if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+  {
+    if (! MHD_create_named_thread_ (&connection->pid,
+                                    "MHD-connection",
+                                    daemon->thread_stack_size,
+                                    &thread_main_handle_connection,
+                                    connection))
     {
-      if (! MHD_create_named_thread_ (&connection->pid,
-                                      "MHD-connection",
-                                      daemon->thread_stack_size,
-                                      &thread_main_handle_connection,
-                                      connection))
-        {
-          eno = errno;
+      eno = errno;
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    "Failed to create a thread: %s\n",
-                    MHD_strerror_ (eno));
+      MHD_DLOG (daemon,
+                "Failed to create a thread: %s\n",
+                MHD_strerror_ (eno));
 #endif
-          goto cleanup;
-        }
+      goto cleanup;
     }
+  }
   else
     connection->pid = daemon->pid;
 #endif
 #ifdef EPOLL_SUPPORT
   if (0 != (daemon->options & MHD_USE_EPOLL))
-    {
-      if ((0 == (daemon->options & MHD_USE_TURBO)) || (external_add))
-       { /* Do not manipulate EReady DL-list in 'external_add' mode. */
-         struct epoll_event event;
+  {
+    if ((0 == (daemon->options & MHD_USE_TURBO)) || (external_add))
+    { /* Do not manipulate EReady DL-list in 'external_add' mode. */
+      struct epoll_event event;
 
-         event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
-         event.data.ptr = connection;
-         if (0 != epoll_ctl (daemon->epoll_fd,
+      event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
+      event.data.ptr = connection;
+      if (0 != epoll_ctl (daemon->epoll_fd,
                           EPOLL_CTL_ADD,
                           client_socket,
                           &event))
-           {
-             eno = errno;
+      {
+        eno = errno;
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("Call to epoll_ctl failed: %s\n"),
-                        MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  _ ("Call to epoll_ctl failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-             goto cleanup;
-           }
-         connection->epoll_state |= MHD_EPOLL_STATE_IN_EPOLL_SET;
-       }
-      else
-       {
-         connection->epoll_state |= MHD_EPOLL_STATE_READ_READY | 
MHD_EPOLL_STATE_WRITE_READY
-           | MHD_EPOLL_STATE_IN_EREADY_EDLL;
-         EDLL_insert (daemon->eready_head,
+        goto cleanup;
+      }
+      connection->epoll_state |= MHD_EPOLL_STATE_IN_EPOLL_SET;
+    }
+    else
+    {
+      connection->epoll_state |= MHD_EPOLL_STATE_READ_READY
+                                 | MHD_EPOLL_STATE_WRITE_READY
+                                 | MHD_EPOLL_STATE_IN_EREADY_EDLL;
+      EDLL_insert (daemon->eready_head,
                    daemon->eready_tail,
                    connection);
-       }
     }
+  }
   else /* This 'else' is combined with next 'if'. */
 #endif
   if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
        (external_add) &&
-       (MHD_ITC_IS_VALID_(daemon->itc)) &&
+       (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_itc_activate_ (daemon->itc, "n")) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to signal new connection via inter-thread 
communication channel."));
+    MHD_DLOG (daemon,
+              _ (
+                "Failed to signal new connection via inter-thread 
communication channel."));
 #endif
-    }
+  }
   return MHD_YES;
- cleanup:
+cleanup:
   if (NULL != daemon->notify_connection)
     daemon->notify_connection (daemon->notify_connection_cls,
                                connection,
                                &connection->socket_context,
                                MHD_CONNECTION_NOTIFY_CLOSED);
 #ifdef HTTPS_SUPPORT
- if (NULL != connection->tls_session)
-   gnutls_deinit (connection->tls_session);
+  if (NULL != connection->tls_session)
+    gnutls_deinit (connection->tls_session);
 #endif /* HTTPS_SUPPORT */
   MHD_socket_close_chk_ (client_socket);
   MHD_ip_limit_del (daemon,
@@ -2742,14 +2760,14 @@ internal_add_connection (struct MHD_Daemon *daemon,
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
-    {
-      XDLL_remove (daemon->normal_timeout_head,
-                   daemon->normal_timeout_tail,
-                   connection);
-    }
+  {
+    XDLL_remove (daemon->normal_timeout_head,
+                 daemon->normal_timeout_tail,
+                 connection);
+  }
   DLL_remove (daemon->connections_head,
-             daemon->connections_tail,
-             connection);
+              daemon->connections_tail,
+              connection);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
@@ -2782,25 +2800,25 @@ internal_suspend_connection_ (struct MHD_Connection 
*connection)
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
   if (connection->resuming)
-    {
-      /* suspending again while we didn't even complete resuming yet */
-      connection->resuming = false;
+  {
+    /* suspending again while we didn't even complete resuming yet */
+    connection->resuming = false;
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+    MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
-      return;
-    }
+    return;
+  }
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
-    {
-      if (connection->connection_timeout == daemon->connection_timeout)
-        XDLL_remove (daemon->normal_timeout_head,
-                     daemon->normal_timeout_tail,
-                     connection);
-      else
-        XDLL_remove (daemon->manual_timeout_head,
-                     daemon->manual_timeout_tail,
-                     connection);
-    }
+  {
+    if (connection->connection_timeout == daemon->connection_timeout)
+      XDLL_remove (daemon->normal_timeout_head,
+                   daemon->normal_timeout_tail,
+                   connection);
+    else
+      XDLL_remove (daemon->manual_timeout_head,
+                   daemon->manual_timeout_tail,
+                   connection);
+  }
   DLL_remove (daemon->connections_head,
               daemon->connections_tail,
               connection);
@@ -2811,25 +2829,25 @@ internal_suspend_connection_ (struct MHD_Connection 
*connection)
   connection->suspended = true;
 #ifdef EPOLL_SUPPORT
   if (0 != (daemon->options & MHD_USE_EPOLL))
+  {
+    if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
     {
-      if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-        {
-          EDLL_remove (daemon->eready_head,
-                       daemon->eready_tail,
-                       connection);
-          connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
-        }
-      if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET))
-        {
-          if (0 != epoll_ctl (daemon->epoll_fd,
-                              EPOLL_CTL_DEL,
-                              connection->socket_fd,
-                              NULL))
-            MHD_PANIC (_("Failed to remove FD from epoll set\n"));
-          connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
-        }
-      connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED;
+      EDLL_remove (daemon->eready_head,
+                   daemon->eready_tail,
+                   connection);
+      connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
+    }
+    if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET))
+    {
+      if (0 != epoll_ctl (daemon->epoll_fd,
+                          EPOLL_CTL_DEL,
+                          connection->socket_fd,
+                          NULL))
+        MHD_PANIC (_ ("Failed to remove FD from epoll set\n"));
+      connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
     }
+    connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED;
+  }
 #endif
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
@@ -2871,19 +2889,21 @@ internal_suspend_connection_ (struct MHD_Connection 
*connection)
 void
 MHD_suspend_connection (struct MHD_Connection *connection)
 {
-  struct MHD_Daemon * const daemon = connection->daemon;
+  struct MHD_Daemon *const daemon = connection->daemon;
 
   if (0 == (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
-    MHD_PANIC (_("Cannot suspend connections without enabling 
MHD_ALLOW_SUSPEND_RESUME!\n"));
+    MHD_PANIC (_ (
+                 "Cannot suspend connections without enabling 
MHD_ALLOW_SUSPEND_RESUME!\n"));
 #ifdef UPGRADE_SUPPORT
   if (NULL != connection->urh)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Error: connection scheduled for \"upgrade\" cannot be 
suspended"));
+    MHD_DLOG (daemon,
+              _ (
+                "Error: connection scheduled for \"upgrade\" cannot be 
suspended"));
 #endif /* HAVE_MESSAGES */
-      return;
-    }
+    return;
+  }
 #endif /* UPGRADE_SUPPORT */
   internal_suspend_connection_ (connection);
 }
@@ -2903,7 +2923,8 @@ MHD_resume_connection (struct MHD_Connection *connection)
   struct MHD_Daemon *daemon = connection->daemon;
 
   if (0 == (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
-    MHD_PANIC (_("Cannot resume connections without enabling 
MHD_ALLOW_SUSPEND_RESUME!\n"));
+    MHD_PANIC (_ (
+                 "Cannot resume connections without enabling 
MHD_ALLOW_SUSPEND_RESUME!\n"));
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
@@ -2912,14 +2933,15 @@ MHD_resume_connection (struct MHD_Connection 
*connection)
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_itc_activate_ (daemon->itc, "r")) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to signal resume via inter-thread communication 
channel."));
+    MHD_DLOG (daemon,
+              _ (
+                "Failed to signal resume via inter-thread communication 
channel."));
 #endif
-    }
+  }
 }
 
 
@@ -2938,7 +2960,8 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
   struct MHD_Connection *pos;
   struct MHD_Connection *prev = NULL;
   int ret;
-  const bool used_thr_p_c = (0 != (daemon->options & 
MHD_USE_THREAD_PER_CONNECTION));
+  const bool used_thr_p_c = (0 != (daemon->options
+                                   & MHD_USE_THREAD_PER_CONNECTION));
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   mhd_assert (NULL == daemon->worker_pool);
 #endif
@@ -2947,112 +2970,114 @@ resume_suspended_connections (struct MHD_Daemon 
*daemon)
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
   if (daemon->resuming)
-    {
-      prev = daemon->suspended_connections_tail;
-      /* During shutdown check for resuming is forced. */
-      mhd_assert((NULL != prev) || (daemon->shutdown));
-    }
+  {
+    prev = daemon->suspended_connections_tail;
+    /* During shutdown check for resuming is forced. */
+    mhd_assert ((NULL != prev) || (daemon->shutdown));
+  }
 
   daemon->resuming = false;
 
   while (NULL != (pos = prev))
-    {
+  {
 #ifdef UPGRADE_SUPPORT
-      struct MHD_UpgradeResponseHandle * const urh = pos->urh;
+    struct MHD_UpgradeResponseHandle *const urh = pos->urh;
 #else  /* ! UPGRADE_SUPPORT */
-      static const void * const urh = NULL;
+    static const void *const urh = NULL;
 #endif /* ! UPGRADE_SUPPORT */
-      prev = pos->prev;
-      if ( (! pos->resuming)
+    prev = pos->prev;
+    if ( (! pos->resuming)
 #ifdef UPGRADE_SUPPORT
-          || ( (NULL != urh) &&
-               ( (! urh->was_closed) ||
-                 (! urh->clean_ready) ) )
+         || ( (NULL != urh) &&
+              ( (! urh->was_closed) ||
+                (! urh->clean_ready) ) )
 #endif /* UPGRADE_SUPPORT */
          )
-        continue;
-      ret = MHD_YES;
-      mhd_assert (pos->suspended);
-      DLL_remove (daemon->suspended_connections_head,
-                  daemon->suspended_connections_tail,
+      continue;
+    ret = MHD_YES;
+    mhd_assert (pos->suspended);
+    DLL_remove (daemon->suspended_connections_head,
+                daemon->suspended_connections_tail,
+                pos);
+    pos->suspended = false;
+    if (NULL == urh)
+    {
+      DLL_insert (daemon->connections_head,
+                  daemon->connections_tail,
                   pos);
-      pos->suspended = false;
-      if (NULL == urh)
-        {
-          DLL_insert (daemon->connections_head,
-                      daemon->connections_tail,
-                      pos);
-          if (! used_thr_p_c)
-            {
-              /* Reset timeout timer on resume. */
-              if (0 != pos->connection_timeout)
-                pos->last_activity = MHD_monotonic_sec_counter();
-
-              if (pos->connection_timeout == daemon->connection_timeout)
-                XDLL_insert (daemon->normal_timeout_head,
-                             daemon->normal_timeout_tail,
-                             pos);
-              else
-                XDLL_insert (daemon->manual_timeout_head,
-                             daemon->manual_timeout_tail,
-                             pos);
-            }
+      if (! used_thr_p_c)
+      {
+        /* Reset timeout timer on resume. */
+        if (0 != pos->connection_timeout)
+          pos->last_activity = MHD_monotonic_sec_counter ();
+
+        if (pos->connection_timeout == daemon->connection_timeout)
+          XDLL_insert (daemon->normal_timeout_head,
+                       daemon->normal_timeout_tail,
+                       pos);
+        else
+          XDLL_insert (daemon->manual_timeout_head,
+                       daemon->manual_timeout_tail,
+                       pos);
+      }
 #ifdef EPOLL_SUPPORT
-          if (0 != (daemon->options & MHD_USE_EPOLL))
-            {
-              if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-                MHD_PANIC ("Resumed connection was already in EREADY set\n");
-              /* we always mark resumed connections as ready, as we
-                 might have missed the edge poll event during suspension */
-              EDLL_insert (daemon->eready_head,
-                           daemon->eready_tail,
-                           pos);
-              pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL | \
-                  MHD_EPOLL_STATE_READ_READY | MHD_EPOLL_STATE_WRITE_READY;
-              pos->epoll_state &= ~MHD_EPOLL_STATE_SUSPENDED;
-            }
+      if (0 != (daemon->options & MHD_USE_EPOLL))
+      {
+        if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
+          MHD_PANIC ("Resumed connection was already in EREADY set\n");
+        /* we always mark resumed connections as ready, as we
+           might have missed the edge poll event during suspension */
+        EDLL_insert (daemon->eready_head,
+                     daemon->eready_tail,
+                     pos);
+        pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL   \
+                            | MHD_EPOLL_STATE_READ_READY
+                            | MHD_EPOLL_STATE_WRITE_READY;
+        pos->epoll_state &= ~MHD_EPOLL_STATE_SUSPENDED;
+      }
 #endif
-        }
+    }
 #ifdef UPGRADE_SUPPORT
-      else
-        {
-          /* Data forwarding was finished (for TLS connections) AND
-           * application was closed upgraded connection.
-           * Insert connection into cleanup list. */
-
-          if ( (NULL != daemon->notify_completed) &&
-               (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
-               (pos->client_aware) )
-           {
-             daemon->notify_completed (daemon->notify_completed_cls,
-                                       pos,
-                                       &pos->client_context,
-                                       MHD_REQUEST_TERMINATED_COMPLETED_OK);
-             pos->client_aware = false;
-           }
-          DLL_insert (daemon->cleanup_head,
-                      daemon->cleanup_tail,
-                      pos);
+    else
+    {
+      /* Data forwarding was finished (for TLS connections) AND
+       * application was closed upgraded connection.
+       * Insert connection into cleanup list. */
+
+      if ( (NULL != daemon->notify_completed) &&
+           (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
+           (pos->client_aware) )
+      {
+        daemon->notify_completed (daemon->notify_completed_cls,
+                                  pos,
+                                  &pos->client_context,
+                                  MHD_REQUEST_TERMINATED_COMPLETED_OK);
+        pos->client_aware = false;
+      }
+      DLL_insert (daemon->cleanup_head,
+                  daemon->cleanup_tail,
+                  pos);
 
-        }
-#endif /* UPGRADE_SUPPORT */
-      pos->resuming = false;
     }
+#endif /* UPGRADE_SUPPORT */
+    pos->resuming = false;
+  }
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
   if ( (used_thr_p_c) &&
        (MHD_NO != ret) )
-    { /* Wake up suspended connections. */
-      if (! MHD_itc_activate_(daemon->itc,
-                              "w"))
-        {
+  {   /* Wake up suspended connections. */
+    if (! MHD_itc_activate_ (daemon->itc,
+                             "w"))
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Failed to signal resume of connection via inter-thread 
communication channel."));
+      MHD_DLOG (daemon,
+                _ (
+                  "Failed to signal resume of connection via inter-thread 
communication channel."));
 #endif
-        }
     }
+  }
   return ret;
 }
 
@@ -3093,34 +3118,34 @@ MHD_add_connection (struct MHD_Daemon *daemon,
   bool sk_nonbl;
 
   if (! MHD_socket_nonblocking_ (client_socket))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to set nonblocking mode on new client socket: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ ("Failed to set nonblocking mode on new client socket: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      sk_nonbl = 0;
-    }
+    sk_nonbl = 0;
+  }
   else
-    sk_nonbl = !0;
+    sk_nonbl = ! 0;
 
   if ( (0 != (daemon->options & MHD_USE_TURBO)) &&
        (! MHD_socket_noninheritable_ (client_socket)) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to set noninheritable mode on new client 
socket.\n"));
+    MHD_DLOG (daemon,
+              _ ("Failed to set noninheritable mode on new client socket.\n"));
 #endif
-    }
+  }
 
   if ( (0 == (daemon->options & MHD_USE_TURBO)) &&
        (! MHD_socket_buffering_reset_ (client_socket)) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to reset buffering mode on new client socket.\n"));
+    MHD_DLOG (daemon,
+              _ ("Failed to reset buffering mode on new client socket.\n"));
 #endif
-    }
+  }
   return internal_add_connection (daemon,
                                   client_socket,
                                   addr,
@@ -3179,94 +3204,98 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
 #endif /* ! USE_ACCEPT4 */
   if ( (MHD_INVALID_SOCKET == s) ||
        (addrlen <= 0) )
-    {
-      const int err = MHD_socket_get_error_ ();
+  {
+    const int err = MHD_socket_get_error_ ();
 
-      /* This could be a common occurance with multiple worker threads */
-      if (MHD_SCKT_ERR_IS_ (err,
-                            MHD_SCKT_EINVAL_))
-        return MHD_NO; /* can happen during shutdown */
-      if (MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err))
-        return MHD_NO; /* do not print error if client just disconnected early 
*/
+    /* This could be a common occurance with multiple worker threads */
+    if (MHD_SCKT_ERR_IS_ (err,
+                          MHD_SCKT_EINVAL_))
+      return MHD_NO;   /* can happen during shutdown */
+    if (MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_ (err))
+      return MHD_NO;   /* do not print error if client just disconnected early 
*/
+#ifdef HAVE_MESSAGES
+    if (! MHD_SCKT_ERR_IS_EAGAIN_ (err) )
+      MHD_DLOG (daemon,
+                _ ("Error accepting connection: %s\n"),
+                MHD_socket_strerr_ (err));
+#endif
+    if (MHD_INVALID_SOCKET != s)
+    {
+      MHD_socket_close_chk_ (s);
+    }
+    if ( MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err) )
+    {
+      /* system/process out of resources */
+      if (0 == daemon->connections)
+      {
 #ifdef HAVE_MESSAGES
-      if (! MHD_SCKT_ERR_IS_EAGAIN_ (err) )
+        /* Not setting 'at_limit' flag, as there is no way it
+           would ever be cleared.  Instead trying to produce
+           bit fat ugly warning. */
         MHD_DLOG (daemon,
-                 _("Error accepting connection: %s\n"),
-                 MHD_socket_strerr_(err));
+                  _ (
+                    "Hit process or system resource limit at FIRST connection. 
This is really bad as there is no sane way to proceed. Will try busy waiting 
for system resources to become magically available.\n"));
 #endif
-      if (MHD_INVALID_SOCKET != s)
-        {
-          MHD_socket_close_chk_ (s);
-        }
-      if ( MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err) )
-        {
-          /* system/process out of resources */
-          if (0 == daemon->connections)
-            {
-#ifdef HAVE_MESSAGES
-              /* Not setting 'at_limit' flag, as there is no way it
-                 would ever be cleared.  Instead trying to produce
-                 bit fat ugly warning. */
-              MHD_DLOG (daemon,
-                        _("Hit process or system resource limit at FIRST 
connection. This is really bad as there is no sane way to proceed. Will try 
busy waiting for system resources to become magically available.\n"));
-#endif
-            }
-          else
-            {
+      }
+      else
+      {
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-              MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+        MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
-              daemon->at_limit = true;
+        daemon->at_limit = true;
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-              MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+        MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("Hit process or system resource limit at %u 
connections, temporarily suspending accept(). Consider setting a lower 
MHD_OPTION_CONNECTION_LIMIT.\n"),
-                        (unsigned int) daemon->connections);
+        MHD_DLOG (daemon,
+                  _ (
+                    "Hit process or system resource limit at %u connections, 
temporarily suspending accept(). Consider setting a lower 
MHD_OPTION_CONNECTION_LIMIT.\n"),
+                  (unsigned int) daemon->connections);
 #endif
-            }
-        }
-      return MHD_NO;
+      }
     }
+    return MHD_NO;
+  }
 #if defined(MHD_TCP_CORK_NOPUSH) || defined(HAVE_MSG_MORE)
   /* We will use TCP_CORK or TCP_NOPUSH or MSG_MORE to control
      transmission, disable Nagle's algorithm (always) */
   if (0 != MHD_socket_set_nodelay_ (s,
                                     true))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to disable TCP Nagle on socket: %s\n"),
-                MHD_socket_last_strerr_());
-    }
+    MHD_DLOG (daemon,
+              _ ("Failed to disable TCP Nagle on socket: %s\n"),
+              MHD_socket_last_strerr_ ());
+  }
 #endif
 #endif
-#if !defined(USE_ACCEPT4) || !defined(HAVE_SOCK_NONBLOCK)
+#if ! defined(USE_ACCEPT4) || ! defined(HAVE_SOCK_NONBLOCK)
   if (! MHD_socket_nonblocking_ (s))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to set nonblocking mode on incoming connection 
socket: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ (
+                "Failed to set nonblocking mode on incoming connection socket: 
%s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-    }
+  }
   else
-    sk_nonbl = !0;
+    sk_nonbl = ! 0;
 #endif /* !USE_ACCEPT4 || !HAVE_SOCK_NONBLOCK */
-#if !defined(USE_ACCEPT4) || !defined(SOCK_CLOEXEC)
+#if ! defined(USE_ACCEPT4) || ! defined(SOCK_CLOEXEC)
   if (! MHD_socket_noninheritable_ (s))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to set noninheritable mode on incoming connection 
socket.\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "Failed to set noninheritable mode on incoming connection 
socket.\n"));
 #endif
-    }
+  }
 #endif /* !USE_ACCEPT4 || !SOCK_CLOEXEC */
 #ifdef HAVE_MESSAGES
 #if DEBUG_CONNECT
   MHD_DLOG (daemon,
-            _("Accepted connection on socket %d\n"),
+            _ ("Accepted connection on socket %d\n"),
             s);
 #endif
 #endif
@@ -3298,80 +3327,80 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
   while (NULL != (pos = daemon->cleanup_tail))
-    {
-      DLL_remove (daemon->cleanup_head,
-                 daemon->cleanup_tail,
-                 pos);
+  {
+    DLL_remove (daemon->cleanup_head,
+                daemon->cleanup_tail,
+                pos);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-      if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
-          (! pos->thread_joined) &&
-           (! MHD_join_thread_ (pos->pid.handle)) )
-        MHD_PANIC (_("Failed to join a thread\n"));
+    MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+    if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
+         (! pos->thread_joined) &&
+         (! MHD_join_thread_ (pos->pid.handle)) )
+      MHD_PANIC (_ ("Failed to join a thread\n"));
 #endif
 #ifdef UPGRADE_SUPPORT
-      cleanup_upgraded_connection (pos);
+    cleanup_upgraded_connection (pos);
 #endif /* UPGRADE_SUPPORT */
-      MHD_pool_destroy (pos->pool);
+    MHD_pool_destroy (pos->pool);
 #ifdef HTTPS_SUPPORT
-      if (NULL != pos->tls_session)
-       gnutls_deinit (pos->tls_session);
+    if (NULL != pos->tls_session)
+      gnutls_deinit (pos->tls_session);
 #endif /* HTTPS_SUPPORT */
 
-      /* clean up the connection */
-      if (NULL != daemon->notify_connection)
-        daemon->notify_connection (daemon->notify_connection_cls,
-                                   pos,
-                                   &pos->socket_context,
-                                   MHD_CONNECTION_NOTIFY_CLOSED);
-      MHD_ip_limit_del (daemon,
-                        pos->addr,
-                        pos->addr_len);
+    /* clean up the connection */
+    if (NULL != daemon->notify_connection)
+      daemon->notify_connection (daemon->notify_connection_cls,
+                                 pos,
+                                 &pos->socket_context,
+                                 MHD_CONNECTION_NOTIFY_CLOSED);
+    MHD_ip_limit_del (daemon,
+                      pos->addr,
+                      pos->addr_len);
 #ifdef EPOLL_SUPPORT
-      if (0 != (daemon->options & MHD_USE_EPOLL))
-        {
-          if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-            {
-              EDLL_remove (daemon->eready_head,
-                           daemon->eready_tail,
-                           pos);
-              pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
-            }
-          if ( (-1 != daemon->epoll_fd) &&
-               (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET)) )
-            {
-              /* epoll documentation suggests that closing a FD
-                 automatically removes it from the epoll set; however,
-                 this is not true as if we fail to do manually remove it,
-                 we are still seeing an event for this fd in epoll,
-                 causing grief (use-after-free...) --- at least on my
-                 system. */
-              if (0 != epoll_ctl (daemon->epoll_fd,
-                                  EPOLL_CTL_DEL,
-                                  pos->socket_fd,
-                                  NULL))
-                MHD_PANIC (_("Failed to remove FD from epoll set\n"));
-              pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
-            }
-        }
+    if (0 != (daemon->options & MHD_USE_EPOLL))
+    {
+      if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
+      {
+        EDLL_remove (daemon->eready_head,
+                     daemon->eready_tail,
+                     pos);
+        pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
+      }
+      if ( (-1 != daemon->epoll_fd) &&
+           (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET)) )
+      {
+        /* epoll documentation suggests that closing a FD
+           automatically removes it from the epoll set; however,
+           this is not true as if we fail to do manually remove it,
+           we are still seeing an event for this fd in epoll,
+           causing grief (use-after-free...) --- at least on my
+           system. */
+        if (0 != epoll_ctl (daemon->epoll_fd,
+                            EPOLL_CTL_DEL,
+                            pos->socket_fd,
+                            NULL))
+          MHD_PANIC (_ ("Failed to remove FD from epoll set\n"));
+        pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
+      }
+    }
 #endif
-      if (NULL != pos->response)
-       {
-         MHD_destroy_response (pos->response);
-         pos->response = NULL;
-       }
-      if (MHD_INVALID_SOCKET != pos->socket_fd)
-        MHD_socket_close_chk_ (pos->socket_fd);
-      if (NULL != pos->addr)
-       free (pos->addr);
-      free (pos);
+    if (NULL != pos->response)
+    {
+      MHD_destroy_response (pos->response);
+      pos->response = NULL;
+    }
+    if (MHD_INVALID_SOCKET != pos->socket_fd)
+      MHD_socket_close_chk_ (pos->socket_fd);
+    if (NULL != pos->addr)
+      free (pos->addr);
+    free (pos);
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+    MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
-      daemon->connections--;
-      daemon->at_limit = false;
-    }
+    daemon->connections--;
+    daemon->at_limit = false;
+  }
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
@@ -3408,71 +3437,71 @@ MHD_get_timeout (struct MHD_Daemon *daemon,
   bool have_timeout;
 
   if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Illegal call to MHD_get_timeout\n"));
+    MHD_DLOG (daemon,
+              _ ("Illegal call to MHD_get_timeout\n"));
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
 
   if (daemon->data_already_pending)
-    {
-      /* Some data already waiting to be processed. */
-      *timeout = 0;
-      return MHD_YES;
-    }
+  {
+    /* Some data already waiting to be processed. */
+    *timeout = 0;
+    return MHD_YES;
+  }
 
 #ifdef EPOLL_SUPPORT
   if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
        ((NULL != daemon->eready_head)
 #if defined(UPGRADE_SUPPORT) && defined(HTTPS_SUPPORT)
-        || (NULL != daemon->eready_urh_head)
+        || (NULL != daemon->eready_urh_head)
 #endif /* UPGRADE_SUPPORT && HTTPS_SUPPORT */
-        ) )
-    {
-         /* Some connection(s) already have some data pending. */
-      *timeout = 0;
-      return MHD_YES;
-    }
+       ) )
+  {
+    /* Some connection(s) already have some data pending. */
+    *timeout = 0;
+    return MHD_YES;
+  }
 #endif /* EPOLL_SUPPORT */
 
   have_timeout = false;
   earliest_deadline = 0; /* avoid compiler warnings */
   for (pos = daemon->manual_timeout_tail; NULL != pos; pos = pos->prevX)
+  {
+    if (0 != pos->connection_timeout)
     {
-      if (0 != pos->connection_timeout)
-       {
-         if ( (! have_timeout) ||
-              (earliest_deadline - pos->last_activity > 
pos->connection_timeout) )
-           earliest_deadline = pos->last_activity + pos->connection_timeout;
-         have_timeout = true;
-       }
+      if ( (! have_timeout) ||
+           (earliest_deadline - pos->last_activity > pos->connection_timeout) )
+        earliest_deadline = pos->last_activity + pos->connection_timeout;
+      have_timeout = true;
     }
+  }
   /* normal timeouts are sorted, so we only need to look at the 'tail' 
(oldest) */
   pos = daemon->normal_timeout_tail;
   if ( (NULL != pos) &&
        (0 != pos->connection_timeout) )
-    {
-      if ( (! have_timeout) ||
-          (earliest_deadline - pos->connection_timeout > pos->last_activity) )
-       earliest_deadline = pos->last_activity + pos->connection_timeout;
-      have_timeout = true;
-    }
+  {
+    if ( (! have_timeout) ||
+         (earliest_deadline - pos->connection_timeout > pos->last_activity) )
+      earliest_deadline = pos->last_activity + pos->connection_timeout;
+    have_timeout = true;
+  }
 
   if (! have_timeout)
     return MHD_NO;
-  now = MHD_monotonic_sec_counter();
+  now = MHD_monotonic_sec_counter ();
   if (earliest_deadline < now)
     *timeout = 0;
   else
-    {
-      const time_t second_left = earliest_deadline - now;
+  {
+    const time_t second_left = earliest_deadline - now;
 
-      if (((unsigned long long)second_left) > ULLONG_MAX / 1000)
-        *timeout = ULLONG_MAX;
-      else
-        *timeout = 1000LLU * (unsigned long long) second_left;
+    if (((unsigned long long) second_left) > ULLONG_MAX / 1000)
+      *timeout = ULLONG_MAX;
+    else
+      *timeout = 1000LLU * (unsigned long long) second_left;
   }
   return MHD_YES;
 }
@@ -3508,7 +3537,7 @@ internal_run_from_select (struct MHD_Daemon *daemon,
   /* Clear ITC to avoid spinning select */
   /* Do it before any other processing so new signals
      will trigger select again and will be processed */
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
                   read_fd_set)) )
     MHD_itc_clear_ (daemon->itc);
@@ -3521,49 +3550,49 @@ internal_run_from_select (struct MHD_Daemon *daemon,
     (void) MHD_accept_connection (daemon);
 
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+  {
+    /* do not have a thread per connection, process all connections now */
+    prev = daemon->connections_tail;
+    while (NULL != (pos = prev))
     {
-      /* do not have a thread per connection, process all connections now */
-      prev = daemon->connections_tail;
-      while (NULL != (pos = prev))
-        {
-         prev = pos->prev;
-          ds = pos->socket_fd;
-          if (MHD_INVALID_SOCKET == ds)
-           continue;
-          call_handlers (pos,
-                         FD_ISSET (ds,
-                                   read_fd_set),
-                         FD_ISSET (ds,
-                                   write_fd_set),
-                         FD_ISSET (ds,
-                                   except_fd_set));
-        }
+      prev = pos->prev;
+      ds = pos->socket_fd;
+      if (MHD_INVALID_SOCKET == ds)
+        continue;
+      call_handlers (pos,
+                     FD_ISSET (ds,
+                               read_fd_set),
+                     FD_ISSET (ds,
+                               write_fd_set),
+                     FD_ISSET (ds,
+                               except_fd_set));
     }
+  }
 
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   /* handle upgraded HTTPS connections */
   for (urh = daemon->urh_tail; NULL != urh; urh = urhn)
+  {
+    urhn = urh->prev;
+    /* update urh state based on select() output */
+    urh_from_fdset (urh,
+                    read_fd_set,
+                    write_fd_set,
+                    except_fd_set);
+    /* call generic forwarding function for passing data */
+    process_urh (urh);
+    /* Finished forwarding? */
+    if ( (0 == urh->in_buffer_size) &&
+         (0 == urh->out_buffer_size) &&
+         (0 == urh->in_buffer_used) &&
+         (0 == urh->out_buffer_used) )
     {
-      urhn = urh->prev;
-      /* update urh state based on select() output */
-      urh_from_fdset (urh,
-                      read_fd_set,
-                      write_fd_set,
-                      except_fd_set);
-      /* call generic forwarding function for passing data */
-      process_urh (urh);
-      /* Finished forwarding? */
-      if ( (0 == urh->in_buffer_size) &&
-           (0 == urh->out_buffer_size) &&
-           (0 == urh->in_buffer_used) &&
-           (0 == urh->out_buffer_used) )
-        {
-          MHD_connection_finish_forward_ (urh->connection);
-          urh->clean_ready = true;
-          /* Resuming will move connection to cleanup list. */
-          MHD_resume_connection(urh->connection);
-        }
+      MHD_connection_finish_forward_ (urh->connection);
+      urh->clean_ready = true;
+      /* Resuming will move connection to cleanup list. */
+      MHD_resume_connection (urh->connection);
     }
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   MHD_cleanup_connections (daemon);
   return MHD_YES;
@@ -3599,33 +3628,33 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
                      const fd_set *except_fd_set)
 {
   fd_set es;
-  if (0 != (daemon->options &
-        (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_POLL)) )
+  if (0 != (daemon->options
+            & (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_POLL)) )
     return MHD_NO;
-  if (NULL == read_fd_set || NULL == write_fd_set)
+  if ((NULL == read_fd_set)||(NULL == write_fd_set))
     return MHD_NO;
   if (NULL == except_fd_set)
-    { /* Workaround to maintain backward compatibility. */
+  {   /* Workaround to maintain backward compatibility. */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("MHD_run_from_select() called with except_fd_set "
-                  "set to NULL. Such behavior is deprecated.\n"));
+    MHD_DLOG (daemon,
+              _ ("MHD_run_from_select() called with except_fd_set "
+                 "set to NULL. Such behavior is deprecated.\n"));
 #endif
-      FD_ZERO (&es);
-      except_fd_set = &es;
-    }
+    FD_ZERO (&es);
+    except_fd_set = &es;
+  }
   if (0 != (daemon->options & MHD_USE_EPOLL))
-    {
+  {
 #ifdef EPOLL_SUPPORT
-      int ret = MHD_epoll (daemon,
-                          MHD_NO);
+    int ret = MHD_epoll (daemon,
+                         MHD_NO);
 
-      MHD_cleanup_connections (daemon);
-      return ret;
+    MHD_cleanup_connections (daemon);
+    return ret;
 #else  /* ! EPOLL_SUPPORT */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* ! EPOLL_SUPPORT */
-    }
+  }
 
   /* Resuming external connections when using an extern mainloop  */
   if (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
@@ -3648,7 +3677,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
  */
 static int
 MHD_select (struct MHD_Daemon *daemon,
-           int may_block)
+            int may_block)
 {
   int num_ready;
   fd_set rs;
@@ -3676,71 +3705,72 @@ MHD_select (struct MHD_Daemon *daemon,
     may_block = MHD_NO;
 
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+  {
+    /* single-threaded, go over everything */
+    if (MHD_NO ==
+        internal_get_fdset2 (daemon,
+                             &rs,
+                             &ws,
+                             &es,
+                             &maxsock,
+                             FD_SETSIZE))
     {
-      /* single-threaded, go over everything */
-      if (MHD_NO ==
-          internal_get_fdset2 (daemon,
-                               &rs,
-                               &ws,
-                               &es,
-                               &maxsock,
-                               FD_SETSIZE))
-        {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (daemon,
-                  _("Could not obtain daemon fdsets"));
+      MHD_DLOG (daemon,
+                _ ("Could not obtain daemon fdsets"));
 #endif
-          err_state = MHD_YES;
-        }
+      err_state = MHD_YES;
     }
+  }
   else
+  {
+    /* accept only, have one thread per connection */
+    if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
+         (! daemon->was_quiesced) &&
+         (! MHD_add_to_fd_set_ (ls,
+                                &rs,
+                                &maxsock,
+                                FD_SETSIZE)) )
     {
-      /* accept only, have one thread per connection */
-      if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
-           (! daemon->was_quiesced) &&
-           (! MHD_add_to_fd_set_ (ls,
-                                  &rs,
-                                  &maxsock,
-                                  FD_SETSIZE)) )
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Could not add listen socket to fdset"));
+      MHD_DLOG (daemon,
+                _ ("Could not add listen socket to fdset"));
 #endif
-          return MHD_NO;
-        }
+      return MHD_NO;
     }
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  }
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
                               &rs,
                               &maxsock,
                               FD_SETSIZE)) )
-    {
+  {
 #if defined(MHD_WINSOCK_SOCKETS)
-      /* fdset limit reached, new connections
-         cannot be handled. Remove listen socket FD
-         from fdset and retry to add ITC FD. */
-      if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
-           (! daemon->was_quiesced) )
-        {
-          FD_CLR (ls,
-                  &rs);
-          if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_(daemon->itc),
-                                    &rs,
-                                    &maxsock,
-                                    FD_SETSIZE))
-            {
+    /* fdset limit reached, new connections
+       cannot be handled. Remove listen socket FD
+       from fdset and retry to add ITC FD. */
+    if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
+         (! daemon->was_quiesced) )
+    {
+      FD_CLR (ls,
+              &rs);
+      if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
+                                &rs,
+                                &maxsock,
+                                FD_SETSIZE))
+      {
 #endif /* MHD_WINSOCK_SOCKETS */
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("Could not add control inter-thread communication 
channel FD to fdset"));
+    MHD_DLOG (daemon,
+              _ (
+                "Could not add control inter-thread communication channel FD 
to fdset"));
 #endif
-              err_state = MHD_YES;
+    err_state = MHD_YES;
 #if defined(MHD_WINSOCK_SOCKETS)
-            }
-        }
+  }
+}
 #endif /* MHD_WINSOCK_SOCKETS */
-    }
+  }
   /* Stop listening if we are at the configured connection limit */
   /* If we're at the connection limit, no point in really
      accepting new connections; however, make sure we do not miss
@@ -3748,33 +3778,33 @@ MHD_select (struct MHD_Daemon *daemon,
      only do this optimization if we have a signaling ITC in
      place. */
   if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
-       (MHD_ITC_IS_VALID_(daemon->itc)) &&
+       (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        ( (daemon->connections == daemon->connection_limit) ||
          (daemon->at_limit) ) )
-    {
-      FD_CLR (ls,
-              &rs);
-    }
+  {
+    FD_CLR (ls,
+            &rs);
+  }
   tv = NULL;
   if (MHD_YES == err_state)
     may_block = MHD_NO;
   if (MHD_NO == may_block)
-    {
-      timeout.tv_usec = 0;
-      timeout.tv_sec = 0;
-      tv = &timeout;
-    }
+  {
+    timeout.tv_usec = 0;
+    timeout.tv_sec = 0;
+    tv = &timeout;
+  }
   else if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
-           (MHD_YES == MHD_get_timeout (daemon, &ltimeout)) )
-    {
-      /* ltimeout is in ms */
-      timeout.tv_usec = (ltimeout % 1000) * 1000;
-      if (ltimeout / 1000 > TIMEVAL_TV_SEC_MAX)
-        timeout.tv_sec = TIMEVAL_TV_SEC_MAX;
-      else
-        timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE)(ltimeout / 1000);
-      tv = &timeout;
-    }
+            (MHD_YES == MHD_get_timeout (daemon, &ltimeout)) )
+  {
+    /* ltimeout is in ms */
+    timeout.tv_usec = (ltimeout % 1000) * 1000;
+    if (ltimeout / 1000 > TIMEVAL_TV_SEC_MAX)
+      timeout.tv_sec = TIMEVAL_TV_SEC_MAX;
+    else
+      timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) (ltimeout / 1000);
+    tv = &timeout;
+  }
   num_ready = MHD_SYS_select_ (maxsock + 1,
                                &rs,
                                &ws,
@@ -3783,17 +3813,17 @@ MHD_select (struct MHD_Daemon *daemon,
   if (daemon->shutdown)
     return MHD_NO;
   if (num_ready < 0)
-    {
-      const int err = MHD_socket_get_error_ ();
-      if (MHD_SCKT_ERR_IS_EINTR_(err))
-        return (MHD_NO == err_state) ? MHD_YES : MHD_NO;
+  {
+    const int err = MHD_socket_get_error_ ();
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return (MHD_NO == err_state) ? MHD_YES : MHD_NO;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("select failed: %s\n"),
-                MHD_socket_strerr_ (err));
+    MHD_DLOG (daemon,
+              _ ("select failed: %s\n"),
+              MHD_socket_strerr_ (err));
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
   if (MHD_YES == internal_run_from_select (daemon,
                                            &rs,
                                            &ws,
@@ -3814,7 +3844,7 @@ MHD_select (struct MHD_Daemon *daemon,
  */
 static int
 MHD_poll_all (struct MHD_Daemon *daemon,
-             int may_block)
+              int may_block)
 {
   unsigned int num_connections;
   struct MHD_Connection *pos;
@@ -3846,44 +3876,44 @@ MHD_poll_all (struct MHD_Daemon *daemon,
     struct pollfd *p;
     MHD_socket ls;
 
-    p = MHD_calloc_ ((2 + (size_t)num_connections),
+    p = MHD_calloc_ ((2 + (size_t) num_connections),
                      sizeof (struct pollfd));
     if (NULL == p)
-      {
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (daemon,
-                  _("Error allocating memory: %s\n"),
-                  MHD_strerror_(errno));
+      MHD_DLOG (daemon,
+                _ ("Error allocating memory: %s\n"),
+                MHD_strerror_ (errno));
 #endif
-        return MHD_NO;
-      }
+      return MHD_NO;
+    }
     poll_server = 0;
     poll_listen = -1;
     if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
          (! daemon->was_quiesced) &&
-        (daemon->connections < daemon->connection_limit) &&
+         (daemon->connections < daemon->connection_limit) &&
          (! daemon->at_limit) )
-      {
-       /* only listen if we are not at the connection limit */
-       p[poll_server].fd = ls;
-       p[poll_server].events = POLLIN;
-       p[poll_server].revents = 0;
-       poll_listen = (int) poll_server;
-       poll_server++;
-      }
+    {
+      /* only listen if we are not at the connection limit */
+      p[poll_server].fd = ls;
+      p[poll_server].events = POLLIN;
+      p[poll_server].revents = 0;
+      poll_listen = (int) poll_server;
+      poll_server++;
+    }
     poll_itc_idx = -1;
-    if (MHD_ITC_IS_VALID_(daemon->itc))
-      {
-       p[poll_server].fd = MHD_itc_r_fd_ (daemon->itc);
-       p[poll_server].events = POLLIN;
-       p[poll_server].revents = 0;
-        poll_itc_idx = (int) poll_server;
-       poll_server++;
-      }
+    if (MHD_ITC_IS_VALID_ (daemon->itc))
+    {
+      p[poll_server].fd = MHD_itc_r_fd_ (daemon->itc);
+      p[poll_server].events = POLLIN;
+      p[poll_server].revents = 0;
+      poll_itc_idx = (int) poll_server;
+      poll_server++;
+    }
     if (may_block == MHD_NO)
       timeout = 0;
     else if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) ||
-             (MHD_YES != MHD_get_timeout (daemon,
+              (MHD_YES != MHD_get_timeout (daemon,
                                            &ltimeout)) )
       timeout = -1;
     else
@@ -3891,55 +3921,55 @@ MHD_poll_all (struct MHD_Daemon *daemon,
 
     i = 0;
     for (pos = daemon->connections_tail; NULL != pos; pos = pos->prev)
+    {
+      p[poll_server + i].fd = pos->socket_fd;
+      switch (pos->event_loop_info)
       {
-       p[poll_server+i].fd = pos->socket_fd;
-       switch (pos->event_loop_info)
-         {
-         case MHD_EVENT_LOOP_INFO_READ:
-           p[poll_server+i].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
-           break;
-         case MHD_EVENT_LOOP_INFO_WRITE:
-           p[poll_server+i].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
-           break;
-         case MHD_EVENT_LOOP_INFO_BLOCK:
-           p[poll_server+i].events |=  MHD_POLL_EVENTS_ERR_DISC;
-           break;
-         case MHD_EVENT_LOOP_INFO_CLEANUP:
-           timeout = 0; /* clean up "pos" immediately */
-           break;
-         }
-       i++;
+      case MHD_EVENT_LOOP_INFO_READ:
+        p[poll_server + i].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_WRITE:
+        p[poll_server + i].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_BLOCK:
+        p[poll_server + i].events |=  MHD_POLL_EVENTS_ERR_DISC;
+        break;
+      case MHD_EVENT_LOOP_INFO_CLEANUP:
+        timeout = 0; /* clean up "pos" immediately */
+        break;
       }
+      i++;
+    }
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
     for (urh = daemon->urh_tail; NULL != urh; urh = urh->prev)
-      {
-        urh_to_pollfd(urh, &(p[poll_server+i]));
-        i += 2;
-      }
+    {
+      urh_to_pollfd (urh, &(p[poll_server + i]));
+      i += 2;
+    }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
     if (0 == poll_server + num_connections)
+    {
+      free (p);
+      return MHD_YES;
+    }
+    if (MHD_sys_poll_ (p,
+                       poll_server + num_connections,
+                       timeout) < 0)
+    {
+      const int err = MHD_socket_get_error_ ();
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
       {
-        free(p);
-        return MHD_YES;
-      }
-    if (MHD_sys_poll_(p,
-                      poll_server + num_connections,
-                      timeout) < 0)
-      {
-        const int err = MHD_socket_get_error_ ();
-       if (MHD_SCKT_ERR_IS_EINTR_ (err))
-      {
-        free(p);
+        free (p);
         return MHD_YES;
       }
 #ifdef HAVE_MESSAGES
-       MHD_DLOG (daemon,
-                 _("poll failed: %s\n"),
-                 MHD_socket_strerr_ (err));
+      MHD_DLOG (daemon,
+                _ ("poll failed: %s\n"),
+                MHD_socket_strerr_ (err));
 #endif
-        free(p);
-       return MHD_NO;
-      }
+      free (p);
+      return MHD_NO;
+    }
 
     /* Reset. New value will be set when connections are processed. */
     daemon->data_already_pending = false;
@@ -3953,67 +3983,68 @@ MHD_poll_all (struct MHD_Daemon *daemon,
 
     /* handle shutdown */
     if (daemon->shutdown)
-      {
-        free(p);
-        return MHD_NO;
-      }
+    {
+      free (p);
+      return MHD_NO;
+    }
     i = 0;
     prev = daemon->connections_tail;
     while (NULL != (pos = prev))
-      {
-       prev = pos->prev;
-        /* first, sanity checks */
-        if (i >= num_connections)
-          break; /* connection list changed somehow, retry later ... */
-        if (p[poll_server+i].fd != pos->socket_fd)
-          continue; /* fd mismatch, something else happened, retry later ... */
-        call_handlers (pos,
-                       0 != (p[poll_server+i].revents & POLLIN),
-                       0 != (p[poll_server+i].revents & POLLOUT),
-                       0 != (p[poll_server+i].revents & 
MHD_POLL_REVENTS_ERR_DISC));
-        i++;
-      }
+    {
+      prev = pos->prev;
+      /* first, sanity checks */
+      if (i >= num_connections)
+        break;   /* connection list changed somehow, retry later ... */
+      if (p[poll_server + i].fd != pos->socket_fd)
+        continue;   /* fd mismatch, something else happened, retry later ... */
+      call_handlers (pos,
+                     0 != (p[poll_server + i].revents & POLLIN),
+                     0 != (p[poll_server + i].revents & POLLOUT),
+                     0 != (p[poll_server + i].revents
+                           & MHD_POLL_REVENTS_ERR_DISC));
+      i++;
+    }
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
     for (urh = daemon->urh_tail; NULL != urh; urh = urhn)
+    {
+      if (i >= num_connections)
+        break;   /* connection list changed somehow, retry later ... */
+
+      /* Get next connection here as connection can be removed
+       * from 'daemon->urh_head' list. */
+      urhn = urh->prev;
+      /* Check for fd mismatch. FIXME: required for safety? */
+      if ((p[poll_server + i].fd != urh->connection->socket_fd) ||
+          (p[poll_server + i + 1].fd != urh->mhd.socket))
+        break;
+      urh_from_pollfd (urh,
+                       &p[poll_server + i]);
+      i += 2;
+      process_urh (urh);
+      /* Finished forwarding? */
+      if ( (0 == urh->in_buffer_size) &&
+           (0 == urh->out_buffer_size) &&
+           (0 == urh->in_buffer_used) &&
+           (0 == urh->out_buffer_used) )
       {
-        if (i >= num_connections)
-          break; /* connection list changed somehow, retry later ... */
-
-        /* Get next connection here as connection can be removed
-         * from 'daemon->urh_head' list. */
-        urhn = urh->prev;
-        /* Check for fd mismatch. FIXME: required for safety? */
-        if ((p[poll_server+i].fd != urh->connection->socket_fd) ||
-            (p[poll_server+i+1].fd != urh->mhd.socket))
-          break;
-        urh_from_pollfd (urh,
-                         &p[poll_server+i]);
-        i += 2;
-        process_urh (urh);
-        /* Finished forwarding? */
-        if ( (0 == urh->in_buffer_size) &&
-             (0 == urh->out_buffer_size) &&
-             (0 == urh->in_buffer_used) &&
-             (0 == urh->out_buffer_used) )
-          {
-            /* MHD_connection_finish_forward_() will remove connection from
-             * 'daemon->urh_head' list. */
-            MHD_connection_finish_forward_ (urh->connection);
-            urh->clean_ready = true;
-            /* If 'urh->was_closed' already was set to true, connection will be
-             * moved immediately to cleanup list. Otherwise connection
-             * will stay in suspended list until 'urh' will be marked
-             * with 'was_closed' by application. */
-            MHD_resume_connection(urh->connection);
-          }
+        /* MHD_connection_finish_forward_() will remove connection from
+         * 'daemon->urh_head' list. */
+        MHD_connection_finish_forward_ (urh->connection);
+        urh->clean_ready = true;
+        /* If 'urh->was_closed' already was set to true, connection will be
+         * moved immediately to cleanup list. Otherwise connection
+         * will stay in suspended list until 'urh' will be marked
+         * with 'was_closed' by application. */
+        MHD_resume_connection (urh->connection);
       }
+    }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
     /* handle 'listen' FD */
     if ( (-1 != poll_listen) &&
-        (0 != (p[poll_listen].revents & POLLIN)) )
+         (0 != (p[poll_listen].revents & POLLIN)) )
       (void) MHD_accept_connection (daemon);
 
-    free(p);
+    free (p);
   }
   return MHD_YES;
 }
@@ -4028,7 +4059,7 @@ MHD_poll_all (struct MHD_Daemon *daemon,
  */
 static int
 MHD_poll_listen_socket (struct MHD_Daemon *daemon,
-                       int may_block)
+                        int may_block)
 {
   struct pollfd p[2];
   int timeout;
@@ -4046,21 +4077,21 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
   if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
        (! daemon->was_quiesced) )
 
-    {
-      p[poll_count].fd = ls;
-      p[poll_count].events = POLLIN;
-      p[poll_count].revents = 0;
-      poll_listen = poll_count;
-      poll_count++;
-    }
-  if (MHD_ITC_IS_VALID_(daemon->itc))
-    {
-      p[poll_count].fd = MHD_itc_r_fd_ (daemon->itc);
-      p[poll_count].events = POLLIN;
-      p[poll_count].revents = 0;
-      poll_itc_idx = poll_count;
-      poll_count++;
-    }
+  {
+    p[poll_count].fd = ls;
+    p[poll_count].events = POLLIN;
+    p[poll_count].revents = 0;
+    poll_listen = poll_count;
+    poll_count++;
+  }
+  if (MHD_ITC_IS_VALID_ (daemon->itc))
+  {
+    p[poll_count].fd = MHD_itc_r_fd_ (daemon->itc);
+    p[poll_count].events = POLLIN;
+    p[poll_count].revents = 0;
+    poll_itc_idx = poll_count;
+    poll_count++;
+  }
 
   if (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
     (void) resume_suspended_connections (daemon);
@@ -4071,21 +4102,21 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
     timeout = -1;
   if (0 == poll_count)
     return MHD_YES;
-  if (MHD_sys_poll_(p,
-                    poll_count,
-                    timeout) < 0)
-    {
-      const int err = MHD_socket_get_error_ ();
+  if (MHD_sys_poll_ (p,
+                     poll_count,
+                     timeout) < 0)
+  {
+    const int err = MHD_socket_get_error_ ();
 
-      if (MHD_SCKT_ERR_IS_EINTR_ (err))
-       return MHD_YES;
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return MHD_YES;
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("poll failed: %s\n"),
-                MHD_socket_strerr_ (err));
+    MHD_DLOG (daemon,
+              _ ("poll failed: %s\n"),
+              MHD_socket_strerr_ (err));
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
   if ( (-1 != poll_itc_idx) &&
        (0 != (p[poll_itc_idx].revents & POLLIN)) )
     MHD_itc_clear_ (daemon->itc);
@@ -4110,7 +4141,7 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
  */
 static int
 MHD_poll (struct MHD_Daemon *daemon,
-         int may_block)
+          int may_block)
 {
 #ifdef HAVE_POLL
   if (daemon->shutdown)
@@ -4151,9 +4182,9 @@ MHD_poll (struct MHD_Daemon *daemon,
  *         'false' otherwise
  */
 static bool
-is_urh_ready(struct MHD_UpgradeResponseHandle * const urh)
+is_urh_ready (struct MHD_UpgradeResponseHandle *const urh)
 {
-  const struct MHD_Connection * const connection = urh->connection;
+  const struct MHD_Connection *const connection = urh->connection;
 
   if ( (0 == urh->in_buffer_size) &&
        (0 == urh->out_buffer_size) &&
@@ -4173,7 +4204,7 @@ is_urh_ready(struct MHD_UpgradeResponseHandle * const urh)
        (urh->out_buffer_used > 0) )
     return true;
   if ( (0 != (MHD_EPOLL_STATE_WRITE_READY & urh->mhd.celi)) &&
-         (urh->in_buffer_used > 0) )
+       (urh->in_buffer_used > 0) )
     return true;
   return false;
 }
@@ -4192,98 +4223,98 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon)
 {
   struct epoll_event events[MAX_EVENTS];
   int num_events;
-  struct MHD_UpgradeResponseHandle * pos;
-  struct MHD_UpgradeResponseHandle * prev;
+  struct MHD_UpgradeResponseHandle *pos;
+  struct MHD_UpgradeResponseHandle *prev;
 
   num_events = MAX_EVENTS;
   while (0 != num_events)
+  {
+    unsigned int i;
+    /* update event masks */
+    num_events = epoll_wait (daemon->epoll_upgrade_fd,
+                             events,
+                             MAX_EVENTS,
+                             0);
+    if (-1 == num_events)
     {
-      unsigned int i;
-      /* update event masks */
-      num_events = epoll_wait (daemon->epoll_upgrade_fd,
-                               events,
-                               MAX_EVENTS,
-                               0);
-      if (-1 == num_events)
-        {
-          const int err = MHD_socket_get_error_ ();
+      const int err = MHD_socket_get_error_ ();
 
-          if (MHD_SCKT_ERR_IS_EINTR_ (err))
-            return MHD_YES;
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
+        return MHD_YES;
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Call to epoll_wait failed: %s\n"),
-                    MHD_socket_strerr_ (err));
+      MHD_DLOG (daemon,
+                _ ("Call to epoll_wait failed: %s\n"),
+                MHD_socket_strerr_ (err));
 #endif
-          return MHD_NO;
-        }
-      for (i = 0; i < (unsigned int) num_events; i++)
-        {
-          struct UpgradeEpollHandle * const ueh = events[i].data.ptr;
-          struct MHD_UpgradeResponseHandle * const urh = ueh->urh;
-          bool new_err_state = false;
+      return MHD_NO;
+    }
+    for (i = 0; i < (unsigned int) num_events; i++)
+    {
+      struct UpgradeEpollHandle *const ueh = events[i].data.ptr;
+      struct MHD_UpgradeResponseHandle *const urh = ueh->urh;
+      bool new_err_state = false;
 
-          if (urh->clean_ready)
-            continue;
+      if (urh->clean_ready)
+        continue;
+
+      /* Update ueh state based on what is ready according to epoll() */
+      if (0 != (events[i].events & EPOLLIN))
+        ueh->celi |= MHD_EPOLL_STATE_READ_READY;
+      if (0 != (events[i].events & EPOLLOUT))
+        ueh->celi |= MHD_EPOLL_STATE_WRITE_READY;
+      if (0 != (events[i].events & EPOLLHUP))
+        ueh->celi |= MHD_EPOLL_STATE_READ_READY | MHD_EPOLL_STATE_WRITE_READY;
+
+      if ( (0 == (ueh->celi & MHD_EPOLL_STATE_ERROR)) &&
+           (0 != (events[i].events & (EPOLLERR | EPOLLPRI))) )
+      {
+        /* Process new error state only one time
+         * and avoid continuously marking this connection
+         * as 'ready'. */
+        ueh->celi |= MHD_EPOLL_STATE_ERROR;
+        new_err_state = true;
+      }
 
-          /* Update ueh state based on what is ready according to epoll() */
-          if (0 != (events[i].events & EPOLLIN))
-            ueh->celi |= MHD_EPOLL_STATE_READ_READY;
-          if (0 != (events[i].events & EPOLLOUT))
-            ueh->celi |= MHD_EPOLL_STATE_WRITE_READY;
-          if (0 != (events[i].events & EPOLLHUP))
-            ueh->celi |= MHD_EPOLL_STATE_READ_READY | 
MHD_EPOLL_STATE_WRITE_READY;
-
-          if ( (0 == (ueh->celi & MHD_EPOLL_STATE_ERROR)) &&
-               (0 != (events[i].events & (EPOLLERR | EPOLLPRI))) )
-            {
-              /* Process new error state only one time
-               * and avoid continuously marking this connection
-               * as 'ready'. */
-              ueh->celi |= MHD_EPOLL_STATE_ERROR;
-              new_err_state = true;
-            }
-
-          if (! urh->in_eready_list)
-            {
-              if (new_err_state ||
-                  is_urh_ready(urh))
-                {
-                  EDLL_insert (daemon->eready_urh_head,
-                               daemon->eready_urh_tail,
-                               urh);
-                  urh->in_eready_list = true;
-                }
-            }
+      if (! urh->in_eready_list)
+      {
+        if (new_err_state ||
+            is_urh_ready (urh))
+        {
+          EDLL_insert (daemon->eready_urh_head,
+                       daemon->eready_urh_tail,
+                       urh);
+          urh->in_eready_list = true;
         }
+      }
     }
+  }
   prev = daemon->eready_urh_tail;
   while (NULL != (pos = prev))
-    {
-      prev = pos->prevE;
-      process_urh (pos);
-      if (! is_urh_ready(pos))
-       {
-         EDLL_remove (daemon->eready_urh_head,
-                       daemon->eready_urh_tail,
-                       pos);
-         pos->in_eready_list = false;
-       }
-      /* Finished forwarding? */
-      if ( (0 == pos->in_buffer_size) &&
-           (0 == pos->out_buffer_size) &&
-           (0 == pos->in_buffer_used) &&
-           (0 == pos->out_buffer_used) )
-        {
-          MHD_connection_finish_forward_ (pos->connection);
-          pos->clean_ready = true;
-          /* If 'pos->was_closed' already was set to true, connection
-           * will be moved immediately to cleanup list. Otherwise
-           * connection will stay in suspended list until 'pos' will
-           * be marked with 'was_closed' by application. */
-          MHD_resume_connection (pos->connection);
-        }
+  {
+    prev = pos->prevE;
+    process_urh (pos);
+    if (! is_urh_ready (pos))
+    {
+      EDLL_remove (daemon->eready_urh_head,
+                   daemon->eready_urh_tail,
+                   pos);
+      pos->in_eready_list = false;
+    }
+    /* Finished forwarding? */
+    if ( (0 == pos->in_buffer_size) &&
+         (0 == pos->out_buffer_size) &&
+         (0 == pos->in_buffer_used) &&
+         (0 == pos->out_buffer_used) )
+    {
+      MHD_connection_finish_forward_ (pos->connection);
+      pos->clean_ready = true;
+      /* If 'pos->was_closed' already was set to true, connection
+       * will be moved immediately to cleanup list. Otherwise
+       * connection will stay in suspended list until 'pos' will
+       * be marked with 'was_closed' by application. */
+      MHD_resume_connection (pos->connection);
     }
+  }
 
   return MHD_YES;
 }
@@ -4293,7 +4324,7 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon)
 /**
  * Pointer-marker to distinguish ITC slot in epoll sets.
  */
-static const char * const epoll_itc_marker = "itc_marker";
+static const char *const epoll_itc_marker = "itc_marker";
 
 
 /**
@@ -4309,7 +4340,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
            int may_block)
 {
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-  static const char * const upgrade_marker = "upgrade_ptr";
+  static const char *const upgrade_marker = "upgrade_ptr";
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   struct MHD_Connection *pos;
   struct MHD_Connection *prev;
@@ -4333,89 +4364,89 @@ MHD_epoll (struct MHD_Daemon *daemon,
        (daemon->connections < daemon->connection_limit) &&
        (! daemon->listen_socket_in_epoll) &&
        (! daemon->at_limit) )
+  {
+    event.events = EPOLLIN;
+    event.data.ptr = daemon;
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_ADD,
+                        ls,
+                        &event))
     {
-      event.events = EPOLLIN;
-      event.data.ptr = daemon;
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                          EPOLL_CTL_ADD,
-                          ls,
-                          &event))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Call to epoll_ctl failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                _ ("Call to epoll_ctl failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-          return MHD_NO;
-        }
-      daemon->listen_socket_in_epoll = true;
+      return MHD_NO;
     }
+    daemon->listen_socket_in_epoll = true;
+  }
   if ( (daemon->was_quiesced) &&
        (daemon->listen_socket_in_epoll) )
-    {
-      if ( (0 != epoll_ctl (daemon->epoll_fd,
-                            EPOLL_CTL_DEL,
-                            ls,
-                            NULL)) &&
-           (ENOENT != errno) ) /* ENOENT can happen due to race with
+  {
+    if ( (0 != epoll_ctl (daemon->epoll_fd,
+                          EPOLL_CTL_DEL,
+                          ls,
+                          NULL)) &&
+         (ENOENT != errno) )   /* ENOENT can happen due to race with
                                   #MHD_quiesce_daemon() */
-        MHD_PANIC ("Failed to remove listen FD from epoll set\n");
-      daemon->listen_socket_in_epoll = false;
-    }
+      MHD_PANIC ("Failed to remove listen FD from epoll set\n");
+    daemon->listen_socket_in_epoll = false;
+  }
 
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   if ( ( (! daemon->upgrade_fd_in_epoll) &&
          (-1 != daemon->epoll_upgrade_fd) ) )
+  {
+    event.events = EPOLLIN | EPOLLOUT;
+    event.data.ptr = (void *) upgrade_marker;
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_ADD,
+                        daemon->epoll_upgrade_fd,
+                        &event))
     {
-      event.events = EPOLLIN | EPOLLOUT;
-      event.data.ptr = (void *) upgrade_marker;
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                          EPOLL_CTL_ADD,
-                          daemon->epoll_upgrade_fd,
-                          &event))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Call to epoll_ctl failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                _ ("Call to epoll_ctl failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-          return MHD_NO;
-        }
-      daemon->upgrade_fd_in_epoll = true;
+      return MHD_NO;
     }
+    daemon->upgrade_fd_in_epoll = true;
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   if ( (daemon->listen_socket_in_epoll) &&
        ( (daemon->connections == daemon->connection_limit) ||
          (daemon->at_limit) ||
          (daemon->was_quiesced) ) )
-    {
-      /* we're at the connection limit, disable listen socket
-        for event loop for now */
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                          EPOLL_CTL_DEL,
-                          ls,
-                          NULL))
-        MHD_PANIC (_("Failed to remove listen FD from epoll set\n"));
-      daemon->listen_socket_in_epoll = false;
-    }
+  {
+    /* we're at the connection limit, disable listen socket
+ for event loop for now */
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_DEL,
+                        ls,
+                        NULL))
+      MHD_PANIC (_ ("Failed to remove listen FD from epoll set\n"));
+    daemon->listen_socket_in_epoll = false;
+  }
 
   if ( (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME)) &&
        (MHD_YES == resume_suspended_connections (daemon)) )
     may_block = MHD_NO;
 
   if (MHD_YES == may_block)
+  {
+    if (MHD_YES == MHD_get_timeout (daemon,
+                                    &timeout_ll))
     {
-      if (MHD_YES == MHD_get_timeout (daemon,
-                                      &timeout_ll))
-        {
-          if (timeout_ll >= (MHD_UNSIGNED_LONG_LONG) INT_MAX)
-            timeout_ms = INT_MAX;
-          else
-            timeout_ms = (int) timeout_ll;
-        }
+      if (timeout_ll >= (MHD_UNSIGNED_LONG_LONG) INT_MAX)
+        timeout_ms = INT_MAX;
       else
-        timeout_ms = -1;
+        timeout_ms = (int) timeout_ll;
     }
+    else
+      timeout_ms = -1;
+  }
   else
     timeout_ms = 0;
 
@@ -4430,111 +4461,111 @@ MHD_epoll (struct MHD_Daemon *daemon,
      than unfair behavior... */
   num_events = MAX_EVENTS;
   while (MAX_EVENTS == num_events)
+  {
+    /* update event masks */
+    num_events = epoll_wait (daemon->epoll_fd,
+                             events,
+                             MAX_EVENTS,
+                             timeout_ms);
+    if (-1 == num_events)
     {
-      /* update event masks */
-      num_events = epoll_wait (daemon->epoll_fd,
-                               events,
-                               MAX_EVENTS,
-                               timeout_ms);
-      if (-1 == num_events)
-        {
-          const int err = MHD_socket_get_error_ ();
-          if (MHD_SCKT_ERR_IS_EINTR_ (err))
-            return MHD_YES;
+      const int err = MHD_socket_get_error_ ();
+      if (MHD_SCKT_ERR_IS_EINTR_ (err))
+        return MHD_YES;
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Call to epoll_wait failed: %s\n"),
-                    MHD_socket_strerr_ (err));
+      MHD_DLOG (daemon,
+                _ ("Call to epoll_wait failed: %s\n"),
+                MHD_socket_strerr_ (err));
 #endif
-          return MHD_NO;
-        }
-      for (i=0;i<(unsigned int) num_events;i++)
-        {
-          /* First, check for the values of `ptr` that would indicate
-             that this event is not about a normal connection. */
-          if (NULL == events[i].data.ptr)
-            continue; /* shutdown signal! */
+      return MHD_NO;
+    }
+    for (i = 0; i<(unsigned int) num_events; i++)
+    {
+      /* First, check for the values of `ptr` that would indicate
+         that this event is not about a normal connection. */
+      if (NULL == events[i].data.ptr)
+        continue;     /* shutdown signal! */
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-          if (upgrade_marker == events[i].data.ptr)
-            {
-              /* activity on an upgraded connection, we process
-                 those in a separate epoll() */
-              run_upgraded = true;
-              continue;
-            }
+      if (upgrade_marker == events[i].data.ptr)
+      {
+        /* activity on an upgraded connection, we process
+           those in a separate epoll() */
+        run_upgraded = true;
+        continue;
+      }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
-          if (epoll_itc_marker == events[i].data.ptr)
-            {
-              /* It's OK to clear ITC here as all external
-                 conditions will be processed later. */
-              MHD_itc_clear_ (daemon->itc);
-              continue;
-            }
-          if (daemon == events[i].data.ptr)
-            {
-              /* Check for error conditions on listen socket. */
-              /* FIXME: Initiate MHD_quiesce_daemon() to prevent busy waiting? 
*/
-              if (0 == (events[i].events & (EPOLLERR | EPOLLHUP)))
-                {
-                  unsigned int series_length = 0;
-                  /* Run 'accept' until it fails or daemon at limit of 
connections.
-                   * Do not accept more then 10 connections at once. The rest 
will
-                   * be accepted on next turn (level trigger is used for listen
-                   * socket). */
-                  while ( (MHD_YES == MHD_accept_connection (daemon)) &&
-                          (series_length < 10) &&
-                          (daemon->connections < daemon->connection_limit) &&
-                          (! daemon->at_limit) )
-                    series_length++;
-                }
-              continue;
-            }
-          /* this is an event relating to a 'normal' connection,
-             remember the event and if appropriate mark the
-             connection as 'eready'. */
-          pos = events[i].data.ptr;
-          /* normal processing: update read/write data */
-          if (0 != (events[i].events & (EPOLLPRI | EPOLLERR | EPOLLHUP)))
-            {
-              pos->epoll_state |= MHD_EPOLL_STATE_ERROR;
-              if (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
-                {
-                  EDLL_insert (daemon->eready_head,
-                               daemon->eready_tail,
-                               pos);
-                  pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
-                }
-            }
-          else
-            {
-              if (0 != (events[i].events & EPOLLIN))
-                {
-                  pos->epoll_state |= MHD_EPOLL_STATE_READ_READY;
-                  if ( ( (MHD_EVENT_LOOP_INFO_READ == pos->event_loop_info) ||
-                         (pos->read_buffer_size > pos->read_buffer_offset) ) &&
-                       (0 == (pos->epoll_state & 
MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
-                    {
-                      EDLL_insert (daemon->eready_head,
-                                   daemon->eready_tail,
-                                   pos);
-                      pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
-                    }
-                }
-              if (0 != (events[i].events & EPOLLOUT))
-                {
-                  pos->epoll_state |= MHD_EPOLL_STATE_WRITE_READY;
-                  if ( (MHD_EVENT_LOOP_INFO_WRITE == pos->event_loop_info) &&
-                       (0 == (pos->epoll_state & 
MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
-                    {
-                      EDLL_insert (daemon->eready_head,
-                                   daemon->eready_tail,
-                                   pos);
-                      pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
-                    }
-                }
-            }
+      if (epoll_itc_marker == events[i].data.ptr)
+      {
+        /* It's OK to clear ITC here as all external
+           conditions will be processed later. */
+        MHD_itc_clear_ (daemon->itc);
+        continue;
+      }
+      if (daemon == events[i].data.ptr)
+      {
+        /* Check for error conditions on listen socket. */
+        /* FIXME: Initiate MHD_quiesce_daemon() to prevent busy waiting? */
+        if (0 == (events[i].events & (EPOLLERR | EPOLLHUP)))
+        {
+          unsigned int series_length = 0;
+          /* Run 'accept' until it fails or daemon at limit of connections.
+           * Do not accept more then 10 connections at once. The rest will
+           * be accepted on next turn (level trigger is used for listen
+           * socket). */
+          while ( (MHD_YES == MHD_accept_connection (daemon)) &&
+                  (series_length < 10) &&
+                  (daemon->connections < daemon->connection_limit) &&
+                  (! daemon->at_limit) )
+            series_length++;
+        }
+        continue;
+      }
+      /* this is an event relating to a 'normal' connection,
+         remember the event and if appropriate mark the
+         connection as 'eready'. */
+      pos = events[i].data.ptr;
+      /* normal processing: update read/write data */
+      if (0 != (events[i].events & (EPOLLPRI | EPOLLERR | EPOLLHUP)))
+      {
+        pos->epoll_state |= MHD_EPOLL_STATE_ERROR;
+        if (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
+        {
+          EDLL_insert (daemon->eready_head,
+                       daemon->eready_tail,
+                       pos);
+          pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
+        }
+      }
+      else
+      {
+        if (0 != (events[i].events & EPOLLIN))
+        {
+          pos->epoll_state |= MHD_EPOLL_STATE_READ_READY;
+          if ( ( (MHD_EVENT_LOOP_INFO_READ == pos->event_loop_info) ||
+                 (pos->read_buffer_size > pos->read_buffer_offset) ) &&
+               (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
+          {
+            EDLL_insert (daemon->eready_head,
+                         daemon->eready_tail,
+                         pos);
+            pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
+          }
+        }
+        if (0 != (events[i].events & EPOLLOUT))
+        {
+          pos->epoll_state |= MHD_EPOLL_STATE_WRITE_READY;
+          if ( (MHD_EVENT_LOOP_INFO_WRITE == pos->event_loop_info) &&
+               (0 == (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) ) )
+          {
+            EDLL_insert (daemon->eready_head,
+                         daemon->eready_tail,
+                         pos);
+            pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
+          }
         }
+      }
     }
+  }
 
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   if (run_upgraded || (NULL != daemon->eready_urh_head))
@@ -4544,28 +4575,29 @@ MHD_epoll (struct MHD_Daemon *daemon,
   /* process events for connections */
   prev = daemon->eready_tail;
   while (NULL != (pos = prev))
-    {
-         prev = pos->prevE;
-      call_handlers (pos,
-                     0 != (pos->epoll_state & MHD_EPOLL_STATE_READ_READY),
-                     0 != (pos->epoll_state & MHD_EPOLL_STATE_WRITE_READY),
-                     0 != (pos->epoll_state & MHD_EPOLL_STATE_ERROR));
-      if (MHD_EPOLL_STATE_IN_EREADY_EDLL ==
-            (pos->epoll_state & (MHD_EPOLL_STATE_SUSPENDED | 
MHD_EPOLL_STATE_IN_EREADY_EDLL)))
-        {
-          if ( (MHD_EVENT_LOOP_INFO_READ == pos->event_loop_info &&
-                  0 == (pos->epoll_state & MHD_EPOLL_STATE_READ_READY) ) ||
-               (MHD_EVENT_LOOP_INFO_WRITE == pos->event_loop_info &&
-                 0 == (pos->epoll_state & MHD_EPOLL_STATE_WRITE_READY) ) ||
-               MHD_EVENT_LOOP_INFO_CLEANUP == pos->event_loop_info)
-            {
-              EDLL_remove (daemon->eready_head,
-                           daemon->eready_tail,
-                           pos);
-              pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
-            }
-        }
+  {
+    prev = pos->prevE;
+    call_handlers (pos,
+                   0 != (pos->epoll_state & MHD_EPOLL_STATE_READ_READY),
+                   0 != (pos->epoll_state & MHD_EPOLL_STATE_WRITE_READY),
+                   0 != (pos->epoll_state & MHD_EPOLL_STATE_ERROR));
+    if (MHD_EPOLL_STATE_IN_EREADY_EDLL ==
+        (pos->epoll_state & (MHD_EPOLL_STATE_SUSPENDED
+                             | MHD_EPOLL_STATE_IN_EREADY_EDLL)))
+    {
+      if ( ((MHD_EVENT_LOOP_INFO_READ == pos->event_loop_info) &&
+            (0 == (pos->epoll_state & MHD_EPOLL_STATE_READ_READY)) ) ||
+           ((MHD_EVENT_LOOP_INFO_WRITE == pos->event_loop_info) &&
+            (0 == (pos->epoll_state & MHD_EPOLL_STATE_WRITE_READY)) ) ||
+           (MHD_EVENT_LOOP_INFO_CLEANUP == pos->event_loop_info) )
+      {
+        EDLL_remove (daemon->eready_head,
+                     daemon->eready_tail,
+                     pos);
+        pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
+      }
     }
+  }
 
   /* Finally, handle timed-out connections; we need to do this here
      as the epoll mechanism won't call the 'MHD_connection_handle_idle()' on 
everything,
@@ -4577,22 +4609,22 @@ MHD_epoll (struct MHD_Daemon *daemon,
      do not bother to sort that (presumably very short) list. */
   prev = daemon->manual_timeout_tail;
   while (NULL != (pos = prev))
-    {
-      prev = pos->prevX;
-      MHD_connection_handle_idle (pos);
-    }
+  {
+    prev = pos->prevX;
+    MHD_connection_handle_idle (pos);
+  }
   /* Connections with the default timeout are sorted by prepending
      them to the head of the list whenever we touch the connection;
      thus it suffices to iterate from the tail until the first
      connection is NOT timed out */
   prev = daemon->normal_timeout_tail;
   while (NULL != (pos = prev))
-    {
-      prev = pos->prevX;
-      MHD_connection_handle_idle (pos);
-      if (MHD_CONNECTION_CLOSED != pos->state)
-       break; /* sorted by timeout, no need to visit the rest! */
-    }
+  {
+    prev = pos->prevX;
+    MHD_connection_handle_idle (pos);
+    if (MHD_CONNECTION_CLOSED != pos->state)
+      break; /* sorted by timeout, no need to visit the rest! */
+  }
   return MHD_YES;
 }
 #endif
@@ -4625,22 +4657,22 @@ MHD_run (struct MHD_Daemon *daemon)
        (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) )
     return MHD_NO;
   if (0 != (daemon->options & MHD_USE_POLL))
-    {
-      MHD_poll (daemon, MHD_NO);
-      MHD_cleanup_connections (daemon);
-    }
+  {
+    MHD_poll (daemon, MHD_NO);
+    MHD_cleanup_connections (daemon);
+  }
 #ifdef EPOLL_SUPPORT
   else if (0 != (daemon->options & MHD_USE_EPOLL))
-    {
-      MHD_epoll (daemon, MHD_NO);
-      MHD_cleanup_connections (daemon);
-    }
+  {
+    MHD_epoll (daemon, MHD_NO);
+    MHD_cleanup_connections (daemon);
+  }
 #endif
   else
-    {
-      MHD_select (daemon, MHD_NO);
-      /* MHD_select does MHD_cleanup_connections already */
-    }
+  {
+    MHD_select (daemon, MHD_NO);
+    /* MHD_select does MHD_cleanup_connections already */
+  }
   return MHD_YES;
 }
 
@@ -4659,10 +4691,10 @@ close_connection (struct MHD_Connection *pos)
   struct MHD_Daemon *daemon = pos->daemon;
 
   if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
-    {
-      MHD_connection_mark_closed_ (pos);
-      return; /* must let thread to do the rest */
-    }
+  {
+    MHD_connection_mark_closed_ (pos);
+    return;   /* must let thread to do the rest */
+  }
   MHD_connection_close_ (pos,
                          MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
@@ -4672,18 +4704,18 @@ close_connection (struct MHD_Connection *pos)
   mhd_assert (! pos->resuming);
   if (pos->connection_timeout == daemon->connection_timeout)
     XDLL_remove (daemon->normal_timeout_head,
-                daemon->normal_timeout_tail,
-                pos);
+                 daemon->normal_timeout_tail,
+                 pos);
   else
     XDLL_remove (daemon->manual_timeout_head,
-                daemon->manual_timeout_tail,
-                pos);
+                 daemon->manual_timeout_tail,
+                 pos);
   DLL_remove (daemon->connections_head,
-             daemon->connections_tail,
-             pos);
+              daemon->connections_tail,
+              pos);
   DLL_insert (daemon->cleanup_head,
-             daemon->cleanup_tail,
-             pos);
+              daemon->cleanup_tail,
+              pos);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
@@ -4703,19 +4735,19 @@ MHD_polling_thread (void *cls)
 {
   struct MHD_Daemon *daemon = cls;
 
-  MHD_thread_init_(&(daemon->pid));
+  MHD_thread_init_ (&(daemon->pid));
   while (! daemon->shutdown)
-    {
-      if (0 != (daemon->options & MHD_USE_POLL))
-       MHD_poll (daemon, MHD_YES);
+  {
+    if (0 != (daemon->options & MHD_USE_POLL))
+      MHD_poll (daemon, MHD_YES);
 #ifdef EPOLL_SUPPORT
-      else if (0 != (daemon->options & MHD_USE_EPOLL))
-       MHD_epoll (daemon, MHD_YES);
+    else if (0 != (daemon->options & MHD_USE_EPOLL))
+      MHD_epoll (daemon, MHD_YES);
 #endif
-      else
-       MHD_select (daemon, MHD_YES);
-      MHD_cleanup_connections (daemon);
-    }
+    else
+      MHD_select (daemon, MHD_YES);
+    MHD_cleanup_connections (daemon);
+  }
 
   /* Resume any pending for resume connections, join
    * all connection's threads (if any) and finally cleanup
@@ -4724,7 +4756,7 @@ MHD_polling_thread (void *cls)
     resume_suspended_connections (daemon);
   close_all_connections (daemon);
 
-  return (MHD_THRD_RTRN_TYPE_)0;
+  return (MHD_THRD_RTRN_TYPE_) 0;
 }
 #endif
 
@@ -4830,59 +4862,61 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
     return MHD_INVALID_SOCKET;
   if ( (0 == (daemon->options & (MHD_USE_ITC))) &&
        (0 != (daemon->options & (MHD_USE_INTERNAL_POLLING_THREAD))) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               "Using MHD_quiesce_daemon in this mode requires MHD_USE_ITC\n");
+    MHD_DLOG (daemon,
+              "Using MHD_quiesce_daemon in this mode requires MHD_USE_ITC\n");
 #endif
-      return MHD_INVALID_SOCKET;
-    }
+    return MHD_INVALID_SOCKET;
+  }
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   if (NULL != daemon->worker_pool)
     for (i = 0; i < daemon->worker_pool_size; i++)
-      {
-        daemon->worker_pool[i].was_quiesced = true;
+    {
+      daemon->worker_pool[i].was_quiesced = true;
 #ifdef EPOLL_SUPPORT
-        if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
-             (-1 != daemon->worker_pool[i].epoll_fd) &&
-             (daemon->worker_pool[i].listen_socket_in_epoll) )
-          {
-            if (0 != epoll_ctl (daemon->worker_pool[i].epoll_fd,
-                                EPOLL_CTL_DEL,
-                                ret,
-                                NULL))
-              MHD_PANIC (_("Failed to remove listen FD from epoll set\n"));
-            daemon->worker_pool[i].listen_socket_in_epoll = false;
-          }
-        else
+      if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
+           (-1 != daemon->worker_pool[i].epoll_fd) &&
+           (daemon->worker_pool[i].listen_socket_in_epoll) )
+      {
+        if (0 != epoll_ctl (daemon->worker_pool[i].epoll_fd,
+                            EPOLL_CTL_DEL,
+                            ret,
+                            NULL))
+          MHD_PANIC (_ ("Failed to remove listen FD from epoll set\n"));
+        daemon->worker_pool[i].listen_socket_in_epoll = false;
+      }
+      else
 #endif
-          if (MHD_ITC_IS_VALID_(daemon->worker_pool[i].itc))
-            {
-              if (! MHD_itc_activate_ (daemon->worker_pool[i].itc, "q"))
-                MHD_PANIC (_("Failed to signal quiesce via inter-thread 
communication channel"));
-            }
+      if (MHD_ITC_IS_VALID_ (daemon->worker_pool[i].itc))
+      {
+        if (! MHD_itc_activate_ (daemon->worker_pool[i].itc, "q"))
+          MHD_PANIC (_ (
+                       "Failed to signal quiesce via inter-thread 
communication channel"));
       }
+    }
 #endif
   daemon->was_quiesced = true;
 #ifdef EPOLL_SUPPORT
   if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
        (-1 != daemon->epoll_fd) &&
        (daemon->listen_socket_in_epoll) )
-    {
-      if ( (0 != epoll_ctl (daemon->epoll_fd,
-                            EPOLL_CTL_DEL,
-                            ret,
-                            NULL)) &&
-           (ENOENT != errno) ) /* ENOENT can happen due to race with
+  {
+    if ( (0 != epoll_ctl (daemon->epoll_fd,
+                          EPOLL_CTL_DEL,
+                          ret,
+                          NULL)) &&
+         (ENOENT != errno) )   /* ENOENT can happen due to race with
                                   #MHD_epoll() */
-        MHD_PANIC ("Failed to remove listen FD from epoll set\n");
-      daemon->listen_socket_in_epoll = false;
-    }
+      MHD_PANIC ("Failed to remove listen FD from epoll set\n");
+    daemon->listen_socket_in_epoll = false;
+  }
 #endif
-  if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
+  if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (! MHD_itc_activate_ (daemon->itc, "q")) )
-    MHD_PANIC (_("failed to signal quiesce via inter-thread communication 
channel"));
+    MHD_PANIC (_ (
+                 "failed to signal quiesce via inter-thread communication 
channel"));
   return ret;
 }
 
@@ -4924,8 +4958,8 @@ parse_options_va (struct MHD_Daemon *daemon,
  */
 static int
 parse_options (struct MHD_Daemon *daemon,
-              const struct sockaddr **servaddr,
-              ...)
+               const struct sockaddr **servaddr,
+               ...)
 {
   va_list ap;
   int ret;
@@ -4968,521 +5002,537 @@ parse_options_va (struct MHD_Daemon *daemon,
 #endif /* HTTPS_SUPPORT */
 
   while (MHD_OPTION_END != (opt = (enum MHD_OPTION) va_arg (ap, int)))
-    {
-      switch (opt)
-        {
-        case MHD_OPTION_CONNECTION_MEMORY_LIMIT:
-          daemon->pool_size = va_arg (ap,
-                                      size_t);
-          break;
-        case MHD_OPTION_CONNECTION_MEMORY_INCREMENT:
-          daemon->pool_increment= va_arg (ap,
-                                          size_t);
-          break;
-        case MHD_OPTION_CONNECTION_LIMIT:
-          daemon->connection_limit = va_arg (ap,
-                                             unsigned int);
-          break;
-        case MHD_OPTION_CONNECTION_TIMEOUT:
-          uv = va_arg (ap,
-                       unsigned int);
-          daemon->connection_timeout = (time_t)uv;
-          /* Next comparison could be always false on some platforms and whole 
branch will
-           * be optimized out on those platforms. On others it will be 
compiled into real
-           * check. */
-          if ( ( (MHD_TYPE_IS_SIGNED_(time_t)) &&
-                 (daemon->connection_timeout < 0) ) || /* Compiler may warn on 
some platforms, ignore warning. */
-               (uv != (unsigned int)daemon->connection_timeout) )
-            {
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("Warning: Too large timeout value, ignored.\n"));
-#endif
-              daemon->connection_timeout = 0;
-            }
-          break;
-        case MHD_OPTION_NOTIFY_COMPLETED:
-          daemon->notify_completed = va_arg (ap,
-                                             MHD_RequestCompletedCallback);
-          daemon->notify_completed_cls = va_arg (ap,
-                                                 void *);
-          break;
-        case MHD_OPTION_NOTIFY_CONNECTION:
-          daemon->notify_connection = va_arg (ap,
-                                              MHD_NotifyConnectionCallback);
-          daemon->notify_connection_cls = va_arg (ap,
-                                                  void *);
-          break;
-        case MHD_OPTION_PER_IP_CONNECTION_LIMIT:
-          daemon->per_ip_connection_limit = va_arg (ap,
-                                                    unsigned int);
-          break;
-        case MHD_OPTION_SOCK_ADDR:
-          *servaddr = va_arg (ap,
-                              const struct sockaddr *);
-          break;
-        case MHD_OPTION_URI_LOG_CALLBACK:
-          daemon->uri_log_callback = va_arg (ap,
-                                             LogCallback);
-          daemon->uri_log_callback_cls = va_arg (ap,
-                                                 void *);
-          break;
-#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-        case MHD_OPTION_THREAD_POOL_SIZE:
-          daemon->worker_pool_size = va_arg (ap,
-                                             unsigned int);
-          if (0 == daemon->worker_pool_size)
-            {
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("Warning: Zero size, specified for thread pool size, 
is ignored. "
-                          "Thread pool is not used.\n"));
-#endif
-            }
-          else if (1 == daemon->worker_pool_size)
-            {
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("Warning: \"1\", specified for thread pool size, is 
ignored. "
-                          "Thread pool is not used.\n"));
-#endif
-              daemon->worker_pool_size = 0;
-            }
-          /* Next comparison could be always false on some platforms and whole 
branch will
-           * be optimized out on those platforms. On others it will be 
compiled into real
-           * check. */
-          else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct 
MHD_Daemon))) /* Compiler may warn on some platforms, ignore warning. */
-           {
-#ifdef HAVE_MESSAGES
-             MHD_DLOG (daemon,
-                       _("Specified thread pool size (%u) too big\n"),
-                       daemon->worker_pool_size);
-#endif
-             return MHD_NO;
-           }
-         else
-           {
-             if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
-               {
-#ifdef HAVE_MESSAGES
-                 MHD_DLOG (daemon,
-                           _("MHD_OPTION_THREAD_POOL_SIZE option is specified 
but "
-                             "MHD_USE_INTERNAL_POLLING_THREAD flag is not 
specified.\n"));
-#endif
-                 return MHD_NO;
-               }
-             if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
-               {
-#ifdef HAVE_MESSAGES
-                 MHD_DLOG (daemon,
-                           _("Both MHD_OPTION_THREAD_POOL_SIZE option and "
-                             "MHD_USE_THREAD_PER_CONNECTION flag are 
specified.\n"));
-#endif
-                 return MHD_NO;
-               }
-           }
-          break;
-#endif
-#ifdef HTTPS_SUPPORT
-        case MHD_OPTION_HTTPS_MEM_KEY:
-          pstr = va_arg (ap,
-                         const char *);
-         if (0 != (daemon->options & MHD_USE_TLS))
-           daemon->https_mem_key = pstr;
-#ifdef HAVE_MESSAGES
-         else
-           MHD_DLOG (daemon,
-                     _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
-                     opt);
-#endif
-          break;
-        case MHD_OPTION_HTTPS_KEY_PASSWORD:
-          pstr = va_arg (ap,
-                         const char *);
-         if (0 != (daemon->options & MHD_USE_TLS))
-           daemon->https_key_password = pstr;
+  {
+    switch (opt)
+    {
+    case MHD_OPTION_CONNECTION_MEMORY_LIMIT:
+      daemon->pool_size = va_arg (ap,
+                                  size_t);
+      break;
+    case MHD_OPTION_CONNECTION_MEMORY_INCREMENT:
+      daemon->pool_increment = va_arg (ap,
+                                       size_t);
+      break;
+    case MHD_OPTION_CONNECTION_LIMIT:
+      daemon->connection_limit = va_arg (ap,
+                                         unsigned int);
+      break;
+    case MHD_OPTION_CONNECTION_TIMEOUT:
+      uv = va_arg (ap,
+                   unsigned int);
+      daemon->connection_timeout = (time_t) uv;
+      /* Next comparison could be always false on some platforms and whole 
branch will
+       * be optimized out on those platforms. On others it will be compiled 
into real
+       * check. */
+      if ( ( (MHD_TYPE_IS_SIGNED_ (time_t)) &&
+             (daemon->connection_timeout < 0) ) ||     /* Compiler may warn on 
some platforms, ignore warning. */
+           (uv != (unsigned int) daemon->connection_timeout) )
+      {
 #ifdef HAVE_MESSAGES
-         else
-           MHD_DLOG (daemon,
-                     _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
-                     opt);
+        MHD_DLOG (daemon,
+                  _ ("Warning: Too large timeout value, ignored.\n"));
 #endif
-          break;
-        case MHD_OPTION_HTTPS_MEM_CERT:
-          pstr = va_arg (ap,
-                         const char *);
-         if (0 != (daemon->options & MHD_USE_TLS))
-           daemon->https_mem_cert = pstr;
+        daemon->connection_timeout = 0;
+      }
+      break;
+    case MHD_OPTION_NOTIFY_COMPLETED:
+      daemon->notify_completed = va_arg (ap,
+                                         MHD_RequestCompletedCallback);
+      daemon->notify_completed_cls = va_arg (ap,
+                                             void *);
+      break;
+    case MHD_OPTION_NOTIFY_CONNECTION:
+      daemon->notify_connection = va_arg (ap,
+                                          MHD_NotifyConnectionCallback);
+      daemon->notify_connection_cls = va_arg (ap,
+                                              void *);
+      break;
+    case MHD_OPTION_PER_IP_CONNECTION_LIMIT:
+      daemon->per_ip_connection_limit = va_arg (ap,
+                                                unsigned int);
+      break;
+    case MHD_OPTION_SOCK_ADDR:
+      *servaddr = va_arg (ap,
+                          const struct sockaddr *);
+      break;
+    case MHD_OPTION_URI_LOG_CALLBACK:
+      daemon->uri_log_callback = va_arg (ap,
+                                         LogCallback);
+      daemon->uri_log_callback_cls = va_arg (ap,
+                                             void *);
+      break;
+#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
+    case MHD_OPTION_THREAD_POOL_SIZE:
+      daemon->worker_pool_size = va_arg (ap,
+                                         unsigned int);
+      if (0 == daemon->worker_pool_size)
+      {
 #ifdef HAVE_MESSAGES
-         else
-           MHD_DLOG (daemon,
-                     _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
-                     opt);
+        MHD_DLOG (daemon,
+                  _ (
+                    "Warning: Zero size, specified for thread pool size, is 
ignored. "
+                    "Thread pool is not used.\n"));
 #endif
-          break;
-        case MHD_OPTION_HTTPS_MEM_TRUST:
-          pstr = va_arg (ap,
-                         const char *);
-         if (0 != (daemon->options & MHD_USE_TLS))
-           daemon->https_mem_trust = pstr;
+      }
+      else if (1 == daemon->worker_pool_size)
+      {
 #ifdef HAVE_MESSAGES
-         else
-           MHD_DLOG (daemon,
-                     _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
-                     opt);
+        MHD_DLOG (daemon,
+                  _ (
+                    "Warning: \"1\", specified for thread pool size, is 
ignored. "
+                    "Thread pool is not used.\n"));
 #endif
-          break;
-       case MHD_OPTION_HTTPS_CRED_TYPE:
-         daemon->cred_type = (gnutls_credentials_type_t) va_arg (ap,
-                                                                  int);
-         break;
-        case MHD_OPTION_HTTPS_MEM_DHPARAMS:
-          pstr = va_arg (ap,
-                         const char *);
-          if (0 != (daemon->options & MHD_USE_TLS))
-            {
-              gnutls_datum_t dhpar;
-              size_t pstr_len;
-
-              if (gnutls_dh_params_init (&daemon->https_mem_dhparams) < 0)
-                {
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                            _("Error initializing DH parameters\n"));
-#endif
-                  return MHD_NO;
-                }
-              dhpar.data = (unsigned char *) pstr;
-              pstr_len = strlen (pstr);
-              if (UINT_MAX < pstr_len)
-                {
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                            _("Diffie-Hellman parameters string too long\n"));
-#endif
-                  return MHD_NO;
-                }
-              dhpar.size = (unsigned int) pstr_len;
-              if (gnutls_dh_params_import_pkcs3 (daemon->https_mem_dhparams,
-                                                 &dhpar,
-                                                 GNUTLS_X509_FMT_PEM) < 0)
-                {
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                            _("Bad Diffie-Hellman parameters format\n"));
-#endif
-                  gnutls_dh_params_deinit (daemon->https_mem_dhparams);
-                  return MHD_NO;
-                }
-              daemon->have_dhparams = true;
-            }
-#ifdef HAVE_MESSAGES
-          else
-              MHD_DLOG (daemon,
-                        _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS 
not set\n"),
-                        opt);
+        daemon->worker_pool_size = 0;
+      }
+      /* Next comparison could be always false on some platforms and whole 
branch will
+       * be optimized out on those platforms. On others it will be compiled 
into real
+       * check. */
+      else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct
+                                                               MHD_Daemon)))   
         /* Compiler may warn on some platforms, ignore warning. */
+      {
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (daemon,
+                  _ ("Specified thread pool size (%u) too big\n"),
+                  daemon->worker_pool_size);
 #endif
-          break;
-        case MHD_OPTION_HTTPS_PRIORITIES:
-          pstr = va_arg (ap,
-                         const char *);
-         if (0 != (daemon->options & MHD_USE_TLS))
-           {
-             gnutls_priority_deinit (daemon->priority_cache);
-             ret = gnutls_priority_init (&daemon->priority_cache,
-                                         pstr,
-                                         NULL);
-             if (GNUTLS_E_SUCCESS != ret)
-             {
-#ifdef HAVE_MESSAGES
-               MHD_DLOG (daemon,
-                         _("Setting priorities to `%s' failed: %s\n"),
-                         pstr,
-                         gnutls_strerror (ret));
-#endif
-               daemon->priority_cache = NULL;
-               return MHD_NO;
-             }
-           }
-#ifdef HAVE_MESSAGES
-          else
-              MHD_DLOG (daemon,
-                        _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS 
not set\n"),
-                        opt);
+        return MHD_NO;
+      }
+      else
+      {
+        if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
+        {
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (daemon,
+                    _ ("MHD_OPTION_THREAD_POOL_SIZE option is specified but "
+                       "MHD_USE_INTERNAL_POLLING_THREAD flag is not 
specified.\n"));
 #endif
-          break;
-        case MHD_OPTION_HTTPS_CERT_CALLBACK:
-#if GNUTLS_VERSION_MAJOR < 3
+          return MHD_NO;
+        }
+        if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+        {
 #ifdef HAVE_MESSAGES
           MHD_DLOG (daemon,
-                    _("MHD_OPTION_HTTPS_CERT_CALLBACK requires building MHD 
with GnuTLS >= 3.0\n"));
+                    _ ("Both MHD_OPTION_THREAD_POOL_SIZE option and "
+                       "MHD_USE_THREAD_PER_CONNECTION flag are specified.\n"));
 #endif
           return MHD_NO;
-#else
-          pgcrf = va_arg (ap,
-                          gnutls_certificate_retrieve_function2 *);
-          if (0 != (daemon->options & MHD_USE_TLS))
-            daemon->cert_callback = pgcrf;
-          else
+        }
+      }
+      break;
+#endif
+#ifdef HTTPS_SUPPORT
+    case MHD_OPTION_HTTPS_MEM_KEY:
+      pstr = va_arg (ap,
+                     const char *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+        daemon->https_mem_key = pstr;
+#ifdef HAVE_MESSAGES
+      else
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
+#endif
+      break;
+    case MHD_OPTION_HTTPS_KEY_PASSWORD:
+      pstr = va_arg (ap,
+                     const char *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+        daemon->https_key_password = pstr;
+#ifdef HAVE_MESSAGES
+      else
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
+#endif
+      break;
+    case MHD_OPTION_HTTPS_MEM_CERT:
+      pstr = va_arg (ap,
+                     const char *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+        daemon->https_mem_cert = pstr;
+#ifdef HAVE_MESSAGES
+      else
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
+#endif
+      break;
+    case MHD_OPTION_HTTPS_MEM_TRUST:
+      pstr = va_arg (ap,
+                     const char *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+        daemon->https_mem_trust = pstr;
+#ifdef HAVE_MESSAGES
+      else
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
+#endif
+      break;
+    case MHD_OPTION_HTTPS_CRED_TYPE:
+      daemon->cred_type = (gnutls_credentials_type_t) va_arg (ap,
+                                                              int);
+      break;
+    case MHD_OPTION_HTTPS_MEM_DHPARAMS:
+      pstr = va_arg (ap,
+                     const char *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+      {
+        gnutls_datum_t dhpar;
+        size_t pstr_len;
+
+        if (gnutls_dh_params_init (&daemon->https_mem_dhparams) < 0)
+        {
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS 
not set\n"),
-                        opt);
+          MHD_DLOG (daemon,
+                    _ ("Error initializing DH parameters\n"));
 #endif
-          break;
+          return MHD_NO;
+        }
+        dhpar.data = (unsigned char *) pstr;
+        pstr_len = strlen (pstr);
+        if (UINT_MAX < pstr_len)
+        {
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (daemon,
+                    _ ("Diffie-Hellman parameters string too long\n"));
 #endif
-        case MHD_OPTION_HTTPS_CERT_CALLBACK2:
-#if GNUTLS_VERSION_NUMBER < 0x030603
+          return MHD_NO;
+        }
+        dhpar.size = (unsigned int) pstr_len;
+        if (gnutls_dh_params_import_pkcs3 (daemon->https_mem_dhparams,
+                                           &dhpar,
+                                           GNUTLS_X509_FMT_PEM) < 0)
+        {
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (daemon,
+                    _ ("Bad Diffie-Hellman parameters format\n"));
+#endif
+          gnutls_dh_params_deinit (daemon->https_mem_dhparams);
+          return MHD_NO;
+        }
+        daemon->have_dhparams = true;
+      }
+#ifdef HAVE_MESSAGES
+      else
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
+#endif
+      break;
+    case MHD_OPTION_HTTPS_PRIORITIES:
+      pstr = va_arg (ap,
+                     const char *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+      {
+        gnutls_priority_deinit (daemon->priority_cache);
+        ret = gnutls_priority_init (&daemon->priority_cache,
+                                    pstr,
+                                    NULL);
+        if (GNUTLS_E_SUCCESS != ret)
+        {
 #ifdef HAVE_MESSAGES
           MHD_DLOG (daemon,
-                    _("MHD_OPTION_HTTPS_CERT_CALLBACK2 requires building MHD 
with GnuTLS >= 3.6.3\n"));
+                    _ ("Setting priorities to `%s' failed: %s\n"),
+                    pstr,
+                    gnutls_strerror (ret));
 #endif
+          daemon->priority_cache = NULL;
           return MHD_NO;
+        }
+      }
+#ifdef HAVE_MESSAGES
+      else
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
+#endif
+      break;
+    case MHD_OPTION_HTTPS_CERT_CALLBACK:
+#if GNUTLS_VERSION_MAJOR < 3
+#ifdef HAVE_MESSAGES
+      MHD_DLOG (daemon,
+                _ (
+                  "MHD_OPTION_HTTPS_CERT_CALLBACK requires building MHD with 
GnuTLS >= 3.0\n"));
+#endif
+      return MHD_NO;
+#else
+      pgcrf = va_arg (ap,
+                      gnutls_certificate_retrieve_function2 *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+        daemon->cert_callback = pgcrf;
+      else
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
+#endif
+        break;
+#endif
+    case MHD_OPTION_HTTPS_CERT_CALLBACK2:
+#if GNUTLS_VERSION_NUMBER < 0x030603
+#ifdef HAVE_MESSAGES
+      MHD_DLOG (daemon,
+                _ (
+                  "MHD_OPTION_HTTPS_CERT_CALLBACK2 requires building MHD with 
GnuTLS >= 3.6.3\n"));
+#endif
+      return MHD_NO;
 #else
-          pgcrf2 = va_arg (ap,
-                          gnutls_certificate_retrieve_function3 *);
-          if (0 != (daemon->options & MHD_USE_TLS))
-            daemon->cert_callback2 = pgcrf2;
-          else
+      pgcrf2 = va_arg (ap,
+                       gnutls_certificate_retrieve_function3 *);
+      if (0 != (daemon->options & MHD_USE_TLS))
+        daemon->cert_callback2 = pgcrf2;
+      else
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("MHD HTTPS option %d passed to MHD but MHD_USE_TLS 
not set\n"),
-                        opt);
+        MHD_DLOG (daemon,
+                  _ (
+                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set\n"),
+                  opt);
 #endif
-          break;
+        break;
 #endif
 #endif /* HTTPS_SUPPORT */
 #ifdef DAUTH_SUPPORT
-       case MHD_OPTION_DIGEST_AUTH_RANDOM:
-         daemon->digest_auth_rand_size = va_arg (ap,
-                                                  size_t);
-         daemon->digest_auth_random = va_arg (ap,
-                                               const char *);
-         break;
-       case MHD_OPTION_NONCE_NC_SIZE:
-         daemon->nonce_nc_size = va_arg (ap,
-                                          unsigned int);
-         break;
-#endif
-       case MHD_OPTION_LISTEN_SOCKET:
-          if (0 != (daemon->options & MHD_USE_NO_LISTEN_SOCKET))
-            {
-#ifdef HAVE_MESSAGES
-                MHD_DLOG (daemon,
-                          _("MHD_OPTION_LISTEN_SOCKET specified for daemon "
-                            "with MHD_USE_NO_LISTEN_SOCKET flag set.\n"));
-#endif
-                return MHD_NO;
-            }
-          else
-            daemon->listen_fd = va_arg (ap,
-                                        MHD_socket);
-         break;
-        case MHD_OPTION_EXTERNAL_LOGGER:
+    case MHD_OPTION_DIGEST_AUTH_RANDOM:
+      daemon->digest_auth_rand_size = va_arg (ap,
+                                              size_t);
+      daemon->digest_auth_random = va_arg (ap,
+                                           const char *);
+      break;
+    case MHD_OPTION_NONCE_NC_SIZE:
+      daemon->nonce_nc_size = va_arg (ap,
+                                      unsigned int);
+      break;
+#endif
+    case MHD_OPTION_LISTEN_SOCKET:
+      if (0 != (daemon->options & MHD_USE_NO_LISTEN_SOCKET))
+      {
 #ifdef HAVE_MESSAGES
-          daemon->custom_error_log = va_arg (ap,
-                                             VfprintfFunctionPointerType);
-          daemon->custom_error_log_cls = va_arg (ap,
-                                                 void *);
+        MHD_DLOG (daemon,
+                  _ ("MHD_OPTION_LISTEN_SOCKET specified for daemon "
+                     "with MHD_USE_NO_LISTEN_SOCKET flag set.\n"));
+#endif
+        return MHD_NO;
+      }
+      else
+        daemon->listen_fd = va_arg (ap,
+                                    MHD_socket);
+      break;
+    case MHD_OPTION_EXTERNAL_LOGGER:
+#ifdef HAVE_MESSAGES
+      daemon->custom_error_log = va_arg (ap,
+                                         VfprintfFunctionPointerType);
+      daemon->custom_error_log_cls = va_arg (ap,
+                                             void *);
 #else
-          va_arg (ap,
-                  VfprintfFunctionPointerType);
-          va_arg (ap,
-                  void *);
+      va_arg (ap,
+              VfprintfFunctionPointerType);
+      va_arg (ap,
+              void *);
 #endif
-          break;
+      break;
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-        case MHD_OPTION_THREAD_STACK_SIZE:
-          daemon->thread_stack_size = va_arg (ap,
-                                              size_t);
-          break;
+    case MHD_OPTION_THREAD_STACK_SIZE:
+      daemon->thread_stack_size = va_arg (ap,
+                                          size_t);
+      break;
 #endif
-        case MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE:
+    case MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE:
 #ifdef TCP_FASTOPEN
-          daemon->fastopen_queue_size = va_arg (ap,
-                                                unsigned int);
-          break;
+      daemon->fastopen_queue_size = va_arg (ap,
+                                            unsigned int);
+      break;
 #else  /* ! TCP_FASTOPEN */
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("TCP fastopen is not supported on this platform\n"));
-          return MHD_NO;
+      MHD_DLOG (daemon,
+                _ ("TCP fastopen is not supported on this platform\n"));
+      return MHD_NO;
 #endif /* HAVE_MESSAGES */
 #endif /* ! TCP_FASTOPEN */
-       case MHD_OPTION_LISTENING_ADDRESS_REUSE:
-         daemon->listening_address_reuse = va_arg (ap,
-                                                    unsigned int) ? 1 : -1;
-         break;
-       case MHD_OPTION_LISTEN_BACKLOG_SIZE:
-         daemon->listen_backlog_size = va_arg (ap,
-                                                unsigned int);
-         break;
-       case MHD_OPTION_STRICT_FOR_CLIENT:
-          daemon->strict_for_client = va_arg (ap, int);
-#ifdef HAVE_MESSAGES
-         if ( (0 != (daemon->options & MHD_USE_PEDANTIC_CHECKS)) &&
-              (1 != daemon->strict_for_client) )
-            {
-              MHD_DLOG (daemon,
-                        _("Flag MHD_USE_PEDANTIC_CHECKS is ignored because "
-                          "another behavior is specified by 
MHD_OPTION_STRICT_CLIENT.\n"));
-            }
+    case MHD_OPTION_LISTENING_ADDRESS_REUSE:
+      daemon->listening_address_reuse = va_arg (ap,
+                                                unsigned int) ? 1 : -1;
+      break;
+    case MHD_OPTION_LISTEN_BACKLOG_SIZE:
+      daemon->listen_backlog_size = va_arg (ap,
+                                            unsigned int);
+      break;
+    case MHD_OPTION_STRICT_FOR_CLIENT:
+      daemon->strict_for_client = va_arg (ap, int);
+#ifdef HAVE_MESSAGES
+      if ( (0 != (daemon->options & MHD_USE_PEDANTIC_CHECKS)) &&
+           (1 != daemon->strict_for_client) )
+      {
+        MHD_DLOG (daemon,
+                  _ ("Flag MHD_USE_PEDANTIC_CHECKS is ignored because "
+                     "another behavior is specified by 
MHD_OPTION_STRICT_CLIENT.\n"));
+      }
 #endif /* HAVE_MESSAGES */
-         break;
-       case MHD_OPTION_ARRAY:
-         oa = va_arg (ap, struct MHD_OptionItem*);
-         i = 0;
-         while (MHD_OPTION_END != (opt = oa[i].option))
-           {
-             switch (opt)
-               {
-                 /* all options taking 'size_t' */
-               case MHD_OPTION_CONNECTION_MEMORY_LIMIT:
-               case MHD_OPTION_CONNECTION_MEMORY_INCREMENT:
-               case MHD_OPTION_THREAD_STACK_SIZE:
-                 if (MHD_YES != parse_options (daemon,
-                                               servaddr,
-                                               opt,
-                                               (size_t) oa[i].value,
-                                               MHD_OPTION_END))
-                   return MHD_NO;
-                 break;
-                 /* all options taking 'unsigned int' */
-               case MHD_OPTION_NONCE_NC_SIZE:
-               case MHD_OPTION_CONNECTION_LIMIT:
-               case MHD_OPTION_CONNECTION_TIMEOUT:
-               case MHD_OPTION_PER_IP_CONNECTION_LIMIT:
-               case MHD_OPTION_THREAD_POOL_SIZE:
-                case MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE:
-               case MHD_OPTION_LISTENING_ADDRESS_REUSE:
-               case MHD_OPTION_LISTEN_BACKLOG_SIZE:
-                 if (MHD_YES != parse_options (daemon,
-                                               servaddr,
-                                               opt,
-                                               (unsigned int) oa[i].value,
-                                               MHD_OPTION_END))
-                   return MHD_NO;
-                 break;
-                 /* all options taking 'enum' */
+      break;
+    case MHD_OPTION_ARRAY:
+      oa = va_arg (ap, struct MHD_OptionItem*);
+      i = 0;
+      while (MHD_OPTION_END != (opt = oa[i].option))
+      {
+        switch (opt)
+        {
+        /* all options taking 'size_t' */
+        case MHD_OPTION_CONNECTION_MEMORY_LIMIT:
+        case MHD_OPTION_CONNECTION_MEMORY_INCREMENT:
+        case MHD_OPTION_THREAD_STACK_SIZE:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        (size_t) oa[i].value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
+          break;
+        /* all options taking 'unsigned int' */
+        case MHD_OPTION_NONCE_NC_SIZE:
+        case MHD_OPTION_CONNECTION_LIMIT:
+        case MHD_OPTION_CONNECTION_TIMEOUT:
+        case MHD_OPTION_PER_IP_CONNECTION_LIMIT:
+        case MHD_OPTION_THREAD_POOL_SIZE:
+        case MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE:
+        case MHD_OPTION_LISTENING_ADDRESS_REUSE:
+        case MHD_OPTION_LISTEN_BACKLOG_SIZE:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        (unsigned int) oa[i].value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
+          break;
+          /* all options taking 'enum' */
 #ifdef HTTPS_SUPPORT
-               case MHD_OPTION_HTTPS_CRED_TYPE:
-                 if (MHD_YES != parse_options (daemon,
-                                               servaddr,
-                                               opt,
-                                               (gnutls_credentials_type_t) 
oa[i].value,
-                                               MHD_OPTION_END))
-                   return MHD_NO;
-                 break;
+        case MHD_OPTION_HTTPS_CRED_TYPE:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        (gnutls_credentials_type_t) 
oa[i].value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
+          break;
 #endif /* HTTPS_SUPPORT */
-                  /* all options taking 'MHD_socket' */
-                case MHD_OPTION_LISTEN_SOCKET:
-                  if (MHD_YES != parse_options (daemon,
-                                                servaddr,
-                                                opt,
-                                                (MHD_socket) oa[i].value,
-                                                MHD_OPTION_END))
-                    return MHD_NO;
-                  break;
-                  /* all options taking 'int' */
-                case MHD_OPTION_STRICT_FOR_CLIENT:
-                  if (MHD_YES != parse_options (daemon,
-                                                servaddr,
-                                                opt,
-                                                (int) oa[i].value,
-                                                MHD_OPTION_END))
-                    return MHD_NO;
-                  break;
-                 /* all options taking one pointer */
-               case MHD_OPTION_SOCK_ADDR:
-               case MHD_OPTION_HTTPS_MEM_KEY:
-               case MHD_OPTION_HTTPS_KEY_PASSWORD:
-               case MHD_OPTION_HTTPS_MEM_CERT:
-               case MHD_OPTION_HTTPS_MEM_TRUST:
-               case MHD_OPTION_HTTPS_MEM_DHPARAMS:
-               case MHD_OPTION_HTTPS_PRIORITIES:
-               case MHD_OPTION_ARRAY:
-                case MHD_OPTION_HTTPS_CERT_CALLBACK:
-                case MHD_OPTION_HTTPS_CERT_CALLBACK2:
-                 if (MHD_YES != parse_options (daemon,
-                                               servaddr,
-                                               opt,
-                                               oa[i].ptr_value,
-                                               MHD_OPTION_END))
-                   return MHD_NO;
-                 break;
-                 /* all options taking two pointers */
-               case MHD_OPTION_NOTIFY_COMPLETED:
-               case MHD_OPTION_NOTIFY_CONNECTION:
-               case MHD_OPTION_URI_LOG_CALLBACK:
-               case MHD_OPTION_EXTERNAL_LOGGER:
-               case MHD_OPTION_UNESCAPE_CALLBACK:
-               case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER:
-                 if (MHD_YES != parse_options (daemon,
-                                               servaddr,
-                                               opt,
-                                               (void *) oa[i].value,
-                                               oa[i].ptr_value,
-                                               MHD_OPTION_END))
-                   return MHD_NO;
-                 break;
-                 /* options taking size_t-number followed by pointer */
-               case MHD_OPTION_DIGEST_AUTH_RANDOM:
-                 if (MHD_YES != parse_options (daemon,
-                                               servaddr,
-                                               opt,
-                                               (size_t) oa[i].value,
-                                               oa[i].ptr_value,
-                                               MHD_OPTION_END))
-                   return MHD_NO;
-                 break;
-               default:
-                 return MHD_NO;
-               }
-             i++;
-           }
-         break;
+        /* all options taking 'MHD_socket' */
+        case MHD_OPTION_LISTEN_SOCKET:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        (MHD_socket) oa[i].value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
+          break;
+        /* all options taking 'int' */
+        case MHD_OPTION_STRICT_FOR_CLIENT:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        (int) oa[i].value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
+          break;
+        /* all options taking one pointer */
+        case MHD_OPTION_SOCK_ADDR:
+        case MHD_OPTION_HTTPS_MEM_KEY:
+        case MHD_OPTION_HTTPS_KEY_PASSWORD:
+        case MHD_OPTION_HTTPS_MEM_CERT:
+        case MHD_OPTION_HTTPS_MEM_TRUST:
+        case MHD_OPTION_HTTPS_MEM_DHPARAMS:
+        case MHD_OPTION_HTTPS_PRIORITIES:
+        case MHD_OPTION_ARRAY:
+        case MHD_OPTION_HTTPS_CERT_CALLBACK:
+        case MHD_OPTION_HTTPS_CERT_CALLBACK2:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        oa[i].ptr_value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
+          break;
+        /* all options taking two pointers */
+        case MHD_OPTION_NOTIFY_COMPLETED:
+        case MHD_OPTION_NOTIFY_CONNECTION:
+        case MHD_OPTION_URI_LOG_CALLBACK:
+        case MHD_OPTION_EXTERNAL_LOGGER:
         case MHD_OPTION_UNESCAPE_CALLBACK:
-          daemon->unescape_callback = va_arg (ap,
-                                              UnescapeCallback);
-          daemon->unescape_callback_cls = va_arg (ap,
-                                                  void *);
+        case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        (void *) oa[i].value,
+                                        oa[i].ptr_value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
           break;
+        /* options taking size_t-number followed by pointer */
+        case MHD_OPTION_DIGEST_AUTH_RANDOM:
+          if (MHD_YES != parse_options (daemon,
+                                        servaddr,
+                                        opt,
+                                        (size_t) oa[i].value,
+                                        oa[i].ptr_value,
+                                        MHD_OPTION_END))
+            return MHD_NO;
+          break;
+        default:
+          return MHD_NO;
+        }
+        i++;
+      }
+      break;
+    case MHD_OPTION_UNESCAPE_CALLBACK:
+      daemon->unescape_callback = va_arg (ap,
+                                          UnescapeCallback);
+      daemon->unescape_callback_cls = va_arg (ap,
+                                              void *);
+      break;
 #ifdef HTTPS_SUPPORT
-        case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER:
+    case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER:
 #if GNUTLS_VERSION_MAJOR >= 3
-          daemon->cred_callback = va_arg (ap,
-                                          MHD_PskServerCredentialsCallback);
-         daemon->cred_callback_cls = va_arg (ap,
-                                             void *);
-          break;
+      daemon->cred_callback = va_arg (ap,
+                                      MHD_PskServerCredentialsCallback);
+      daemon->cred_callback_cls = va_arg (ap,
+                                          void *);
+      break;
 #else
-          MHD_DLOG (daemon,
-                    _("MHD HTTPS option %d passed to MHD compiled without 
GNUtls >= 3\n"),
-                    opt);
-          return MHD_NO;
+      MHD_DLOG (daemon,
+                _ (
+                  "MHD HTTPS option %d passed to MHD compiled without GNUtls 
>= 3\n"),
+                opt);
+      return MHD_NO;
 #endif
 #endif /* HTTPS_SUPPORT */
-        default:
+    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);
-            }
-#endif
-         return MHD_NO;
-        }
+      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);
+      }
+#endif
+      return MHD_NO;
     }
+  }
   return MHD_YES;
 }
 
@@ -5494,7 +5544,7 @@ setup_epoll_fd (struct MHD_Daemon *daemon)
   int fd;
 
 #ifndef HAVE_MESSAGES
-  (void)daemon; /* Mute compiler warning. */
+  (void) daemon; /* Mute compiler warning. */
 #endif /* ! HAVE_MESSAGES */
 
 #ifdef USE_EPOLL_CREATE1
@@ -5503,22 +5553,22 @@ setup_epoll_fd (struct MHD_Daemon *daemon)
   fd = epoll_create (MAX_EVENTS);
 #endif /* ! USE_EPOLL_CREATE1 */
   if (MHD_INVALID_SOCKET == fd)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Call to epoll_create1 failed: %s\n"),
-                MHD_socket_last_strerr_ ());
+    MHD_DLOG (daemon,
+              _ ("Call to epoll_create1 failed: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      return MHD_INVALID_SOCKET;
-    }
-#if !defined(USE_EPOLL_CREATE1)
+    return MHD_INVALID_SOCKET;
+  }
+#if ! defined(USE_EPOLL_CREATE1)
   if (! MHD_socket_noninheritable_ (fd))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to set noninheritable mode on epoll FD.\n"));
+    MHD_DLOG (daemon,
+              _ ("Failed to set noninheritable mode on epoll FD.\n"));
 #endif
-    }
+  }
 #endif /* ! USE_EPOLL_CREATE1 */
   return fd;
 }
@@ -5544,11 +5594,11 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
     return MHD_NO;
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   if (0 != (MHD_ALLOW_UPGRADE & daemon->options))
-    {
-       daemon->epoll_upgrade_fd = setup_epoll_fd (daemon);
-       if (MHD_INVALID_SOCKET == daemon->epoll_upgrade_fd)
-         return MHD_NO;
-    }
+  {
+    daemon->epoll_upgrade_fd = setup_epoll_fd (daemon);
+    if (MHD_INVALID_SOCKET == daemon->epoll_upgrade_fd)
+      return MHD_NO;
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   if ( (MHD_INVALID_SOCKET == (ls = daemon->listen_fd)) ||
        (daemon->was_quiesced) )
@@ -5556,35 +5606,35 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
   event.events = EPOLLIN;
   event.data.ptr = daemon;
   if (0 != epoll_ctl (daemon->epoll_fd,
-                     EPOLL_CTL_ADD,
-                     ls,
-                     &event))
-    {
+                      EPOLL_CTL_ADD,
+                      ls,
+                      &event))
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Call to epoll_ctl failed: %s\n"),
-                MHD_socket_last_strerr_ ());
+    MHD_DLOG (daemon,
+              _ ("Call to epoll_ctl failed: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
   daemon->listen_socket_in_epoll = true;
-  if (MHD_ITC_IS_VALID_(daemon->itc))
+  if (MHD_ITC_IS_VALID_ (daemon->itc))
+  {
+    event.events = EPOLLIN;
+    event.data.ptr = (void *) epoll_itc_marker;
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_ADD,
+                        MHD_itc_r_fd_ (daemon->itc),
+                        &event))
     {
-      event.events = EPOLLIN;
-      event.data.ptr = (void *) epoll_itc_marker;
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                          EPOLL_CTL_ADD,
-                          MHD_itc_r_fd_ (daemon->itc),
-                          &event))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Call to epoll_ctl failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                _ ("Call to epoll_ctl failed: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-          return MHD_NO;
-        }
+      return MHD_NO;
     }
+  }
   return MHD_YES;
 }
 #endif
@@ -5618,7 +5668,7 @@ MHD_start_daemon_va (unsigned int flags,
                      void *apc_cls,
                      MHD_AccessHandlerCallback dh,
                      void *dh_cls,
-                    va_list ap)
+                     va_list ap)
 {
   const MHD_SCKT_OPT_BOOL_ on = 1;
   struct MHD_Daemon *daemon;
@@ -5635,7 +5685,7 @@ MHD_start_daemon_va (unsigned int flags,
   enum MHD_FLAG eflags; /* same type as in MHD_Daemon */
   enum MHD_FLAG *pflags;
 
-  MHD_check_global_init_();
+  MHD_check_global_init_ ();
   eflags = (enum MHD_FLAG) flags;
   pflags = &eflags;
 #ifndef HAVE_INET6
@@ -5659,56 +5709,61 @@ MHD_start_daemon_va (unsigned int flags,
     return NULL;
 #endif
   if (0 != (*pflags & MHD_ALLOW_UPGRADE))
-    {
+  {
 #ifdef UPGRADE_SUPPORT
-      *pflags |= MHD_ALLOW_SUSPEND_RESUME;
+    *pflags |= MHD_ALLOW_SUSPEND_RESUME;
 #else  /* ! UPGRADE_SUPPORT */
-      return NULL;
+    return NULL;
 #endif /* ! UPGRADE_SUPPORT */
-    }
+  }
   if (NULL == dh)
     return NULL;
 
   /* Check for invalid combinations of flags. */
   if ( ((0 != (*pflags & MHD_USE_POLL)) && (0 != (*pflags & MHD_USE_EPOLL))) ||
-       ((0 != (*pflags & MHD_USE_EPOLL)) && (0 != (*pflags & 
MHD_USE_THREAD_PER_CONNECTION))) ||
+       ((0 != (*pflags & MHD_USE_EPOLL)) && (0 != (*pflags
+                                                   &
+                                                   
MHD_USE_THREAD_PER_CONNECTION)))
+       ||
        ((0 != (*pflags & MHD_USE_POLL)) &&
-           (0 == (*pflags & (MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_THREAD_PER_CONNECTION)))) ||
-       ((0 != (*pflags & MHD_USE_AUTO)) && (0 != (*pflags & (MHD_USE_POLL | 
MHD_USE_EPOLL)))) )
+        (0 == (*pflags & (MHD_USE_INTERNAL_POLLING_THREAD
+                          | MHD_USE_THREAD_PER_CONNECTION)))) ||
+       ((0 != (*pflags & MHD_USE_AUTO)) && (0 != (*pflags & (MHD_USE_POLL
+                                                             | 
MHD_USE_EPOLL)))) )
     return NULL;
 
   if (0 != (*pflags & MHD_USE_AUTO))
+  {
+    if (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION))
     {
-      if (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION))
-        {
-          /* Thread per connection with internal polling thread. */
+      /* Thread per connection with internal polling thread. */
 #ifdef HAVE_POLL
-          *pflags |= MHD_USE_POLL;
+      *pflags |= MHD_USE_POLL;
 #else  /* ! HAVE_POLL */
-          /* use select() - do not modify flags */
+       /* use select() - do not modify flags */
 #endif /* ! HAVE_POLL */
-        }
-      else if (0 != (*pflags & MHD_USE_INTERNAL_POLLING_THREAD))
-        {
-          /* Internal polling thread. */
+    }
+    else if (0 != (*pflags & MHD_USE_INTERNAL_POLLING_THREAD))
+    {
+      /* Internal polling thread. */
 #if defined(EPOLL_SUPPORT)
-          *pflags |= MHD_USE_EPOLL;
+      *pflags |= MHD_USE_EPOLL;
 #elif defined(HAVE_POLL)
-          *pflags |= MHD_USE_POLL;
+      *pflags |= MHD_USE_POLL;
 #else  /* !HAVE_POLL && !EPOLL_SUPPORT */
-          /* use select() - do not modify flags */
+       /* use select() - do not modify flags */
 #endif /* !HAVE_POLL && !EPOLL_SUPPORT */
-        }
-      else
-        {
-          /* Internal threads are not used - "external" polling mode. */
+    }
+    else
+    {
+      /* Internal threads are not used - "external" polling mode. */
 #if defined(EPOLL_SUPPORT)
-          *pflags |= MHD_USE_EPOLL;
+      *pflags |= MHD_USE_EPOLL;
 #else  /* ! EPOLL_SUPPORT */
-          /* use select() - do not modify flags */
+       /* use select() - do not modify flags */
 #endif /* ! EPOLL_SUPPORT */
-        }
     }
+  }
 
   if (NULL == (daemon = MHD_calloc_ (1, sizeof (struct MHD_Daemon))))
     return NULL;
@@ -5722,17 +5777,18 @@ MHD_start_daemon_va (unsigned int flags,
 #ifdef HTTPS_SUPPORT
   daemon->priority_cache = NULL;
   if (0 != (*pflags & MHD_USE_TLS))
-    {
-      gnutls_priority_init (&daemon->priority_cache,
-                           "NORMAL",
-                           NULL);
-    }
+  {
+    gnutls_priority_init (&daemon->priority_cache,
+                          "NORMAL",
+                          NULL);
+  }
 #endif /* HTTPS_SUPPORT */
   daemon->listen_fd = MHD_INVALID_SOCKET;
   daemon->listening_address_reuse = 0;
   daemon->options = *pflags;
   pflags = &daemon->options;
-  daemon->strict_for_client = (0 != (*pflags & MHD_USE_PEDANTIC_CHECKS)) ? 1 : 
0;
+  daemon->strict_for_client = (0 != (*pflags & MHD_USE_PEDANTIC_CHECKS)) ? 1 :
+                              0;
   daemon->port = port;
   daemon->apc = apc;
   daemon->apc_cls = apc_cls;
@@ -5756,24 +5812,25 @@ MHD_start_daemon_va (unsigned int flags,
 #endif
   if ( (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION)) &&
        (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD)) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Warning: MHD_USE_THREAD_PER_CONNECTION must be used only 
with "
-                  "MHD_USE_INTERNAL_POLLING_THREAD. Flag 
MHD_USE_INTERNAL_POLLING_THREAD "
-                   "was added. Consider setting 
MHD_USE_INTERNAL_POLLING_THREAD explicitly.\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "Warning: MHD_USE_THREAD_PER_CONNECTION must be used only with 
"
+                "MHD_USE_INTERNAL_POLLING_THREAD. Flag 
MHD_USE_INTERNAL_POLLING_THREAD "
+                "was added. Consider setting MHD_USE_INTERNAL_POLLING_THREAD 
explicitly.\n"));
 #endif
-      *pflags |= MHD_USE_INTERNAL_POLLING_THREAD;
-    }
+    *pflags |= MHD_USE_INTERNAL_POLLING_THREAD;
+  }
   if (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD))
     *pflags &= ~MHD_USE_ITC; /* useless if we are using 'external' select */
   else
-    {
+  {
 #ifdef HAVE_LISTEN_SHUTDOWN
-      if (0 != (*pflags & MHD_USE_NO_LISTEN_SOCKET))
+    if (0 != (*pflags & MHD_USE_NO_LISTEN_SOCKET))
 #endif
-        *pflags |= MHD_USE_ITC; /* yes, must use ITC to signal thread */
-    }
+    *pflags |= MHD_USE_ITC;     /* yes, must use ITC to signal thread */
+  }
 #ifdef DAUTH_SUPPORT
   daemon->digest_auth_rand_size = 0;
   daemon->digest_auth_random = NULL;
@@ -5781,24 +5838,24 @@ MHD_start_daemon_va (unsigned int flags,
 #endif
 #ifdef HTTPS_SUPPORT
   if (0 != (*pflags & MHD_USE_TLS))
-    {
-      daemon->cred_type = GNUTLS_CRD_CERTIFICATE;
-    }
+  {
+    daemon->cred_type = GNUTLS_CRD_CERTIFICATE;
+  }
 #endif /* HTTPS_SUPPORT */
 
 
   if (MHD_YES != parse_options_va (daemon,
                                    &servaddr,
                                    ap))
-    {
+  {
 #ifdef HTTPS_SUPPORT
-      if ( (0 != (*pflags & MHD_USE_TLS)) &&
-          (NULL != daemon->priority_cache) )
-       gnutls_priority_deinit (daemon->priority_cache);
+    if ( (0 != (*pflags & MHD_USE_TLS)) &&
+         (NULL != daemon->priority_cache) )
+      gnutls_priority_deinit (daemon->priority_cache);
 #endif /* HTTPS_SUPPORT */
-      free (daemon);
-      return NULL;
-    }
+    free (daemon);
+    return NULL;
+  }
 
   if ( (NULL != daemon->notify_completed) &&
        (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) )
@@ -5807,7 +5864,7 @@ MHD_start_daemon_va (unsigned int flags,
 #ifndef NDEBUG
 #ifdef HAVE_MESSAGES
   MHD_DLOG (daemon,
-           _("Using debug build of libmicrohttpd.\n") );
+            _ ("Using debug build of libmicrohttpd.\n") );
 #endif /* HAVE_MESSAGES */
 #endif /* ! NDEBUG */
 
@@ -5816,466 +5873,471 @@ MHD_start_daemon_va (unsigned int flags,
        && (0 == daemon->worker_pool_size)
 #endif
        )
+  {
+    if (! MHD_itc_init_ (daemon->itc))
     {
-      if (! MHD_itc_init_ (daemon->itc))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Failed to create inter-thread communication channel: 
%s\n"),
-                    MHD_itc_last_strerror_ ());
+      MHD_DLOG (daemon,
+                _ ("Failed to create inter-thread communication channel: 
%s\n"),
+                MHD_itc_last_strerror_ ());
 #endif
 #ifdef HTTPS_SUPPORT
-          if (NULL != daemon->priority_cache)
-            gnutls_priority_deinit (daemon->priority_cache);
+      if (NULL != daemon->priority_cache)
+        gnutls_priority_deinit (daemon->priority_cache);
 #endif /* HTTPS_SUPPORT */
-          free (daemon);
-          return NULL;
-        }
-      if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
-           (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc),
-                                      NULL)) )
-        {
+      free (daemon);
+      return NULL;
+    }
+    if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
+         (! MHD_SCKT_FD_FITS_FDSET_ (MHD_itc_r_fd_ (daemon->itc),
+                                     NULL)) )
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("file descriptor for inter-thread communication channel 
exceeds maximum value\n"));
+      MHD_DLOG (daemon,
+                _ (
+                  "file descriptor for inter-thread communication channel 
exceeds maximum value\n"));
 #endif
-          MHD_itc_destroy_chk_ (daemon->itc);
+      MHD_itc_destroy_chk_ (daemon->itc);
 #ifdef HTTPS_SUPPORT
-          if (NULL != daemon->priority_cache)
-            gnutls_priority_deinit (daemon->priority_cache);
+      if (NULL != daemon->priority_cache)
+        gnutls_priority_deinit (daemon->priority_cache);
 #endif /* HTTPS_SUPPORT */
-          free (daemon);
-          return NULL;
-        }
+      free (daemon);
+      return NULL;
     }
+  }
 
 #ifdef DAUTH_SUPPORT
   if (daemon->nonce_nc_size > 0)
+  {
+    if ( ( (size_t) (daemon->nonce_nc_size * sizeof (struct MHD_NonceNc)))
+         / sizeof(struct MHD_NonceNc) != daemon->nonce_nc_size)
     {
-      if ( ( (size_t) (daemon->nonce_nc_size * sizeof (struct MHD_NonceNc))) /
-          sizeof(struct MHD_NonceNc) != daemon->nonce_nc_size)
-       {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   _("Specified value for NC_SIZE too large\n"));
+      MHD_DLOG (daemon,
+                _ ("Specified value for NC_SIZE too large\n"));
 #endif
 #ifdef HTTPS_SUPPORT
-         if (0 != (*pflags & MHD_USE_TLS))
-           gnutls_priority_deinit (daemon->priority_cache);
+      if (0 != (*pflags & MHD_USE_TLS))
+        gnutls_priority_deinit (daemon->priority_cache);
 #endif /* HTTPS_SUPPORT */
-         free (daemon);
-         return NULL;
-       }
-      daemon->nnc = malloc (daemon->nonce_nc_size * sizeof (struct 
MHD_NonceNc));
-      if (NULL == daemon->nnc)
-       {
+      free (daemon);
+      return NULL;
+    }
+    daemon->nnc = malloc (daemon->nonce_nc_size * sizeof (struct MHD_NonceNc));
+    if (NULL == daemon->nnc)
+    {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   _("Failed to allocate memory for nonce-nc map: %s\n"),
-                   MHD_strerror_ (errno));
+      MHD_DLOG (daemon,
+                _ ("Failed to allocate memory for nonce-nc map: %s\n"),
+                MHD_strerror_ (errno));
 #endif
 #ifdef HTTPS_SUPPORT
-         if (0 != (*pflags & MHD_USE_TLS))
-           gnutls_priority_deinit (daemon->priority_cache);
+      if (0 != (*pflags & MHD_USE_TLS))
+        gnutls_priority_deinit (daemon->priority_cache);
 #endif /* HTTPS_SUPPORT */
-         free (daemon);
-         return NULL;
-       }
+      free (daemon);
+      return NULL;
     }
+  }
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   if (! MHD_mutex_init_ (&daemon->nnc_lock))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("MHD failed to initialize nonce-nc mutex\n"));
+    MHD_DLOG (daemon,
+              _ ("MHD failed to initialize nonce-nc mutex\n"));
 #endif
 #ifdef HTTPS_SUPPORT
-      if (0 != (*pflags & MHD_USE_TLS))
-       gnutls_priority_deinit (daemon->priority_cache);
+    if (0 != (*pflags & MHD_USE_TLS))
+      gnutls_priority_deinit (daemon->priority_cache);
 #endif /* HTTPS_SUPPORT */
-      free (daemon->nnc);
-      free (daemon);
-      return NULL;
-    }
+    free (daemon->nnc);
+    free (daemon);
+    return NULL;
+  }
 #endif
 #endif
 
   /* Thread pooling currently works only with internal select thread mode */
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   if ( (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD)) &&
-        (daemon->worker_pool_size > 0) )
-    {
+       (daemon->worker_pool_size > 0) )
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("MHD thread pooling only works with 
MHD_USE_INTERNAL_POLLING_THREAD\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "MHD thread pooling only works with 
MHD_USE_INTERNAL_POLLING_THREAD\n"));
 #endif
-      goto free_and_fail;
-    }
+    goto free_and_fail;
+  }
 #endif
   if ( (MHD_INVALID_SOCKET == daemon->listen_fd) &&
        (0 == (*pflags & MHD_USE_NO_LISTEN_SOCKET)) )
-    {
-      /* try to open listen socket */
-      int domain;
+  {
+    /* try to open listen socket */
+    int domain;
 
 #ifdef HAVE_INET6
-      domain = (*pflags & MHD_USE_IPv6) ? PF_INET6 : PF_INET;
+    domain = (*pflags & MHD_USE_IPv6) ? PF_INET6 : PF_INET;
 #else  /* ! HAVE_INET6 */
-      if (*pflags & MHD_USE_IPv6)
-       goto free_and_fail;
-      domain = PF_INET;
+    if (*pflags & MHD_USE_IPv6)
+      goto free_and_fail;
+    domain = PF_INET;
 #endif /* ! HAVE_INET6 */
 
-      listen_fd = MHD_socket_create_listen_(domain);
-      if (MHD_INVALID_SOCKET == listen_fd)
-       {
+    listen_fd = MHD_socket_create_listen_ (domain);
+    if (MHD_INVALID_SOCKET == listen_fd)
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Failed to create socket for listening: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                _ ("Failed to create socket for listening: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-         goto free_and_fail;
-       }
+      goto free_and_fail;
+    }
 
-      /* Apply the socket options according to listening_address_reuse. */
-      if (0 == daemon->listening_address_reuse)
-        {
+    /* Apply the socket options according to listening_address_reuse. */
+    if (0 == daemon->listening_address_reuse)
+    {
 #ifndef MHD_WINSOCK_SOCKETS
-          /* No user requirement, use "traditional" default SO_REUSEADDR
-           * on non-W32 platforms, and do not fail if it doesn't work.
-           * Don't use it on W32, because on W32 it will allow multiple
-           * bind to the same address:port, like SO_REUSEPORT on others. */
-          if (0 > setsockopt (listen_fd,
-                              SOL_SOCKET,
-                              SO_REUSEADDR,
-                              (void*)&on, sizeof (on)))
-          {
+      /* No user requirement, use "traditional" default SO_REUSEADDR
+       * on non-W32 platforms, and do not fail if it doesn't work.
+       * Don't use it on W32, because on W32 it will allow multiple
+       * bind to the same address:port, like SO_REUSEPORT on others. */
+      if (0 > setsockopt (listen_fd,
+                          SOL_SOCKET,
+                          SO_REUSEADDR,
+                          (void*) &on, sizeof (on)))
+      {
 #ifdef HAVE_MESSAGES
-            MHD_DLOG (daemon,
-                      _("setsockopt failed: %s\n"),
-                      MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  _ ("setsockopt failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-          }
+      }
 #endif /* ! MHD_WINSOCK_SOCKETS */
-        }
-      else if (daemon->listening_address_reuse > 0)
-        {
-          /* User requested to allow reusing listening address:port. */
+    }
+    else if (daemon->listening_address_reuse > 0)
+    {
+      /* User requested to allow reusing listening address:port. */
 #ifndef MHD_WINSOCK_SOCKETS
-          /* Use SO_REUSEADDR on non-W32 platforms, and do not fail if
-           * it doesn't work. */
-          if (0 > setsockopt (listen_fd,
-                              SOL_SOCKET,
-                              SO_REUSEADDR,
-                              (void*)&on, sizeof (on)))
-            {
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("setsockopt failed: %s\n"),
-                        MHD_socket_last_strerr_ ());
-#endif
-            }
+      /* Use SO_REUSEADDR on non-W32 platforms, and do not fail if
+       * it doesn't work. */
+      if (0 > setsockopt (listen_fd,
+                          SOL_SOCKET,
+                          SO_REUSEADDR,
+                          (void*) &on, sizeof (on)))
+      {
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (daemon,
+                  _ ("setsockopt failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
+#endif
+      }
 #endif /* ! MHD_WINSOCK_SOCKETS */
-          /* Use SO_REUSEADDR on Windows and SO_REUSEPORT on most platforms.
-           * Fail if SO_REUSEPORT is not defined or setsockopt fails.
-           */
-          /* SO_REUSEADDR on W32 has the same semantics
-             as SO_REUSEPORT on BSD/Linux */
+       /* Use SO_REUSEADDR on Windows and SO_REUSEPORT on most platforms.
+        * Fail if SO_REUSEPORT is not defined or setsockopt fails.
+        */
+       /* SO_REUSEADDR on W32 has the same semantics
+          as SO_REUSEPORT on BSD/Linux */
 #if defined(MHD_WINSOCK_SOCKETS) || defined(SO_REUSEPORT)
-          if (0 > setsockopt (listen_fd,
-                              SOL_SOCKET,
+      if (0 > setsockopt (listen_fd,
+                          SOL_SOCKET,
 #ifndef MHD_WINSOCK_SOCKETS
-                              SO_REUSEPORT,
+                          SO_REUSEPORT,
 #else  /* MHD_WINSOCK_SOCKETS */
-                              SO_REUSEADDR,
+                          SO_REUSEADDR,
 #endif /* MHD_WINSOCK_SOCKETS */
-                              (void *) &on,
-                              sizeof (on)))
-            {
+                          (void *) &on,
+                          sizeof (on)))
+      {
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("setsockopt failed: %s\n"),
-                        MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  _ ("setsockopt failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-              goto free_and_fail;
-            }
+        goto free_and_fail;
+      }
 #else  /* !MHD_WINSOCK_SOCKETS && !SO_REUSEPORT */
-          /* we're supposed to allow address:port re-use, but
-             on this platform we cannot; fail hard */
+       /* we're supposed to allow address:port re-use, but
+          on this platform we cannot; fail hard */
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Cannot allow listening address reuse: SO_REUSEPORT not 
defined\n"));
+      MHD_DLOG (daemon,
+                _ (
+                  "Cannot allow listening address reuse: SO_REUSEPORT not 
defined\n"));
 #endif
-          goto free_and_fail;
+      goto free_and_fail;
 #endif /* !MHD_WINSOCK_SOCKETS && !SO_REUSEPORT */
-        }
-      else /* if (daemon->listening_address_reuse < 0) */
-        {
-          /* User requested to disallow reusing listening address:port.
-           * Do nothing except for Windows where SO_EXCLUSIVEADDRUSE
-           * is used and Solaris with SO_EXCLBIND.
-           * Fail if MHD was compiled for W32 without SO_EXCLUSIVEADDRUSE
-           * or setsockopt fails.
-           */
+    }
+    else   /* if (daemon->listening_address_reuse < 0) */
+    {
+      /* User requested to disallow reusing listening address:port.
+       * Do nothing except for Windows where SO_EXCLUSIVEADDRUSE
+       * is used and Solaris with SO_EXCLBIND.
+       * Fail if MHD was compiled for W32 without SO_EXCLUSIVEADDRUSE
+       * or setsockopt fails.
+       */
 #if (defined(MHD_WINSOCK_SOCKETS) && defined(SO_EXCLUSIVEADDRUSE)) || \
-    (defined(__sun) && defined(SO_EXCLBIND))
-          if (0 > setsockopt (listen_fd,
-                              SOL_SOCKET,
+      (defined(__sun) && defined(SO_EXCLBIND))
+      if (0 > setsockopt (listen_fd,
+                          SOL_SOCKET,
 #ifdef SO_EXCLUSIVEADDRUSE
-                              SO_EXCLUSIVEADDRUSE,
+                          SO_EXCLUSIVEADDRUSE,
 #else  /* SO_EXCLBIND */
-                              SO_EXCLBIND,
+                          SO_EXCLBIND,
 #endif /* SO_EXCLBIND */
-                              (void *) &on,
-                              sizeof (on)))
-            {
+                          (void *) &on,
+                          sizeof (on)))
+      {
 #ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("setsockopt failed: %s\n"),
-                        MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  _ ("setsockopt failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-              goto free_and_fail;
-            }
+        goto free_and_fail;
+      }
 #elif defined(MHD_WINSOCK_SOCKETS) /* SO_EXCLUSIVEADDRUSE not defined on W32? 
*/
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Cannot disallow listening address reuse: 
SO_EXCLUSIVEADDRUSE not defined\n"));
+      MHD_DLOG (daemon,
+                _ (
+                  "Cannot disallow listening address reuse: 
SO_EXCLUSIVEADDRUSE not defined\n"));
 #endif
-          goto free_and_fail;
+      goto free_and_fail;
 #endif /* MHD_WINSOCK_SOCKETS */
-        }
+    }
 
-      /* check for user supplied sockaddr */
+    /* check for user supplied sockaddr */
 #if HAVE_INET6
-      if (0 != (*pflags & MHD_USE_IPv6))
-       addrlen = sizeof (struct sockaddr_in6);
-      else
+    if (0 != (*pflags & MHD_USE_IPv6))
+      addrlen = sizeof (struct sockaddr_in6);
+    else
 #endif
-       addrlen = sizeof (struct sockaddr_in);
-      if (NULL == servaddr)
-       {
+    addrlen = sizeof (struct sockaddr_in);
+    if (NULL == servaddr)
+    {
 #if HAVE_INET6
-         if (0 != (*pflags & MHD_USE_IPv6))
-           {
+      if (0 != (*pflags & MHD_USE_IPv6))
+      {
 #ifdef IN6ADDR_ANY_INIT
-             static const struct in6_addr static_in6any = IN6ADDR_ANY_INIT;
+        static const struct in6_addr static_in6any = IN6ADDR_ANY_INIT;
 #endif
-              memset (&servaddr6,
-                      0,
-                      sizeof (struct sockaddr_in6));
-             servaddr6.sin6_family = AF_INET6;
-             servaddr6.sin6_port = htons (port);
+        memset (&servaddr6,
+                0,
+                sizeof (struct sockaddr_in6));
+        servaddr6.sin6_family = AF_INET6;
+        servaddr6.sin6_port = htons (port);
 #ifdef IN6ADDR_ANY_INIT
-             servaddr6.sin6_addr = static_in6any;
+        servaddr6.sin6_addr = static_in6any;
 #endif
 #if HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
-             servaddr6.sin6_len = sizeof (struct sockaddr_in6);
-#endif
-             servaddr = (struct sockaddr *) &servaddr6;
-           }
-         else
-#endif
-           {
-             memset (&servaddr4,
-                      0,
-                      sizeof (struct sockaddr_in));
-             servaddr4.sin_family = AF_INET;
-             servaddr4.sin_port = htons (port);
-             if (0 != INADDR_ANY)
-               servaddr4.sin_addr.s_addr = htonl (INADDR_ANY);
+        servaddr6.sin6_len = sizeof (struct sockaddr_in6);
+#endif
+        servaddr = (struct sockaddr *) &servaddr6;
+      }
+      else
+#endif
+      {
+        memset (&servaddr4,
+                0,
+                sizeof (struct sockaddr_in));
+        servaddr4.sin_family = AF_INET;
+        servaddr4.sin_port = htons (port);
+        if (0 != INADDR_ANY)
+          servaddr4.sin_addr.s_addr = htonl (INADDR_ANY);
 #if HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
-             servaddr4.sin_len = sizeof (struct sockaddr_in);
+        servaddr4.sin_len = sizeof (struct sockaddr_in);
 #endif
-             servaddr = (struct sockaddr *) &servaddr4;
-           }
-       }
-      daemon->listen_fd = listen_fd;
+        servaddr = (struct sockaddr *) &servaddr4;
+      }
+    }
+    daemon->listen_fd = listen_fd;
 
-      if (0 != (*pflags & MHD_USE_IPv6))
-       {
+    if (0 != (*pflags & MHD_USE_IPv6))
+    {
 #ifdef IPPROTO_IPV6
 #ifdef IPV6_V6ONLY
-         /* Note: "IPV6_V6ONLY" is declared by Windows Vista ff., see 
"IPPROTO_IPV6 Socket Options"
-            
(http://msdn.microsoft.com/en-us/library/ms738574%28v=VS.85%29.aspx);
-            and may also be missing on older POSIX systems; good luck if you 
have any of those,
-            your IPv6 socket may then also bind against IPv4 anyway... */
-         const MHD_SCKT_OPT_BOOL_ v6_only =
-            (MHD_USE_DUAL_STACK != (*pflags & MHD_USE_DUAL_STACK));
-         if (0 > setsockopt (listen_fd,
-                              IPPROTO_IPV6, IPV6_V6ONLY,
-                              (const void *) &v6_only,
-                              sizeof (v6_only)))
+      /* Note: "IPV6_V6ONLY" is declared by Windows Vista ff., see 
"IPPROTO_IPV6 Socket Options"
+         (http://msdn.microsoft.com/en-us/library/ms738574%28v=VS.85%29.aspx);
+         and may also be missing on older POSIX systems; good luck if you have 
any of those,
+         your IPv6 socket may then also bind against IPv4 anyway... */
+      const MHD_SCKT_OPT_BOOL_ v6_only =
+        (MHD_USE_DUAL_STACK != (*pflags & MHD_USE_DUAL_STACK));
+      if (0 > setsockopt (listen_fd,
+                          IPPROTO_IPV6, IPV6_V6ONLY,
+                          (const void *) &v6_only,
+                          sizeof (v6_only)))
       {
 #ifdef HAVE_MESSAGES
-            MHD_DLOG (daemon,
-                      _("setsockopt failed: %s\n"),
-                      MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  _ ("setsockopt failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
       }
 #endif
 #endif
-       }
-      if (-1 == bind (listen_fd, servaddr, addrlen))
-       {
+    }
+    if (-1 == bind (listen_fd, servaddr, addrlen))
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Failed to bind to port %u: %s\n"),
-                    (unsigned int) port,
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                _ ("Failed to bind to port %u: %s\n"),
+                (unsigned int) port,
+                MHD_socket_last_strerr_ ());
 #endif
-         MHD_socket_close_chk_ (listen_fd);
-         goto free_and_fail;
-       }
+      MHD_socket_close_chk_ (listen_fd);
+      goto free_and_fail;
+    }
 #ifdef TCP_FASTOPEN
-      if (0 != (*pflags & MHD_USE_TCP_FASTOPEN))
+    if (0 != (*pflags & MHD_USE_TCP_FASTOPEN))
+    {
+      if (0 == daemon->fastopen_queue_size)
+        daemon->fastopen_queue_size = MHD_TCP_FASTOPEN_QUEUE_SIZE_DEFAULT;
+      if (0 != setsockopt (listen_fd,
+                           IPPROTO_TCP,
+                           TCP_FASTOPEN,
+                           (const void*) &daemon->fastopen_queue_size,
+                           sizeof (daemon->fastopen_queue_size)))
       {
-        if (0 == daemon->fastopen_queue_size)
-          daemon->fastopen_queue_size = MHD_TCP_FASTOPEN_QUEUE_SIZE_DEFAULT;
-        if (0 != setsockopt (listen_fd,
-                             IPPROTO_TCP,
-                             TCP_FASTOPEN,
-                             (const void*)&daemon->fastopen_queue_size,
-                             sizeof (daemon->fastopen_queue_size)))
-        {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("setsockopt failed: %s\n"),
-                    MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  _ ("setsockopt failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-        }
       }
+    }
 #endif
-      if (listen (listen_fd,
-                  daemon->listen_backlog_size) < 0)
-       {
+    if (listen (listen_fd,
+                daemon->listen_backlog_size) < 0)
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Failed to listen for connections: %s\n"),
-                    MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                _ ("Failed to listen for connections: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif
-         MHD_socket_close_chk_ (listen_fd);
-         goto free_and_fail;
-       }
+      MHD_socket_close_chk_ (listen_fd);
+      goto free_and_fail;
     }
+  }
   else
-    {
-      listen_fd = daemon->listen_fd;
-    }
+  {
+    listen_fd = daemon->listen_fd;
+  }
 
 #ifdef HAVE_GETSOCKNAME
   if ( (0 == daemon->port) &&
        (0 == (*pflags & MHD_USE_NO_LISTEN_SOCKET)) )
-    { /* Get port number. */
-      struct sockaddr_storage bindaddr;
+  {   /* Get port number. */
+    struct sockaddr_storage bindaddr;
 
-      memset (&bindaddr,
-              0,
-              sizeof (struct sockaddr_storage));
-      addrlen = sizeof (struct sockaddr_storage);
+    memset (&bindaddr,
+            0,
+            sizeof (struct sockaddr_storage));
+    addrlen = sizeof (struct sockaddr_storage);
 #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN
-      bindaddr.ss_len = addrlen;
+    bindaddr.ss_len = addrlen;
 #endif
-      if (0 != getsockname (listen_fd,
-                            (struct sockaddr *) &bindaddr,
-                            &addrlen))
-      {
+    if (0 != getsockname (listen_fd,
+                          (struct sockaddr *) &bindaddr,
+                          &addrlen))
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (daemon,
-                  _("Failed to get listen port number: %s\n"),
-                  MHD_socket_last_strerr_ ());
+      MHD_DLOG (daemon,
+                _ ("Failed to get listen port number: %s\n"),
+                MHD_socket_last_strerr_ ());
 #endif /* HAVE_MESSAGES */
-        }
+    }
 #ifdef MHD_POSIX_SOCKETS
-      else if (sizeof (bindaddr) < addrlen)
-        {
-          /* should be impossible with `struct sockaddr_storage` */
+    else if (sizeof (bindaddr) < addrlen)
+    {
+      /* should be impossible with `struct sockaddr_storage` */
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("Failed to get listen port number (`struct 
sockaddr_storage` too small!?)\n"));
+      MHD_DLOG (daemon,
+                _ (
+                  "Failed to get listen port number (`struct sockaddr_storage` 
too small!?)\n"));
 #endif /* HAVE_MESSAGES */
-        }
+    }
 #ifndef __linux__
-      else if (0 == addrlen)
-        {
-          /* Many non-Linux-based platforms return zero addrlen
-           * for AF_UNIX sockets */
-          daemon->port = 0; /* special value for UNIX domain sockets */
-        }
+    else if (0 == addrlen)
+    {
+      /* Many non-Linux-based platforms return zero addrlen
+       * for AF_UNIX sockets */
+      daemon->port = 0;     /* special value for UNIX domain sockets */
+    }
 #endif /* __linux__ */
 #endif /* MHD_POSIX_SOCKETS */
-      else
+    else
+    {
+      switch (bindaddr.ss_family)
+      {
+      case AF_INET:
         {
-          switch (bindaddr.ss_family)
-          {
-          case AF_INET:
-            {
-              struct sockaddr_in *s4 = (struct sockaddr_in *) &bindaddr;
+          struct sockaddr_in *s4 = (struct sockaddr_in *) &bindaddr;
 
-              daemon->port = ntohs (s4->sin_port);
-              break;
-            }
+          daemon->port = ntohs (s4->sin_port);
+          break;
+        }
 #ifdef HAVE_INET6
-          case AF_INET6:
-            {
-              struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) &bindaddr;
-
-              daemon->port = ntohs(s6->sin6_port);
-              mhd_assert (0 != (*pflags & MHD_USE_IPv6));
-              break;
-            }
+      case AF_INET6:
+        {
+          struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) &bindaddr;
+
+          daemon->port = ntohs (s6->sin6_port);
+          mhd_assert (0 != (*pflags & MHD_USE_IPv6));
+          break;
+        }
 #endif /* HAVE_INET6 */
 #ifdef AF_UNIX
-          case AF_UNIX:
-            daemon->port = 0; /* special value for UNIX domain sockets */
-            break;
+      case AF_UNIX:
+        daemon->port = 0;     /* special value for UNIX domain sockets */
+        break;
 #endif
-          default:
+      default:
 #ifdef HAVE_MESSAGES
-            MHD_DLOG (daemon,
-                      _("Unknown address family!\n"));
+        MHD_DLOG (daemon,
+                  _ ("Unknown address family!\n"));
 #endif
-            daemon->port = 0; /* ugh */
-            break;
-          }
-        }
+        daemon->port = 0;     /* ugh */
+        break;
+      }
     }
+  }
 #endif /* HAVE_GETSOCKNAME */
   if ( (MHD_INVALID_SOCKET != listen_fd) &&
        (! MHD_socket_nonblocking_ (listen_fd)) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Failed to set nonblocking mode on listening socket: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ ("Failed to set nonblocking mode on listening socket: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      if (0 != (*pflags & MHD_USE_EPOLL)
+    if (0 != (*pflags & MHD_USE_EPOLL)
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-          || (daemon->worker_pool_size > 0)
+        || (daemon->worker_pool_size > 0)
 #endif
-         )
-        {
-           /* Accept must be non-blocking. Multiple children may wake up
-            * to handle a new connection, but only one will win the race.
-            * The others must immediately return. */
-          MHD_socket_close_chk_ (listen_fd);
-          goto free_and_fail;
-        }
+        )
+    {
+      /* Accept must be non-blocking. Multiple children may wake up
+       * to handle a new connection, but only one will win the race.
+       * The others must immediately return. */
+      MHD_socket_close_chk_ (listen_fd);
+      goto free_and_fail;
     }
+  }
   if ( (MHD_INVALID_SOCKET != listen_fd) &&
-       (! MHD_SCKT_FD_FITS_FDSET_(listen_fd,
-                                  NULL)) &&
+       (! MHD_SCKT_FD_FITS_FDSET_ (listen_fd,
+                                   NULL)) &&
        (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL)) ) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
-                listen_fd,
-                FD_SETSIZE);
+    MHD_DLOG (daemon,
+              _ ("Socket descriptor larger than FD_SETSIZE: %d > %d\n"),
+              listen_fd,
+              FD_SETSIZE);
 #endif
-      MHD_socket_close_chk_ (listen_fd);
-      goto free_and_fail;
-    }
+    MHD_socket_close_chk_ (listen_fd);
+    goto free_and_fail;
+  }
 
 #ifdef EPOLL_SUPPORT
   if ( (0 != (*pflags & MHD_USE_EPOLL))
@@ -6283,193 +6345,197 @@ MHD_start_daemon_va (unsigned int flags,
        && (0 == daemon->worker_pool_size)
 #endif
        )
+  {
+    if (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION))
     {
-      if (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION))
-       {
 #ifdef HAVE_MESSAGES
-         MHD_DLOG (daemon,
-                   _("Combining MHD_USE_THREAD_PER_CONNECTION and 
MHD_USE_EPOLL is not supported.\n"));
+      MHD_DLOG (daemon,
+                _ (
+                  "Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL 
is not supported.\n"));
 #endif
-         goto free_and_fail;
-       }
-      if (MHD_YES != setup_epoll_to_listen (daemon))
-       goto free_and_fail;
+      goto free_and_fail;
     }
+    if (MHD_YES != setup_epoll_to_listen (daemon))
+      goto free_and_fail;
+  }
 #endif /* EPOLL_SUPPORT */
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   if (! MHD_mutex_init_ (&daemon->per_ip_connection_mutex))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("MHD failed to initialize IP connection limit mutex\n"));
+    MHD_DLOG (daemon,
+              _ ("MHD failed to initialize IP connection limit mutex\n"));
 #endif
-      if (MHD_INVALID_SOCKET != listen_fd)
-        MHD_socket_close_chk_ (listen_fd);
-      goto free_and_fail;
-    }
+    if (MHD_INVALID_SOCKET != listen_fd)
+      MHD_socket_close_chk_ (listen_fd);
+    goto free_and_fail;
+  }
   if (0 == daemon->worker_pool_size)
-    { /* Initialise connection mutex only if this daemon will handle
+  {   /* Initialise connection mutex only if this daemon will handle
        * any connections by itself. */
-      if (! MHD_mutex_init_ (&daemon->cleanup_connection_mutex))
-        {
+    if (! MHD_mutex_init_ (&daemon->cleanup_connection_mutex))
+    {
 #ifdef HAVE_MESSAGES
-          MHD_DLOG (daemon,
-                    _("MHD failed to initialize IP connection limit mutex\n"));
+      MHD_DLOG (daemon,
+                _ ("MHD failed to initialize IP connection limit mutex\n"));
 #endif
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-          MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
+      MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
 #endif
-          if (MHD_INVALID_SOCKET != listen_fd)
-            MHD_socket_close_chk_ (listen_fd);
-          goto free_and_fail;
-        }
+      if (MHD_INVALID_SOCKET != listen_fd)
+        MHD_socket_close_chk_ (listen_fd);
+      goto free_and_fail;
     }
+  }
 #endif
 
 #ifdef HTTPS_SUPPORT
   /* initialize HTTPS daemon certificate aspects & send / recv functions */
   if ( (0 != (*pflags & MHD_USE_TLS)) &&
        (0 != MHD_TLS_init (daemon)) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("Failed to initialize TLS support\n"));
+    MHD_DLOG (daemon,
+              _ ("Failed to initialize TLS support\n"));
 #endif
-      if (MHD_INVALID_SOCKET != listen_fd)
-        MHD_socket_close_chk_ (listen_fd);
+    if (MHD_INVALID_SOCKET != listen_fd)
+      MHD_socket_close_chk_ (listen_fd);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      if (0 == daemon->worker_pool_size)
+    if (0 == daemon->worker_pool_size)
+      MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
+    MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
+#endif
+    goto free_and_fail;
+  }
+#endif /* HTTPS_SUPPORT */
+#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
+  if ( (0 != (*pflags & MHD_USE_INTERNAL_POLLING_THREAD)) &&
+       (0 == (*pflags & MHD_USE_NO_LISTEN_SOCKET)) )
+  {
+    if (0 == daemon->worker_pool_size)
+    {
+      if (! MHD_create_named_thread_ (&daemon->pid,
+                                      (*pflags
+                                       & MHD_USE_THREAD_PER_CONNECTION) ?
+                                      "MHD-listen" : "MHD-single",
+                                      daemon->thread_stack_size,
+                                      &MHD_polling_thread,
+                                      daemon) )
+      {
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (daemon,
+                  _ ("Failed to create listen thread: %s\n"),
+                  MHD_strerror_ (errno));
+#endif
         MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
-      MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
+        MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
+        if (MHD_INVALID_SOCKET != listen_fd)
+          MHD_socket_close_chk_ (listen_fd);
+        goto free_and_fail;
+      }
+    }
+    else   /* 0 < daemon->worker_pool_size */
+    {
+      /* Coarse-grained count of connections per thread (note error
+       * due to integer division). Also keep track of how many
+       * connections are leftover after an equal split. */
+      unsigned int conns_per_thread = daemon->connection_limit
+                                      / daemon->worker_pool_size;
+      unsigned int leftover_conns = daemon->connection_limit
+                                    % daemon->worker_pool_size;
+
+      i = 0;     /* we need this in case fcntl or malloc fails */
+
+      /* Allocate memory for pooled objects */
+      daemon->worker_pool = malloc (sizeof (struct MHD_Daemon)
+                                    * daemon->worker_pool_size);
+      if (NULL == daemon->worker_pool)
+        goto thread_failed;
+
+      /* Start the workers in the pool */
+      for (i = 0; i < daemon->worker_pool_size; ++i)
+      {
+        /* Create copy of the Daemon object for each worker */
+        struct MHD_Daemon *d = &daemon->worker_pool[i];
+
+        memcpy (d, daemon, sizeof (struct MHD_Daemon));
+        /* Adjust pooling params for worker daemons; note that memcpy()
+           has already copied MHD_USE_INTERNAL_POLLING_THREAD thread mode into
+           the worker threads. */
+        d->master = daemon;
+        d->worker_pool_size = 0;
+        d->worker_pool = NULL;
+
+        if (0 != (*pflags & MHD_USE_ITC))
+        {
+          if (! MHD_itc_init_ (d->itc))
+          {
+#ifdef HAVE_MESSAGES
+            MHD_DLOG (daemon,
+                      _ (
+                        "Failed to create worker inter-thread communication 
channel: %s\n"),
+                      MHD_itc_last_strerror_ () );
+#endif
+            goto thread_failed;
+          }
+          if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
+               (! MHD_SCKT_FD_FITS_FDSET_ (MHD_itc_r_fd_ (d->itc),
+                                           NULL)) )
+          {
+#ifdef HAVE_MESSAGES
+            MHD_DLOG (daemon,
+                      _ (
+                        "File descriptor for worker inter-thread communication 
channel exceeds maximum value\n"));
+#endif
+            MHD_itc_destroy_chk_ (d->itc);
+            goto thread_failed;
+          }
+        }
+        else
+          MHD_itc_set_invalid_ (d->itc);
+
+        /* Divide available connections evenly amongst the threads.
+         * Thread indexes in [0, leftover_conns) each get one of the
+         * leftover connections. */
+        d->connection_limit = conns_per_thread;
+        if (i < leftover_conns)
+          ++d->connection_limit;
+#ifdef EPOLL_SUPPORT
+        if ( (0 != (*pflags & MHD_USE_EPOLL)) &&
+             (MHD_YES != setup_epoll_to_listen (d)) )
+          goto thread_failed;
 #endif
-      goto free_and_fail;
-    }
-#endif /* HTTPS_SUPPORT */
-#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-  if ( (0 != (*pflags & MHD_USE_INTERNAL_POLLING_THREAD)) &&
-       (0 == (*pflags & MHD_USE_NO_LISTEN_SOCKET)) )
-    {
-      if (0 == daemon->worker_pool_size)
+        /* Must init cleanup connection mutex for each worker */
+        if (! MHD_mutex_init_ (&d->cleanup_connection_mutex))
         {
-          if (! MHD_create_named_thread_ (&daemon->pid,
-                (*pflags & MHD_USE_THREAD_PER_CONNECTION) ?
-                  "MHD-listen" : "MHD-single",
-                daemon->thread_stack_size,
-                &MHD_polling_thread,
-                daemon) )
-            {
-#ifdef HAVE_MESSAGES
-              MHD_DLOG (daemon,
-                        _("Failed to create listen thread: %s\n"),
-                        MHD_strerror_ (errno));
-#endif
-              MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
-              MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
-              if (MHD_INVALID_SOCKET != listen_fd)
-                MHD_socket_close_chk_ (listen_fd);
-              goto free_and_fail;
-            }
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (daemon,
+                    _ ("MHD failed to initialize cleanup connection mutex\n"));
+#endif
+          goto thread_failed;
         }
-      else /* 0 < daemon->worker_pool_size */
-        {
-          /* Coarse-grained count of connections per thread (note error
-           * due to integer division). Also keep track of how many
-           * connections are leftover after an equal split. */
-          unsigned int conns_per_thread = daemon->connection_limit
-                                          / daemon->worker_pool_size;
-          unsigned int leftover_conns = daemon->connection_limit
-                                        % daemon->worker_pool_size;
-
-          i = 0; /* we need this in case fcntl or malloc fails */
-
-          /* Allocate memory for pooled objects */
-          daemon->worker_pool = malloc (sizeof (struct MHD_Daemon)
-                                        * daemon->worker_pool_size);
-          if (NULL == daemon->worker_pool)
-            goto thread_failed;
 
-          /* Start the workers in the pool */
-          for (i = 0; i < daemon->worker_pool_size; ++i)
-            {
-              /* Create copy of the Daemon object for each worker */
-              struct MHD_Daemon *d = &daemon->worker_pool[i];
-
-              memcpy (d, daemon, sizeof (struct MHD_Daemon));
-              /* Adjust pooling params for worker daemons; note that memcpy()
-                 has already copied MHD_USE_INTERNAL_POLLING_THREAD thread 
mode into
-                 the worker threads. */
-              d->master = daemon;
-              d->worker_pool_size = 0;
-              d->worker_pool = NULL;
-
-              if (0 != (*pflags & MHD_USE_ITC))
-                {
-                  if (! MHD_itc_init_ (d->itc))
-                    {
-#ifdef HAVE_MESSAGES
-                      MHD_DLOG (daemon,
-                                _("Failed to create worker inter-thread 
communication channel: %s\n"),
-                                MHD_itc_last_strerror_() );
-#endif
-                      goto thread_failed;
-                    }
-                  if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
-                       (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (d->itc),
-                                                  NULL)) )
-                    {
-#ifdef HAVE_MESSAGES
-                      MHD_DLOG (daemon,
-                                _("File descriptor for worker inter-thread 
communication channel exceeds maximum value\n"));
-#endif
-                      MHD_itc_destroy_chk_ (d->itc);
-                      goto thread_failed;
-                    }
-                }
-              else
-                MHD_itc_set_invalid_ (d->itc);
-
-              /* Divide available connections evenly amongst the threads.
-               * Thread indexes in [0, leftover_conns) each get one of the
-               * leftover connections. */
-              d->connection_limit = conns_per_thread;
-              if (i < leftover_conns)
-                ++d->connection_limit;
-#ifdef EPOLL_SUPPORT
-              if ( (0 != (*pflags & MHD_USE_EPOLL)) &&
-                   (MHD_YES != setup_epoll_to_listen (d)) )
-                goto thread_failed;
-#endif
-              /* Must init cleanup connection mutex for each worker */
-              if (! MHD_mutex_init_ (&d->cleanup_connection_mutex))
-                {
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                            _("MHD failed to initialize cleanup connection 
mutex\n"));
-#endif
-                  goto thread_failed;
-                }
-
-              /* Spawn the worker thread */
-              if (! MHD_create_named_thread_ (&d->pid,
-                                              "MHD-worker",
-                                              daemon->thread_stack_size,
-                                              &MHD_polling_thread,
-                                              d))
-                {
-#ifdef HAVE_MESSAGES
-                  MHD_DLOG (daemon,
-                            _("Failed to create pool thread: %s\n"),
-                            MHD_strerror_ (errno));
-#endif
-                  /* Free memory for this worker; cleanup below handles
-                   * all previously-created workers. */
-                  MHD_mutex_destroy_chk_ (&d->cleanup_connection_mutex);
-                  goto thread_failed;
-                }
-            }
+        /* Spawn the worker thread */
+        if (! MHD_create_named_thread_ (&d->pid,
+                                        "MHD-worker",
+                                        daemon->thread_stack_size,
+                                        &MHD_polling_thread,
+                                        d))
+        {
+#ifdef HAVE_MESSAGES
+          MHD_DLOG (daemon,
+                    _ ("Failed to create pool thread: %s\n"),
+                    MHD_strerror_ (errno));
+#endif
+          /* Free memory for this worker; cleanup below handles
+           * all previously-created workers. */
+          MHD_mutex_destroy_chk_ (&d->cleanup_connection_mutex);
+          goto thread_failed;
         }
+      }
     }
+  }
 #endif
 #ifdef HTTPS_SUPPORT
   /* API promises to never use the password after initialization,
@@ -6486,14 +6552,14 @@ thread_failed:
      assumes a 0-sized thread pool means we had been in the default
      MHD_USE_INTERNAL_POLLING_THREAD mode. */
   if (0 == i)
-    {
-      if (MHD_INVALID_SOCKET != listen_fd)
-        MHD_socket_close_chk_ (listen_fd);
-      MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
-      if (NULL != daemon->worker_pool)
-        free (daemon->worker_pool);
-      goto free_and_fail;
-    }
+  {
+    if (MHD_INVALID_SOCKET != listen_fd)
+      MHD_socket_close_chk_ (listen_fd);
+    MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
+    if (NULL != daemon->worker_pool)
+      free (daemon->worker_pool);
+    goto free_and_fail;
+  }
 
   /* Shutdown worker threads we've already created. Pretend
      as though we had fully initialized our daemon, but
@@ -6504,20 +6570,20 @@ thread_failed:
   return NULL;
 #endif
 
- free_and_fail:
+free_and_fail:
   /* clean up basic memory state in 'daemon' and return NULL to
      indicate failure */
 #ifdef EPOLL_SUPPORT
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
   if (daemon->upgrade_fd_in_epoll)
-    {
-      if (0 != epoll_ctl (daemon->epoll_fd,
-                          EPOLL_CTL_DEL,
-                          daemon->epoll_upgrade_fd,
-                          NULL))
-        MHD_PANIC (_("Failed to remove FD from epoll set\n"));
-      daemon->upgrade_fd_in_epoll = false;
-    }
+  {
+    if (0 != epoll_ctl (daemon->epoll_fd,
+                        EPOLL_CTL_DEL,
+                        daemon->epoll_upgrade_fd,
+                        NULL))
+      MHD_PANIC (_ ("Failed to remove FD from epoll set\n"));
+    daemon->upgrade_fd_in_epoll = false;
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
   if (-1 != daemon->epoll_fd)
     close (daemon->epoll_fd);
@@ -6542,7 +6608,7 @@ thread_failed:
       gnutls_psk_free_server_credentials (daemon->psk_cred);
   }
 #endif /* HTTPS_SUPPORT */
-  if (MHD_ITC_IS_VALID_(daemon->itc))
+  if (MHD_ITC_IS_VALID_ (daemon->itc))
     MHD_itc_destroy_chk_ (daemon->itc);
   free (daemon);
   return NULL;
@@ -6561,7 +6627,8 @@ static void
 close_all_connections (struct MHD_Daemon *daemon)
 {
   struct MHD_Connection *pos;
-  const bool used_thr_p_c = (0 != (daemon->options & 
MHD_USE_THREAD_PER_CONNECTION));
+  const bool used_thr_p_c = (0 != (daemon->options
+                                   & MHD_USE_THREAD_PER_CONNECTION));
 #ifdef UPGRADE_SUPPORT
   const bool upg_allowed = (0 != (daemon->options & MHD_ALLOW_UPGRADE));
 #endif /* UPGRADE_SUPPORT */
@@ -6577,16 +6644,16 @@ close_all_connections (struct MHD_Daemon *daemon)
   /* give upgraded HTTPS connections a chance to finish */
   /* 'daemon->urh_head' is not used in thread-per-connection mode. */
   for (urh = daemon->urh_tail; NULL != urh; urh = urhn)
-    {
-      urhn = urh->prev;
-      /* call generic forwarding function for passing data
-         with chance to detect that application is done. */
-      process_urh (urh);
-      MHD_connection_finish_forward_ (urh->connection);
-      urh->clean_ready = true;
-      /* Resuming will move connection to cleanup list. */
-      MHD_resume_connection(urh->connection);
-    }
+  {
+    urhn = urh->prev;
+    /* call generic forwarding function for passing data
+       with chance to detect that application is done. */
+    process_urh (urh);
+    MHD_connection_finish_forward_ (urh->connection);
+    urh->clean_ready = true;
+    /* Resuming will move connection to cleanup list. */
+    MHD_resume_connection (urh->connection);
+  }
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
 
   /* Give suspended connections a chance to resume to avoid
@@ -6594,10 +6661,10 @@ close_all_connections (struct MHD_Daemon *daemon)
      connections left in case of a tight race with a recently
      resumed connection. */
   if (0 != (MHD_TEST_ALLOW_SUSPEND_RESUME & daemon->options))
-    {
-      daemon->resuming = true; /* Force check for pending resume. */
-      resume_suspended_connections (daemon);
-    }
+  {
+    daemon->resuming = true;   /* Force check for pending resume. */
+    resume_suspended_connections (daemon);
+  }
   /* first, make sure all threads are aware of shutdown; need to
      traverse DLLs in peace... */
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
@@ -6605,79 +6672,83 @@ close_all_connections (struct MHD_Daemon *daemon)
 #endif
 #ifdef UPGRADE_SUPPORT
   if (upg_allowed)
-    {
-      struct MHD_Connection * susp;
+  {
+    struct MHD_Connection *susp;
 
-      susp = daemon->suspended_connections_tail;
-      while (NULL != susp)
-        {
-          if (NULL == susp->urh) /* "Upgraded" connection? */
-            MHD_PANIC (_("MHD_stop_daemon() called while we have suspended 
connections.\n"));
+    susp = daemon->suspended_connections_tail;
+    while (NULL != susp)
+    {
+      if (NULL == susp->urh)     /* "Upgraded" connection? */
+        MHD_PANIC (_ (
+                     "MHD_stop_daemon() called while we have suspended 
connections.\n"));
 #ifdef HTTPS_SUPPORT
-          else if (used_tls &&
-                   used_thr_p_c &&
-                   (! susp->urh->clean_ready) )
-            shutdown (susp->urh->app.socket,
-                      SHUT_RDWR); /* Wake thread by shutdown of app socket. */
+      else if (used_tls &&
+               used_thr_p_c &&
+               (! susp->urh->clean_ready) )
+        shutdown (susp->urh->app.socket,
+                  SHUT_RDWR);     /* Wake thread by shutdown of app socket. */
 #endif /* HTTPS_SUPPORT */
-          else
-            {
-#ifdef HAVE_MESSAGES
-              if (! susp->urh->was_closed)
-                MHD_DLOG (daemon,
-                          _("Initiated daemon shutdown while \"upgraded\" 
connection was not closed.\n"));
-#endif
-              susp->urh->was_closed = true;
-              /* If thread-per-connection is used, connection's thread
-               * may still processing "upgrade" (exiting). */
-              if (! used_thr_p_c)
-                MHD_connection_finish_forward_ (susp);
-              /* Do not use MHD_resume_connection() as mutex is
-               * already locked. */
-              susp->resuming = true;
-              daemon->resuming = true;
-            }
-          susp = susp->prev;
-        }
+      else
+      {
+#ifdef HAVE_MESSAGES
+        if (! susp->urh->was_closed)
+          MHD_DLOG (daemon,
+                    _ (
+                      "Initiated daemon shutdown while \"upgraded\" connection 
was not closed.\n"));
+#endif
+        susp->urh->was_closed = true;
+        /* If thread-per-connection is used, connection's thread
+         * may still processing "upgrade" (exiting). */
+        if (! used_thr_p_c)
+          MHD_connection_finish_forward_ (susp);
+        /* Do not use MHD_resume_connection() as mutex is
+         * already locked. */
+        susp->resuming = true;
+        daemon->resuming = true;
+      }
+      susp = susp->prev;
     }
+  }
   else /* This 'else' is combined with next 'if' */
 #endif /* UPGRADE_SUPPORT */
   if (NULL != daemon->suspended_connections_head)
-    MHD_PANIC (_("MHD_stop_daemon() called while we have suspended 
connections.\n"));
+    MHD_PANIC (_ (
+                 "MHD_stop_daemon() called while we have suspended 
connections.\n"));
   for (pos = daemon->connections_tail; NULL != pos; pos = pos->prev)
-    {
-      shutdown (pos->socket_fd,
-                SHUT_RDWR);
+  {
+    shutdown (pos->socket_fd,
+              SHUT_RDWR);
 #if MHD_WINSOCK_SOCKETS
-      if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
-           (MHD_ITC_IS_VALID_(daemon->itc)) &&
-           (! MHD_itc_activate_ (daemon->itc, "e")) )
-        MHD_PANIC (_("Failed to signal shutdown via inter-thread communication 
channel"));
+    if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
+         (MHD_ITC_IS_VALID_ (daemon->itc)) &&
+         (! MHD_itc_activate_ (daemon->itc, "e")) )
+      MHD_PANIC (_ (
+                   "Failed to signal shutdown via inter-thread communication 
channel"));
 #endif
-    }
+  }
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   /* now, collect per-connection threads */
   if (used_thr_p_c)
+  {
+    pos = daemon->connections_tail;
+    while (NULL != pos)
     {
-      pos = daemon->connections_tail;
-      while (NULL != pos)
+      if (! pos->thread_joined)
       {
-        if (! pos->thread_joined)
-          {
-            MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-            if (! MHD_join_thread_ (pos->pid.handle))
-              MHD_PANIC (_("Failed to join a thread\n"));
-            MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
-            pos->thread_joined = true;
-            /* The thread may have concurrently modified the DLL,
-               need to restart from the beginning */
-            pos = daemon->connections_tail;
-            continue;
-          }
-        pos = pos->prev;
+        MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+        if (! MHD_join_thread_ (pos->pid.handle))
+          MHD_PANIC (_ ("Failed to join a thread\n"));
+        MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+        pos->thread_joined = true;
+        /* The thread may have concurrently modified the DLL,
+           need to restart from the beginning */
+        pos = daemon->connections_tail;
+        continue;
       }
+      pos = pos->prev;
     }
+  }
   MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 #endif
 
@@ -6687,10 +6758,10 @@ close_all_connections (struct MHD_Daemon *daemon)
   /* "Upgraded" connections that were not closed explicitly by
    * application should be moved to cleanup list too. */
   if (upg_allowed)
-    {
-      daemon->resuming = true; /* Force check for pending resume. */
-      resume_suspended_connections (daemon);
-    }
+  {
+    daemon->resuming = true;   /* Force check for pending resume. */
+    resume_suspended_connections (daemon);
+  }
 #endif /* UPGRADE_SUPPORT */
 
   /* now that we're alone, move everyone to cleanup */
@@ -6699,7 +6770,7 @@ close_all_connections (struct MHD_Daemon *daemon)
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
     if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
          (! pos->thread_joined) )
-      MHD_PANIC (_("Failed to join a thread\n"));
+      MHD_PANIC (_ ("Failed to join a thread\n"));
 #endif
     close_connection (pos);
   }
@@ -6732,137 +6803,139 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   if (NULL != daemon->worker_pool)
-    { /* Master daemon with worker pool. */
-      mhd_assert (1 < daemon->worker_pool_size);
-      mhd_assert (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD));
+  {   /* Master daemon with worker pool. */
+    mhd_assert (1 < daemon->worker_pool_size);
+    mhd_assert (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD));
 
-      /* Let workers shutdown in parallel. */
-      for (i = 0; i < daemon->worker_pool_size; ++i)
-        {
-          daemon->worker_pool[i].shutdown = true;
-          if (MHD_ITC_IS_VALID_(daemon->worker_pool[i].itc))
-            {
-              if (! MHD_itc_activate_ (daemon->worker_pool[i].itc,
-                                       "e"))
-                MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel."));
-            }
-          else
-            mhd_assert (MHD_INVALID_SOCKET != fd);
-        }
+    /* Let workers shutdown in parallel. */
+    for (i = 0; i < daemon->worker_pool_size; ++i)
+    {
+      daemon->worker_pool[i].shutdown = true;
+      if (MHD_ITC_IS_VALID_ (daemon->worker_pool[i].itc))
+      {
+        if (! MHD_itc_activate_ (daemon->worker_pool[i].itc,
+                                 "e"))
+          MHD_PANIC (_ (
+                       "Failed to signal shutdown via inter-thread 
communication channel."));
+      }
+      else
+        mhd_assert (MHD_INVALID_SOCKET != fd);
+    }
 #ifdef HAVE_LISTEN_SHUTDOWN
-      if (MHD_INVALID_SOCKET != fd)
-        {
-          (void) shutdown (fd,
-                           SHUT_RDWR);
-        }
+    if (MHD_INVALID_SOCKET != fd)
+    {
+      (void) shutdown (fd,
+                       SHUT_RDWR);
+    }
 #endif /* HAVE_LISTEN_SHUTDOWN */
-      for (i = 0; i < daemon->worker_pool_size; ++i)
-        {
-          MHD_stop_daemon (&daemon->worker_pool[i]);
-        }
-      free (daemon->worker_pool);
-      mhd_assert (MHD_ITC_IS_INVALID_(daemon->itc));
+    for (i = 0; i < daemon->worker_pool_size; ++i)
+    {
+      MHD_stop_daemon (&daemon->worker_pool[i]);
+    }
+    free (daemon->worker_pool);
+    mhd_assert (MHD_ITC_IS_INVALID_ (daemon->itc));
 #ifdef EPOLL_SUPPORT
-      mhd_assert (-1 == daemon->epoll_fd);
+    mhd_assert (-1 == daemon->epoll_fd);
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-      mhd_assert (-1 == daemon->epoll_upgrade_fd);
+    mhd_assert (-1 == daemon->epoll_upgrade_fd);
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
 #endif /* EPOLL_SUPPORT */
-    }
+  }
   else
 #endif
-    { /* Worker daemon or single daemon. */
+  {   /* Worker daemon or single daemon. */
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      if (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
-        { /* Worker daemon or single daemon with internal thread(s). */
-          mhd_assert (0 == daemon->worker_pool_size);
-         /* Separate thread(s) is used for polling sockets. */
-         if (MHD_ITC_IS_VALID_ (daemon->itc))
-           {
-             if (! MHD_itc_activate_ (daemon->itc,
-                                       "e"))
-               MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel"));
-           }
-         else
-           {
-#ifdef HAVE_LISTEN_SHUTDOWN
-             if (MHD_INVALID_SOCKET != fd)
-               {
-                 if (NULL == daemon->master)
-                   (void) shutdown (fd,
-                                    SHUT_RDWR);
-               }
-             else
-#endif /* HAVE_LISTEN_SHUTDOWN */
-               mhd_assert (false); /* Should never happen */
-           }
-
-         if (! MHD_join_thread_ (daemon->pid.handle))
-           {
-             MHD_PANIC (_("Failed to join a thread\n"));
-           }
-         /* close_all_connections() was called in daemon thread. */
-        }
+    if (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
+    {     /* Worker daemon or single daemon with internal thread(s). */
+      mhd_assert (0 == daemon->worker_pool_size);
+      /* Separate thread(s) is used for polling sockets. */
+      if (MHD_ITC_IS_VALID_ (daemon->itc))
+      {
+        if (! MHD_itc_activate_ (daemon->itc,
+                                 "e"))
+          MHD_PANIC (_ (
+                       "Failed to signal shutdown via inter-thread 
communication channel"));
+      }
       else
-#endif
+      {
+#ifdef HAVE_LISTEN_SHUTDOWN
+        if (MHD_INVALID_SOCKET != fd)
         {
-          /* No internal threads are used for polling sockets. */
-          close_all_connections (daemon);
+          if (NULL == daemon->master)
+            (void) shutdown (fd,
+                             SHUT_RDWR);
         }
-      if (MHD_ITC_IS_VALID_ (daemon->itc))
-        MHD_itc_destroy_chk_ (daemon->itc);
+        else
+#endif /* HAVE_LISTEN_SHUTDOWN */
+        mhd_assert (false); /* Should never happen */
+      }
+
+      if (! MHD_join_thread_ (daemon->pid.handle))
+      {
+        MHD_PANIC (_ ("Failed to join a thread\n"));
+      }
+      /* close_all_connections() was called in daemon thread. */
+    }
+    else
+#endif
+    {
+      /* No internal threads are used for polling sockets. */
+      close_all_connections (daemon);
+    }
+    if (MHD_ITC_IS_VALID_ (daemon->itc))
+      MHD_itc_destroy_chk_ (daemon->itc);
 
 #ifdef EPOLL_SUPPORT
-      if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
-           (-1 != daemon->epoll_fd) )
-        MHD_socket_close_chk_ (daemon->epoll_fd);
+    if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
+         (-1 != daemon->epoll_fd) )
+      MHD_socket_close_chk_ (daemon->epoll_fd);
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-      if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
-           (-1 != daemon->epoll_upgrade_fd) )
-        MHD_socket_close_chk_ (daemon->epoll_upgrade_fd);
+    if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
+         (-1 != daemon->epoll_upgrade_fd) )
+      MHD_socket_close_chk_ (daemon->epoll_upgrade_fd);
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
 #endif /* EPOLL_SUPPORT */
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
+    MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
 #endif
-    }
+  }
 
   if (NULL == daemon->master)
-    { /* Cleanup that should be done only one time in master/single daemon.
+  {   /* Cleanup that should be done only one time in master/single daemon.
        * Do not perform this cleanup in worker daemons. */
 
-      if (MHD_INVALID_SOCKET != fd)
-        MHD_socket_close_chk_ (fd);
+    if (MHD_INVALID_SOCKET != fd)
+      MHD_socket_close_chk_ (fd);
 
-      /* TLS clean up */
+    /* TLS clean up */
 #ifdef HTTPS_SUPPORT
-      if (daemon->have_dhparams)
-        {
-          gnutls_dh_params_deinit (daemon->https_mem_dhparams);
-          daemon->have_dhparams = false;
-        }
-      if (0 != (daemon->options & MHD_USE_TLS))
-        {
-          gnutls_priority_deinit (daemon->priority_cache);
-          if (daemon->x509_cred)
-            gnutls_certificate_free_credentials (daemon->x509_cred);
-          if (daemon->psk_cred)
-              gnutls_psk_free_server_credentials (daemon->psk_cred);
-        }
+    if (daemon->have_dhparams)
+    {
+      gnutls_dh_params_deinit (daemon->https_mem_dhparams);
+      daemon->have_dhparams = false;
+    }
+    if (0 != (daemon->options & MHD_USE_TLS))
+    {
+      gnutls_priority_deinit (daemon->priority_cache);
+      if (daemon->x509_cred)
+        gnutls_certificate_free_credentials (daemon->x509_cred);
+      if (daemon->psk_cred)
+        gnutls_psk_free_server_credentials (daemon->psk_cred);
+    }
 #endif /* HTTPS_SUPPORT */
 
 #ifdef DAUTH_SUPPORT
-      free (daemon->nnc);
+    free (daemon->nnc);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_destroy_chk_ (&daemon->nnc_lock);
+    MHD_mutex_destroy_chk_ (&daemon->nnc_lock);
 #endif
 #endif
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
+    MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
 #endif
-      free (daemon);
-    }
+    free (daemon);
+  }
 }
 
 
@@ -6879,51 +6952,51 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
  */
 const union MHD_DaemonInfo *
 MHD_get_daemon_info (struct MHD_Daemon *daemon,
-                    enum MHD_DaemonInfoType info_type,
-                    ...)
+                     enum MHD_DaemonInfoType info_type,
+                     ...)
 {
   if (NULL == daemon)
     return NULL;
   switch (info_type)
-    {
-    case MHD_DAEMON_INFO_KEY_SIZE:
-      return NULL; /* no longer supported */
-    case MHD_DAEMON_INFO_MAC_KEY_SIZE:
-      return NULL; /* no longer supported */
-    case MHD_DAEMON_INFO_LISTEN_FD:
-      return (const union MHD_DaemonInfo *) &daemon->listen_fd;
+  {
+  case MHD_DAEMON_INFO_KEY_SIZE:
+    return NULL;   /* no longer supported */
+  case MHD_DAEMON_INFO_MAC_KEY_SIZE:
+    return NULL;   /* no longer supported */
+  case MHD_DAEMON_INFO_LISTEN_FD:
+    return (const union MHD_DaemonInfo *) &daemon->listen_fd;
 #ifdef EPOLL_SUPPORT
-    case MHD_DAEMON_INFO_EPOLL_FD:
-      return (const union MHD_DaemonInfo *) &daemon->epoll_fd;
+  case MHD_DAEMON_INFO_EPOLL_FD:
+    return (const union MHD_DaemonInfo *) &daemon->epoll_fd;
 #endif
-    case MHD_DAEMON_INFO_CURRENT_CONNECTIONS:
-      if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
-        {
-          /* Assume that MHD_run() in not called in other thread
-           * at the same time. */
-          MHD_cleanup_connections (daemon);
-        }
+  case MHD_DAEMON_INFO_CURRENT_CONNECTIONS:
+    if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
+    {
+      /* Assume that MHD_run() in not called in other thread
+       * at the same time. */
+      MHD_cleanup_connections (daemon);
+    }
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      else if (daemon->worker_pool)
-        {
-          unsigned int i;
-          /* Collect the connection information stored in the workers. */
-          daemon->connections = 0;
-          for (i = 0; i < daemon->worker_pool_size; i++)
-            {
-              /* FIXME: next line is thread-safe only if read is atomic. */
-              daemon->connections += daemon->worker_pool[i].connections;
-            }
-        }
-#endif
-      return (const union MHD_DaemonInfo *) &daemon->connections;
-    case MHD_DAEMON_INFO_FLAGS:
-      return (const union MHD_DaemonInfo *) &daemon->options;
-    case MHD_DAEMON_INFO_BIND_PORT:
-      return (const union MHD_DaemonInfo *) &daemon->port;
-    default:
-      return NULL;
+    else if (daemon->worker_pool)
+    {
+      unsigned int i;
+      /* Collect the connection information stored in the workers. */
+      daemon->connections = 0;
+      for (i = 0; i < daemon->worker_pool_size; i++)
+      {
+        /* FIXME: next line is thread-safe only if read is atomic. */
+        daemon->connections += daemon->worker_pool[i].connections;
+      }
     }
+#endif
+    return (const union MHD_DaemonInfo *) &daemon->connections;
+  case MHD_DAEMON_INFO_FLAGS:
+    return (const union MHD_DaemonInfo *) &daemon->options;
+  case MHD_DAEMON_INFO_BIND_PORT:
+    return (const union MHD_DaemonInfo *) &daemon->port;
+  default:
+    return NULL;
+  }
 }
 
 
@@ -6967,13 +7040,13 @@ MHD_get_version (void)
   static char ver[12] = "\0\0\0\0\0\0\0\0\0\0\0";
   if (0 == ver[0])
   {
-    int res = MHD_snprintf_(ver,
-                            sizeof(ver),
-                            "%x.%x.%x",
-                            (((int)MHD_VERSION >> 24) & 0xFF),
-                            (((int)MHD_VERSION >> 16) & 0xFF),
-                            (((int)MHD_VERSION >> 8) & 0xFF));
-    if (0 >= res || sizeof(ver) <= res)
+    int res = MHD_snprintf_ (ver,
+                             sizeof(ver),
+                             "%x.%x.%x",
+                             (((int) MHD_VERSION >> 24) & 0xFF),
+                             (((int) MHD_VERSION >> 16) & 0xFF),
+                             (((int) MHD_VERSION >> 8) & 0xFF));
+    if ((0 >= res)||(sizeof(ver) <= res))
       return "0.0.0"; /* Can't return real version*/
   }
   return ver;
@@ -6993,154 +7066,155 @@ MHD_get_version (void)
  * @ingroup specialized
  */
 _MHD_EXTERN int
-MHD_is_feature_supported(enum MHD_FEATURE feature)
+MHD_is_feature_supported (enum MHD_FEATURE feature)
 {
-  switch(feature)
-    {
-    case MHD_FEATURE_MESSAGES:
+  switch (feature)
+  {
+  case MHD_FEATURE_MESSAGES:
 #ifdef HAVE_MESSAGES
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_TLS:
+  case MHD_FEATURE_TLS:
 #ifdef HTTPS_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else  /* ! HTTPS_SUPPORT */
-      return MHD_NO;
+    return MHD_NO;
 #endif  /* ! HTTPS_SUPPORT */
-    case MHD_FEATURE_HTTPS_CERT_CALLBACK:
+  case MHD_FEATURE_HTTPS_CERT_CALLBACK:
 #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_MAJOR >= 3
-      return MHD_YES;
+    return MHD_YES;
 #else  /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */
-    case MHD_FEATURE_HTTPS_CERT_CALLBACK2:
+  case MHD_FEATURE_HTTPS_CERT_CALLBACK2:
 #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_NUMBER >= 0x030603
-      return MHD_YES;
+    return MHD_YES;
 #else  /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030603 */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030603 */
-    case MHD_FEATURE_IPv6:
+  case MHD_FEATURE_IPv6:
 #ifdef HAVE_INET6
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_IPv6_ONLY:
+  case MHD_FEATURE_IPv6_ONLY:
 #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_POLL:
+  case MHD_FEATURE_POLL:
 #ifdef HAVE_POLL
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_EPOLL:
+  case MHD_FEATURE_EPOLL:
 #ifdef EPOLL_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET:
+  case MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET:
 #ifdef HAVE_LISTEN_SHUTDOWN
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_SOCKETPAIR:
+  case MHD_FEATURE_SOCKETPAIR:
 #ifdef _MHD_ITC_SOCKETPAIR
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_TCP_FASTOPEN:
+  case MHD_FEATURE_TCP_FASTOPEN:
 #ifdef TCP_FASTOPEN
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_BASIC_AUTH:
+  case MHD_FEATURE_BASIC_AUTH:
 #ifdef BAUTH_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_DIGEST_AUTH:
+  case MHD_FEATURE_DIGEST_AUTH:
 #ifdef DAUTH_SUPPORT
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_POSTPROCESSOR:
+  case MHD_FEATURE_POSTPROCESSOR:
 #ifdef HAVE_POSTPROCESSOR
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_HTTPS_KEY_PASSWORD:
+  case MHD_FEATURE_HTTPS_KEY_PASSWORD:
 #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_NUMBER >= 0x030111
-      return MHD_YES;
+    return MHD_YES;
 #else  /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */
-      return MHD_NO;
+    return MHD_NO;
 #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */
-    case MHD_FEATURE_LARGE_FILE:
+  case MHD_FEATURE_LARGE_FILE:
 #if defined(HAVE_PREAD64) || defined(_WIN32)
-      return MHD_YES;
+    return MHD_YES;
 #elif defined(HAVE_PREAD)
-      return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
+    return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
 #elif defined(HAVE_LSEEK64)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
+    return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
 #endif
-    case MHD_FEATURE_THREAD_NAMES:
+  case MHD_FEATURE_THREAD_NAMES:
 #if defined(MHD_USE_THREAD_NAME_)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_UPGRADE:
+  case MHD_FEATURE_UPGRADE:
 #if defined(UPGRADE_SUPPORT)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_RESPONSES_SHARED_FD:
+  case MHD_FEATURE_RESPONSES_SHARED_FD:
 #if defined(HAVE_PREAD64) || defined(HAVE_PREAD) || defined(_WIN32)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_AUTODETECT_BIND_PORT:
+  case MHD_FEATURE_AUTODETECT_BIND_PORT:
 #ifdef MHD_USE_GETSOCKNAME
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE:
-#if defined(MHD_WINSOCK_SOCKETS) || defined(MHD_socket_nosignal_) || defined 
(MSG_NOSIGNAL)
-      return MHD_YES;
+  case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE:
+#if defined(MHD_WINSOCK_SOCKETS) || defined(MHD_socket_nosignal_) || \
+    defined (MSG_NOSIGNAL)
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_SENDFILE:
+  case MHD_FEATURE_SENDFILE:
 #ifdef _MHD_HAVE_SENDFILE
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
-    case MHD_FEATURE_THREADS:
+  case MHD_FEATURE_THREADS:
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      return MHD_YES;
+    return MHD_YES;
 #else
-      return MHD_NO;
+    return MHD_NO;
 #endif
 
-    }
+  }
   return MHD_NO;
 }
 
@@ -7158,12 +7232,12 @@ gcry_w32_mutex_init (void **ppmtx)
 
   if (NULL == *ppmtx)
     return ENOMEM;
-  if (!MHD_mutex_init_ ((MHD_mutex_*)*ppmtx))
-    {
-      free (*ppmtx);
-      *ppmtx = NULL;
-      return EPERM;
-    }
+  if (! MHD_mutex_init_ ((MHD_mutex_*) *ppmtx))
+  {
+    free (*ppmtx);
+    *ppmtx = NULL;
+    return EPERM;
+  }
 
   return 0;
 }
@@ -7172,7 +7246,7 @@ gcry_w32_mutex_init (void **ppmtx)
 static int
 gcry_w32_mutex_destroy (void **ppmtx)
 {
-  int res = (MHD_mutex_destroy_ ((MHD_mutex_*)*ppmtx)) ? 0 : EINVAL;
+  int res = (MHD_mutex_destroy_ ((MHD_mutex_*) *ppmtx)) ? 0 : EINVAL;
   free (*ppmtx);
   return res;
 }
@@ -7181,14 +7255,14 @@ gcry_w32_mutex_destroy (void **ppmtx)
 static int
 gcry_w32_mutex_lock (void **ppmtx)
 {
-  return MHD_mutex_lock_ ((MHD_mutex_*)*ppmtx) ? 0 : EINVAL;
+  return MHD_mutex_lock_ ((MHD_mutex_*) *ppmtx) ? 0 : EINVAL;
 }
 
 
 static int
 gcry_w32_mutex_unlock (void **ppmtx)
 {
-  return MHD_mutex_unlock_ ((MHD_mutex_*)*ppmtx) ? 0 : EINVAL;
+  return MHD_mutex_unlock_ ((MHD_mutex_*) *ppmtx) ? 0 : EINVAL;
 }
 
 
@@ -7196,7 +7270,8 @@ static struct gcry_thread_cbs gcry_threads_w32 = {
   (GCRY_THREAD_OPTION_USER | (GCRY_THREAD_OPTION_VERSION << 8)),
   NULL, gcry_w32_mutex_init, gcry_w32_mutex_destroy,
   gcry_w32_mutex_lock, gcry_w32_mutex_unlock,
-  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
 
 #endif /* defined(MHD_W32_MUTEX_) */
 #endif /* HTTPS_SUPPORT && GCRYPT_VERSION_NUMBER < 0x010600 */
@@ -7206,7 +7281,7 @@ static struct gcry_thread_cbs gcry_threads_w32 = {
  * Initialize do setup work.
  */
 void
-MHD_init(void)
+MHD_init (void)
 {
 #if defined(MHD_WINSOCK_SOCKETS)
   WSADATA wsd;
@@ -7216,11 +7291,11 @@ MHD_init(void)
     mhd_panic = &mhd_panic_std;
 
 #if defined(MHD_WINSOCK_SOCKETS)
-  if (0 != WSAStartup(MAKEWORD(2, 2), &wsd))
-    MHD_PANIC (_("Failed to initialize winsock\n"));
+  if (0 != WSAStartup (MAKEWORD (2, 2), &wsd))
+    MHD_PANIC (_ ("Failed to initialize winsock\n"));
   mhd_winsock_inited_ = 1;
-  if (2 != LOBYTE(wsd.wVersion) && 2 != HIBYTE(wsd.wVersion))
-    MHD_PANIC (_("Winsock version 2.2 is not available\n"));
+  if ((2 != LOBYTE (wsd.wVersion))&&(2 != HIBYTE (wsd.wVersion)))
+    MHD_PANIC (_ ("Winsock version 2.2 is not available\n"));
 #endif /* MHD_WINSOCK_SOCKETS */
 #ifdef HTTPS_SUPPORT
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
@@ -7228,21 +7303,22 @@ MHD_init(void)
 #if defined(MHD_USE_POSIX_THREADS)
   if (0 != gcry_control (GCRYCTL_SET_THREAD_CBS,
                          &gcry_threads_pthread))
-    MHD_PANIC (_("Failed to initialise multithreading in libgcrypt\n"));
+    MHD_PANIC (_ ("Failed to initialise multithreading in libgcrypt\n"));
 #elif defined(MHD_W32_MUTEX_)
   if (0 != gcry_control (GCRYCTL_SET_THREAD_CBS,
                          &gcry_threads_w32))
-    MHD_PANIC (_("Failed to initialise multithreading in libgcrypt\n"));
+    MHD_PANIC (_ ("Failed to initialise multithreading in libgcrypt\n"));
 #endif /* defined(MHD_W32_MUTEX_) */
   gcry_check_version (NULL);
 #else
   if (NULL == gcry_check_version ("1.6.0"))
-    MHD_PANIC (_("libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 
or newer\n"));
+    MHD_PANIC (_ (
+                 "libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 
or newer\n"));
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
   gnutls_global_init ();
 #endif /* HTTPS_SUPPORT */
-  MHD_monotonic_sec_counter_init();
+  MHD_monotonic_sec_counter_init ();
 #ifdef HAVE_FREEBSD_SENDFILE
   MHD_conn_init_static_ ();
 #endif /* HAVE_FREEBSD_SENDFILE */
@@ -7251,20 +7327,20 @@ MHD_init(void)
 
 
 void
-MHD_fini(void)
+MHD_fini (void)
 {
 #ifdef HTTPS_SUPPORT
   gnutls_global_deinit ();
 #endif /* HTTPS_SUPPORT */
 #if defined(MHD_WINSOCK_SOCKETS)
   if (mhd_winsock_inited_)
-    WSACleanup();
+    WSACleanup ();
 #endif /* MHD_WINSOCK_SOCKETS */
-  MHD_monotonic_sec_counter_finish();
+  MHD_monotonic_sec_counter_finish ();
 }
 
 #ifdef _AUTOINIT_FUNCS_ARE_SUPPORTED
-_SET_INIT_AND_DEINIT_FUNCS(MHD_init, MHD_fini);
+_SET_INIT_AND_DEINIT_FUNCS (MHD_init, MHD_fini);
 #endif /* _AUTOINIT_FUNCS_ARE_SUPPORTED */
 
 /* end of daemon.c */
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index ce7edb79..95aee7b4 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -82,13 +82,15 @@
 /**
  * Check that @a n is below #MAX_NONCE
  */
-#define VLA_CHECK_LEN_DIGEST(n) do { if ((n) > MAX_DIGEST) 
mhd_panic(mhd_panic_cls, __FILE__, __LINE__, "VLA too big"); } while (0)
+#define VLA_CHECK_LEN_DIGEST(n) do { if ((n) > MAX_DIGEST) mhd_panic ( \
+                                         mhd_panic_cls, __FILE__, __LINE__, \
+                                         "VLA too big"); } while (0)
 
 
 /**
  * Beginning string for any valid Digest authentication header.
  */
-#define _BASE          "Digest "
+#define _BASE   "Digest "
 
 /**
  * Maximum length of a username for digest authentication.
@@ -149,7 +151,7 @@ struct DigestAlgorithm
    */
   void
   (*update)(void *ctx,
-           const uint8_t *data,
+            const uint8_t *data,
             size_t length);
 
   /**
@@ -161,7 +163,7 @@ struct DigestAlgorithm
    */
   void
   (*digest)(void *ctx,
-           uint8_t *digest);
+            uint8_t *digest);
 };
 
 
@@ -174,19 +176,19 @@ struct DigestAlgorithm
  */
 static void
 cvthex (const unsigned char *bin,
-       size_t len,
-       char *hex)
+        size_t len,
+        char *hex)
 {
   size_t i;
   unsigned int j;
 
   for (i = 0; i < len; ++i)
-    {
-      j = (bin[i] >> 4) & 0x0f;
-      hex[i * 2] = (char)((j <= 9) ? (j + '0') : (j - 10 + 'a'));
-      j = bin[i] & 0x0f;
-      hex[i * 2 + 1] = (char)((j <= 9) ? (j + '0') : (j - 10 + 'a'));
-    }
+  {
+    j = (bin[i] >> 4) & 0x0f;
+    hex[i * 2] = (char) ((j <= 9) ? (j + '0') : (j - 10 + 'a'));
+    j = bin[i] & 0x0f;
+    hex[i * 2 + 1] = (char) ((j <= 9) ? (j + '0') : (j - 10 + 'a'));
+  }
   hex[len * 2] = '\0';
 }
 
@@ -201,54 +203,54 @@ cvthex (const unsigned char *bin,
  * @param[in,out] da digest implementation, must match @a alg; the
  *          da->sessionkey will be initialized to the digest in HEX
  * @param digest An `unsigned char *' pointer to the binary MD5 sum
- *                     for the precalculated hash value 
"username:realm:password"
- *                     of #MHD_MD5_DIGEST_SIZE or #MHD_SHA256_DIGEST_SIZE bytes
+ *      for the precalculated hash value "username:realm:password"
+ *      of #MHD_MD5_DIGEST_SIZE or #MHD_SHA256_DIGEST_SIZE bytes
  * @param nonce A `char *' pointer to the nonce value
  * @param cnonce A `char *' pointer to the cnonce value
  */
 static void
 digest_calc_ha1_from_digest (const char *alg,
                              struct DigestAlgorithm *da,
-                            const uint8_t *digest,
-                            const char *nonce,
-                            const char *cnonce)
+                             const uint8_t *digest,
+                             const char *nonce,
+                             const char *cnonce)
 {
-  if ( (MHD_str_equal_caseless_(alg,
-                                "md5-sess")) ||
-       (MHD_str_equal_caseless_(alg,
-                                "sha-256-sess")) )
-    {
-      uint8_t dig[VLA_ARRAY_LEN_DIGEST(da->digest_size)];
+  if ( (MHD_str_equal_caseless_ (alg,
+                                 "md5-sess")) ||
+       (MHD_str_equal_caseless_ (alg,
+                                 "sha-256-sess")) )
+  {
+    uint8_t dig[VLA_ARRAY_LEN_DIGEST (da->digest_size)];
 
-      VLA_CHECK_LEN_DIGEST(da->digest_size);
-      da->init (da->ctx);
-      da->update (da->ctx,
-                  digest,
-                  MHD_MD5_DIGEST_SIZE);
-      da->update (da->ctx,
-                  (const unsigned char *) ":",
-                  1);
-      da->update (da->ctx,
-                  (const unsigned char *) nonce,
-                  strlen (nonce));
-      da->update (da->ctx,
-                 (const unsigned char *) ":",
-                 1);
-      da->update (da->ctx,
-                  (const unsigned char *) cnonce,
-                  strlen (cnonce));
-      da->digest (da->ctx,
-                  dig);
-      cvthex (dig,
-              sizeof (dig),
-              da->sessionkey);
-    }
+    VLA_CHECK_LEN_DIGEST (da->digest_size);
+    da->init (da->ctx);
+    da->update (da->ctx,
+                digest,
+                MHD_MD5_DIGEST_SIZE);
+    da->update (da->ctx,
+                (const unsigned char *) ":",
+                1);
+    da->update (da->ctx,
+                (const unsigned char *) nonce,
+                strlen (nonce));
+    da->update (da->ctx,
+                (const unsigned char *) ":",
+                1);
+    da->update (da->ctx,
+                (const unsigned char *) cnonce,
+                strlen (cnonce));
+    da->digest (da->ctx,
+                dig);
+    cvthex (dig,
+            sizeof (dig),
+            da->sessionkey);
+  }
   else
-    {
-      cvthex (digest,
-             da->digest_size,
-             da->sessionkey);
-    }
+  {
+    cvthex (digest,
+            da->digest_size,
+            da->sessionkey);
+  }
 }
 
 
@@ -268,20 +270,20 @@ digest_calc_ha1_from_digest (const char *alg,
  */
 static void
 digest_calc_ha1_from_user (const char *alg,
-                          const char *username,
-                          const char *realm,
-                          const char *password,
-                          const char *nonce,
-                          const char *cnonce,
+                           const char *username,
+                           const char *realm,
+                           const char *password,
+                           const char *nonce,
+                           const char *cnonce,
                            struct DigestAlgorithm *da)
 {
-  unsigned char ha1[VLA_ARRAY_LEN_DIGEST(da->digest_size)];
+  unsigned char ha1[VLA_ARRAY_LEN_DIGEST (da->digest_size)];
 
-  VLA_CHECK_LEN_DIGEST(da->digest_size);
+  VLA_CHECK_LEN_DIGEST (da->digest_size);
   da->init (da->ctx);
   da->update (da->ctx,
-             (const unsigned char *) username,
-             strlen (username));
+              (const unsigned char *) username,
+              strlen (username));
   da->update (da->ctx,
               (const unsigned char *) ":",
               1);
@@ -322,20 +324,20 @@ digest_calc_ha1_from_user (const char *alg,
  */
 static void
 digest_calc_response (const char *ha1,
-                     const char *nonce,
-                     const char *noncecount,
-                     const char *cnonce,
-                     const char *qop,
-                     const char *method,
-                     const char *uri,
-                     const char *hentity,
-                     struct DigestAlgorithm *da)
+                      const char *nonce,
+                      const char *noncecount,
+                      const char *cnonce,
+                      const char *qop,
+                      const char *method,
+                      const char *uri,
+                      const char *hentity,
+                      struct DigestAlgorithm *da)
 {
-  unsigned char ha2[VLA_ARRAY_LEN_DIGEST(da->digest_size)];
-  unsigned char resphash[VLA_ARRAY_LEN_DIGEST(da->digest_size)];
-  (void)hentity; /* Unused. Silence compiler warning. */
+  unsigned char ha2[VLA_ARRAY_LEN_DIGEST (da->digest_size)];
+  unsigned char resphash[VLA_ARRAY_LEN_DIGEST (da->digest_size)];
+  (void) hentity; /* Unused. Silence compiler warning. */
 
-  VLA_CHECK_LEN_DIGEST(da->digest_size);
+  VLA_CHECK_LEN_DIGEST (da->digest_size);
   da->init (da->ctx);
   da->update (da->ctx,
               (const unsigned char *) method,
@@ -344,22 +346,22 @@ digest_calc_response (const char *ha1,
               (const unsigned char *) ":",
               1);
   da->update (da->ctx,
-             (const unsigned char *) uri,
-             strlen (uri));
+              (const unsigned char *) uri,
+              strlen (uri));
 #if 0
   if (0 == strcasecmp (qop,
                        "auth-int"))
-    {
-      /* This is dead code since the rest of this module does
-        not support auth-int. */
+  {
+    /* This is dead code since the rest of this module does
+ not support auth-int. */
+    da->update (da->ctx,
+                ":",
+                1);
+    if (NULL != hentity)
       da->update (da->ctx,
-                  ":",
-                  1);
-      if (NULL != hentity)
-       da->update (da->ctx,
-                    hentity,
-                    strlen (hentity));
-    }
+                  hentity,
+                  strlen (hentity));
+  }
 #endif
   da->digest (da->ctx,
               ha2);
@@ -381,26 +383,26 @@ digest_calc_response (const char *ha1,
               (const unsigned char*) ":",
               1);
   if ('\0' != *qop)
-    {
-      da->update (da->ctx,
-                  (const unsigned char *) noncecount,
-                  strlen (noncecount));
-      da->update (da->ctx,
-                  (const unsigned char *) ":",
-                  1);
-      da->update (da->ctx,
-                  (const unsigned char *) cnonce,
-                  strlen (cnonce));
-      da->update (da->ctx,
-                  (const unsigned char *) ":",
-                  1);
-      da->update (da->ctx,
-                  (const unsigned char *) qop,
-                  strlen (qop));
-      da->update (da->ctx,
-                  (const unsigned char *) ":",
-                  1);
-    }
+  {
+    da->update (da->ctx,
+                (const unsigned char *) noncecount,
+                strlen (noncecount));
+    da->update (da->ctx,
+                (const unsigned char *) ":",
+                1);
+    da->update (da->ctx,
+                (const unsigned char *) cnonce,
+                strlen (cnonce));
+    da->update (da->ctx,
+                (const unsigned char *) ":",
+                1);
+    da->update (da->ctx,
+                (const unsigned char *) qop,
+                strlen (qop));
+    da->update (da->ctx,
+                (const unsigned char *) ":",
+                1);
+  }
   da->update (da->ctx,
               (const unsigned char *) da->sessionkey,
               da->digest_size * 2);
@@ -428,9 +430,9 @@ digest_calc_response (const char *ha1,
  */
 static size_t
 lookup_sub_value (char *dest,
-                 size_t size,
-                 const char *data,
-                 const char *key)
+                  size_t size,
+                  const char *data,
+                  const char *key)
 {
   size_t keylen;
   size_t len;
@@ -445,67 +447,67 @@ lookup_sub_value (char *dest,
   keylen = strlen (key);
   ptr = data;
   while ('\0' != *ptr)
+  {
+    if (NULL == (eq = strchr (ptr,
+                              '=')))
+      return 0;
+    q1 = eq + 1;
+    while (' ' == *q1)
+      q1++;
+    if ('\"' != *q1)
+    {
+      q2 = strchr (q1,
+                   ',');
+      qn = q2;
+    }
+    else
+    {
+      q1++;
+      q2 = strchr (q1,
+                   '\"');
+      if (NULL == q2)
+        return 0; /* end quote not found */
+      qn = q2 + 1;
+    }
+    if ( (MHD_str_equal_caseless_n_ (ptr,
+                                     key,
+                                     keylen)) &&
+         (eq == &ptr[keylen]) )
     {
-      if (NULL == (eq = strchr (ptr,
-                                '=')))
-       return 0;
-      q1 = eq + 1;
-      while (' ' == *q1)
-       q1++;
-      if ('\"' != *q1)
-       {
-         q2 = strchr (q1,
-                       ',');
-         qn = q2;
-       }
+      if (NULL == q2)
+      {
+        len = strlen (q1) + 1;
+        if (size > len)
+          size = len;
+        size--;
+        strncpy (dest,
+                 q1,
+                 size);
+        dest[size] = '\0';
+        return size;
+      }
       else
-       {
-         q1++;
-         q2 = strchr (q1,
-                       '\"');
-         if (NULL == q2)
-           return 0; /* end quote not found */
-         qn = q2 + 1;
-       }
-      if ( (MHD_str_equal_caseless_n_(ptr,
-                                      key,
-                                      keylen)) &&
-          (eq == &ptr[keylen]) )
-       {
-         if (NULL == q2)
-           {
-             len = strlen (q1) + 1;
-             if (size > len)
-               size = len;
-             size--;
-             strncpy (dest,
-                      q1,
-                      size);
-             dest[size] = '\0';
-             return size;
-           }
-         else
-           {
-             if (size > (size_t) ((q2 - q1) + 1))
-               size = (q2 - q1) + 1;
-             size--;
-             memcpy (dest,
-                     q1,
-                     size);
-             dest[size] = '\0';
-             return size;
-           }
-       }
-      if (NULL == qn)
-       return 0;
-      ptr = strchr (qn,
-                    ',');
-      if (NULL == ptr)
-       return 0;
-      ptr++;
-      while (' ' == *ptr)
-       ptr++;
+      {
+        if (size > (size_t) ((q2 - q1) + 1))
+          size = (q2 - q1) + 1;
+        size--;
+        memcpy (dest,
+                q1,
+                size);
+        dest[size] = '\0';
+        return size;
+      }
     }
+    if (NULL == qn)
+      return 0;
+    ptr = strchr (qn,
+                  ',');
+    if (NULL == ptr)
+      return 0;
+    ptr++;
+    while (' ' == *ptr)
+      ptr++;
+  }
   return 0;
 }
 
@@ -521,8 +523,8 @@ lookup_sub_value (char *dest,
  */
 static int
 check_nonce_nc (struct MHD_Connection *connection,
-               const char *nonce,
-               uint64_t nc)
+                const char *nonce,
+                uint64_t nc)
 {
   struct MHD_Daemon *daemon = connection->daemon;
   struct MHD_NonceNc *nn;
@@ -544,10 +546,10 @@ check_nonce_nc (struct MHD_Connection *connection,
   off = 0;
   np = nonce;
   while ('\0' != *np)
-    {
-      off = (off << 8) | (*np ^ (off >> 24));
-      np++;
-    }
+  {
+    off = (off << 8) | (*np ^ (off >> 24));
+    np++;
+  }
   off = off % mod;
   /*
    * Look for the nonce, if it does exist and its corresponding
@@ -559,47 +561,48 @@ check_nonce_nc (struct MHD_Connection *connection,
   MHD_mutex_lock_chk_ (&daemon->nnc_lock);
 #endif
   if (0 == nc)
-    {
-      /* Fresh nonce, reinitialize array */
-      memcpy (nn->nonce,
-             nonce,
-             noncelen);
-      nn->nc = 0;
-      nn->nmask = 0;
+  {
+    /* Fresh nonce, reinitialize array */
+    memcpy (nn->nonce,
+            nonce,
+            noncelen);
+    nn->nc = 0;
+    nn->nmask = 0;
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_unlock_chk_ (&daemon->nnc_lock);
+    MHD_mutex_unlock_chk_ (&daemon->nnc_lock);
 #endif
-      return MHD_YES;
-    }
+    return MHD_YES;
+  }
   /* Note that we use 64 here, as we do not store the
      bit for 'nn->nc' itself in 'nn->nmask' */
   if ( (nc < nn->nc) &&
        (nc + 64 > nc /* checking for overflow */) &&
        (nc + 64 >= nn->nc) &&
        (0 == ((1LLU << (nn->nc - nc - 1)) & nn->nmask)) )
-    {
-      /* Out-of-order nonce, but within 64-bit bitmask, set bit */
-      nn->nmask |= (1LLU << (nn->nc - nc - 1));
+  {
+    /* Out-of-order nonce, but within 64-bit bitmask, set bit */
+    nn->nmask |= (1LLU << (nn->nc - nc - 1));
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_unlock_chk_ (&daemon->nnc_lock);
+    MHD_mutex_unlock_chk_ (&daemon->nnc_lock);
 #endif
-      return MHD_YES;
-    }
+    return MHD_YES;
+  }
 
   if ( (nc <= nn->nc) ||
        (0 != strcmp (nn->nonce,
                      nonce)) )
-    {
-      /* Nonce does not match, fail */
+  {
+    /* Nonce does not match, fail */
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_unlock_chk_ (&daemon->nnc_lock);
+    MHD_mutex_unlock_chk_ (&daemon->nnc_lock);
 #endif
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("Stale nonce received.  If this happens a lot, you should 
probably increase the size of the nonce array.\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "Stale nonce received.  If this happens a lot, you should 
probably increase the size of the nonce array.\n"));
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
   /* Nonce is larger, shift bitmask and bump limit */
   if (64 > nc - nn->nc)
     nn->nmask <<= (nc - nn->nc); /* small jump, less than mask width */
@@ -618,12 +621,12 @@ check_nonce_nc (struct MHD_Connection *connection,
  *
  * @param connection The MHD connection structure
  * @return NULL if no username could be found, a pointer
- *                     to the username if found
+ *      to the username if found
  * @warning Returned value must be freed by #MHD_free().
  * @ingroup authentication
  */
 char *
-MHD_digest_auth_get_username(struct MHD_Connection *connection)
+MHD_digest_auth_get_username (struct MHD_Connection *connection)
 {
   size_t len;
   char user[MAX_USERNAME_LENGTH];
@@ -632,7 +635,8 @@ MHD_digest_auth_get_username(struct MHD_Connection 
*connection)
   if (MHD_NO == MHD_lookup_connection_value_n (connection,
                                                MHD_HEADER_KIND,
                                                MHD_HTTP_HEADER_AUTHORIZATION,
-                                               MHD_STATICSTR_LEN_ 
(MHD_HTTP_HEADER_AUTHORIZATION),
+                                               MHD_STATICSTR_LEN_ (
+                                                 
MHD_HTTP_HEADER_AUTHORIZATION),
                                                &header,
                                                NULL))
     return NULL;
@@ -642,9 +646,9 @@ MHD_digest_auth_get_username(struct MHD_Connection 
*connection)
     return NULL;
   header += MHD_STATICSTR_LEN_ (_BASE);
   if (0 == (len = lookup_sub_value (user,
-                                   sizeof (user),
-                                   header,
-                                   "username")))
+                                    sizeof (user),
+                                    header,
+                                    "username")))
     return NULL;
   return strdup (user);
 }
@@ -667,24 +671,24 @@ MHD_digest_auth_get_username(struct MHD_Connection 
*connection)
  */
 static void
 calculate_nonce (uint32_t nonce_time,
-                const char *method,
-                const char *rnd,
-                size_t rnd_size,
-                const char *uri,
-                const char *realm,
+                 const char *method,
+                 const char *rnd,
+                 size_t rnd_size,
+                 const char *uri,
+                 const char *realm,
                  struct DigestAlgorithm *da,
-                char *nonce)
+                 char *nonce)
 {
   unsigned char timestamp[TIMESTAMP_BIN_SIZE];
-  unsigned char tmpnonce[VLA_ARRAY_LEN_DIGEST(da->digest_size)];
+  unsigned char tmpnonce[VLA_ARRAY_LEN_DIGEST (da->digest_size)];
   char timestamphex[TIMESTAMP_BIN_SIZE * 2 + 1];
 
-  VLA_CHECK_LEN_DIGEST(da->digest_size);
+  VLA_CHECK_LEN_DIGEST (da->digest_size);
   da->init (da->ctx);
-  timestamp[0] = (unsigned char)((nonce_time & 0xff000000) >> 0x18);
-  timestamp[1] = (unsigned char)((nonce_time & 0x00ff0000) >> 0x10);
-  timestamp[2] = (unsigned char)((nonce_time & 0x0000ff00) >> 0x08);
-  timestamp[3] = (unsigned char)((nonce_time & 0x000000ff));
+  timestamp[0] = (unsigned char) ((nonce_time & 0xff000000) >> 0x18);
+  timestamp[1] = (unsigned char) ((nonce_time & 0x00ff0000) >> 0x10);
+  timestamp[2] = (unsigned char) ((nonce_time & 0x0000ff00) >> 0x08);
+  timestamp[3] = (unsigned char) ((nonce_time & 0x000000ff));
   da->update (da->ctx,
               timestamp,
               sizeof (timestamp));
@@ -742,37 +746,37 @@ calculate_nonce (uint32_t nonce_time,
  */
 static int
 test_header (struct MHD_Connection *connection,
-            const char *key,
+             const char *key,
              size_t key_size,
-            const char *value,
-            size_t value_size,
-            enum MHD_ValueKind kind)
+             const char *value,
+             size_t value_size,
+             enum MHD_ValueKind kind)
 {
   struct MHD_HTTP_Header *pos;
 
   for (pos = connection->headers_received; NULL != pos; pos = pos->next)
-    {
-      if (kind != pos->kind)
-       continue;
-      if (key_size != pos->header_size)
-       continue;
-      if (value_size != pos->value_size)
-        continue;
-      if (0 != memcmp (key,
-                       pos->header,
-                       key_size))
-       continue;
-      if ( (NULL == value) &&
-          (NULL == pos->value) )
-       return MHD_YES;
-      if ( (NULL == value) ||
-          (NULL == pos->value) ||
-          (0 != memcmp (value,
-                         pos->value,
-                        value_size)) )
-       continue;
+  {
+    if (kind != pos->kind)
+      continue;
+    if (key_size != pos->header_size)
+      continue;
+    if (value_size != pos->value_size)
+      continue;
+    if (0 != memcmp (key,
+                     pos->header,
+                     key_size))
+      continue;
+    if ( (NULL == value) &&
+         (NULL == pos->value) )
       return MHD_YES;
-    }
+    if ( (NULL == value) ||
+         (NULL == pos->value) ||
+         (0 != memcmp (value,
+                       pos->value,
+                       value_size)) )
+      continue;
+    return MHD_YES;
+  }
   return MHD_NO;
 }
 
@@ -789,7 +793,7 @@ test_header (struct MHD_Connection *connection,
  */
 static int
 check_argument_match (struct MHD_Connection *connection,
-                     const char *args)
+                      const char *args)
 {
   struct MHD_HTTP_Header *pos;
   char *argb;
@@ -798,35 +802,35 @@ check_argument_match (struct MHD_Connection *connection,
 
   argb = strdup (args);
   if (NULL == argb)
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (connection->daemon,
-               _("Failed to allocate memory for copy of URI arguments\n"));
+    MHD_DLOG (connection->daemon,
+              _ ("Failed to allocate memory for copy of URI arguments\n"));
 #endif /* HAVE_MESSAGES */
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
   ret = MHD_parse_arguments_ (connection,
-                             MHD_GET_ARGUMENT_KIND,
-                             argb,
-                             &test_header,
-                             &num_headers);
+                              MHD_GET_ARGUMENT_KIND,
+                              argb,
+                              &test_header,
+                              &num_headers);
   free (argb);
   if (MHD_YES != ret)
-    {
-      return MHD_NO;
-    }
+  {
+    return MHD_NO;
+  }
   /* also check that the number of headers matches */
   for (pos = connection->headers_received; NULL != pos; pos = pos->next)
-    {
-      if (MHD_GET_ARGUMENT_KIND != pos->kind)
-       continue;
-      num_headers--;
-    }
+  {
+    if (MHD_GET_ARGUMENT_KIND != pos->kind)
+      continue;
+    num_headers--;
+  }
   if (0 != num_headers)
-    {
-      /* argument count mismatch */
-      return MHD_NO;
-    }
+  {
+    /* argument count mismatch */
+    return MHD_NO;
+  }
   return MHD_YES;
 }
 
@@ -842,51 +846,52 @@ check_argument_match (struct MHD_Connection *connection,
  * @param username The username needs to be authenticated
  * @param password The password used in the authentication
  * @param digest An optional binary hash
- *              of the precalculated hash value "username:realm:password"
- *              (must contain "da->digest_size" bytes or be NULL)
+ *     of the precalculated hash value "username:realm:password"
+ *     (must contain "da->digest_size" bytes or be NULL)
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  */
 static int
 digest_auth_check_all (struct MHD_Connection *connection,
                        struct DigestAlgorithm *da,
-                      const char *realm,
-                      const char *username,
-                      const char *password,
-                      const uint8_t *digest,
-                      unsigned int nonce_timeout)
+                       const char *realm,
+                       const char *username,
+                       const char *password,
+                       const uint8_t *digest,
+                       unsigned int nonce_timeout)
 {
   struct MHD_Daemon *daemon = connection->daemon;
   size_t len;
   const char *header;
   char nonce[MAX_NONCE_LENGTH];
   char cnonce[MAX_NONCE_LENGTH];
-  char ha1[VLA_ARRAY_LEN_DIGEST(da->digest_size) * 2 + 1];
+  char ha1[VLA_ARRAY_LEN_DIGEST (da->digest_size) * 2 + 1];
   char qop[15]; /* auth,auth-int */
   char nc[20];
   char response[MAX_AUTH_RESPONSE_LENGTH];
   const char *hentity = NULL; /* "auth-int" is not supported */
-  char noncehashexp[NONCE_STD_LEN(VLA_ARRAY_LEN_DIGEST(da->digest_size)) + 1];
+  char noncehashexp[NONCE_STD_LEN (VLA_ARRAY_LEN_DIGEST (da->digest_size)) + 
1];
   uint32_t nonce_time;
   uint32_t t;
   size_t left; /* number of characters left in 'header' for 'uri' */
   uint64_t nci;
   char *qmark;
 
-  VLA_CHECK_LEN_DIGEST(da->digest_size);
+  VLA_CHECK_LEN_DIGEST (da->digest_size);
   if (MHD_NO == MHD_lookup_connection_value_n (connection,
                                                MHD_HEADER_KIND,
                                                MHD_HTTP_HEADER_AUTHORIZATION,
-                                               MHD_STATICSTR_LEN_ 
(MHD_HTTP_HEADER_AUTHORIZATION),
+                                               MHD_STATICSTR_LEN_ (
+                                                 
MHD_HTTP_HEADER_AUTHORIZATION),
                                                &header,
                                                NULL))
     return MHD_NO;
   if (0 != strncmp (header,
                     _BASE,
-                    MHD_STATICSTR_LEN_(_BASE)))
+                    MHD_STATICSTR_LEN_ (_BASE)))
     return MHD_NO;
   header += MHD_STATICSTR_LEN_ (_BASE);
   left = strlen (header);
@@ -895,11 +900,11 @@ digest_auth_check_all (struct MHD_Connection *connection,
     char un[MAX_USERNAME_LENGTH];
 
     len = lookup_sub_value (un,
-                           sizeof (un),
-                           header,
+                            sizeof (un),
+                            header,
                             "username");
     if ( (0 == len) ||
-        (0 != strcmp (username,
+         (0 != strcmp (username,
                        un)) )
       return MHD_NO;
     left -= strlen ("username") + len;
@@ -913,15 +918,15 @@ digest_auth_check_all (struct MHD_Connection *connection,
                             header,
                             "realm");
     if ( (0 == len) ||
-        (0 != strcmp (realm,
+         (0 != strcmp (realm,
                        r)) )
       return MHD_NO;
     left -= strlen ("realm") + len;
   }
 
   if (0 == (len = lookup_sub_value (nonce,
-                                   sizeof (nonce),
-                                   header,
+                                    sizeof (nonce),
+                                    header,
                                     "nonce")))
     return MHD_NO;
   left -= strlen ("nonce") + len;
@@ -940,14 +945,14 @@ digest_auth_check_all (struct MHD_Connection *connection,
       MHD_strx_to_uint32_n_ (nonce + len - TIMESTAMP_BIN_SIZE * 2,
                              TIMESTAMP_BIN_SIZE * 2,
                              &nonce_time))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Authentication failed, invalid timestamp format.\n"));
+    MHD_DLOG (daemon,
+              _ ("Authentication failed, invalid timestamp format.\n"));
 #endif
-      return MHD_NO;
-    }
-  t = (uint32_t) MHD_monotonic_sec_counter();
+    return MHD_NO;
+  }
+  t = (uint32_t) MHD_monotonic_sec_counter ();
   /*
    * First level vetting for the nonce validity: if the timestamp
    * attached to the nonce exceeds `nonce_timeout', then the nonce is
@@ -955,10 +960,10 @@ digest_auth_check_all (struct MHD_Connection *connection,
    */
   if ( (t > nonce_time + nonce_timeout) ||
        (nonce_time + nonce_timeout < nonce_time) )
-    {
-      /* too old */
-      return MHD_INVALID_NONCE;
-    }
+  {
+    /* too old */
+    return MHD_INVALID_NONCE;
+  }
 
   calculate_nonce (nonce_time,
                    connection->method,
@@ -980,9 +985,9 @@ digest_auth_check_all (struct MHD_Connection *connection,
 
   if (0 != strcmp (nonce,
                    noncehashexp))
-    {
-      return MHD_INVALID_NONCE;
-    }
+  {
+    return MHD_INVALID_NONCE;
+  }
   if ( (0 == lookup_sub_value (cnonce,
                                sizeof (cnonce),
                                header,
@@ -1003,23 +1008,23 @@ digest_auth_check_all (struct MHD_Connection 
*connection,
                                sizeof (response),
                                header,
                                "response")) )
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("Authentication failed, invalid format.\n"));
+    MHD_DLOG (daemon,
+              _ ("Authentication failed, invalid format.\n"));
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
   if (len != MHD_strx_to_uint64_n_ (nc,
                                     len,
                                     &nci))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("Authentication failed, invalid nc format.\n"));
+    MHD_DLOG (daemon,
+              _ ("Authentication failed, invalid nc format.\n"));
 #endif
-      return MHD_NO; /* invalid nonce format */
-    }
+    return MHD_NO;   /* invalid nonce format */
+  }
 
   /*
    * Checking if that combination of nonce and nc is sound
@@ -1030,64 +1035,64 @@ digest_auth_check_all (struct MHD_Connection 
*connection,
       check_nonce_nc (connection,
                       nonce,
                       nci))
-    {
-      return MHD_NO;
-    }
+  {
+    return MHD_NO;
+  }
 
   {
     char *uri;
 
     uri = malloc (left + 1);
     if (NULL == uri)
-      {
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG(daemon,
-                 _("Failed to allocate memory for auth header processing\n"));
+      MHD_DLOG (daemon,
+                _ ("Failed to allocate memory for auth header processing\n"));
 #endif /* HAVE_MESSAGES */
-        return MHD_NO;
-      }
+      return MHD_NO;
+    }
     if (0 == lookup_sub_value (uri,
                                left + 1,
                                header,
                                "uri"))
-      {
-        free (uri);
-        return MHD_NO;
-      }
+    {
+      free (uri);
+      return MHD_NO;
+    }
     if (NULL != digest)
-      {
-        /* This will initialize da->sessionkey (ha1) */
-       digest_calc_ha1_from_digest (da->alg,
-                                     da,
-                                    digest,
-                                    nonce,
-                                    cnonce);
-      }
+    {
+      /* This will initialize da->sessionkey (ha1) */
+      digest_calc_ha1_from_digest (da->alg,
+                                   da,
+                                   digest,
+                                   nonce,
+                                   cnonce);
+    }
     else
-      {
-        /* This will initialize da->sessionkey (ha1) */
-        mhd_assert (NULL != password); /* NULL == digest => password != NULL */
-       digest_calc_ha1_from_user (da->alg,
-                                  username,
-                                  realm,
-                                  password,
-                                  nonce,
-                                  cnonce,
-                                   da);
-      }
+    {
+      /* This will initialize da->sessionkey (ha1) */
+      mhd_assert (NULL != password);   /* NULL == digest => password != NULL */
+      digest_calc_ha1_from_user (da->alg,
+                                 username,
+                                 realm,
+                                 password,
+                                 nonce,
+                                 cnonce,
+                                 da);
+    }
     memcpy (ha1,
             da->sessionkey,
             sizeof (ha1));
     /* This will initialize da->sessionkey (respexp) */
     digest_calc_response (ha1,
-                         nonce,
-                         nc,
-                         cnonce,
-                         qop,
-                         connection->method,
-                         uri,
-                         hentity,
-                         da);
+                          nonce,
+                          nc,
+                          cnonce,
+                          qop,
+                          connection->method,
+                          uri,
+                          hentity,
+                          da);
     qmark = strchr (uri,
                     '?');
     if (NULL != qmark)
@@ -1102,7 +1107,7 @@ digest_auth_check_all (struct MHD_Connection *connection,
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-               _("Authentication failed, URI does not match.\n"));
+                _ ("Authentication failed, URI does not match.\n"));
 #endif
       free (uri);
       return MHD_NO;
@@ -1112,26 +1117,26 @@ digest_auth_check_all (struct MHD_Connection 
*connection,
       const char *args = qmark;
 
       if (NULL == args)
-       args = "";
+        args = "";
       else
-       args++;
+        args++;
       if (MHD_YES !=
-         check_argument_match (connection,
-                               args) )
+          check_argument_match (connection,
+                                args) )
       {
 #ifdef HAVE_MESSAGES
-       MHD_DLOG (daemon,
-                 _("Authentication failed, arguments do not match.\n"));
+        MHD_DLOG (daemon,
+                  _ ("Authentication failed, arguments do not match.\n"));
 #endif
-       free (uri);
-       return MHD_NO;
+        free (uri);
+        return MHD_NO;
       }
     }
     free (uri);
     return (0 == strcmp (response,
                          da->sessionkey))
-      ? MHD_YES
-      : MHD_NO;
+           ? MHD_YES
+           : MHD_NO;
   }
 }
 
@@ -1148,17 +1153,17 @@ digest_auth_check_all (struct MHD_Connection 
*connection,
  * @param username The username needs to be authenticated
  * @param password The password used in the authentication
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  */
 _MHD_EXTERN int
 MHD_digest_auth_check (struct MHD_Connection *connection,
-                      const char *realm,
-                      const char *username,
-                      const char *password,
-                      unsigned int nonce_timeout)
+                       const char *realm,
+                       const char *username,
+                       const char *password,
+                       unsigned int nonce_timeout)
 {
   return MHD_digest_auth_check2 (connection,
                                  realm,
@@ -1189,29 +1194,29 @@ MHD_digest_auth_check (struct MHD_Connection 
*connection,
   struct DigestAlgorithm da;                      \
                                                   \
   do {                                            \
-  switch (algo) {                                 \
-  case MHD_DIGEST_ALG_MD5:                        \
-    da.digest_size = MD5_DIGEST_SIZE;             \
-    da.ctx = &ctx.md5;                            \
-    da.alg = "md5";                               \
-    da.sessionkey = skey.md5;                     \
-    da.init = &MHD_MD5Init;                           \
-    da.update = &MHD_MD5Update;                       \
-    da.digest = &MHD_MD5Final;                        \
-    break;                                        \
-  case MHD_DIGEST_ALG_AUTO:                             \
+    switch (algo) {                                 \
+    case MHD_DIGEST_ALG_MD5:                        \
+      da.digest_size = MD5_DIGEST_SIZE;             \
+      da.ctx = &ctx.md5;                            \
+      da.alg = "md5";                               \
+      da.sessionkey = skey.md5;                     \
+      da.init = &MHD_MD5Init;                           \
+      da.update = &MHD_MD5Update;                       \
+      da.digest = &MHD_MD5Final;                        \
+      break;                                        \
+    case MHD_DIGEST_ALG_AUTO:                             \
     /* auto == SHA256, fall-though thus intentional! */ \
-  case MHD_DIGEST_ALG_SHA256:                           \
-    da.digest_size = SHA256_DIGEST_SIZE;                \
-    da.ctx = &ctx.sha256;                               \
-    da.alg = "sha-256";                                 \
-    da.sessionkey = skey.sha256;                        \
-    da.init = &MHD_SHA256_init;                             \
-    da.update = &MHD_SHA256_update;                         \
-    da.digest = &sha256_finish;                         \
-    break;                                              \
-  }                                                     \
-  } while(0)
+    case MHD_DIGEST_ALG_SHA256:                           \
+      da.digest_size = SHA256_DIGEST_SIZE;                \
+      da.ctx = &ctx.sha256;                               \
+      da.alg = "sha-256";                                 \
+      da.sessionkey = skey.sha256;                        \
+      da.init = &MHD_SHA256_init;                             \
+      da.update = &MHD_SHA256_update;                         \
+      da.digest = &sha256_finish;                         \
+      break;                                              \
+    }                                                     \
+  } while (0)
 
 
 
@@ -1223,19 +1228,19 @@ MHD_digest_auth_check (struct MHD_Connection 
*connection,
  * @param username The username needs to be authenticated
  * @param password The password used in the authentication
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @param algo digest algorithms allowed for verification
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  */
 _MHD_EXTERN int
 MHD_digest_auth_check2 (struct MHD_Connection *connection,
-                       const char *realm,
-                       const char *username,
-                       const char *password,
-                       unsigned int nonce_timeout,
-                       enum MHD_DigestAuthAlgorithm algo)
+                        const char *realm,
+                        const char *username,
+                        const char *password,
+                        unsigned int nonce_timeout,
+                        enum MHD_DigestAuthAlgorithm algo)
 {
   SETUP_DA (algo, da);
 
@@ -1256,36 +1261,36 @@ MHD_digest_auth_check2 (struct MHD_Connection 
*connection,
  * @param realm The realm presented to the client
  * @param username The username needs to be authenticated
  * @param digest An `unsigned char *' pointer to the binary MD5 sum
- *                     for the precalculated hash value 
"username:realm:password"
- *                     of #MHD_MD5_DIGEST_SIZE bytes
+ *      for the precalculated hash value "username:realm:password"
+ *      of #MHD_MD5_DIGEST_SIZE bytes
  * @param digest_size number of bytes in @a digest
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @param algo digest algorithms allowed for verification
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  */
 _MHD_EXTERN int
 MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
-                              const char *realm,
-                              const char *username,
-                              const uint8_t *digest,
+                               const char *realm,
+                               const char *username,
+                               const uint8_t *digest,
                                size_t digest_size,
-                              unsigned int nonce_timeout,
-                              enum MHD_DigestAuthAlgorithm algo)
+                               unsigned int nonce_timeout,
+                               enum MHD_DigestAuthAlgorithm algo)
 {
   SETUP_DA (algo, da);
 
   if (da.digest_size != digest_size)
-    MHD_PANIC (_("digest size missmatch")); /* API violation! */
+    MHD_PANIC (_ ("digest size missmatch")); /* API violation! */
   return digest_auth_check_all (connection,
                                 &da,
-                               realm,
-                               username,
-                               NULL,
-                               digest,
-                               nonce_timeout);
+                                realm,
+                                username,
+                                NULL,
+                                digest,
+                                nonce_timeout);
 }
 
 
@@ -1298,20 +1303,20 @@ MHD_digest_auth_check_digest2 (struct MHD_Connection 
*connection,
  * @param realm The realm presented to the client
  * @param username The username needs to be authenticated
  * @param digest An `unsigned char *' pointer to the binary digest
- *                     for the precalculated hash value 
"username:realm:password"
- *                     of @a digest_size bytes
+ *      for the precalculated hash value "username:realm:password"
+ *      of @a digest_size bytes
  * @param nonce_timeout The amount of time for a nonce to be
- *                     invalid in seconds
+ *      invalid in seconds
  * @return #MHD_YES if authenticated, #MHD_NO if not,
- *                     #MHD_INVALID_NONCE if nonce is invalid
+ *      #MHD_INVALID_NONCE if nonce is invalid
  * @ingroup authentication
  */
 _MHD_EXTERN int
 MHD_digest_auth_check_digest (struct MHD_Connection *connection,
-                             const char *realm,
-                             const char *username,
-                             const uint8_t digest[MHD_MD5_DIGEST_SIZE],
-                             unsigned int nonce_timeout)
+                              const char *realm,
+                              const char *username,
+                              const uint8_t digest[MHD_MD5_DIGEST_SIZE],
+                              unsigned int nonce_timeout)
 {
   return MHD_digest_auth_check_digest2 (connection,
                                         realm,
@@ -1333,29 +1338,29 @@ MHD_digest_auth_check_digest (struct MHD_Connection 
*connection,
  *        body; note that this function will set the "WWW Authenticate"
  *        header and that the caller should not do this
  * @param signal_stale #MHD_YES if the nonce is invalid to add
- *                     'stale=true' to the authentication header
+ *      'stale=true' to the authentication header
  * @param algo digest algorithm to use
  * @return #MHD_YES on success, #MHD_NO otherwise
  * @ingroup authentication
  */
 int
 MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
-                              const char *realm,
-                              const char *opaque,
-                              struct MHD_Response *response,
-                              int signal_stale,
-                              enum MHD_DigestAuthAlgorithm algo)
+                               const char *realm,
+                               const char *opaque,
+                               struct MHD_Response *response,
+                               int signal_stale,
+                               enum MHD_DigestAuthAlgorithm algo)
 {
   int ret;
   int hlen;
   SETUP_DA (algo, da);
 
   {
-    char nonce[NONCE_STD_LEN(VLA_ARRAY_LEN_DIGEST (da.digest_size)) + 1];
+    char nonce[NONCE_STD_LEN (VLA_ARRAY_LEN_DIGEST (da.digest_size)) + 1];
 
-    VLA_CHECK_LEN_DIGEST(da.digest_size);
+    VLA_CHECK_LEN_DIGEST (da.digest_size);
     /* Generating the server nonce */
-    calculate_nonce ((uint32_t) MHD_monotonic_sec_counter(),
+    calculate_nonce ((uint32_t) MHD_monotonic_sec_counter (),
                      connection->method,
                      connection->daemon->digest_auth_random,
                      connection->daemon->digest_auth_rand_size,
@@ -1367,13 +1372,14 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection 
*connection,
         check_nonce_nc (connection,
                         nonce,
                         0))
-      {
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (connection->daemon,
-                  _("Could not register nonce (is the nonce array size 
zero?).\n"));
+      MHD_DLOG (connection->daemon,
+                _ (
+                  "Could not register nonce (is the nonce array size 
zero?).\n"));
 #endif
-        return MHD_NO;
-      }
+      return MHD_NO;
+    }
     /* Building the authentication header */
     hlen = MHD_snprintf_ (NULL,
                           0,
@@ -1386,54 +1392,54 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection 
*connection,
                           ? ",stale=\"true\""
                           : "");
     if (hlen > 0)
-      {
-        char *header;
+    {
+      char *header;
 
-        header = MHD_calloc_ (1,
-                              hlen + 1);
-        if (NULL == header)
-          {
+      header = MHD_calloc_ (1,
+                            hlen + 1);
+      if (NULL == header)
+      {
 #ifdef HAVE_MESSAGES
-            MHD_DLOG(connection->daemon,
-                     _("Failed to allocate memory for auth response 
header\n"));
+        MHD_DLOG (connection->daemon,
+                  _ ("Failed to allocate memory for auth response header\n"));
 #endif /* HAVE_MESSAGES */
-            return MHD_NO;
-          }
-
-        if (MHD_snprintf_ (header,
-                           hlen + 1,
-                           "Digest 
realm=\"%s\",qop=\"auth\",nonce=\"%s\",opaque=\"%s\",algorithm=%s%s",
-                           realm,
-                           nonce,
-                           opaque,
-                           da.alg,
-                           signal_stale
-                           ? ",stale=\"true\""
-                           : "") == hlen)
-          ret = MHD_add_response_header(response,
-                                        MHD_HTTP_HEADER_WWW_AUTHENTICATE,
-                                        header);
-        else
-          ret = MHD_NO;
-        free (header);
+        return MHD_NO;
       }
+
+      if (MHD_snprintf_ (header,
+                         hlen + 1,
+                         "Digest 
realm=\"%s\",qop=\"auth\",nonce=\"%s\",opaque=\"%s\",algorithm=%s%s",
+                         realm,
+                         nonce,
+                         opaque,
+                         da.alg,
+                         signal_stale
+                         ? ",stale=\"true\""
+                         : "") == hlen)
+        ret = MHD_add_response_header (response,
+                                       MHD_HTTP_HEADER_WWW_AUTHENTICATE,
+                                       header);
+      else
+        ret = MHD_NO;
+      free (header);
+    }
     else
       ret = MHD_NO;
   }
 
   if (MHD_YES == ret)
-    {
-      ret = MHD_queue_response (connection,
-                                MHD_HTTP_UNAUTHORIZED,
-                                response);
-    }
+  {
+    ret = MHD_queue_response (connection,
+                              MHD_HTTP_UNAUTHORIZED,
+                              response);
+  }
   else
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (connection->daemon,
-                _("Failed to add Digest auth header\n"));
+    MHD_DLOG (connection->daemon,
+              _ ("Failed to add Digest auth header\n"));
 #endif /* HAVE_MESSAGES */
-    }
+  }
   return ret;
 }
 
@@ -1450,16 +1456,16 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection 
*connection,
  *        body; note that this function will set the "WWW Authenticate"
  *        header and that the caller should not do this
  * @param signal_stale #MHD_YES if the nonce is invalid to add
- *                     'stale=true' to the authentication header
+ *      'stale=true' to the authentication header
  * @return #MHD_YES on success, #MHD_NO otherwise
  * @ingroup authentication
  */
 int
 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
-                             const char *realm,
-                             const char *opaque,
-                             struct MHD_Response *response,
-                             int signal_stale)
+                              const char *realm,
+                              const char *opaque,
+                              struct MHD_Response *response,
+                              int signal_stale)
 {
   return MHD_queue_auth_fail_response2 (connection,
                                         realm,
diff --git a/src/microhttpd/internal.c b/src/microhttpd/internal.c
index ff861545..109ebfe2 100644
--- a/src/microhttpd/internal.c
+++ b/src/microhttpd/internal.c
@@ -36,50 +36,50 @@ const char *
 MHD_state_to_string (enum MHD_CONNECTION_STATE state)
 {
   switch (state)
-    {
-    case MHD_CONNECTION_INIT:
-      return "connection init";
-    case MHD_CONNECTION_URL_RECEIVED:
-      return "connection url received";
-    case MHD_CONNECTION_HEADER_PART_RECEIVED:
-      return "header partially received";
-    case MHD_CONNECTION_HEADERS_RECEIVED:
-      return "headers received";
-    case MHD_CONNECTION_HEADERS_PROCESSED:
-      return "headers processed";
-    case MHD_CONNECTION_CONTINUE_SENDING:
-      return "continue sending";
-    case MHD_CONNECTION_CONTINUE_SENT:
-      return "continue sent";
-    case MHD_CONNECTION_BODY_RECEIVED:
-      return "body received";
-    case MHD_CONNECTION_FOOTER_PART_RECEIVED:
-      return "footer partially received";
-    case MHD_CONNECTION_FOOTERS_RECEIVED:
-      return "footers received";
-    case MHD_CONNECTION_HEADERS_SENDING:
-      return "headers sending";
-    case MHD_CONNECTION_HEADERS_SENT:
-      return "headers sent";
-    case MHD_CONNECTION_NORMAL_BODY_READY:
-      return "normal body ready";
-    case MHD_CONNECTION_NORMAL_BODY_UNREADY:
-      return "normal body unready";
-    case MHD_CONNECTION_CHUNKED_BODY_READY:
-      return "chunked body ready";
-    case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
-      return "chunked body unready";
-    case MHD_CONNECTION_BODY_SENT:
-      return "body sent";
-    case MHD_CONNECTION_FOOTERS_SENDING:
-      return "footers sending";
-    case MHD_CONNECTION_FOOTERS_SENT:
-      return "footers sent";
-    case MHD_CONNECTION_CLOSED:
-      return "closed";
-    default:
-      return "unrecognized connection state";
-    }
+  {
+  case MHD_CONNECTION_INIT:
+    return "connection init";
+  case MHD_CONNECTION_URL_RECEIVED:
+    return "connection url received";
+  case MHD_CONNECTION_HEADER_PART_RECEIVED:
+    return "header partially received";
+  case MHD_CONNECTION_HEADERS_RECEIVED:
+    return "headers received";
+  case MHD_CONNECTION_HEADERS_PROCESSED:
+    return "headers processed";
+  case MHD_CONNECTION_CONTINUE_SENDING:
+    return "continue sending";
+  case MHD_CONNECTION_CONTINUE_SENT:
+    return "continue sent";
+  case MHD_CONNECTION_BODY_RECEIVED:
+    return "body received";
+  case MHD_CONNECTION_FOOTER_PART_RECEIVED:
+    return "footer partially received";
+  case MHD_CONNECTION_FOOTERS_RECEIVED:
+    return "footers received";
+  case MHD_CONNECTION_HEADERS_SENDING:
+    return "headers sending";
+  case MHD_CONNECTION_HEADERS_SENT:
+    return "headers sent";
+  case MHD_CONNECTION_NORMAL_BODY_READY:
+    return "normal body ready";
+  case MHD_CONNECTION_NORMAL_BODY_UNREADY:
+    return "normal body unready";
+  case MHD_CONNECTION_CHUNKED_BODY_READY:
+    return "chunked body ready";
+  case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
+    return "chunked body unready";
+  case MHD_CONNECTION_BODY_SENT:
+    return "body sent";
+  case MHD_CONNECTION_FOOTERS_SENDING:
+    return "footers sending";
+  case MHD_CONNECTION_FOOTERS_SENT:
+    return "footers sent";
+  case MHD_CONNECTION_CLOSED:
+    return "closed";
+  default:
+    return "unrecognized connection state";
+  }
 }
 #endif
 #endif
@@ -118,7 +118,7 @@ MHD_unescape_plus (char *arg)
 {
   char *p;
 
-  for (p=strchr (arg, '+'); NULL != p; p = strchr (p + 1, '+'))
+  for (p = strchr (arg, '+'); NULL != p; p = strchr (p + 1, '+'))
     *p = ' ';
 }
 
@@ -139,28 +139,28 @@ MHD_http_unescape (char *val)
   char *wpos = val;
 
   while ('\0' != *rpos)
+  {
+    uint32_t num;
+    switch (*rpos)
     {
-      uint32_t num;
-      switch (*rpos)
-       {
-       case '%':
-          if (2 == MHD_strx_to_uint32_n_ (rpos + 1,
-                                          2,
-                                          &num))
-           {
-             *wpos = (char)((unsigned char) num);
-             wpos++;
-             rpos += 3;
-             break;
-           }
-          /* TODO: add bad sequence handling */
-         /* intentional fall through! */
-       default:
-         *wpos = *rpos;
-         wpos++;
-         rpos++;
-       }
+    case '%':
+      if (2 == MHD_strx_to_uint32_n_ (rpos + 1,
+                                      2,
+                                      &num))
+      {
+        *wpos = (char) ((unsigned char) num);
+        wpos++;
+        rpos += 3;
+        break;
+      }
+    /* TODO: add bad sequence handling */
+    /* intentional fall through! */
+    default:
+      *wpos = *rpos;
+      wpos++;
+      rpos++;
     }
+  }
   *wpos = '\0'; /* add 0-terminator */
   return wpos - val;
 }
@@ -182,10 +182,10 @@ MHD_http_unescape (char *val)
  */
 int
 MHD_parse_arguments_ (struct MHD_Connection *connection,
-                     enum MHD_ValueKind kind,
-                     char *args,
-                     MHD_ArgumentIterator_ cb,
-                     unsigned int *num_headers)
+                      enum MHD_ValueKind kind,
+                      char *args,
+                      MHD_ArgumentIterator_ cb,
+                      unsigned int *num_headers)
 {
   struct MHD_Daemon *daemon = connection->daemon;
   char *equals;
@@ -193,78 +193,33 @@ MHD_parse_arguments_ (struct MHD_Connection *connection,
 
   *num_headers = 0;
   while ( (NULL != args) &&
-         ('\0' != args[0]) )
+          ('\0' != args[0]) )
+  {
+    size_t key_len;
+    size_t value_len;
+    equals = strchr (args, '=');
+    amper = strchr (args, '&');
+    if (NULL == amper)
     {
-      size_t key_len;
-      size_t value_len;
-      equals = strchr (args, '=');
-      amper = strchr (args, '&');
-      if (NULL == amper)
-       {
-         /* last argument */
-         if (NULL == equals)
-           {
-             /* last argument, without '=' */
-              MHD_unescape_plus (args);
-             key_len = daemon->unescape_callback 
(daemon->unescape_callback_cls,
-                                                  connection,
-                                                   args);
-             if (MHD_YES != cb (connection,
-                                args,
-                                key_len,
-                                NULL,
-                                0,
-                                kind))
-               return MHD_NO;
-             (*num_headers)++;
-             break;
-           }
-         /* got 'foo=bar' */
-         equals[0] = '\0';
-         equals++;
-          MHD_unescape_plus (args);
-         key_len = daemon->unescape_callback (daemon->unescape_callback_cls,
-                                               connection,
-                                               args);
-          MHD_unescape_plus (equals);
-         value_len = daemon->unescape_callback (daemon->unescape_callback_cls,
-                                                 connection,
-                                                 equals);
-         if (MHD_YES != cb (connection,
-                            args,
-                            key_len,
-                            equals,
-                            value_len,
-                            kind))
-           return MHD_NO;
-         (*num_headers)++;
-         break;
-       }
-      /* amper is non-NULL here */
-      amper[0] = '\0';
-      amper++;
-      if ( (NULL == equals) ||
-          (equals >= amper) )
-       {
-         /* got 'foo&bar' or 'foo&bar=val', add key 'foo' with NULL for value 
*/
-          MHD_unescape_plus (args);
-          key_len = daemon->unescape_callback (daemon->unescape_callback_cls,
-                                               connection,
-                                               args);
-         if (MHD_YES != cb (connection,
-                            args,
-                            key_len,
-                            NULL,
-                            0,
-                            kind))
-           return MHD_NO;
-         /* continue with 'bar' */
-         (*num_headers)++;
-         args = amper;
-         continue;
-       }
-      /* equals and amper are non-NULL here, and equals < amper,
-        so we got regular 'foo=value&bar...'-kind of argument */
+      /* last argument */
+      if (NULL == equals)
+      {
+        /* last argument, without '=' */
+        MHD_unescape_plus (args);
+        key_len = daemon->unescape_callback (daemon->unescape_callback_cls,
+                                             connection,
+                                             args);
+        if (MHD_YES != cb (connection,
+                           args,
+                           key_len,
+                           NULL,
+                           0,
+                           kind))
+          return MHD_NO;
+        (*num_headers)++;
+        break;
+      }
+      /* got 'foo=bar' */
       equals[0] = '\0';
       equals++;
       MHD_unescape_plus (args);
@@ -276,15 +231,60 @@ MHD_parse_arguments_ (struct MHD_Connection *connection,
                                              connection,
                                              equals);
       if (MHD_YES != cb (connection,
-                        args,
-                        key_len,
-                        equals,
-                        value_len,
-                        kind))
+                         args,
+                         key_len,
+                         equals,
+                         value_len,
+                         kind))
         return MHD_NO;
       (*num_headers)++;
+      break;
+    }
+    /* amper is non-NULL here */
+    amper[0] = '\0';
+    amper++;
+    if ( (NULL == equals) ||
+         (equals >= amper) )
+    {
+      /* got 'foo&bar' or 'foo&bar=val', add key 'foo' with NULL for value */
+      MHD_unescape_plus (args);
+      key_len = daemon->unescape_callback (daemon->unescape_callback_cls,
+                                           connection,
+                                           args);
+      if (MHD_YES != cb (connection,
+                         args,
+                         key_len,
+                         NULL,
+                         0,
+                         kind))
+        return MHD_NO;
+      /* continue with 'bar' */
+      (*num_headers)++;
       args = amper;
+      continue;
     }
+    /* equals and amper are non-NULL here, and equals < amper,
+ so we got regular 'foo=value&bar...'-kind of argument */
+    equals[0] = '\0';
+    equals++;
+    MHD_unescape_plus (args);
+    key_len = daemon->unescape_callback (daemon->unescape_callback_cls,
+                                         connection,
+                                         args);
+    MHD_unescape_plus (equals);
+    value_len = daemon->unescape_callback (daemon->unescape_callback_cls,
+                                           connection,
+                                           equals);
+    if (MHD_YES != cb (connection,
+                       args,
+                       key_len,
+                       equals,
+                       value_len,
+                       kind))
+      return MHD_NO;
+    (*num_headers)++;
+    args = amper;
+  }
   return MHD_YES;
 }
 
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index ac43d819..5cf35790 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -55,14 +55,16 @@
  *
  * @param msg error message (const char *)
  */
-#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
msg); BUILTIN_NOT_REACHED; } while (0)
+#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
msg); \
+                            BUILTIN_NOT_REACHED; } while (0)
 #else
 /**
  * Trigger 'panic' action based on fatal errors.
  *
  * @param msg error message (const char *)
  */
-#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
NULL); BUILTIN_NOT_REACHED; } while (0)
+#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, 
NULL); \
+                            BUILTIN_NOT_REACHED; } while (0)
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
@@ -78,9 +80,9 @@
  * @param fd the FD to close
  */
 #define MHD_fd_close_chk_(fd) do {                      \
-    if ( (0 != close ((fd)) && (EBADF == errno)) )     \
-      MHD_PANIC(_("Failed to close FD.\n"));            \
-  } while(0)
+    if ( (0 != close ((fd)) && (EBADF == errno)) )  \
+      MHD_PANIC (_ ("Failed to close FD.\n"));            \
+} while (0)
 
 /**
  * Should we perform additional sanity checks at runtime (on our internal
@@ -113,10 +115,11 @@ extern MHD_PanicCallback mhd_panic;
 extern void *mhd_panic_cls;
 
 /* If we have Clang or gcc >= 4.5, use __buildin_unreachable() */
-#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ 
>= 5)
-#define BUILTIN_NOT_REACHED __builtin_unreachable()
+#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ 
>= \
+                                             5)
+#define BUILTIN_NOT_REACHED __builtin_unreachable ()
 #elif defined(_MSC_FULL_VER)
-#define BUILTIN_NOT_REACHED __assume(0)
+#define BUILTIN_NOT_REACHED __assume (0)
 #else
 #define BUILTIN_NOT_REACHED
 #endif
@@ -125,7 +128,7 @@ extern void *mhd_panic_cls;
 /**
  * Determine length of static string / macro strings at compile time.
  */
-#define MHD_STATICSTR_LEN_(macro) (sizeof(macro)/sizeof(char) - 1)
+#define MHD_STATICSTR_LEN_(macro) (sizeof(macro) / sizeof(char) - 1)
 #endif /* ! MHD_STATICSTR_LEN_ */
 
 
@@ -250,7 +253,7 @@ struct MHD_NonceNc
  */
 void
 MHD_DLOG (const struct MHD_Daemon *daemon,
-         const char *format,
+          const char *format,
           ...);
 #endif
 
@@ -1758,15 +1761,15 @@ struct MHD_Daemon
  * @param element element to insert
  */
 #define DLL_insert(head,tail,element) do { \
-  mhd_assert (NULL == (element)->next); \
-  mhd_assert (NULL == (element)->prev); \
-  (element)->next = (head); \
-  (element)->prev = NULL; \
-  if ((tail) == NULL) \
-    (tail) = element; \
-  else \
-    (head)->prev = element; \
-  (head) = (element); } while (0)
+    mhd_assert (NULL == (element)->next); \
+    mhd_assert (NULL == (element)->prev); \
+    (element)->next = (head); \
+    (element)->prev = NULL; \
+    if ((tail) == NULL) \
+      (tail) = element; \
+    else \
+      (head)->prev = element; \
+    (head) = (element); } while (0)
 
 
 /**
@@ -1779,18 +1782,18 @@ struct MHD_Daemon
  * @param element element to remove
  */
 #define DLL_remove(head,tail,element) do { \
-  mhd_assert ( (NULL != (element)->next) || ((element) == (tail)));  \
-  mhd_assert ( (NULL != (element)->prev) || ((element) == (head)));  \
-  if ((element)->prev == NULL) \
-    (head) = (element)->next;  \
-  else \
-    (element)->prev->next = (element)->next; \
-  if ((element)->next == NULL) \
-    (tail) = (element)->prev;  \
-  else \
-    (element)->next->prev = (element)->prev; \
-  (element)->next = NULL; \
-  (element)->prev = NULL; } while (0)
+    mhd_assert ( (NULL != (element)->next) || ((element) == (tail)));  \
+    mhd_assert ( (NULL != (element)->prev) || ((element) == (head)));  \
+    if ((element)->prev == NULL) \
+      (head) = (element)->next;  \
+    else \
+      (element)->prev->next = (element)->next; \
+    if ((element)->next == NULL) \
+      (tail) = (element)->prev;  \
+    else \
+      (element)->next->prev = (element)->prev; \
+    (element)->next = NULL; \
+    (element)->prev = NULL; } while (0)
 
 
 
@@ -1803,15 +1806,15 @@ struct MHD_Daemon
  * @param element element to insert
  */
 #define XDLL_insert(head,tail,element) do { \
-  mhd_assert (NULL == (element)->nextX); \
-  mhd_assert (NULL == (element)->prevX); \
-  (element)->nextX = (head); \
-  (element)->prevX = NULL; \
-  if (NULL == (tail)) \
-    (tail) = element; \
-  else \
-    (head)->prevX = element; \
-  (head) = (element); } while (0)
+    mhd_assert (NULL == (element)->nextX); \
+    mhd_assert (NULL == (element)->prevX); \
+    (element)->nextX = (head); \
+    (element)->prevX = NULL; \
+    if (NULL == (tail)) \
+      (tail) = element; \
+    else \
+      (head)->prevX = element; \
+    (head) = (element); } while (0)
 
 
 /**
@@ -1824,18 +1827,18 @@ struct MHD_Daemon
  * @param element element to remove
  */
 #define XDLL_remove(head,tail,element) do { \
-  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail)));  \
-  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head)));  \
-  if (NULL == (element)->prevX) \
-    (head) = (element)->nextX;  \
-  else \
-    (element)->prevX->nextX = (element)->nextX; \
-  if (NULL == (element)->nextX) \
-    (tail) = (element)->prevX;  \
-  else \
-    (element)->nextX->prevX = (element)->prevX; \
-  (element)->nextX = NULL; \
-  (element)->prevX = NULL; } while (0)
+    mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail)));  \
+    mhd_assert ( (NULL != (element)->prevX) || ((element) == (head)));  \
+    if (NULL == (element)->prevX) \
+      (head) = (element)->nextX;  \
+    else \
+      (element)->prevX->nextX = (element)->nextX; \
+    if (NULL == (element)->nextX) \
+      (tail) = (element)->prevX;  \
+    else \
+      (element)->nextX->prevX = (element)->prevX; \
+    (element)->nextX = NULL; \
+    (element)->prevX = NULL; } while (0)
 
 
 /**
@@ -1847,13 +1850,13 @@ struct MHD_Daemon
  * @param element element to insert
  */
 #define EDLL_insert(head,tail,element) do { \
-  (element)->nextE = (head); \
-  (element)->prevE = NULL; \
-  if ((tail) == NULL) \
-    (tail) = element; \
-  else \
-    (head)->prevE = element; \
-  (head) = (element); } while (0)
+    (element)->nextE = (head); \
+    (element)->prevE = NULL; \
+    if ((tail) == NULL) \
+      (tail) = element; \
+    else \
+      (head)->prevE = element; \
+    (head) = (element); } while (0)
 
 
 /**
@@ -1866,16 +1869,16 @@ struct MHD_Daemon
  * @param element element to remove
  */
 #define EDLL_remove(head,tail,element) do { \
-  if ((element)->prevE == NULL) \
-    (head) = (element)->nextE;  \
-  else \
-    (element)->prevE->nextE = (element)->nextE; \
-  if ((element)->nextE == NULL) \
-    (tail) = (element)->prevE;  \
-  else \
-    (element)->nextE->prevE = (element)->prevE; \
-  (element)->nextE = NULL; \
-  (element)->prevE = NULL; } while (0)
+    if ((element)->prevE == NULL) \
+      (head) = (element)->nextE;  \
+    else \
+      (element)->prevE->nextE = (element)->nextE; \
+    if ((element)->nextE == NULL) \
+      (tail) = (element)->prevE;  \
+    else \
+      (element)->nextE->prevE = (element)->prevE; \
+    (element)->nextE = NULL; \
+    (element)->prevE = NULL; } while (0)
 
 
 /**
@@ -1902,11 +1905,11 @@ MHD_unescape_plus (char *arg);
  */
 typedef int
 (*MHD_ArgumentIterator_)(struct MHD_Connection *connection,
-                        const char *key,
+                         const char *key,
                          size_t key_size,
-                        const char *value,
-                        size_t value_size,
-                        enum MHD_ValueKind kind);
+                         const char *value,
+                         size_t value_size,
+                         enum MHD_ValueKind kind);
 
 
 /**
@@ -1925,10 +1928,10 @@ typedef int
  */
 int
 MHD_parse_arguments_ (struct MHD_Connection *connection,
-                     enum MHD_ValueKind kind,
-                     char *args,
-                     MHD_ArgumentIterator_ cb,
-                     unsigned int *num_headers);
+                      enum MHD_ValueKind kind,
+                      char *args,
+                      MHD_ArgumentIterator_ cb,
+                      unsigned int *num_headers);
 
 
 /**
@@ -1966,8 +1969,8 @@ MHD_check_response_header_token_ci (const struct 
MHD_Response *response,
  *         false otherwise
  */
 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
-    MHD_check_response_header_token_ci((r),(k),MHD_STATICSTR_LEN_(k),\
-                  (tkn),MHD_STATICSTR_LEN_(tkn))
+  MHD_check_response_header_token_ci ((r),(k),MHD_STATICSTR_LEN_ (k), \
+                                      (tkn),MHD_STATICSTR_LEN_ (tkn))
 
 
 /**
diff --git a/src/microhttpd/md5.c b/src/microhttpd/md5.c
index 25f25372..39b66185 100644
--- a/src/microhttpd/md5.c
+++ b/src/microhttpd/md5.c
@@ -58,7 +58,7 @@ MD5Transform (uint32_t state[4],
  */
 void
 MHD_MD5Final (void *ctx_,
-          uint8_t digest[MD5_DIGEST_SIZE])
+              uint8_t digest[MD5_DIGEST_SIZE])
 {
   struct MD5Context *ctx = ctx_;
   uint64_t count_bits;
@@ -75,27 +75,28 @@ MHD_MD5Final (void *ctx_,
   ctx->buffer[have_bytes++] = 0x80; /* First padding byte is 0x80 */
 
   if (MD5_BLOCK_SIZE - have_bytes < 8)
-    { /* Not enough space to put number of bits */
-      while (have_bytes < MD5_BLOCK_SIZE) ctx->buffer[have_bytes++] = 0;
-      MD5Transform(ctx->state, ctx->buffer);
-      have_bytes = 0; /* Additional block */
-    }
+  {   /* Not enough space to put number of bits */
+    while (have_bytes < MD5_BLOCK_SIZE)
+      ctx->buffer[have_bytes++] = 0;
+    MD5Transform (ctx->state, ctx->buffer);
+    have_bytes = 0;   /* Additional block */
+  }
   /* Pad out to 56 */
-  memset(ctx->buffer + have_bytes, 0, MD5_BLOCK_SIZE - have_bytes - 8);
+  memset (ctx->buffer + have_bytes, 0, MD5_BLOCK_SIZE - have_bytes - 8);
 
   /* Put number of bits */
   count_bits = ctx->count << 3;
-  _MHD_PUT_64BIT_LE(ctx->buffer + 56, count_bits);
-  MD5Transform(ctx->state, ctx->buffer);
+  _MHD_PUT_64BIT_LE (ctx->buffer + 56, count_bits);
+  MD5Transform (ctx->state, ctx->buffer);
 
   /* Put digest in LE mode */
-  _MHD_PUT_32BIT_LE(digest, ctx->state[0]);
-  _MHD_PUT_32BIT_LE(digest + 4, ctx->state[1]);
-  _MHD_PUT_32BIT_LE(digest + 8, ctx->state[2]);
-  _MHD_PUT_32BIT_LE(digest + 12, ctx->state[3]);
+  _MHD_PUT_32BIT_LE (digest, ctx->state[0]);
+  _MHD_PUT_32BIT_LE (digest + 4, ctx->state[1]);
+  _MHD_PUT_32BIT_LE (digest + 8, ctx->state[2]);
+  _MHD_PUT_32BIT_LE (digest + 12, ctx->state[3]);
 
   /* Erase buffer */
-  memset(ctx, 0, sizeof(*ctx));
+  memset (ctx, 0, sizeof(*ctx));
 }
 
 
@@ -109,13 +110,13 @@ MHD_MD5Final (void *ctx_,
 
 /* #define F1(x, y, z) (x & y | ~x & z) */
 #define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
+#define F2(x, y, z) F1 (z, x, y)
 #define F3(x, y, z) (x ^ y ^ z)
 #define F4(x, y, z) (y ^ (x | ~z))
 
 /* This is the central step in the MD5 algorithm. */
 #define MD5STEP(f, w, x, y, z, data, s) \
-       ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+  (w += f (x, y, z) + data,  w = w << s | w >> (32 - s),  w += x)
 
 /**
  * The core of the MD5 algorithm, this alters an existing MD5 hash to
@@ -129,14 +130,14 @@ MD5Transform (uint32_t state[4],
   uint32_t a, b, c, d;
 
 #if _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
-  const uint32_t *in = (const uint32_t *)block;
+  const uint32_t *in = (const uint32_t *) block;
 #else
   uint32_t in[MD5_BLOCK_SIZE / MD5_BYTES_IN_WORD];
   int i;
 
   for (i = 0; i < MD5_BLOCK_SIZE / MD5_BYTES_IN_WORD; i++)
   {
-    in[i] = _MHD_GET_32BIT_LE(block + i * MD5_BYTES_IN_WORD);
+    in[i] = _MHD_GET_32BIT_LE (block + i * MD5_BYTES_IN_WORD);
   }
 #endif
 
@@ -145,73 +146,73 @@ MD5Transform (uint32_t state[4],
   c = state[2];
   d = state[3];
 
-  MD5STEP(F1, a, b, c, d, in[0]  + 0xd76aa478, 7);
-  MD5STEP(F1, d, a, b, c, in[1]  + 0xe8c7b756, 12);
-  MD5STEP(F1, c, d, a, b, in[2]  + 0x242070db, 17);
-  MD5STEP(F1, b, c, d, a, in[3]  + 0xc1bdceee, 22);
-  MD5STEP(F1, a, b, c, d, in[4]  + 0xf57c0faf, 7);
-  MD5STEP(F1, d, a, b, c, in[5]  + 0x4787c62a, 12);
-  MD5STEP(F1, c, d, a, b, in[6]  + 0xa8304613, 17);
-  MD5STEP(F1, b, c, d, a, in[7]  + 0xfd469501, 22);
-  MD5STEP(F1, a, b, c, d, in[8]  + 0x698098d8, 7);
-  MD5STEP(F1, d, a, b, c, in[9]  + 0x8b44f7af, 12);
-  MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
-  MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
-  MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
-  MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
-  MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
-  MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
-
-  MD5STEP(F2, a, b, c, d, in[1]  + 0xf61e2562, 5);
-  MD5STEP(F2, d, a, b, c, in[6]  + 0xc040b340, 9);
-  MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
-  MD5STEP(F2, b, c, d, a, in[0]  + 0xe9b6c7aa, 20);
-  MD5STEP(F2, a, b, c, d, in[5]  + 0xd62f105d, 5);
-  MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
-  MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
-  MD5STEP(F2, b, c, d, a, in[4]  + 0xe7d3fbc8, 20);
-  MD5STEP(F2, a, b, c, d, in[9]  + 0x21e1cde6, 5);
-  MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
-  MD5STEP(F2, c, d, a, b, in[3]  + 0xf4d50d87, 14);
-  MD5STEP(F2, b, c, d, a, in[8]  + 0x455a14ed, 20);
-  MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
-  MD5STEP(F2, d, a, b, c, in[2]  + 0xfcefa3f8, 9);
-  MD5STEP(F2, c, d, a, b, in[7]  + 0x676f02d9, 14);
-  MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-
-  MD5STEP(F3, a, b, c, d, in[5]  + 0xfffa3942, 4);
-  MD5STEP(F3, d, a, b, c, in[8]  + 0x8771f681, 11);
-  MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
-  MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
-  MD5STEP(F3, a, b, c, d, in[1]  + 0xa4beea44, 4);
-  MD5STEP(F3, d, a, b, c, in[4]  + 0x4bdecfa9, 11);
-  MD5STEP(F3, c, d, a, b, in[7]  + 0xf6bb4b60, 16);
-  MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
-  MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
-  MD5STEP(F3, d, a, b, c, in[0]  + 0xeaa127fa, 11);
-  MD5STEP(F3, c, d, a, b, in[3]  + 0xd4ef3085, 16);
-  MD5STEP(F3, b, c, d, a, in[6]  + 0x04881d05, 23);
-  MD5STEP(F3, a, b, c, d, in[9]  + 0xd9d4d039, 4);
-  MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
-  MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
-  MD5STEP(F3, b, c, d, a, in[2]  + 0xc4ac5665, 23);
-
-  MD5STEP(F4, a, b, c, d, in[0]  + 0xf4292244, 6);
-  MD5STEP(F4, d, a, b, c, in[7]  + 0x432aff97, 10);
-  MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
-  MD5STEP(F4, b, c, d, a, in[5]  + 0xfc93a039, 21);
-  MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
-  MD5STEP(F4, d, a, b, c, in[3]  + 0x8f0ccc92, 10);
-  MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
-  MD5STEP(F4, b, c, d, a, in[1]  + 0x85845dd1, 21);
-  MD5STEP(F4, a, b, c, d, in[8]  + 0x6fa87e4f, 6);
-  MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
-  MD5STEP(F4, c, d, a, b, in[6]  + 0xa3014314, 15);
-  MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
-  MD5STEP(F4, a, b, c, d, in[4]  + 0xf7537e82, 6);
-  MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
-  MD5STEP(F4, c, d, a, b, in[2]  + 0x2ad7d2bb, 15);
-  MD5STEP(F4, b, c, d, a, in[9]  + 0xeb86d391, 21);
+  MD5STEP (F1, a, b, c, d, in[0]  + 0xd76aa478, 7);
+  MD5STEP (F1, d, a, b, c, in[1]  + 0xe8c7b756, 12);
+  MD5STEP (F1, c, d, a, b, in[2]  + 0x242070db, 17);
+  MD5STEP (F1, b, c, d, a, in[3]  + 0xc1bdceee, 22);
+  MD5STEP (F1, a, b, c, d, in[4]  + 0xf57c0faf, 7);
+  MD5STEP (F1, d, a, b, c, in[5]  + 0x4787c62a, 12);
+  MD5STEP (F1, c, d, a, b, in[6]  + 0xa8304613, 17);
+  MD5STEP (F1, b, c, d, a, in[7]  + 0xfd469501, 22);
+  MD5STEP (F1, a, b, c, d, in[8]  + 0x698098d8, 7);
+  MD5STEP (F1, d, a, b, c, in[9]  + 0x8b44f7af, 12);
+  MD5STEP (F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+  MD5STEP (F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+  MD5STEP (F1, a, b, c, d, in[12] + 0x6b901122, 7);
+  MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
+  MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
+  MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+  MD5STEP (F2, a, b, c, d, in[1]  + 0xf61e2562, 5);
+  MD5STEP (F2, d, a, b, c, in[6]  + 0xc040b340, 9);
+  MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+  MD5STEP (F2, b, c, d, a, in[0]  + 0xe9b6c7aa, 20);
+  MD5STEP (F2, a, b, c, d, in[5]  + 0xd62f105d, 5);
+  MD5STEP (F2, d, a, b, c, in[10] + 0x02441453, 9);
+  MD5STEP (F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+  MD5STEP (F2, b, c, d, a, in[4]  + 0xe7d3fbc8, 20);
+  MD5STEP (F2, a, b, c, d, in[9]  + 0x21e1cde6, 5);
+  MD5STEP (F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+  MD5STEP (F2, c, d, a, b, in[3]  + 0xf4d50d87, 14);
+  MD5STEP (F2, b, c, d, a, in[8]  + 0x455a14ed, 20);
+  MD5STEP (F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+  MD5STEP (F2, d, a, b, c, in[2]  + 0xfcefa3f8, 9);
+  MD5STEP (F2, c, d, a, b, in[7]  + 0x676f02d9, 14);
+  MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+  MD5STEP (F3, a, b, c, d, in[5]  + 0xfffa3942, 4);
+  MD5STEP (F3, d, a, b, c, in[8]  + 0x8771f681, 11);
+  MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+  MD5STEP (F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+  MD5STEP (F3, a, b, c, d, in[1]  + 0xa4beea44, 4);
+  MD5STEP (F3, d, a, b, c, in[4]  + 0x4bdecfa9, 11);
+  MD5STEP (F3, c, d, a, b, in[7]  + 0xf6bb4b60, 16);
+  MD5STEP (F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+  MD5STEP (F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+  MD5STEP (F3, d, a, b, c, in[0]  + 0xeaa127fa, 11);
+  MD5STEP (F3, c, d, a, b, in[3]  + 0xd4ef3085, 16);
+  MD5STEP (F3, b, c, d, a, in[6]  + 0x04881d05, 23);
+  MD5STEP (F3, a, b, c, d, in[9]  + 0xd9d4d039, 4);
+  MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+  MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+  MD5STEP (F3, b, c, d, a, in[2]  + 0xc4ac5665, 23);
+
+  MD5STEP (F4, a, b, c, d, in[0]  + 0xf4292244, 6);
+  MD5STEP (F4, d, a, b, c, in[7]  + 0x432aff97, 10);
+  MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+  MD5STEP (F4, b, c, d, a, in[5]  + 0xfc93a039, 21);
+  MD5STEP (F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+  MD5STEP (F4, d, a, b, c, in[3]  + 0x8f0ccc92, 10);
+  MD5STEP (F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+  MD5STEP (F4, b, c, d, a, in[1]  + 0x85845dd1, 21);
+  MD5STEP (F4, a, b, c, d, in[8]  + 0x6fa87e4f, 6);
+  MD5STEP (F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+  MD5STEP (F4, c, d, a, b, in[6]  + 0xa3014314, 15);
+  MD5STEP (F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+  MD5STEP (F4, a, b, c, d, in[4]  + 0xf7537e82, 6);
+  MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+  MD5STEP (F4, c, d, a, b, in[2]  + 0x2ad7d2bb, 15);
+  MD5STEP (F4, b, c, d, a, in[9]  + 0xeb86d391, 21);
 
   state[0] += a;
   state[1] += b;
@@ -226,8 +227,8 @@ MD5Transform (uint32_t state[4],
  */
 void
 MHD_MD5Update (void *ctx_,
-           const uint8_t *input,
-           size_t len)
+               const uint8_t *input,
+               size_t len)
 {
   struct MD5Context *ctx = ctx_;
   size_t have, need;
@@ -236,11 +237,11 @@ MHD_MD5Update (void *ctx_,
   mhd_assert ((ctx != NULL) || (len == 0));
 
   /* Check how many bytes we already have and how many more we need. */
-  have = (size_t)((ctx->count) & (MD5_BLOCK_SIZE - 1));
+  have = (size_t) ((ctx->count) & (MD5_BLOCK_SIZE - 1));
   need = MD5_BLOCK_SIZE - have;
 
   /* Update bytecount */
-  ctx->count += (uint64_t)len;
+  ctx->count += (uint64_t) len;
 
   if (len >= need)
   {
@@ -249,7 +250,7 @@ MHD_MD5Update (void *ctx_,
       memcpy (ctx->buffer + have,
               input,
               need);
-      MD5Transform(ctx->state, ctx->buffer);
+      MD5Transform (ctx->state, ctx->buffer);
       input += need;
       len -= need;
       have = 0;
diff --git a/src/microhttpd/md5.h b/src/microhttpd/md5.h
index 3c1d1c1c..f81d91cb 100644
--- a/src/microhttpd/md5.h
+++ b/src/microhttpd/md5.h
@@ -22,15 +22,15 @@
 #include <stdint.h>
 #include <stddef.h>
 
-#define        MD5_BLOCK_SIZE              64
-#define        MD5_DIGEST_SIZE             16
-#define        MD5_DIGEST_STRING_LENGTH    (MD5_DIGEST_SIZE * 2 + 1)
+#define MD5_BLOCK_SIZE              64
+#define MD5_DIGEST_SIZE             16
+#define MD5_DIGEST_STRING_LENGTH    (MD5_DIGEST_SIZE * 2 + 1)
 
 struct MD5Context
 {
-  uint32_t state[4];                   /* state */
-  uint64_t count;                      /* number of bytes, mod 2^64 */
-  uint8_t buffer[MD5_BLOCK_SIZE];      /* input buffer */
+  uint32_t state[4];      /* state */
+  uint64_t count;     /* number of bytes, mod 2^64 */
+  uint8_t buffer[MD5_BLOCK_SIZE]; /* input buffer */
 };
 
 
@@ -52,8 +52,8 @@ MHD_MD5Init (void *ctx_);
  */
 void
 MHD_MD5Update (void *ctx_,
-           const uint8_t *input,
-           size_t len);
+               const uint8_t *input,
+               size_t len);
 
 
 /**
@@ -63,7 +63,7 @@ MHD_MD5Update (void *ctx_,
  */
 void
 MHD_MD5Final (void *ctx_,
-          uint8_t digest[MD5_DIGEST_SIZE]);
+              uint8_t digest[MD5_DIGEST_SIZE]);
 
 
 #endif /* !MHD_MD5_H */
diff --git a/src/microhttpd/memorypool.h b/src/microhttpd/memorypool.h
index abd53365..6f5d539d 100644
--- a/src/microhttpd/memorypool.h
+++ b/src/microhttpd/memorypool.h
@@ -105,9 +105,9 @@ MHD_pool_allocate (struct MemoryPool *pool,
  */
 void *
 MHD_pool_reallocate (struct MemoryPool *pool,
-                    void *old,
-                    size_t old_size,
-                    size_t new_size);
+                     void *old,
+                     size_t old_size,
+                     size_t new_size);
 
 
 /**
@@ -135,8 +135,8 @@ MHD_pool_get_free (struct MemoryPool *pool);
  */
 void *
 MHD_pool_reset (struct MemoryPool *pool,
-               void *keep,
-               size_t copy_bytes,
+                void *keep,
+                size_t copy_bytes,
                 size_t new_size);
 
 #endif
diff --git a/src/microhttpd/mhd_assert.h b/src/microhttpd/mhd_assert.h
index c720ce5c..e99632d0 100644
--- a/src/microhttpd/mhd_assert.h
+++ b/src/microhttpd/mhd_assert.h
@@ -28,21 +28,21 @@
 
 #include "mhd_options.h"
 #ifdef NDEBUG
-#  define mhd_assert(ignore) ((void)0)
+#  define mhd_assert(ignore) ((void) 0)
 #else  /* _DEBUG */
 #  ifdef HAVE_ASSERT
 #    include <assert.h>
-#    define mhd_assert(CHK) assert(CHK)
+#    define mhd_assert(CHK) assert (CHK)
 #  else  /* ! HAVE_ASSERT */
 #    include <stdio.h>
 #    include <stdlib.h>
 #    define mhd_assert(CHK) \
-       do { \
-           if (!(CHK)) { \
-             fprintf(stderr, "%s:%u Assertion failed: %s\nProgram aborted.\n", 
\
-                     __FILE__, (unsigned)__LINE__, #CHK); \
-             fflush(stderr); abort(); } \
-          } while(0)
+  do { \
+    if (! (CHK)) { \
+      fprintf (stderr, "%s:%u Assertion failed: %s\nProgram aborted.\n", \
+               __FILE__, (unsigned) __LINE__, #CHK); \
+      fflush (stderr); abort (); } \
+  } while (0)
 #  endif /* ! HAVE_ASSERT */
 #endif /* _DEBUG */
 
diff --git a/src/microhttpd/mhd_bithelpers.h b/src/microhttpd/mhd_bithelpers.h
index ac2a13ce..34e49d15 100644
--- a/src/microhttpd/mhd_bithelpers.h
+++ b/src/microhttpd/mhd_bithelpers.h
@@ -28,7 +28,8 @@
 
 #include "mhd_byteorder.h"
 #include <stdint.h>
-#if defined(_MSC_FULL_VER) && (!defined(__clang__) || (defined(__c2__) && 
defined(__OPTIMIZE__)))
+#if defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \
+  defined(__OPTIMIZE__)))
 /* Declarations for VC & Clang/C2 built-ins */
 #include <intrin.h>
 #endif /* _MSC_FULL_VER  */
@@ -41,48 +42,50 @@
 
 #ifdef MHD_HAVE___BUILTIN_BSWAP32
 #define _MHD_BYTES_SWAP32(value32)  \
-        ((uint32_t)__builtin_bswap32((uint32_t)value32))
-#elif defined(_MSC_FULL_VER) && (!defined(__clang__) || (defined(__c2__) && 
defined(__OPTIMIZE__)))
+  ((uint32_t) __builtin_bswap32 ((uint32_t) value32))
+#elif defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \
+  defined(__OPTIMIZE__)))
 /* Clang/C2 may not inline this function if optimizations are turned off. */
 #ifndef __clang__
 #pragma intrinsic(_byteswap_ulong)
 #endif /* ! __clang__ */
 #define _MHD_BYTES_SWAP32(value32)  \
-        ((uint32_t)_byteswap_ulong((uint32_t)value32))
-#elif __has_builtin(__builtin_bswap32)
+  ((uint32_t) _byteswap_ulong ((uint32_t) value32))
+#elif __has_builtin (__builtin_bswap32)
 #define _MHD_BYTES_SWAP32(value32)  \
-        ((uint32_t)__builtin_bswap32((uint32_t)value32))
+  ((uint32_t) __builtin_bswap32 ((uint32_t) value32))
 #else  /* ! __has_builtin(__builtin_bswap32) */
 #define _MHD_BYTES_SWAP32(value32)                              \
-   ( (((uint32_t)(value32))                           << 24) |  \
-    ((((uint32_t)(value32)) & ((uint32_t)0x0000FF00)) << 8)  |  \
-    ((((uint32_t)(value32)) & ((uint32_t)0x00FF0000)) >> 8)  |  \
-     (((uint32_t)(value32))                           >> 24) )
+  ( (((uint32_t) (value32)) << 24)    \
+    | ((((uint32_t) (value32)) & ((uint32_t) 0x0000FF00)) << 8)     \
+    | ((((uint32_t) (value32)) & ((uint32_t) 0x00FF0000)) >> 8)     \
+    | (((uint32_t) (value32))                           >> 24) )
 #endif /* ! __has_builtin(__builtin_bswap32) */
 
 #ifdef MHD_HAVE___BUILTIN_BSWAP64
 #define _MHD_BYTES_SWAP64(value64) \
-        ((uint64_t)__builtin_bswap64((uint64_t)value64))
-#elif defined(_MSC_FULL_VER) && (!defined(__clang__) || (defined(__c2__) && 
defined(__OPTIMIZE__)))
+  ((uint64_t) __builtin_bswap64 ((uint64_t) value64))
+#elif defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \
+  defined(__OPTIMIZE__)))
 /* Clang/C2 may not inline this function if optimizations are turned off. */
 #ifndef __clang__
 #pragma intrinsic(_byteswap_uint64)
 #endif /* ! __clang__ */
 #define _MHD_BYTES_SWAP64(value64)  \
-        ((uint64_t)_byteswap_uint64((uint64_t)value64))
-#elif __has_builtin(__builtin_bswap64)
+  ((uint64_t) _byteswap_uint64 ((uint64_t) value64))
+#elif __has_builtin (__builtin_bswap64)
 #define _MHD_BYTES_SWAP64(value64) \
-        ((uint64_t)__builtin_bswap64((uint64_t)value64))
+  ((uint64_t) __builtin_bswap64 ((uint64_t) value64))
 #else  /* ! __has_builtin(__builtin_bswap64) */
 #define _MHD_BYTES_SWAP64(value64)                                     \
-  ( (((uint64_t)(value64))                                   << 56) |  \
-   ((((uint64_t)(value64)) & ((uint64_t)0x000000000000FF00)) << 40) |  \
-   ((((uint64_t)(value64)) & ((uint64_t)0x0000000000FF0000)) << 24) |  \
-   ((((uint64_t)(value64)) & ((uint64_t)0x00000000FF000000)) << 8)  |  \
-   ((((uint64_t)(value64)) & ((uint64_t)0x000000FF00000000)) >> 8)  |  \
-   ((((uint64_t)(value64)) & ((uint64_t)0x0000FF0000000000)) >> 24) |  \
-   ((((uint64_t)(value64)) & ((uint64_t)0x00FF000000000000)) >> 40) |  \
-    (((uint64_t)(value64))                                   >> 56) )
+  ( (((uint64_t) (value64)) << 56)    \
+    | ((((uint64_t) (value64)) & ((uint64_t) 0x000000000000FF00)) << 40)    \
+    | ((((uint64_t) (value64)) & ((uint64_t) 0x0000000000FF0000)) << 24)    \
+    | ((((uint64_t) (value64)) & ((uint64_t) 0x00000000FF000000)) << 8)     \
+    | ((((uint64_t) (value64)) & ((uint64_t) 0x000000FF00000000)) >> 8)     \
+    | ((((uint64_t) (value64)) & ((uint64_t) 0x0000FF0000000000)) >> 24)    \
+    | ((((uint64_t) (value64)) & ((uint64_t) 0x00FF000000000000)) >> 40)    \
+    | (((uint64_t) (value64))                                   >> 56) )
 #endif /* ! __has_builtin(__builtin_bswap64) */
 
 
@@ -92,22 +95,22 @@
  */
 #if _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
 #define _MHD_PUT_64BIT_LE(addr, value64)             \
-        ((*(uint64_t*)(addr)) = (uint64_t)(value64))
+  ((*(uint64_t*) (addr)) = (uint64_t) (value64))
 #elif _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
 #define _MHD_PUT_64BIT_LE(addr, value64)             \
-        ((*(uint64_t*)(addr)) = _MHD_BYTES_SWAP64(value64))
+  ((*(uint64_t*) (addr)) = _MHD_BYTES_SWAP64 (value64))
 #else  /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
 /* Endianess was not detected or non-standard like PDP-endian */
 #define _MHD_PUT_64BIT_LE(addr, value64) do {                             \
-        ((uint8_t*)(addr))[0] = (uint8_t)((uint64_t)(value64));           \
-        ((uint8_t*)(addr))[1] = (uint8_t)(((uint64_t)(value64)) >> 8);    \
-        ((uint8_t*)(addr))[2] = (uint8_t)(((uint64_t)(value64)) >> 16);   \
-        ((uint8_t*)(addr))[3] = (uint8_t)(((uint64_t)(value64)) >> 24);   \
-        ((uint8_t*)(addr))[4] = (uint8_t)(((uint64_t)(value64)) >> 32);   \
-        ((uint8_t*)(addr))[5] = (uint8_t)(((uint64_t)(value64)) >> 40);   \
-        ((uint8_t*)(addr))[6] = (uint8_t)(((uint64_t)(value64)) >> 48);   \
-        ((uint8_t*)(addr))[7] = (uint8_t)(((uint64_t)(value64)) >> 56);   \
-        } while (0)
+    ((uint8_t*) (addr))[0] = (uint8_t) ((uint64_t) (value64));           \
+    ((uint8_t*) (addr))[1] = (uint8_t) (((uint64_t) (value64)) >> 8);    \
+    ((uint8_t*) (addr))[2] = (uint8_t) (((uint64_t) (value64)) >> 16);   \
+    ((uint8_t*) (addr))[3] = (uint8_t) (((uint64_t) (value64)) >> 24);   \
+    ((uint8_t*) (addr))[4] = (uint8_t) (((uint64_t) (value64)) >> 32);   \
+    ((uint8_t*) (addr))[5] = (uint8_t) (((uint64_t) (value64)) >> 40);   \
+    ((uint8_t*) (addr))[6] = (uint8_t) (((uint64_t) (value64)) >> 48);   \
+    ((uint8_t*) (addr))[7] = (uint8_t) (((uint64_t) (value64)) >> 56);   \
+} while (0)
 #endif /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
 
 /* _MHD_PUT_32BIT_LE (addr, value32)
@@ -116,18 +119,18 @@
  */
 #if _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
 #define _MHD_PUT_32BIT_LE(addr,value32)             \
-        ((*(uint32_t*)(addr)) = (uint32_t)(value32))
+  ((*(uint32_t*) (addr)) = (uint32_t) (value32))
 #elif _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
 #define _MHD_PUT_32BIT_LE(addr, value32)            \
-        ((*(uint32_t*)(addr)) = _MHD_BYTES_SWAP32(value32))
+  ((*(uint32_t*) (addr)) = _MHD_BYTES_SWAP32 (value32))
 #else  /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
 /* Endianess was not detected or non-standard like PDP-endian */
 #define _MHD_PUT_32BIT_LE(addr, value32) do {                             \
-        ((uint8_t*)(addr))[0] = (uint8_t)((uint32_t)(value32));           \
-        ((uint8_t*)(addr))[1] = (uint8_t)(((uint32_t)(value32)) >> 8);    \
-        ((uint8_t*)(addr))[2] = (uint8_t)(((uint32_t)(value32)) >> 16);   \
-        ((uint8_t*)(addr))[3] = (uint8_t)(((uint32_t)(value32)) >> 24);   \
-        } while (0)
+    ((uint8_t*) (addr))[0] = (uint8_t) ((uint32_t) (value32));           \
+    ((uint8_t*) (addr))[1] = (uint8_t) (((uint32_t) (value32)) >> 8);    \
+    ((uint8_t*) (addr))[2] = (uint8_t) (((uint32_t) (value32)) >> 16);   \
+    ((uint8_t*) (addr))[3] = (uint8_t) (((uint32_t) (value32)) >> 24);   \
+} while (0)
 #endif /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
 
 /* _MHD_GET_32BIT_LE (addr)
@@ -136,17 +139,17 @@
  */
 #if _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
 #define _MHD_GET_32BIT_LE(addr)             \
-        (*(const uint32_t*)(addr))
+  (*(const uint32_t*) (addr))
 #elif _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
 #define _MHD_GET_32BIT_LE(addr)             \
-        _MHD_BYTES_SWAP32(*(const uint32_t*)(addr))
+  _MHD_BYTES_SWAP32 (*(const uint32_t*) (addr))
 #else  /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
 /* Endianess was not detected or non-standard like PDP-endian */
 #define _MHD_GET_32BIT_LE(addr)                       \
-        ( ( (uint32_t)(((const uint8_t*)addr)[0]))        | \
-          (((uint32_t)(((const uint8_t*)addr)[1])) << 8)  | \
-          (((uint32_t)(((const uint8_t*)addr)[2])) << 16) | \
-          (((uint32_t)(((const uint8_t*)addr)[3])) << 24) )
+  ( ( (uint32_t) (((const uint8_t*) addr)[0]))          \
+    | (((uint32_t) (((const uint8_t*) addr)[1])) << 8)    \
+    | (((uint32_t) (((const uint8_t*) addr)[2])) << 16)   \
+    | (((uint32_t) (((const uint8_t*) addr)[3])) << 24) )
 #endif /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
 
 
@@ -156,22 +159,22 @@
  */
 #if _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
 #define _MHD_PUT_64BIT_BE(addr, value64)             \
-        ((*(uint64_t*)(addr)) = (uint64_t)(value64))
+  ((*(uint64_t*) (addr)) = (uint64_t) (value64))
 #elif _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
 #define _MHD_PUT_64BIT_BE(addr, value64)             \
-        ((*(uint64_t*)(addr)) = _MHD_BYTES_SWAP64(value64))
+  ((*(uint64_t*) (addr)) = _MHD_BYTES_SWAP64 (value64))
 #else  /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
 /* Endianess was not detected or non-standard like PDP-endian */
 #define _MHD_PUT_64BIT_BE(addr, value64) do {                             \
-        ((uint8_t*)(addr))[7] = (uint8_t)((uint64_t)(value64));           \
-        ((uint8_t*)(addr))[6] = (uint8_t)(((uint64_t)(value64)) >> 8);    \
-        ((uint8_t*)(addr))[5] = (uint8_t)(((uint64_t)(value64)) >> 16);   \
-        ((uint8_t*)(addr))[4] = (uint8_t)(((uint64_t)(value64)) >> 24);   \
-        ((uint8_t*)(addr))[3] = (uint8_t)(((uint64_t)(value64)) >> 32);   \
-        ((uint8_t*)(addr))[2] = (uint8_t)(((uint64_t)(value64)) >> 40);   \
-        ((uint8_t*)(addr))[1] = (uint8_t)(((uint64_t)(value64)) >> 48);   \
-        ((uint8_t*)(addr))[0] = (uint8_t)(((uint64_t)(value64)) >> 56);   \
-        } while (0)
+    ((uint8_t*) (addr))[7] = (uint8_t) ((uint64_t) (value64));           \
+    ((uint8_t*) (addr))[6] = (uint8_t) (((uint64_t) (value64)) >> 8);    \
+    ((uint8_t*) (addr))[5] = (uint8_t) (((uint64_t) (value64)) >> 16);   \
+    ((uint8_t*) (addr))[4] = (uint8_t) (((uint64_t) (value64)) >> 24);   \
+    ((uint8_t*) (addr))[3] = (uint8_t) (((uint64_t) (value64)) >> 32);   \
+    ((uint8_t*) (addr))[2] = (uint8_t) (((uint64_t) (value64)) >> 40);   \
+    ((uint8_t*) (addr))[1] = (uint8_t) (((uint64_t) (value64)) >> 48);   \
+    ((uint8_t*) (addr))[0] = (uint8_t) (((uint64_t) (value64)) >> 56);   \
+} while (0)
 #endif /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
 
 /* _MHD_PUT_32BIT_BE (addr, value32)
@@ -180,18 +183,18 @@
  */
 #if _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
 #define _MHD_PUT_32BIT_BE(addr, value32)             \
-        ((*(uint32_t*)(addr)) = (uint32_t)(value32))
+  ((*(uint32_t*) (addr)) = (uint32_t) (value32))
 #elif _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
 #define _MHD_PUT_32BIT_BE(addr, value32)             \
-        ((*(uint32_t*)(addr)) = _MHD_BYTES_SWAP32(value32))
+  ((*(uint32_t*) (addr)) = _MHD_BYTES_SWAP32 (value32))
 #else  /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
 /* Endianess was not detected or non-standard like PDP-endian */
 #define _MHD_PUT_32BIT_BE(addr, value32) do {                             \
-        ((uint8_t*)(addr))[3] = (uint8_t)((uint32_t)(value32));           \
-        ((uint8_t*)(addr))[2] = (uint8_t)(((uint32_t)(value32)) >> 8);    \
-        ((uint8_t*)(addr))[1] = (uint8_t)(((uint32_t)(value32)) >> 16);   \
-        ((uint8_t*)(addr))[0] = (uint8_t)(((uint32_t)(value32)) >> 24);   \
-        } while (0)
+    ((uint8_t*) (addr))[3] = (uint8_t) ((uint32_t) (value32));           \
+    ((uint8_t*) (addr))[2] = (uint8_t) (((uint32_t) (value32)) >> 8);    \
+    ((uint8_t*) (addr))[1] = (uint8_t) (((uint32_t) (value32)) >> 16);   \
+    ((uint8_t*) (addr))[0] = (uint8_t) (((uint32_t) (value32)) >> 24);   \
+} while (0)
 #endif /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
 
 /* _MHD_GET_32BIT_BE (addr)
@@ -200,17 +203,17 @@
  */
 #if _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
 #define _MHD_GET_32BIT_BE(addr)             \
-        (*(const uint32_t*)(addr))
+  (*(const uint32_t*) (addr))
 #elif _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
 #define _MHD_GET_32BIT_BE(addr)             \
-        _MHD_BYTES_SWAP32(*(const uint32_t*)(addr))
+  _MHD_BYTES_SWAP32 (*(const uint32_t*) (addr))
 #else  /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
 /* Endianess was not detected or non-standard like PDP-endian */
 #define _MHD_GET_32BIT_BE(addr)                       \
-        ( (((uint32_t)(((const uint8_t*)addr)[0])) << 24) | \
-          (((uint32_t)(((const uint8_t*)addr)[1])) << 16) | \
-          (((uint32_t)(((const uint8_t*)addr)[2])) << 8)  | \
-          ((uint32_t) (((const uint8_t*)addr)[3])) )
+  ( (((uint32_t) (((const uint8_t*) addr)[0])) << 24)   \
+    | (((uint32_t) (((const uint8_t*) addr)[1])) << 16)   \
+    | (((uint32_t) (((const uint8_t*) addr)[2])) << 8)    \
+    | ((uint32_t) (((const uint8_t*) addr)[3])) )
 #endif /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
 
 
@@ -218,17 +221,18 @@
  * Rotate right 32-bit value by number of bits.
  * bits parameter must be more than zero and must be less than 32.
  */
-#if defined(_MSC_FULL_VER) && (!defined(__clang__) || (defined(__c2__) && 
defined(__OPTIMIZE__)))
+#if defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \
+  defined(__OPTIMIZE__)))
 /* Clang/C2 do not inline this function if optimizations are turned off. */
 #ifndef __clang__
 #pragma intrinsic(_rotr)
 #endif /* ! __clang__ */
 #define _MHD_ROTR32(value32, bits) \
-        ((uint32_t)_rotr((uint32_t)(value32),(bits)))
+  ((uint32_t) _rotr ((uint32_t) (value32),(bits)))
 #else  /* ! _MSC_FULL_VER */
 /* Defined in form which modern compiler could optimize. */
 #define _MHD_ROTR32(value32, bits) \
-        (((uint32_t)(value32)) >> (bits) | ((uint32_t)(value32)) << (32 - 
bits))
+  (((uint32_t) (value32)) >> (bits) | ((uint32_t) (value32)) << (32 - bits))
 #endif /* ! _MSC_FULL_VER */
 
 
diff --git a/src/microhttpd/mhd_byteorder.h b/src/microhttpd/mhd_byteorder.h
index f053aa0e..f1f03f44 100644
--- a/src/microhttpd/mhd_byteorder.h
+++ b/src/microhttpd/mhd_byteorder.h
@@ -73,7 +73,8 @@
 #if defined(__BYTE_ORDER__)
 #if defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
-#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == 
__ORDER_LITTLE_ENDIAN__
+#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == \
+  __ORDER_LITTLE_ENDIAN__
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
 #elif defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
 #define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN
@@ -108,36 +109,40 @@
 /* Byte order specification didn't detected in system headers */
 /* Try some guessing */
 
-#if   (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \
-      (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN))
+#if   (defined(__BIG_ENDIAN__) && ! defined(__LITTLE_ENDIAN__)) || \
+  (defined(_BIG_ENDIAN) && ! defined(_LITTLE_ENDIAN))
 /* Seems that we are on big endian platform */
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
-#elif (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
-      (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN))
+#elif (defined(__LITTLE_ENDIAN__) && ! defined(__BIG_ENDIAN__)) || \
+  (defined(_LITTLE_ENDIAN) && ! defined(_BIG_ENDIAN))
 /* Seems that we are on little endian platform */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
-#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || 
defined(__x86_64) || \
-      defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) 
|| \
-      defined(__i386__) || defined(__i486__) || defined(__i586__) || 
defined(__i686__) || \
-      defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__)
+#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || \
+  defined(__x86_64) || \
+  defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) || \
+  defined(__i386__) || defined(__i486__) || defined(__i586__) || \
+  defined(__i686__) || \
+  defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__)
 /* x86 family is little endian */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
 #elif defined(__ARMEB__) || defined(__THUMBEB__) ||  defined(__AARCH64EB__) || 
\
-      defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
+  defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
 /* Looks like we are on ARM/MIPS in big endian mode */
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
 #elif defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \
-      defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
+  defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
 /* Looks like we are on ARM/MIPS in little endian mode */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
-#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || 
defined(__hppa) || \
-      defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \
-      defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__)
+#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || \
+  defined(__hppa) || \
+  defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \
+  defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__)
 /* Looks like we are on big endian platform */
 #define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
-#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || 
defined(__ia64) || \
-      defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \
-      defined(__BFIN__) || defined(bfin) || defined(BFIN)
+#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
+  defined(__ia64) || \
+  defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \
+  defined(__BFIN__) || defined(bfin) || defined(BFIN)
 /* Looks like we are on little endian platform */
 #define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
 #elif defined(_WIN32)
@@ -153,9 +158,11 @@
 #ifdef _MHD_BYTE_ORDER
 /* Some safety checks */
 #if defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN
-#error Configure detected big endian byte order but headers specify different 
byte order
-#elif !defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
-#error Configure did not detect big endian byte order but headers specify big 
endian byte order
+#error \
+  Configure detected big endian byte order but headers specify different byte 
order
+#elif ! defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
+#error \
+  Configure did not detect big endian byte order but headers specify big 
endian byte order
 #endif /* !WORDS_BIGENDIAN && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN */
 #endif /* _MHD_BYTE_ORDER */
 
diff --git a/src/microhttpd/mhd_compat.c b/src/microhttpd/mhd_compat.c
index 3abdc367..6f6c6f9c 100644
--- a/src/microhttpd/mhd_compat.c
+++ b/src/microhttpd/mhd_compat.c
@@ -25,7 +25,7 @@
  */
 
 #include "mhd_compat.h"
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 #include <stdint.h>
 #include <time.h>
 #ifndef HAVE_SNPRINTF
@@ -38,7 +38,7 @@
 #include <string.h> /* for memset() */
 #endif /* ! HAVE_CALLOC */
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 
 #ifndef HAVE_SNPRINTF
 /* Emulate snprintf function on W32 */
@@ -61,16 +61,16 @@ W32_snprintf (char *__restrict s,
                       format,
                       args);
     va_end (args);
-    if ((int)n == ret)
+    if ((int) n == ret)
       s[n - 1] = 0;
     if (ret >= 0)
       return ret;
   }
-  va_start(args,
-           format);
+  va_start (args,
+            format);
   ret = _vscprintf (format,
                     args);
-  va_end(args);
+  va_end (args);
   if ( (0 <= ret) &&
        (0 != n) &&
        (NULL == s) )
@@ -85,30 +85,30 @@ W32_snprintf (char *__restrict s,
 #ifndef HAVE_CALLOC
 
 #ifdef __has_builtin
-#  if __has_builtin(__builtin_mul_overflow)
+#  if __has_builtin (__builtin_mul_overflow)
 #    define MHD_HAVE_NUL_OVERFLOW 1
 #  endif
-#elif __GNUC__+0 >= 5
+#elif __GNUC__ + 0 >= 5
 #  define MHD_HAVE_NUL_OVERFLOW 1
 #endif /* __GNUC__ >= 5 */
 
 
-void *MHD_calloc_(size_t nelem, size_t elsize)
+void *MHD_calloc_ (size_t nelem, size_t elsize)
 {
   size_t alloc_size;
   void *ptr;
 #ifdef MHD_HAVE_NUL_OVERFLOW
-  if (__builtin_mul_overflow(nelem, elsize, &alloc_size) || 0 == alloc_size)
+  if (__builtin_mul_overflow (nelem, elsize, &alloc_size) ||(0 == alloc_size))
     return NULL;
 #else  /* ! MHD_HAVE_NUL_OVERFLOW */
   alloc_size = nelem * elsize;
-  if (0 == alloc_size || elsize != alloc_size / nelem)
+  if ((0 == alloc_size)||(elsize != alloc_size / nelem))
     return NULL;
 #endif /* ! MHD_HAVE_NUL_OVERFLOW */
   ptr = malloc (alloc_size);
   if (NULL == ptr)
     return NULL;
-  memset(ptr, 0, alloc_size);
+  memset (ptr, 0, alloc_size);
   return ptr;
 }
 #endif /* ! HAVE_CALLOC */
diff --git a/src/microhttpd/mhd_compat.h b/src/microhttpd/mhd_compat.h
index b4e2c66c..6b38a03e 100644
--- a/src/microhttpd/mhd_compat.h
+++ b/src/microhttpd/mhd_compat.h
@@ -40,8 +40,8 @@
 #include <string.h>
 #endif /* HAVE_STRING_H */
 
- /* MHD_strerror_ is strerror */
-#define MHD_strerror_(errnum) strerror((errnum))
+/* MHD_strerror_ is strerror */
+#define MHD_strerror_(errnum) strerror ((errnum))
 
 /* Platform-independent snprintf name */
 #if defined(HAVE_SNPRINTF)
@@ -49,10 +49,12 @@
 #else  /* ! HAVE_SNPRINTF */
 #if defined(_WIN32) && ! defined(__CYGWIN__)
 /* Emulate snprintf function on W32 */
-int W32_snprintf(char *__restrict s, size_t n, const char *__restrict format, 
...);
+int W32_snprintf (char *__restrict s, size_t n, const char *__restrict format,
+                  ...);
 #define MHD_snprintf_ W32_snprintf
 #else  /* ! _WIN32 || __CYGWIN__ */
-#error Your platform does not support snprintf() and MHD does not know how to 
emulate it on your platform.
+#error \
+  Your platform does not support snprintf() and MHD does not know how to 
emulate it on your platform.
 #endif /* ! _WIN32 || __CYGWIN__ */
 #endif /* ! HAVE_SNPRINTF */
 
@@ -61,14 +63,14 @@ int W32_snprintf(char *__restrict s, size_t n, const char 
*__restrict format, ..
  * Generate pseudo random number at least 30-bit wide.
  * @return pseudo random number at least 30-bit wide.
  */
-#define MHD_random_() random()
+#define MHD_random_() random ()
 #else  /* HAVE_RANDOM */
 #ifdef HAVE_RAND
 /**
  * Generate pseudo random number at least 30-bit wide.
  * @return pseudo random number at least 30-bit wide.
  */
-#define MHD_random_() ( (((long)rand()) << 15) + (long)rand() )
+#define MHD_random_() ( (((long) rand ()) << 15) + (long) rand () )
 #endif /* HAVE_RAND */
 #endif /* HAVE_RANDOM */
 
@@ -76,12 +78,12 @@ int W32_snprintf(char *__restrict s, size_t n, const char 
*__restrict format, ..
 /**
  * MHD_calloc_ is platform-independent calloc()
  */
-#define MHD_calloc_(n,s) calloc((n),(s))
+#define MHD_calloc_(n,s) calloc ((n),(s))
 #else  /* ! HAVE_CALLOC */
 /**
  * MHD_calloc_ is platform-independent calloc()
  */
-void *MHD_calloc_(size_t nelem, size_t elsize);
+void *MHD_calloc_ (size_t nelem, size_t elsize);
 #endif /* ! HAVE_CALLOC */
 
 #endif /* MHD_COMPAT_H */
diff --git a/src/microhttpd/mhd_itc.c b/src/microhttpd/mhd_itc.c
index 8aeee576..6c81ef62 100644
--- a/src/microhttpd/mhd_itc.c
+++ b/src/microhttpd/mhd_itc.c
@@ -34,7 +34,7 @@
 
 
 #if defined(_MHD_ITC_PIPE)
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
 
 #ifndef HAVE_PIPE2_FUNC
 /**
@@ -48,7 +48,7 @@ MHD_itc_nonblocking_ (struct MHD_itc_ itc)
 {
   unsigned int i;
 
-  for (i=0;i<2;i++)
+  for (i = 0; i<2; i++)
   {
     int flags;
 
@@ -63,7 +63,7 @@ MHD_itc_nonblocking_ (struct MHD_itc_ itc)
                       flags | O_NONBLOCK)) )
       return 0;
   }
-  return !0;
+  return ! 0;
 }
 #endif /* ! HAVE_PIPE2_FUNC */
 #endif /* !_WIN32 || __CYGWIN__ */
diff --git a/src/microhttpd/mhd_itc.h b/src/microhttpd/mhd_itc.h
index 01331f13..8e303ef9 100644
--- a/src/microhttpd/mhd_itc.h
+++ b/src/microhttpd/mhd_itc.h
@@ -41,8 +41,9 @@
 #  include <stdlib.h>
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
-     "Abnormal termination at %d line in file %s: %s\n", \
-     (int)__LINE__, __FILE__, msg); abort();} while(0)
+                                       "Abnormal termination at %d line in 
file %s: %s\n", \
+                                       (int) __LINE__, __FILE__, msg); abort 
(); \
+} while (0)
 #endif /* ! MHD_PANIC */
 
 #if defined(_MHD_ITC_EVENTFD)
@@ -63,12 +64,13 @@
  * @param itc the itc to initialise
  * @return non-zero if succeeded, zero otherwise
  */
-#define MHD_itc_init_(itc) (-1 != ((itc).fd = eventfd (0, EFD_CLOEXEC | 
EFD_NONBLOCK)))
+#define MHD_itc_init_(itc) (-1 != ((itc).fd = eventfd (0, EFD_CLOEXEC \
+                                                       | EFD_NONBLOCK)))
 
 /**
  * Get description string of last errno for itc operations.
  */
-#define MHD_itc_last_strerror_() strerror(errno)
+#define MHD_itc_last_strerror_() strerror (errno)
 
 /**
  * Internal static const helper for MHD_itc_activate_()
@@ -82,7 +84,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_activate_(itc, str) \
-  ((write((itc).fd, (const void*)&_MHD_itc_wr_data, 8) > 0) || (EAGAIN == 
errno))
+  ((write ((itc).fd, (const void*) &_MHD_itc_wr_data, 8) > 0) || (EAGAIN == \
+                                                                  errno))
 
 /**
  * Return read FD of @a itc which can be used for poll(), select() etc.
@@ -104,8 +107,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_clear_(itc)                  \
   do { uint64_t __b; int __r;                \
-       __r = read((itc).fd, &__b, sizeof(__b)); \
-       (void)__r; } while(0)
+       __r = read ((itc).fd, &__b, sizeof(__b)); \
+       (void) __r; } while (0)
 
 /**
  * Destroy previously initialised ITC.  Note that close()
@@ -155,20 +158,20 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #ifdef HAVE_PIPE2_FUNC
-#  define MHD_itc_init_(itc) (!pipe2((itc).fd, O_CLOEXEC | O_NONBLOCK))
+#  define MHD_itc_init_(itc) (! pipe2 ((itc).fd, O_CLOEXEC | O_NONBLOCK))
 #else  /* ! HAVE_PIPE2_FUNC */
 #  define MHD_itc_init_(itc)              \
-     ( (!pipe((itc).fd)) ?                \
-         (MHD_itc_nonblocking_((itc)) ?   \
-           (!0) :                         \
-           (MHD_itc_destroy_((itc)), 0) ) \
-         : (0) )
+  ( (! pipe ((itc).fd)) ?                \
+    (MHD_itc_nonblocking_ ((itc)) ?   \
+     (! 0) :                         \
+     (MHD_itc_destroy_ ((itc)), 0) ) \
+    : (0) )
 #endif /* ! HAVE_PIPE2_FUNC */
 
 /**
  * Get description string of last errno for itc operations.
  */
-#define MHD_itc_last_strerror_() strerror(errno)
+#define MHD_itc_last_strerror_() strerror (errno)
 
 /**
  * Activate signal on @a itc
@@ -177,7 +180,7 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_activate_(itc, str) \
-  ((write((itc).fd[1], (const void*)(str), 1) > 0) || (EAGAIN == errno))
+  ((write ((itc).fd[1], (const void*) (str), 1) > 0) || (EAGAIN == errno))
 
 
 /**
@@ -200,8 +203,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_clear_(itc) do                      \
   { long __b;                                       \
-    while(0 < read((itc).fd[0], &__b, sizeof(__b))) \
-    {} } while(0)
+    while (0 < read ((itc).fd[0], &__b, sizeof(__b))) \
+    {} } while (0)
 
 /**
  * Destroy previously initialised ITC
@@ -210,8 +213,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_destroy_(itc)      \
   ( (0 == close ((itc).fd[0])) ?   \
-      (0 == close ((itc).fd[1])) : \
-      ((close ((itc).fd[1])), 0) )
+    (0 == close ((itc).fd[1])) : \
+    ((close ((itc).fd[1])), 0) )
 
 /**
  * Check whether ITC has valid value.
@@ -231,14 +234,14 @@ static const uint64_t _MHD_itc_wr_data = 1;
 #define MHD_itc_set_invalid_(itc) ((itc).fd[0] = (itc).fd[1] = -1)
 
 #ifndef HAVE_PIPE2_FUNC
-  /**
-   * Change itc FD options to be non-blocking.
-   *
-   * @param fd the FD to manipulate
-   * @return non-zero if succeeded, zero otherwise
-   */
-  int
-  MHD_itc_nonblocking_ (struct MHD_itc_ itc);
+/**
+ * Change itc FD options to be non-blocking.
+ *
+ * @param fd the FD to manipulate
+ * @return non-zero if succeeded, zero otherwise
+ */
+int
+MHD_itc_nonblocking_ (struct MHD_itc_ itc);
 #endif /* ! HAVE_PIPE2_FUNC */
 
 
@@ -255,20 +258,20 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #ifdef MHD_socket_pair_nblk_
-#  define MHD_itc_init_(itc) MHD_socket_pair_nblk_((itc).sk)
+#  define MHD_itc_init_(itc) MHD_socket_pair_nblk_ ((itc).sk)
 #else  /* ! MHD_socket_pair_nblk_ */
 #  define MHD_itc_init_(itc)            \
-     (MHD_socket_pair_((itc).sk) ?      \
-       (MHD_itc_nonblocking_((itc)) ?   \
-         (!0) :                         \
-         (MHD_itc_destroy_((itc)), 0) ) \
-       : (0))
+  (MHD_socket_pair_ ((itc).sk) ?      \
+   (MHD_itc_nonblocking_ ((itc)) ?   \
+    (! 0) :                         \
+    (MHD_itc_destroy_ ((itc)), 0) ) \
+   : (0))
 #endif /* ! MHD_socket_pair_nblk_ */
 
 /**
  * Get description string of last error for itc operations.
  */
-#define MHD_itc_last_strerror_() MHD_socket_last_strerr_()
+#define MHD_itc_last_strerror_() MHD_socket_last_strerr_ ()
 
 /**
  * Activate signal on @a itc
@@ -277,8 +280,8 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_activate_(itc, str)          \
-  ((MHD_send_((itc).sk[1], (str), 1) > 0) || \
-   (MHD_SCKT_ERR_IS_EAGAIN_(MHD_socket_get_error_())))
+  ((MHD_send_ ((itc).sk[1], (str), 1) > 0) || \
+   (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ())))
 
 /**
  * Return read FD of @a itc which can be used for poll(), select() etc.
@@ -300,10 +303,10 @@ static const uint64_t _MHD_itc_wr_data = 1;
  */
 #define MHD_itc_clear_(itc) do      \
   { long __b;                       \
-    while(0 < recv((itc).sk[0],     \
-                   (char*)&__b,     \
-                   sizeof(__b), 0)) \
-    {} } while(0)
+    while (0 < recv ((itc).sk[0],     \
+                     (char*) &__b,     \
+                     sizeof(__b), 0)) \
+    {} } while (0)
 
 /**
  * Destroy previously initialised ITC
@@ -311,9 +314,9 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return non-zero if succeeded, zero otherwise
  */
 #define MHD_itc_destroy_(itc)          \
-  ( MHD_socket_close_((itc).sk[0]) ?   \
-      MHD_socket_close_((itc).sk[1]) : \
-      ((void)MHD_socket_close_((itc).sk[1]), 0) )
+  (MHD_socket_close_ ((itc).sk[0]) ?   \
+   MHD_socket_close_ ((itc).sk[1]) : \
+   ((void) MHD_socket_close_ ((itc).sk[1]), 0) )
 
 
 /**
@@ -331,10 +334,12 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * Set @a itc to invalid value.
  * @param itc the itc to set
  */
-#define MHD_itc_set_invalid_(itc) ((itc).sk[0] = (itc).sk[1] = 
MHD_INVALID_SOCKET)
+#define MHD_itc_set_invalid_(itc) ((itc).sk[0] = (itc).sk[1] = \
+                                     MHD_INVALID_SOCKET)
 
 #ifndef MHD_socket_pair_nblk_
-#  define MHD_itc_nonblocking_(pip) (MHD_socket_nonblocking_((pip).sk[0]) && 
MHD_socket_nonblocking_((pip).sk[1]))
+#  define MHD_itc_nonblocking_(pip) (MHD_socket_nonblocking_ ((pip).sk[0]) && \
+                                     MHD_socket_nonblocking_ ((pip).sk[1]))
 #endif /* ! MHD_socket_pair_nblk_ */
 
 #endif /* _MHD_ITC_SOCKETPAIR */
@@ -345,9 +350,9 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @param itc the itc to destroy
  */
 #define MHD_itc_destroy_chk_(itc) do {          \
-    if (!MHD_itc_destroy_(itc))                 \
-      MHD_PANIC(_("Failed to destroy ITC.\n")); \
-  } while(0)
+    if (! MHD_itc_destroy_ (itc))                 \
+      MHD_PANIC (_ ("Failed to destroy ITC.\n")); \
+} while (0)
 
 /**
  * Check whether ITC has invalid value.
@@ -358,6 +363,6 @@ static const uint64_t _MHD_itc_wr_data = 1;
  * @return boolean true if @a itc has invalid value,
  *         boolean false otherwise.
  */
-#define MHD_ITC_IS_INVALID_(itc)  (! MHD_ITC_IS_VALID_(itc))
+#define MHD_ITC_IS_INVALID_(itc)  (! MHD_ITC_IS_VALID_ (itc))
 
 #endif /* MHD_ITC_H */
diff --git a/src/microhttpd/mhd_itc_types.h b/src/microhttpd/mhd_itc_types.h
index 04966d36..36d4218b 100644
--- a/src/microhttpd/mhd_itc_types.h
+++ b/src/microhttpd/mhd_itc_types.h
@@ -32,7 +32,7 @@
 #include "mhd_options.h"
 
 /* Force socketpair on native W32 */
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(_MHD_ITC_SOCKETPAIR)
+#if defined(_WIN32) && ! defined(__CYGWIN__) && ! defined(_MHD_ITC_SOCKETPAIR)
 #error _MHD_ITC_SOCKETPAIR is not defined on naitive W32 platform
 #endif /* _WIN32 && !__CYGWIN__ && !_MHD_ITC_SOCKETPAIR */
 
diff --git a/src/microhttpd/mhd_limits.h b/src/microhttpd/mhd_limits.h
index 40ae2e26..b97fce6f 100644
--- a/src/microhttpd/mhd_limits.h
+++ b/src/microhttpd/mhd_limits.h
@@ -32,17 +32,17 @@
 #include <limits.h>
 #endif /* HAVE_LIMITS_H */
 
-#define MHD_UNSIGNED_TYPE_MAX_(type) ((type)-1)
+#define MHD_UNSIGNED_TYPE_MAX_(type) ((type) - 1)
 /* Assume 8 bits per byte, no padding bits. */
 #define MHD_SIGNED_TYPE_MAX_(type) \
-        ( (type)((( ((type)1) << (sizeof(type)*8 - 2)) - 1)*2 + 1) )
-#define MHD_TYPE_IS_SIGNED_(type) (((type)0)>((type)-1))
+  ( (type) ((( ((type) 1) << (sizeof(type) * 8 - 2)) - 1) * 2 + 1) )
+#define MHD_TYPE_IS_SIGNED_(type) (((type) 0)>((type) - 1))
 
 #ifndef UINT_MAX
 #ifdef __UINT_MAX__
 #define UINT_MAX __UINT_MAX__
 #else  /* ! __UINT_MAX__ */
-#define UINT_MAX MHD_UNSIGNED_TYPE_MAX_(unsigned int)
+#define UINT_MAX MHD_UNSIGNED_TYPE_MAX_ (unsigned int)
 #endif /* ! __UINT_MAX__ */
 #endif /* !UINT_MAX */
 
@@ -50,19 +50,19 @@
 #ifdef __LONG_MAX__
 #define LONG_MAX __LONG_MAX__
 #else  /* ! __LONG_MAX__ */
-#define LONG_MAX MHD_SIGNED_TYPE_MAX(long)
+#define LONG_MAX MHD_SIGNED_TYPE_MAX (long)
 #endif /* ! __LONG_MAX__ */
 #endif /* !OFF_T_MAX */
 
 #ifndef ULLONG_MAX
-#define ULLONG_MAX MHD_UNSIGNED_TYPE_MAX_(MHD_UNSIGNED_LONG_LONG)
+#define ULLONG_MAX MHD_UNSIGNED_TYPE_MAX_ (MHD_UNSIGNED_LONG_LONG)
 #endif /* !ULLONG_MAX */
 
 #ifndef INT32_MAX
 #ifdef __INT32_MAX__
 #define INT32_MAX __INT32_MAX__
 #else  /* ! __INT32_MAX__ */
-#define INT32_MAX ((int32_t)0x7FFFFFFF)
+#define INT32_MAX ((int32_t) 0x7FFFFFFF)
 #endif /* ! __INT32_MAX__ */
 #endif /* !INT32_MAX */
 
@@ -70,7 +70,7 @@
 #ifdef __UINT32_MAX__
 #define UINT32_MAX __UINT32_MAX__
 #else  /* ! __UINT32_MAX__ */
-#define UINT32_MAX ((int32_t)0xFFFFFFFF)
+#define UINT32_MAX ((int32_t) 0xFFFFFFFF)
 #endif /* ! __UINT32_MAX__ */
 #endif /* !UINT32_MAX */
 
@@ -78,7 +78,7 @@
 #ifdef __UINT64_MAX__
 #define UINT64_MAX __UINT64_MAX__
 #else  /* ! __UINT64_MAX__ */
-#define UINT64_MAX ((uint64_t)0xFFFFFFFFFFFFFFFF)
+#define UINT64_MAX ((uint64_t) 0xFFFFFFFFFFFFFFFF)
 #endif /* ! __UINT64_MAX__ */
 #endif /* !UINT64_MAX */
 
@@ -86,7 +86,7 @@
 #ifdef __INT64_MAX__
 #define INT64_MAX __INT64_MAX__
 #else  /* ! __INT64_MAX__ */
-#define INT64_MAX ((int64_t)0x7FFFFFFFFFFFFFFF)
+#define INT64_MAX ((int64_t) 0x7FFFFFFFFFFFFFFF)
 #endif /* ! __UINT64_MAX__ */
 #endif /* !INT64_MAX */
 
@@ -96,8 +96,8 @@
 #elif defined(UINTPTR_MAX)
 #define SIZE_MAX UINTPTR_MAX
 #else  /* ! __SIZE_MAX__ */
-#define SIZE_MAX MHD_UNSIGNED_TYPE_MAX_(size_t)
-#endif /* ! __SIZE_MAX__ */ 
+#define SIZE_MAX MHD_UNSIGNED_TYPE_MAX_ (size_t)
+#endif /* ! __SIZE_MAX__ */
 #endif /* !SIZE_MAX */
 
 #ifndef SSIZE_MAX
@@ -108,7 +108,7 @@
 #elif defined(INTPTR_MAX)
 #define SSIZE_MAX INTPTR_MAX
 #else
-#define SSIZE_MAX MHD_SIGNED_TYPE_MAX_(ssize_t)
+#define SSIZE_MAX MHD_SIGNED_TYPE_MAX_ (ssize_t)
 #endif
 #endif /* ! SSIZE_MAX */
 
@@ -120,19 +120,19 @@
 #elif defined(__APPLE__) && defined(__MACH__)
 #define OFF_T_MAX INT64_MAX
 #else
-#define OFF_T_MAX MHD_SIGNED_TYPE_MAX_(off_t)
+#define OFF_T_MAX MHD_SIGNED_TYPE_MAX_ (off_t)
 #endif
 #endif /* !OFF_T_MAX */
 
-#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX)
-#define OFF64_T_MAX MHD_SIGNED_TYPE_MAX_(uint64_t)
+#if defined(_LARGEFILE64_SOURCE) && ! defined(OFF64_T_MAX)
+#define OFF64_T_MAX MHD_SIGNED_TYPE_MAX_ (uint64_t)
 #endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */
 
 #ifndef TIME_T_MAX
 #define TIME_T_MAX ((time_t)              \
-       ( MHD_TYPE_IS_SIGNED_(time_t) ?    \
-           MHD_SIGNED_TYPE_MAX_(time_t) : \
-           MHD_UNSIGNED_TYPE_MAX_(time_t)))
+                    (MHD_TYPE_IS_SIGNED_ (time_t) ?    \
+                     MHD_SIGNED_TYPE_MAX_ (time_t) : \
+                     MHD_UNSIGNED_TYPE_MAX_ (time_t)))
 #endif /* !TIME_T_MAX */
 
 #ifndef TIMEVAL_TV_SEC_MAX
diff --git a/src/microhttpd/mhd_locks.h b/src/microhttpd/mhd_locks.h
index 21db56c4..8c9b0844 100644
--- a/src/microhttpd/mhd_locks.h
+++ b/src/microhttpd/mhd_locks.h
@@ -59,14 +59,15 @@
 #  include <stdlib.h>
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
-     "Abnormal termination at %d line in file %s: %s\n", \
-     (int)__LINE__, __FILE__, msg); abort();} while(0)
+                                       "Abnormal termination at %d line in 
file %s: %s\n", \
+                                       (int) __LINE__, __FILE__, msg); abort 
(); \
+} while (0)
 #endif /* ! MHD_PANIC */
 
 #if defined(MHD_PTHREAD_MUTEX_)
-  typedef pthread_mutex_t MHD_mutex_;
+typedef pthread_mutex_t MHD_mutex_;
 #elif defined(MHD_W32_MUTEX_)
-  typedef CRITICAL_SECTION MHD_mutex_;
+typedef CRITICAL_SECTION MHD_mutex_;
 #endif
 
 #if defined(MHD_PTHREAD_MUTEX_)
@@ -75,14 +76,15 @@
  * @param pmutex pointer to the mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_init_(pmutex) (!(pthread_mutex_init((pmutex), NULL)))
+#define MHD_mutex_init_(pmutex) (! (pthread_mutex_init ((pmutex), NULL)))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Initialise new mutex.
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_init_(pmutex) 
(InitializeCriticalSectionAndSpinCount((pmutex),16))
+#define MHD_mutex_init_(pmutex) (InitializeCriticalSectionAndSpinCount ( \
+                                   (pmutex),16))
 #endif
 
 #if defined(MHD_PTHREAD_MUTEX_)
@@ -90,7 +92,8 @@
 /**
  *  Define static mutex and statically initialise it.
  */
-#    define MHD_MUTEX_STATIC_DEFN_INIT_(m) static MHD_mutex_ m = 
PTHREAD_MUTEX_INITIALIZER
+#    define MHD_MUTEX_STATIC_DEFN_INIT_(m) static MHD_mutex_ m = \
+  PTHREAD_MUTEX_INITIALIZER
 #  endif /* PTHREAD_MUTEX_INITIALIZER */
 #endif
 
@@ -100,14 +103,14 @@
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_destroy_(pmutex) (!(pthread_mutex_destroy((pmutex))))
+#define MHD_mutex_destroy_(pmutex) (! (pthread_mutex_destroy ((pmutex))))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Destroy previously initialised mutex.
  * @param pmutex pointer to mutex
  * @return Always nonzero
  */
-#define MHD_mutex_destroy_(pmutex) (DeleteCriticalSection((pmutex)), !0)
+#define MHD_mutex_destroy_(pmutex) (DeleteCriticalSection ((pmutex)), ! 0)
 #endif
 
 /**
@@ -116,9 +119,9 @@
  * @param pmutex pointer to mutex
  */
 #define MHD_mutex_destroy_chk_(pmutex) do {       \
-    if (!MHD_mutex_destroy_(pmutex))              \
-      MHD_PANIC(_("Failed to destroy mutex.\n")); \
-  } while(0)
+    if (! MHD_mutex_destroy_ (pmutex))              \
+      MHD_PANIC (_ ("Failed to destroy mutex.\n")); \
+} while (0)
 
 
 #if defined(MHD_PTHREAD_MUTEX_)
@@ -129,7 +132,7 @@
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_lock_(pmutex) (!(pthread_mutex_lock((pmutex))))
+#define MHD_mutex_lock_(pmutex) (! (pthread_mutex_lock ((pmutex))))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Acquire lock on previously initialised mutex.
@@ -138,7 +141,7 @@
  * @param pmutex pointer to mutex
  * @return Always nonzero
  */
-#define MHD_mutex_lock_(pmutex) (EnterCriticalSection((pmutex)), !0)
+#define MHD_mutex_lock_(pmutex) (EnterCriticalSection ((pmutex)), ! 0)
 #endif
 
 /**
@@ -149,9 +152,9 @@
  * @param pmutex pointer to mutex
  */
 #define MHD_mutex_lock_chk_(pmutex) do {       \
-    if (!MHD_mutex_lock_(pmutex))              \
-      MHD_PANIC(_("Failed to lock mutex.\n")); \
-  } while(0)
+    if (! MHD_mutex_lock_ (pmutex))              \
+      MHD_PANIC (_ ("Failed to lock mutex.\n")); \
+} while (0)
 
 #if defined(MHD_PTHREAD_MUTEX_)
 /**
@@ -159,14 +162,14 @@
  * @param pmutex pointer to mutex
  * @return nonzero on success, zero otherwise
  */
-#define MHD_mutex_unlock_(pmutex) (!(pthread_mutex_unlock((pmutex))))
+#define MHD_mutex_unlock_(pmutex) (! (pthread_mutex_unlock ((pmutex))))
 #elif defined(MHD_W32_MUTEX_)
 /**
  * Unlock previously initialised and locked mutex.
  * @param pmutex pointer to mutex
  * @return Always nonzero
  */
-#define MHD_mutex_unlock_(pmutex) (LeaveCriticalSection((pmutex)), !0)
+#define MHD_mutex_unlock_(pmutex) (LeaveCriticalSection ((pmutex)), ! 0)
 #endif
 
 /**
@@ -175,9 +178,9 @@
  * @param pmutex pointer to mutex
  */
 #define MHD_mutex_unlock_chk_(pmutex) do {       \
-    if (!MHD_mutex_unlock_(pmutex))              \
-      MHD_PANIC(_("Failed to unlock mutex.\n")); \
-  } while(0)
+    if (! MHD_mutex_unlock_ (pmutex))              \
+      MHD_PANIC (_ ("Failed to unlock mutex.\n")); \
+} while (0)
 
 
 #endif /* ! MHD_LOCKS_H */
diff --git a/src/microhttpd/mhd_mono_clock.c b/src/microhttpd/mhd_mono_clock.c
index 97dbfb9f..eee911fb 100644
--- a/src/microhttpd/mhd_mono_clock.c
+++ b/src/microhttpd/mhd_mono_clock.c
@@ -76,7 +76,8 @@ static clockid_t mono_clock_id = _MHD_UNWANTED_CLOCK;
 #endif /* HAVE_CLOCK_GETTIME */
 
 /* sync clocks; reduce chance of value wrap */
-#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GET_TIME) || 
defined(HAVE_GETHRTIME)
+#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GET_TIME) || \
+  defined(HAVE_GETHRTIME)
 static time_t mono_clock_start;
 #endif /* HAVE_CLOCK_GETTIME || HAVE_CLOCK_GET_TIME || HAVE_GETHRTIME */
 static time_t sys_clock_start;
@@ -124,9 +125,9 @@ enum _MHD_mono_clock_source
    */
   _MHD_CLOCK_GETTICKCOUNT64,
 
-   /**
-    * QueryPerformanceCounter() / QueryPerformanceFrequency()
-    */
+  /**
+   * QueryPerformanceCounter() / QueryPerformanceFrequency()
+   */
   _MHD_CLOCK_PERFCOUNTER
 };
 
@@ -153,8 +154,8 @@ MHD_monotonic_sec_counter_init (void)
   /* just a little syntactic trick to get the
      various following ifdef's to work out nicely */
   if (0)
-    {
-    }
+  {
+  }
   else
 #ifdef HAVE_CLOCK_GETTIME
 #ifdef CLOCK_MONOTONIC_COARSE
@@ -163,11 +164,11 @@ MHD_monotonic_sec_counter_init (void)
   /* but preferred since it's fast */
   if (0 == clock_gettime (CLOCK_MONOTONIC_COARSE,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC_COARSE;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC_COARSE;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_MONOTONIC_COARSE */
 #ifdef CLOCK_MONOTONIC_FAST
@@ -175,11 +176,11 @@ MHD_monotonic_sec_counter_init (void)
   /* Can be affected by frequency adjustment, but preferred since it's fast */
   if (0 == clock_gettime (CLOCK_MONOTONIC_FAST,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC_FAST;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC_FAST;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_MONOTONIC_COARSE */
 #ifdef CLOCK_MONOTONIC_RAW
@@ -187,11 +188,11 @@ MHD_monotonic_sec_counter_init (void)
   /* Not affected by frequency adjustment, but don't count time in suspend */
   if (0 == clock_gettime (CLOCK_MONOTONIC_RAW,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC_RAW;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC_RAW;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_MONOTONIC_RAW */
 #ifdef CLOCK_BOOTTIME
@@ -200,11 +201,11 @@ MHD_monotonic_sec_counter_init (void)
   /* but can be slower value-getting than other clocks */
   if (0 == clock_gettime (CLOCK_BOOTTIME,
                           &ts))
-    {
-      mono_clock_id = CLOCK_BOOTTIME;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_BOOTTIME;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_BOOTTIME */
 #ifdef CLOCK_MONOTONIC
@@ -213,11 +214,11 @@ MHD_monotonic_sec_counter_init (void)
   /* On Linux it's not truly monotonic as it doesn't count time in suspend */
   if (0 == clock_gettime (CLOCK_MONOTONIC,
                           &ts))
-    {
-      mono_clock_id = CLOCK_MONOTONIC;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_MONOTONIC;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_BOOTTIME */
 #endif /* HAVE_CLOCK_GETTIME */
@@ -225,15 +226,15 @@ MHD_monotonic_sec_counter_init (void)
   /* Darwin-specific monotonic clock */
   /* Should be monotonic as clock_set_time function always unconditionally */
   /* failed on latest kernels */
-  if ( (KERN_SUCCESS == host_get_clock_service (mach_host_self(),
+  if ( (KERN_SUCCESS == host_get_clock_service (mach_host_self (),
                                                 SYSTEM_CLOCK,
                                                 &mono_clock_service)) &&
        (KERN_SUCCESS == clock_get_time (mono_clock_service,
                                         &cur_time)) )
-    {
-      mono_clock_start = cur_time.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GET_TIME;
-    }
+  {
+    mono_clock_start = cur_time.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GET_TIME;
+  }
   else
 #endif /* HAVE_CLOCK_GET_TIME */
 #ifdef _WIN32
@@ -241,25 +242,25 @@ MHD_monotonic_sec_counter_init (void)
   /* W32 Vista or later specific monotonic clock */
   /* Available since Vista, ~15ms accuracy */
   if (1)
-    {
-      tick_start = GetTickCount64 ();
-      mono_clock_source = _MHD_CLOCK_GETTICKCOUNT64;
-    }
+  {
+    tick_start = GetTickCount64 ();
+    mono_clock_source = _MHD_CLOCK_GETTICKCOUNT64;
+  }
   else
 #else  /* _WIN32_WINNT < 0x0600 */
   /* W32 specific monotonic clock */
   /* Available on Windows 2000 and later */
   if (1)
-    {
-      LARGE_INTEGER freq;
-      LARGE_INTEGER perf_counter;
-
-      QueryPerformanceFrequency (&freq); /* never fail on XP and later */
-      QueryPerformanceCounter (&perf_counter); /* never fail on XP and later */
-      perf_freq = freq.QuadPart;
-      perf_start = perf_counter.QuadPart;
-      mono_clock_source = _MHD_CLOCK_PERFCOUNTER;
-    }
+  {
+    LARGE_INTEGER freq;
+    LARGE_INTEGER perf_counter;
+
+    QueryPerformanceFrequency (&freq);   /* never fail on XP and later */
+    QueryPerformanceCounter (&perf_counter);   /* never fail on XP and later */
+    perf_freq = freq.QuadPart;
+    perf_start = perf_counter.QuadPart;
+    mono_clock_source = _MHD_CLOCK_PERFCOUNTER;
+  }
   else
 #endif /* _WIN32_WINNT < 0x0600 */
 #endif /* _WIN32 */
@@ -269,11 +270,11 @@ MHD_monotonic_sec_counter_init (void)
   /* Not preferred due to be potentially resource-hungry */
   if (0 == clock_gettime (CLOCK_HIGHRES,
                           &ts))
-    {
-      mono_clock_id = CLOCK_HIGHRES;
-      mono_clock_start = ts.tv_sec;
-      mono_clock_source = _MHD_CLOCK_GETTIME;
-    }
+  {
+    mono_clock_id = CLOCK_HIGHRES;
+    mono_clock_start = ts.tv_sec;
+    mono_clock_source = _MHD_CLOCK_GETTIME;
+  }
   else
 #endif /* CLOCK_HIGHRES */
 #endif /* HAVE_CLOCK_GETTIME */
@@ -281,26 +282,26 @@ MHD_monotonic_sec_counter_init (void)
   /* HP-UX and Solaris monotonic clock */
   /* Not preferred due to be potentially resource-hungry */
   if (1)
-    {
-      hrtime_start = gethrtime ();
-      mono_clock_source = _MHD_CLOCK_GETHRTIME;
-    }
+  {
+    hrtime_start = gethrtime ();
+    mono_clock_source = _MHD_CLOCK_GETHRTIME;
+  }
   else
 #endif /* HAVE_GETHRTIME */
-    {
-      /* no suitable clock source was found */
-      mono_clock_source = _MHD_CLOCK_NO_SOURCE;
-    }
+  {
+    /* no suitable clock source was found */
+    mono_clock_source = _MHD_CLOCK_NO_SOURCE;
+  }
 
 #ifdef HAVE_CLOCK_GET_TIME
   if ( (_MHD_CLOCK_GET_TIME != mono_clock_source) &&
        (_MHD_INVALID_CLOCK_SERV != mono_clock_service) )
-    {
-      /* clock service was initialised but clock_get_time failed */
-      mach_port_deallocate (mach_task_self(),
-                            mono_clock_service);
-      mono_clock_service = _MHD_INVALID_CLOCK_SERV;
-    }
+  {
+    /* clock service was initialised but clock_get_time failed */
+    mach_port_deallocate (mach_task_self (),
+                          mono_clock_service);
+    mono_clock_service = _MHD_INVALID_CLOCK_SERV;
+  }
 #else
   (void) mono_clock_source; /* avoid compiler warning */
 #endif /* HAVE_CLOCK_GET_TIME */
@@ -317,11 +318,11 @@ MHD_monotonic_sec_counter_finish (void)
 {
 #ifdef HAVE_CLOCK_GET_TIME
   if (_MHD_INVALID_CLOCK_SERV != mono_clock_service)
-    {
-      mach_port_deallocate (mach_task_self(),
-                            mono_clock_service);
-      mono_clock_service = _MHD_INVALID_CLOCK_SERV;
-    }
+  {
+    mach_port_deallocate (mach_task_self (),
+                          mono_clock_service);
+    mono_clock_service = _MHD_INVALID_CLOCK_SERV;
+  }
 #endif /* HAVE_CLOCK_GET_TIME */
 }
 
@@ -340,37 +341,38 @@ MHD_monotonic_sec_counter (void)
   struct timespec ts;
 
   if ( (_MHD_UNWANTED_CLOCK != mono_clock_id) &&
-       (0 == clock_gettime (mono_clock_id ,
+       (0 == clock_gettime (mono_clock_id,
                             &ts)) )
     return ts.tv_sec - mono_clock_start;
 #endif /* HAVE_CLOCK_GETTIME */
 #ifdef HAVE_CLOCK_GET_TIME
   if (_MHD_INVALID_CLOCK_SERV != mono_clock_service)
-    {
-      mach_timespec_t cur_time;
+  {
+    mach_timespec_t cur_time;
 
-      if (KERN_SUCCESS == clock_get_time(mono_clock_service,
-                                         &cur_time))
-        return cur_time.tv_sec - mono_clock_start;
-    }
+    if (KERN_SUCCESS == clock_get_time (mono_clock_service,
+                                        &cur_time))
+      return cur_time.tv_sec - mono_clock_start;
+  }
 #endif /* HAVE_CLOCK_GET_TIME */
 #if defined(_WIN32)
 #if _WIN32_WINNT >= 0x0600
   if (1)
-    return (time_t)(((uint64_t)(GetTickCount64() - tick_start)) / 1000);
+    return (time_t) (((uint64_t) (GetTickCount64 () - tick_start)) / 1000);
 #else  /* _WIN32_WINNT < 0x0600 */
   if (0 != perf_freq)
-    {
-      LARGE_INTEGER perf_counter;
+  {
+    LARGE_INTEGER perf_counter;
 
-      QueryPerformanceCounter (&perf_counter); /* never fail on XP and later */
-      return (time_t)(((uint64_t)(perf_counter.QuadPart - perf_start)) / 
perf_freq);
-    }
+    QueryPerformanceCounter (&perf_counter);   /* never fail on XP and later */
+    return (time_t) (((uint64_t) (perf_counter.QuadPart - perf_start))
+                     / perf_freq);
+  }
 #endif /* _WIN32_WINNT < 0x0600 */
 #endif /* _WIN32 */
 #ifdef HAVE_GETHRTIME
   if (1)
-    return (time_t)(((uint64_t) (gethrtime () - hrtime_start)) / 1000000000);
+    return (time_t) (((uint64_t) (gethrtime () - hrtime_start)) / 1000000000);
 #endif /* HAVE_GETHRTIME */
 
   return time (NULL) - sys_clock_start;
diff --git a/src/microhttpd/mhd_mono_clock.h b/src/microhttpd/mhd_mono_clock.h
index f4722af2..92485e00 100644
--- a/src/microhttpd/mhd_mono_clock.h
+++ b/src/microhttpd/mhd_mono_clock.h
@@ -37,14 +37,14 @@
  * Initialise monotonic seconds counter.
  */
 void
-MHD_monotonic_sec_counter_init(void);
+MHD_monotonic_sec_counter_init (void);
 
 
 /**
  * Deinitialise monotonic seconds counter by freeing any allocated resources
  */
 void
-MHD_monotonic_sec_counter_finish(void);
+MHD_monotonic_sec_counter_finish (void);
 
 
 /**
@@ -55,6 +55,6 @@ MHD_monotonic_sec_counter_finish(void);
  * @return number of seconds from some fixed moment
  */
 time_t
-MHD_monotonic_sec_counter(void);
+MHD_monotonic_sec_counter (void);
 
 #endif /* MHD_MONO_CLOCK_H */
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index b3fb25da..e50be96e 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -55,68 +55,69 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
 
   /* If sk_cork_on is already what we pass in, return. */
   if (connection->sk_cork_on == want_cork)
-    {
-      /* nothing to do, success! */
-      return;
-    }
+  {
+    /* nothing to do, success! */
+    return;
+  }
   if (! want_cork)
     return; /* nothing to do *pre* syscall! */
   ret = MHD_socket_cork_ (connection->socket_fd,
                           true);
   if (0 == ret)
-    {
-      connection->sk_cork_on = true;
-      return;
-    }
+  {
+    connection->sk_cork_on = true;
+    return;
+  }
   switch (errno)
-    {
-    case ENOTSOCK:
-      /* FIXME: Could be we are talking to a pipe, maybe remember this
-         and avoid all setsockopt() in the future? */
-      break;
-    case EBADF:
-      /* FIXME: should we die hard here? */
-      break;
-    case EINVAL:
-      /* FIXME: optlen invalid, should at least log this, maybe die */
+  {
+  case ENOTSOCK:
+    /* FIXME: Could be we are talking to a pipe, maybe remember this
+       and avoid all setsockopt() in the future? */
+    break;
+  case EBADF:
+    /* FIXME: should we die hard here? */
+    break;
+  case EINVAL:
+    /* FIXME: optlen invalid, should at least log this, maybe die */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("optlen invalid: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ ("optlen invalid: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      break;
-    case EFAULT:
-      /* wopsie, should at leats log this, FIXME: maybe die */
+    break;
+  case EFAULT:
+    /* wopsie, should at leats log this, FIXME: maybe die */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("The addresss pointed to by optval is not a valid part of 
the process address space: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ (
+                "The addresss pointed to by optval is not a valid part of the 
process address space: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      break;
-    case ENOPROTOOPT:
-      /* optlen unknown, should at least log this */
+    break;
+  case ENOPROTOOPT:
+    /* optlen unknown, should at least log this */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("The option is unknown: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ ("The option is unknown: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      break;
-    default:
-      /* any others? man page does not list more... */
-      break;
-    }
+    break;
+  default:
+    /* any others? man page does not list more... */
+    break;
+  }
 #else
   /* CORK/NOPUSH/MSG_MORE do not exist on this platform,
      so we must toggle Naggle's algorithm on/off instead
      (otherwise we keep it always off) */
   if (connection->sk_cork_on == want_cork)
-    {
-      /* nothing to do, success! */
-      return;
-    }
+  {
+    /* nothing to do, success! */
+    return;
+  }
   if ( (want_cork) &&
        (0 == MHD_socket_set_nodelay_ (connection->socket_fd,
-                                     false)) )
+                                      false)) )
     connection->sk_cork_on = true;
 #endif
 }
@@ -139,10 +140,10 @@ post_cork_setsockopt (struct MHD_Connection *connection,
 
   /* If sk_cork_on is already what we pass in, return. */
   if (connection->sk_cork_on == want_cork)
-    {
-      /* nothing to do, success! */
-      return;
-    }
+  {
+    /* nothing to do, success! */
+    return;
+  }
   if (want_cork)
     return; /* nothing to do *post* syscall (in fact, we should never
                get here, as sk_cork_on should have succeeded in the
@@ -150,59 +151,60 @@ post_cork_setsockopt (struct MHD_Connection *connection,
   ret = MHD_socket_cork_ (connection->socket_fd,
                           false);
   if (0 == ret)
-    {
-      connection->sk_cork_on = false;
-      return;
-    }
+  {
+    connection->sk_cork_on = false;
+    return;
+  }
   switch (errno)
-    {
-    case ENOTSOCK:
-      /* FIXME: Could be we are talking to a pipe, maybe remember this
-         and avoid all setsockopt() in the future? */
-      break;
-    case EBADF:
-      /* FIXME: should we die hard here? */
-      break;
-    case EINVAL:
-      /* FIXME: optlen invalid, should at least log this, maybe die */
+  {
+  case ENOTSOCK:
+    /* FIXME: Could be we are talking to a pipe, maybe remember this
+       and avoid all setsockopt() in the future? */
+    break;
+  case EBADF:
+    /* FIXME: should we die hard here? */
+    break;
+  case EINVAL:
+    /* FIXME: optlen invalid, should at least log this, maybe die */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("optlen invalid: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ ("optlen invalid: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      break;
-    case EFAULT:
-      /* wopsie, should at leats log this, FIXME: maybe die */
+    break;
+  case EFAULT:
+    /* wopsie, should at leats log this, FIXME: maybe die */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("The addresss pointed to by optval is not a valid part of 
the process address space: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ (
+                "The addresss pointed to by optval is not a valid part of the 
process address space: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      break;
-    case ENOPROTOOPT:
-      /* optlen unknown, should at least log this */
+    break;
+  case ENOPROTOOPT:
+    /* optlen unknown, should at least log this */
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("The option is unknown: %s\n"),
-                MHD_socket_last_strerr_());
+    MHD_DLOG (daemon,
+              _ ("The option is unknown: %s\n"),
+              MHD_socket_last_strerr_ ());
 #endif
-      break;
-    default:
-      /* any others? man page does not list more... */
-      break;
-    }
+    break;
+  default:
+    /* any others? man page does not list more... */
+    break;
+  }
 #else
   /* CORK/NOPUSH/MSG_MORE do not exist on this platform,
      so we must toggle Naggle's algorithm on/off instead
      (otherwise we keep it always off) */
   if (connection->sk_cork_on == want_cork)
-    {
-      /* nothing to do, success! */
-      return;
-    }
+  {
+    /* nothing to do, success! */
+    return;
+  }
   if ( (! want_cork) &&
        (0 == MHD_socket_set_nodelay_ (connection->socket_fd,
-                                     true)) )
+                                      true)) )
     connection->sk_cork_on = false;
 #endif
 }
@@ -403,7 +405,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
   {
     struct msghdr msg;
 
-    memset(&msg, 0, sizeof(struct msghdr));
+    memset (&msg, 0, sizeof(struct msghdr));
     msg.msg_iov = vector;
     msg.msg_iovlen = 2;
 
@@ -473,9 +475,9 @@ MHD_send_sendfile_ (struct MHD_Connection *connection)
   uint64_t left;
   uint64_t offsetu64;
 #ifndef HAVE_SENDFILE64
-  const uint64_t max_off_t = (uint64_t)OFF_T_MAX;
+  const uint64_t max_off_t = (uint64_t) OFF_T_MAX;
 #else  /* HAVE_SENDFILE64 */
-  const uint64_t max_off_t = (uint64_t)OFF64_T_MAX;
+  const uint64_t max_off_t = (uint64_t) OFF64_T_MAX;
 #endif /* HAVE_SENDFILE64 */
 #ifdef MHD_LINUX_SOLARIS_SENDFILE
 #ifndef HAVE_SENDFILE64
@@ -491,23 +493,26 @@ MHD_send_sendfile_ (struct MHD_Connection *connection)
 #ifdef HAVE_DARWIN_SENDFILE
   off_t len;
 #endif /* HAVE_DARWIN_SENDFILE */
-  const bool used_thr_p_c = (0 != (connection->daemon->options & 
MHD_USE_THREAD_PER_CONNECTION));
-  const size_t chunk_size = used_thr_p_c ? MHD_SENFILE_CHUNK_THR_P_C_ : 
MHD_SENFILE_CHUNK_;
+  const bool used_thr_p_c = (0 != (connection->daemon->options
+                                   & MHD_USE_THREAD_PER_CONNECTION));
+  const size_t chunk_size = used_thr_p_c ? MHD_SENFILE_CHUNK_THR_P_C_ :
+                            MHD_SENFILE_CHUNK_;
   size_t send_size = 0;
   mhd_assert (MHD_resp_sender_sendfile == connection->resp_sender);
 
   pre_cork_setsockopt (connection, false);
 
-  offsetu64 = connection->response_write_position + 
connection->response->fd_off;
+  offsetu64 = connection->response_write_position
+              + connection->response->fd_off;
   left = connection->response->total_size - 
connection->response_write_position;
   /* Do not allow system to stick sending on single fast connection:
    * use 128KiB chunks (2MiB for thread-per-connection). */
   send_size = (left > chunk_size) ? chunk_size : (size_t) left;
   if (max_off_t < offsetu64)
-    { /* Retry to send with standard 'send()'. */
-      connection->resp_sender = MHD_resp_sender_std;
-      return MHD_ERR_AGAIN_;
-    }
+  {   /* Retry to send with standard 'send()'. */
+    connection->resp_sender = MHD_resp_sender_std;
+    return MHD_ERR_AGAIN_;
+  }
 #ifdef MHD_LINUX_SOLARIS_SENDFILE
 #ifndef HAVE_SENDFILE64
   offset = (off_t) offsetu64;
@@ -523,53 +528,53 @@ MHD_send_sendfile_ (struct MHD_Connection *connection)
                     send_size);
 #endif /* HAVE_SENDFILE64 */
   if (0 > ret)
+  {
+    const int err = MHD_socket_get_error_ ();
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
     {
-      const int err = MHD_socket_get_error_();
-      if (MHD_SCKT_ERR_IS_EAGAIN_(err))
-        {
 #ifdef EPOLL_SUPPORT
-          /* EAGAIN --- no longer write-ready */
-          connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
+      /* EAGAIN --- no longer write-ready */
+      connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
 #endif /* EPOLL_SUPPORT */
-          return MHD_ERR_AGAIN_;
-        }
-      if (MHD_SCKT_ERR_IS_EINTR_ (err))
-        return MHD_ERR_AGAIN_;
+      return MHD_ERR_AGAIN_;
+    }
+    if (MHD_SCKT_ERR_IS_EINTR_ (err))
+      return MHD_ERR_AGAIN_;
 #ifdef HAVE_LINUX_SENDFILE
-      if (MHD_SCKT_ERR_IS_(err,
-                           MHD_SCKT_EBADF_))
-        return MHD_ERR_BADF_;
-      /* sendfile() failed with EINVAL if mmap()-like operations are not
-         supported for FD or other 'unusual' errors occurred, so we should try
-         to fall back to 'SEND'; see also this thread for info on
-         odd libc/Linux behavior with sendfile:
-         http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html 
*/
+    if (MHD_SCKT_ERR_IS_ (err,
+                          MHD_SCKT_EBADF_))
+      return MHD_ERR_BADF_;
+    /* sendfile() failed with EINVAL if mmap()-like operations are not
+       supported for FD or other 'unusual' errors occurred, so we should try
+       to fall back to 'SEND'; see also this thread for info on
+       odd libc/Linux behavior with sendfile:
+       http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */
+    connection->resp_sender = MHD_resp_sender_std;
+    return MHD_ERR_AGAIN_;
+#else  /* HAVE_SOLARIS_SENDFILE */
+    if ( (EAFNOSUPPORT == err) ||
+         (EINVAL == err) ||
+         (EOPNOTSUPP == err) )
+    {     /* Retry with standard file reader. */
       connection->resp_sender = MHD_resp_sender_std;
       return MHD_ERR_AGAIN_;
-#else  /* HAVE_SOLARIS_SENDFILE */
-      if ( (EAFNOSUPPORT == err) ||
-           (EINVAL == err) ||
-           (EOPNOTSUPP == err) )
-        { /* Retry with standard file reader. */
-          connection->resp_sender = MHD_resp_sender_std;
-          return MHD_ERR_AGAIN_;
-        }
-      if ( (ENOTCONN == err) ||
-           (EPIPE == err) )
-        {
-          return MHD_ERR_CONNRESET_;
-        }
-      return MHD_ERR_BADF_; /* Fail hard */
-#endif /* HAVE_SOLARIS_SENDFILE */
     }
+    if ( (ENOTCONN == err) ||
+         (EPIPE == err) )
+    {
+      return MHD_ERR_CONNRESET_;
+    }
+    return MHD_ERR_BADF_;   /* Fail hard */
+#endif /* HAVE_SOLARIS_SENDFILE */
+  }
 #ifdef EPOLL_SUPPORT
-  else if (send_size > (size_t)ret)
-        connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
+  else if (send_size > (size_t) ret)
+    connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
 #endif /* EPOLL_SUPPORT */
 #elif defined(HAVE_FREEBSD_SENDFILE)
 #ifdef SF_FLAGS
   flags = used_thr_p_c ?
-      freebsd_sendfile_flags_thd_p_c_ : freebsd_sendfile_flags_;
+          freebsd_sendfile_flags_thd_p_c_ : freebsd_sendfile_flags_;
 #endif /* SF_FLAGS */
   if (0 != sendfile (file_fd,
                      connection->socket_fd,
@@ -578,63 +583,63 @@ MHD_send_sendfile_ (struct MHD_Connection *connection)
                      NULL,
                      &sent_bytes,
                      flags))
+  {
+    const int err = MHD_socket_get_error_ ();
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err) ||
+        MHD_SCKT_ERR_IS_EINTR_ (err) ||
+        (EBUSY == err) )
     {
-      const int err = MHD_socket_get_error_();
-      if (MHD_SCKT_ERR_IS_EAGAIN_(err) ||
-          MHD_SCKT_ERR_IS_EINTR_(err) ||
-          EBUSY == err)
-        {
-          mhd_assert (SSIZE_MAX >= sent_bytes);
-          if (0 != sent_bytes)
-            return (ssize_t)sent_bytes;
-
-          return MHD_ERR_AGAIN_;
-        }
-      /* Some unrecoverable error. Possibly file FD is not suitable
-       * for sendfile(). Retry with standard send(). */
-      connection->resp_sender = MHD_resp_sender_std;
+      mhd_assert (SSIZE_MAX >= sent_bytes);
+      if (0 != sent_bytes)
+        return (ssize_t) sent_bytes;
+
       return MHD_ERR_AGAIN_;
     }
+    /* Some unrecoverable error. Possibly file FD is not suitable
+     * for sendfile(). Retry with standard send(). */
+    connection->resp_sender = MHD_resp_sender_std;
+    return MHD_ERR_AGAIN_;
+  }
   mhd_assert (0 < sent_bytes);
   mhd_assert (SSIZE_MAX >= sent_bytes);
-  ret = (ssize_t)sent_bytes;
+  ret = (ssize_t) sent_bytes;
 #elif defined(HAVE_DARWIN_SENDFILE)
-  len = (off_t)send_size; /* chunk always fit */
+  len = (off_t) send_size; /* chunk always fit */
   if (0 != sendfile (file_fd,
                      connection->socket_fd,
                      (off_t) offsetu64,
                      &len,
                      NULL,
                      0))
+  {
+    const int err = MHD_socket_get_error_ ();
+    if (MHD_SCKT_ERR_IS_EAGAIN_ (err) ||
+        MHD_SCKT_ERR_IS_EINTR_ (err))
     {
-      const int err = MHD_socket_get_error_();
-      if (MHD_SCKT_ERR_IS_EAGAIN_(err) ||
-          MHD_SCKT_ERR_IS_EINTR_(err))
-        {
-          mhd_assert (0 <= len);
-          mhd_assert (SSIZE_MAX >= len);
-          mhd_assert (send_size >= (size_t)len);
-          if (0 != len)
-            return (ssize_t)len;
-
-          return MHD_ERR_AGAIN_;
-        }
-      if (ENOTCONN == err ||
-          EPIPE == err)
-        return MHD_ERR_CONNRESET_;
-      if (ENOTSUP == err ||
-          EOPNOTSUPP == err)
-        { /* This file FD is not suitable for sendfile().
+      mhd_assert (0 <= len);
+      mhd_assert (SSIZE_MAX >= len);
+      mhd_assert (send_size >= (size_t) len);
+      if (0 != len)
+        return (ssize_t) len;
+
+      return MHD_ERR_AGAIN_;
+    }
+    if ((ENOTCONN == err) ||
+        (EPIPE == err) )
+      return MHD_ERR_CONNRESET_;
+    if ((ENOTSUP == err) ||
+        (EOPNOTSUPP == err) )
+    {     /* This file FD is not suitable for sendfile().
            * Retry with standard send(). */
-          connection->resp_sender = MHD_resp_sender_std;
-          return MHD_ERR_AGAIN_;
-        }
-      return MHD_ERR_BADF_; /* Return hard error. */
+      connection->resp_sender = MHD_resp_sender_std;
+      return MHD_ERR_AGAIN_;
     }
+    return MHD_ERR_BADF_;   /* Return hard error. */
+  }
   mhd_assert (0 <= len);
   mhd_assert (SSIZE_MAX >= len);
-  mhd_assert (send_size >= (size_t)len);
-  ret = (ssize_t)len;
+  mhd_assert (send_size >= (size_t) len);
+  ret = (ssize_t) len;
 #endif /* HAVE_FREEBSD_SENDFILE */
 
   /* Make sure we send the data without delay ONLY if we
diff --git a/src/microhttpd/mhd_send.h b/src/microhttpd/mhd_send.h
index a766c8c0..3c484f79 100644
--- a/src/microhttpd/mhd_send.h
+++ b/src/microhttpd/mhd_send.h
@@ -56,9 +56,9 @@
  */
 enum MHD_SendSocketOptions
 {
- /**
-  * definitely no corking (use NODELAY, or explicitly disable cork)
-  */
+  /**
+   * definitely no corking (use NODELAY, or explicitly disable cork)
+   */
   MHD_SSO_NO_CORK = 0,
   /**
    * should enable corking (use MSG_MORE, or explicitly enable cork)
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
index 08b01c20..3099357b 100644
--- a/src/microhttpd/mhd_sockets.h
+++ b/src/microhttpd/mhd_sockets.h
@@ -37,8 +37,8 @@
 #include <errno.h>
 #include <stdbool.h>
 
-#if !defined(MHD_POSIX_SOCKETS) && !defined(MHD_WINSOCK_SOCKETS)
-#  if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(MHD_POSIX_SOCKETS) && ! defined(MHD_WINSOCK_SOCKETS)
+#  if ! defined(_WIN32) || defined(__CYGWIN__)
 #    define MHD_POSIX_SOCKETS 1
 #  else  /* defined(_WIN32) && !defined(__CYGWIN__) */
 #    define MHD_WINSOCK_SOCKETS 1
@@ -93,7 +93,7 @@
 #    include <sys/epoll.h>
 #  endif
 #  ifdef HAVE_NETINET_TCP_H
-     /* for TCP_FASTOPEN and TCP_CORK */
+/* for TCP_FASTOPEN and TCP_CORK */
 #    include <netinet/tcp.h>
 #  endif
 #  ifdef HAVE_STRING_H
@@ -112,10 +112,10 @@
 #endif
 
 #include <stddef.h>
-#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
+#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
 #  include <stdint.h>
 #  define _SSIZE_T_DEFINED
-   typedef intptr_t ssize_t;
+typedef intptr_t ssize_t;
 #endif /* !_SSIZE_T_DEFINED */
 
 #include "mhd_limits.h"
@@ -124,7 +124,7 @@
 #  define _MHD_SYS_DEFAULT_FD_SETSIZE FD_SETSIZE
 #else  /* ! _MHD_FD_SETSIZE_IS_DEFAULT */
 #  include "sysfdsetsize.h"
-#  define _MHD_SYS_DEFAULT_FD_SETSIZE get_system_fdsetsize_value()
+#  define _MHD_SYS_DEFAULT_FD_SETSIZE get_system_fdsetsize_value ()
 #endif /* ! _MHD_FD_SETSIZE_IS_DEFAULT */
 
 #ifndef MHD_PANIC
@@ -132,8 +132,9 @@
 #  include <stdlib.h>
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
-     "Abnormal termination at %d line in file %s: %s\n", \
-     (int)__LINE__, __FILE__, msg); abort();} while(0)
+                                       "Abnormal termination at %d line in 
file %s: %s\n", \
+                                       (int) __LINE__, __FILE__, msg); abort 
(); \
+} while (0)
 #endif /* ! MHD_PANIC */
 
 #ifndef MHD_SOCKET_DEFINED
@@ -141,10 +142,10 @@
  * MHD_socket is type for socket FDs
  */
 #  if defined(MHD_POSIX_SOCKETS)
-     typedef int MHD_socket;
+typedef int MHD_socket;
 #    define MHD_INVALID_SOCKET (-1)
 #  elif defined(MHD_WINSOCK_SOCKETS)
-     typedef SOCKET MHD_socket;
+typedef SOCKET MHD_socket;
 #    define MHD_INVALID_SOCKET (INVALID_SOCKET)
 #  endif /* MHD_WINSOCK_SOCKETS */
 
@@ -175,17 +176,18 @@
 #  define MAYBE_MSG_NOSIGNAL 0
 #endif /* ! MSG_NOSIGNAL */
 
-#if !defined(SHUT_WR) && defined(SD_SEND)
+#if ! defined(SHUT_WR) && defined(SD_SEND)
 #  define SHUT_WR SD_SEND
 #endif
-#if !defined(SHUT_RD) && defined(SD_RECEIVE)
+#if ! defined(SHUT_RD) && defined(SD_RECEIVE)
 #  define SHUT_RD SD_RECEIVE
 #endif
-#if !defined(SHUT_RDWR) && defined(SD_BOTH)
+#if ! defined(SHUT_RDWR) && defined(SD_BOTH)
 #  define SHUT_RDWR SD_BOTH
 #endif
 
-#if HAVE_ACCEPT4+0 != 0 && (defined(HAVE_SOCK_NONBLOCK) || 
defined(SOCK_CLOEXEC) || defined(SOCK_NOSIGPIPE))
+#if HAVE_ACCEPT4 + 0 != 0 && (defined(HAVE_SOCK_NONBLOCK) || \
+  defined(SOCK_CLOEXEC) || defined(SOCK_NOSIGPIPE))
 #  define USE_ACCEPT4 1
 #endif
 
@@ -218,25 +220,25 @@
  * MHD_SCKT_OPT_BOOL_ is type for bool parameters for setsockopt()/getsockopt()
  */
 #ifdef MHD_POSIX_SOCKETS
-  typedef int MHD_SCKT_OPT_BOOL_;
+typedef int MHD_SCKT_OPT_BOOL_;
 #else /* MHD_WINSOCK_SOCKETS */
-  typedef BOOL MHD_SCKT_OPT_BOOL_;
+typedef BOOL MHD_SCKT_OPT_BOOL_;
 #endif /* MHD_WINSOCK_SOCKETS */
 
 /**
  * MHD_SCKT_SEND_SIZE_ is type used to specify size for send and recv
  * functions
  */
-#if !defined(MHD_WINSOCK_SOCKETS)
-  typedef size_t MHD_SCKT_SEND_SIZE_;
+#if ! defined(MHD_WINSOCK_SOCKETS)
+typedef size_t MHD_SCKT_SEND_SIZE_;
 #else
-  typedef int MHD_SCKT_SEND_SIZE_;
+typedef int MHD_SCKT_SEND_SIZE_;
 #endif
 
 /**
  * MHD_SCKT_SEND_MAX_SIZE_ is maximum send()/recv() size value.
  */
-#if !defined(MHD_WINSOCK_SOCKETS)
+#if ! defined(MHD_WINSOCK_SOCKETS)
 #  define MHD_SCKT_SEND_MAX_SIZE_ SSIZE_MAX
 #else
 #  define MHD_SCKT_SEND_MAX_SIZE_ INT_MAX
@@ -252,10 +254,10 @@
  *         counted as success, only EBADF counts as an error!),
  *         boolean false otherwise.
  */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_close_(fd) ((0 == close((fd))) || (EBADF != errno))
+#if ! defined(MHD_WINSOCK_SOCKETS)
+#  define MHD_socket_close_(fd) ((0 == close ((fd))) || (EBADF != errno))
 #else
-#  define MHD_socket_close_(fd) (0 == closesocket((fd)))
+#  define MHD_socket_close_(fd) (0 == closesocket ((fd)))
 #endif
 
 /**
@@ -264,9 +266,9 @@
  * @param fd socket to close
  */
 #define MHD_socket_close_chk_(fd) do {        \
-    if (!MHD_socket_close_(fd))               \
-      MHD_PANIC(_("Close socket failed.\n")); \
-  } while(0)
+    if (! MHD_socket_close_ (fd))               \
+      MHD_PANIC (_ ("Close socket failed.\n")); \
+} while (0)
 
 
 /**
@@ -277,7 +279,8 @@
  * @return ssize_t type value
  */
 #define MHD_send_(s,b,l) \
-  ((ssize_t)send((s),(const void*)(b),(MHD_SCKT_SEND_SIZE_)(l), 
MAYBE_MSG_NOSIGNAL))
+  ((ssize_t) send ((s),(const void*) (b),(MHD_SCKT_SEND_SIZE_) (l), \
+                   MAYBE_MSG_NOSIGNAL))
 
 
 /**
@@ -288,7 +291,7 @@
  * @return ssize_t type value
  */
 #define MHD_recv_(s,b,l) \
-  ((ssize_t)recv((s),(void*)(b),(MHD_SCKT_SEND_SIZE_)(l), 0))
+  ((ssize_t) recv ((s),(void*) (b),(MHD_SCKT_SEND_SIZE_) (l), 0))
 
 
 /**
@@ -301,11 +304,18 @@
  *         boolean false otherwise.
  */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ((fd) < 
((MHD_socket)setsize))
+#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ((fd) < \
+                                                            ((MHD_socket) \
+                                                             setsize))
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ( 
((void*)(pset)==(void*)0) || \
-                                                             
(((fd_set*)(pset))->fd_count < ((unsigned)setsize)) || \
-                                                             
(FD_ISSET((fd),(pset))) )
+#  define MHD_SCKT_FD_FITS_FDSET_SETSIZE_(fd,pset,setsize) ( ((void*) (pset)== 
\
+                                                              (void*) 0) || \
+                                                             (((fd_set*) 
(pset)) \
+                                                              ->fd_count < \
+                                                              ((unsigned) \
+                                                               setsize)) || \
+                                                             (FD_ISSET ((fd), \
+                                                                        
(pset))) )
 #endif
 
 /**
@@ -316,7 +326,9 @@
  * @return boolean true if FD can be added to fd_set,
  *         boolean false otherwise.
  */
-#define MHD_SCKT_FD_FITS_FDSET_(fd,pset) 
MHD_SCKT_FD_FITS_FDSET_SETSIZE_((fd),(pset),FD_SETSIZE)
+#define MHD_SCKT_FD_FITS_FDSET_(fd,pset) MHD_SCKT_FD_FITS_FDSET_SETSIZE_ 
((fd), \
+                                                                          
(pset), \
+                                                                          
FD_SETSIZE)
 
 /**
  * Add FD to fd_set with specified FD_SETSIZE.
@@ -327,34 +339,35 @@
  *        system definition of FD_SET() is not used.
  */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_(fd,pset,setsize) 
FD_SET((fd),(pset))
+#  define MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_(fd,pset,setsize) FD_SET ((fd), \
+                                                                     (pset))
 #elif defined(MHD_WINSOCK_SOCKETS)
 #  define MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_(fd,pset,setsize)                   
  \
-        do {                                                                   
  \
-           u_int _i_ = 0;                                                      
  \
-           fd_set* const _s_ = (fd_set*)(pset);                                
  \
-           while((_i_ < _s_->fd_count) && ((fd) != _s_->fd_array[_i_])) 
{++_i_;} \
-           if ((_i_ == _s_->fd_count)) {_s_->fd_array[_s_->fd_count++] = 
(fd);}  \
-        } while(0)
+  do {                                                                     \
+    u_int _i_ = 0;                                                        \
+    fd_set*const _s_ = (fd_set*) (pset);                                  \
+    while ((_i_ < _s_->fd_count) && ((fd) != _s_->fd_array [_i_])) {++_i_;} \
+    if ((_i_ == _s_->fd_count)) {_s_->fd_array [_s_->fd_count ++] = (fd);}  \
+  } while (0)
 #endif
 
- /* MHD_SYS_select_ is wrapper macro for system select() function */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_SYS_select_(n,r,w,e,t) select((n),(r),(w),(e),(t))
+/* MHD_SYS_select_ is wrapper macro for system select() function */
+#if ! defined(MHD_WINSOCK_SOCKETS)
+#  define MHD_SYS_select_(n,r,w,e,t) select ((n),(r),(w),(e),(t))
 #else
 #  define MHD_SYS_select_(n,r,w,e,t) \
-( ( (((void*)(r) == (void*)0) || ((fd_set*)(r))->fd_count == 0) &&  \
-    (((void*)(w) == (void*)0) || ((fd_set*)(w))->fd_count == 0) &&  \
-    (((void*)(e) == (void*)0) || ((fd_set*)(e))->fd_count == 0) ) ? \
-  ( ((void*)(t) == (void*)0) ? 0 :                                  \
-    (Sleep(((struct timeval*)(t))->tv_sec * 1000 +                  \
-           ((struct timeval*)(t))->tv_usec / 1000), 0) ) :          \
-  (select((int)0,(r),(w),(e),(t))) )
+  ( ( (((void*) (r) == (void*) 0) || ((fd_set*) (r))->fd_count == 0) &&  \
+      (((void*) (w) == (void*) 0) || ((fd_set*) (w))->fd_count == 0) &&  \
+      (((void*) (e) == (void*) 0) || ((fd_set*) (e))->fd_count == 0) ) ? \
+    ( ((void*) (t) == (void*) 0) ? 0 :                                  \
+      (Sleep (((struct timeval*) (t))->tv_sec * 1000                    \
+              + ((struct timeval*) (t))->tv_usec / 1000), 0) ) :          \
+    (select ((int) 0,(r),(w),(e),(t))) )
 #endif
 
 #if defined(HAVE_POLL)
 /* MHD_sys_poll_ is wrapper macro for system poll() function */
-#  if !defined(MHD_WINSOCK_SOCKETS)
+#  if ! defined(MHD_WINSOCK_SOCKETS)
 #    define MHD_sys_poll_ poll
 #  else  /* MHD_WINSOCK_SOCKETS */
 #    define MHD_sys_poll_ WSAPoll
@@ -383,16 +396,19 @@
 #  elif defined(__linux__)
 #    define MHD_POLL_EVENTS_ERR_DISC POLLPRI
 #  else /* ! __linux__ */
-#    define MHD_POLL_EVENTS_ERR_DISC (MHD_POLLPRI_OR_ZERO | 
MHD_POLLRDBAND_OR_ZERO)
+#    define MHD_POLL_EVENTS_ERR_DISC (MHD_POLLPRI_OR_ZERO \
+                                      | MHD_POLLRDBAND_OR_ZERO)
 #  endif /* ! __linux__ */
 /* MHD_POLL_REVENTS_ERR_DISC is 'revents' mask for errors and disconnect.
  * Note: Out-of-band data is treated as error. */
 #  define MHD_POLL_REVENTS_ERR_DISC \
-     (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO | 
POLLERR | POLLHUP)
+  (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO \
+   | POLLERR | POLLHUP)
 /* MHD_POLL_REVENTS_ERRROR is 'revents' mask for errors.
  * Note: Out-of-band data is treated as error. */
 #  define MHD_POLL_REVENTS_ERRROR \
-     (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO | 
POLLERR)
+  (MHD_POLLPRI_OR_ZERO | MHD_POLLRDBAND_OR_ZERO | MHD_POLLNVAL_OR_ZERO \
+   | POLLERR)
 #endif /* HAVE_POLL */
 
 #define MHD_SCKT_MISSING_ERR_CODE_ 31450
@@ -526,30 +542,30 @@
 #if defined(MHD_POSIX_SOCKETS)
 #  define MHD_socket_get_error_() (errno)
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_get_error_() WSAGetLastError()
+#  define MHD_socket_get_error_() WSAGetLastError ()
 #endif
 
 #ifdef MHD_WINSOCK_SOCKETS
-  /* POSIX-W32 sockets compatibility functions */
+/* POSIX-W32 sockets compatibility functions */
 
 /**
  * Return pointer to string description of specified WinSock error
  * @param err the WinSock error code.
  * @return pointer to string description of specified WinSock error.
  */
-  const char* MHD_W32_strerror_winsock_(int err);
+const char*MHD_W32_strerror_winsock_ (int err);
 #endif /* MHD_WINSOCK_SOCKETS */
 
 /* MHD_socket_last_strerr_ is description string of specified socket error 
code */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_socket_strerr_(err) strerror((err))
+#  define MHD_socket_strerr_(err) strerror ((err))
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_strerr_(err) MHD_W32_strerror_winsock_((err))
+#  define MHD_socket_strerr_(err) MHD_W32_strerror_winsock_ ((err))
 #endif
 
 /* MHD_socket_last_strerr_ is description string of last errno (non-W32) /
  *                            description string of last socket error (W32) */
-#define MHD_socket_last_strerr_() MHD_socket_strerr_(MHD_socket_get_error_())
+#define MHD_socket_last_strerr_() MHD_socket_strerr_ (MHD_socket_get_error_ ())
 
 /**
  * MHD_socket_fset_error_() set socket system native error code.
@@ -557,7 +573,7 @@
 #if defined(MHD_POSIX_SOCKETS)
 #  define MHD_socket_fset_error_(err) (errno = (err))
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_socket_fset_error_(err) (WSASetLastError((err)))
+#  define MHD_socket_fset_error_(err) (WSASetLastError ((err)))
 #endif
 
 /**
@@ -569,7 +585,8 @@
  *         and error was not set.
  */
 #define MHD_socket_try_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ != (err)) 
? \
-                                         (MHD_socket_fset_error_((err)), !0) : 
0 )
+                                         (MHD_socket_fset_error_ ((err)), ! 0) 
: \
+                                         0)
 
 /**
  * MHD_socket_set_error_() set socket system native error code to
@@ -582,7 +599,8 @@
                                          (errno = ENOSYS) : (errno = (err)) )
 #  elif defined(EOPNOTSUPP)
 #    define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) 
? \
-                                         (errno = EOPNOTSUPP) : (errno = 
(err)) )
+                                         (errno = EOPNOTSUPP) : (errno = \
+                                                                   (err)) )
 #  elif defined (EFAULT)
 #    define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) 
? \
                                          (errno = EFAULT) : (errno = (err)) )
@@ -590,13 +608,14 @@
 #    define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) 
? \
                                          (errno = EINVAL) : (errno = (err)) )
 #  else  /* !EOPNOTSUPP && !EFAULT && !EINVAL */
-#    warning No suitable replacement for missing socket error code is found. 
Edit this file and add replacement code which is defined on system.
+#    warning \
+  No suitable replacement for missing socket error code is found. Edit this 
file and add replacement code which is defined on system.
 #    define MHD_socket_set_error_(err) (errno = (err))
 #  endif /* !EOPNOTSUPP && !EFAULT && !EINVAL*/
 #elif defined(MHD_WINSOCK_SOCKETS)
 #  define MHD_socket_set_error_(err) ( (MHD_SCKT_MISSING_ERR_CODE_ == (err)) ? 
\
-                                       (WSASetLastError((WSAEOPNOTSUPP))) : \
-                                       (WSASetLastError((err))) )
+                                       (WSASetLastError ((WSAEOPNOTSUPP))) : \
+                                       (WSASetLastError ((err))) )
 #endif
 
 /**
@@ -620,7 +639,8 @@
  *         last socket error equals to MHD_SCKT_E*_ @a code;
  *         boolean false otherwise
  */
-#define MHD_SCKT_LAST_ERR_IS_(code) MHD_SCKT_ERR_IS_(MHD_socket_get_error_() 
,(code))
+#define MHD_SCKT_LAST_ERR_IS_(code) MHD_SCKT_ERR_IS_ (MHD_socket_get_error_ 
(), \
+                                                      (code))
 
 /* Specific error code checks */
 
@@ -630,7 +650,7 @@
  * @return boolean true if @a err is equal to sockets' EINTR code;
  *         boolean false otherwise.
  */
-#define MHD_SCKT_ERR_IS_EINTR_(err) MHD_SCKT_ERR_IS_((err),MHD_SCKT_EINTR_)
+#define MHD_SCKT_ERR_IS_EINTR_(err) MHD_SCKT_ERR_IS_ ((err),MHD_SCKT_EINTR_)
 
 /**
  * Check whether given socket error is equal to system's
@@ -639,10 +659,12 @@
  *         boolean false otherwise.
  */
 #if MHD_SCKT_EAGAIN_ == MHD_SCKT_EWOULDBLOCK_
-#  define MHD_SCKT_ERR_IS_EAGAIN_(err) MHD_SCKT_ERR_IS_((err),MHD_SCKT_EAGAIN_)
+#  define MHD_SCKT_ERR_IS_EAGAIN_(err) MHD_SCKT_ERR_IS_ 
((err),MHD_SCKT_EAGAIN_)
 #else  /* MHD_SCKT_EAGAIN_ != MHD_SCKT_EWOULDBLOCK_ */
-#  define MHD_SCKT_ERR_IS_EAGAIN_(err) ( 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_EAGAIN_) || \
-                                         
MHD_SCKT_ERR_IS_((err),MHD_SCKT_EWOULDBLOCK_) )
+#  define MHD_SCKT_ERR_IS_EAGAIN_(err) (MHD_SCKT_ERR_IS_ ((err), \
+                                                          MHD_SCKT_EAGAIN_) || 
\
+                                        MHD_SCKT_ERR_IS_ ((err), \
+                                                          
MHD_SCKT_EWOULDBLOCK_) )
 #endif /* MHD_SCKT_EAGAIN_ != MHD_SCKT_EWOULDBLOCK_ */
 
 /**
@@ -650,10 +672,17 @@
  * @return boolean true if @a err is any kind of "low resource" error,
  *         boolean false otherwise.
  */
-#define MHD_SCKT_ERR_IS_LOW_RESOURCES_(err) ( 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_EMFILE_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ENFILE_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ENOMEM_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ENOBUFS_) )
+#define MHD_SCKT_ERR_IS_LOW_RESOURCES_(err) (MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_EMFILE_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ENFILE_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ENOMEM_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ENOBUFS_) )
 
 /**
  * Check whether is given socket error is type of "incoming connection
@@ -662,9 +691,11 @@
  *         boolean false otherwise.
  */
 #if defined(MHD_POSIX_SOCKETS)
-#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNABORTED_)
+#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) MHD_SCKT_ERR_IS_ ((err), \
+                                                                       
MHD_SCKT_ECONNABORTED_)
 #elif defined(MHD_WINSOCK_SOCKETS)
-#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNRESET_)
+#  define MHD_SCKT_ERR_IS_DISCNN_BEFORE_ACCEPT_(err) MHD_SCKT_ERR_IS_ ((err), \
+                                                                       
MHD_SCKT_ECONNRESET_)
 #endif
 
 /**
@@ -673,8 +704,11 @@
  * @return boolean true is @a err match described socket error code,
  *         boolean false otherwise.
  */
-#define MHD_SCKT_ERR_IS_REMOTE_DISCNN_(err) ( 
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNRESET_) || \
-                                              
MHD_SCKT_ERR_IS_((err),MHD_SCKT_ECONNABORTED_))
+#define MHD_SCKT_ERR_IS_REMOTE_DISCNN_(err) (MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ECONNRESET_) \
+                                             || \
+                                             MHD_SCKT_ERR_IS_ ((err), \
+                                                               
MHD_SCKT_ECONNABORTED_))
 
 /* Specific error code set */
 
@@ -683,12 +717,16 @@
  * available on platform.
  */
 #if MHD_SCKT_MISSING_ERR_CODE_ != MHD_SCKT_ENOMEM_
-#  define MHD_socket_set_error_to_ENOMEM() 
MHD_socket_set_error_(MHD_SCKT_ENOMEM_)
+#  define MHD_socket_set_error_to_ENOMEM() MHD_socket_set_error_ ( \
+    MHD_SCKT_ENOMEM_)
 #elif MHD_SCKT_MISSING_ERR_CODE_ != MHD_SCKT_ENOBUFS_
-#  define MHD_socket_set_error_to_ENOMEM() 
MHD_socket_set_error_(MHD_SCKT_ENOBUFS_)
+#  define MHD_socket_set_error_to_ENOMEM() MHD_socket_set_error_ ( \
+    MHD_SCKT_ENOBUFS_)
 #else
-#  warning No suitable replacement for ENOMEM error codes is found. Edit this 
file and add replacement code which is defined on system.
-#  define MHD_socket_set_error_to_ENOMEM() 
MHD_socket_set_error_(MHD_SCKT_ENOMEM_)
+#  warning \
+  No suitable replacement for ENOMEM error codes is found. Edit this file and 
add replacement code which is defined on system.
+#  define MHD_socket_set_error_to_ENOMEM() MHD_socket_set_error_ ( \
+    MHD_SCKT_ENOMEM_)
 #endif
 
 /* Socket functions */
@@ -700,22 +738,26 @@
 #endif /* AF_UNIX */
 
 #if defined(MHD_POSIX_SOCKETS) && defined(MHD_SCKT_LOCAL)
-#  define MHD_socket_pair_(fdarr) (!socketpair(MHD_SCKT_LOCAL, SOCK_STREAM, 0, 
(fdarr)))
+#  define MHD_socket_pair_(fdarr) (! socketpair (MHD_SCKT_LOCAL, SOCK_STREAM, 
0, \
+                                                 (fdarr)))
 #  if defined(HAVE_SOCK_NONBLOCK)
-#    define MHD_socket_pair_nblk_(fdarr) (!socketpair(MHD_SCKT_LOCAL, 
SOCK_STREAM | SOCK_NONBLOCK, 0, (fdarr)))
+#    define MHD_socket_pair_nblk_(fdarr) (! socketpair (MHD_SCKT_LOCAL, \
+                                                        SOCK_STREAM \
+                                                        | SOCK_NONBLOCK, 0, \
+                                                        (fdarr)))
 #  endif /* HAVE_SOCK_NONBLOCK*/
 #elif defined(MHD_WINSOCK_SOCKETS)
-   /**
-    * Create pair of mutually connected TCP/IP sockets on loopback address
-    * @param sockets_pair array to receive resulted sockets
-    * @param non_blk if set to non-zero value, sockets created in non-blocking 
mode
-    *                otherwise sockets will be in blocking mode
-    * @return non-zero if succeeded, zero otherwise
-    */
-   int MHD_W32_socket_pair_(SOCKET sockets_pair[2], int non_blk);
-
-#  define MHD_socket_pair_(fdarr) MHD_W32_socket_pair_((fdarr), 0)
-#  define MHD_socket_pair_nblk_(fdarr) MHD_W32_socket_pair_((fdarr), 1)
+/**
+ * Create pair of mutually connected TCP/IP sockets on loopback address
+ * @param sockets_pair array to receive resulted sockets
+ * @param non_blk if set to non-zero value, sockets created in non-blocking 
mode
+ *                otherwise sockets will be in blocking mode
+ * @return non-zero if succeeded, zero otherwise
+ */
+int MHD_W32_socket_pair_ (SOCKET sockets_pair[2], int non_blk);
+
+#  define MHD_socket_pair_(fdarr) MHD_W32_socket_pair_ ((fdarr), 0)
+#  define MHD_socket_pair_nblk_(fdarr) MHD_W32_socket_pair_ ((fdarr), 1)
 #endif
 
 /**
@@ -804,7 +846,7 @@ MHD_socket_buffering_reset_ (MHD_socket sock);
 
 
 #if defined(SOL_SOCKET) && defined(SO_NOSIGPIPE)
-   static const int _MHD_socket_int_one = 1;
+static const int _MHD_socket_int_one = 1;
 /**
  * Change socket options to no signal on remote disconnect.
  *
@@ -812,7 +854,8 @@ MHD_socket_buffering_reset_ (MHD_socket sock);
  * @return non-zero if succeeded, zero otherwise
  */
 #  define MHD_socket_nosignal_(sock) \
-    
(!setsockopt((sock),SOL_SOCKET,SO_NOSIGPIPE,&_MHD_socket_int_one,sizeof(_MHD_socket_int_one)))
+  (! setsockopt ((sock),SOL_SOCKET,SO_NOSIGPIPE,&_MHD_socket_int_one, \
+                 sizeof(_MHD_socket_int_one)))
 #endif /* SOL_SOCKET && SO_NOSIGPIPE */
 
 /**
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 36a935a2..80f0b82e 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -117,8 +117,8 @@ _MHD_static_inline bool
 isasciixdigit (char c)
 {
   return isasciidigit (c) ||
-    ( (c >= 'A') && (c <= 'F') ) ||
-    ( (c >= 'a') && (c <= 'f') );
+         ( (c >= 'A') && (c <= 'F') ) ||
+         ( (c >= 'a') && (c <= 'f') );
 }
 
 
@@ -181,7 +181,7 @@ _MHD_static_inline int
 todigitvalue (char c)
 {
   if (isasciidigit (c))
-    return (unsigned char)(c - '0');
+    return (unsigned char) (c - '0');
 
   return -1;
 }
@@ -198,11 +198,11 @@ _MHD_static_inline int
 toxdigitvalue (char c)
 {
   if (isasciidigit (c))
-    return (unsigned char)(c - '0');
+    return (unsigned char) (c - '0');
   if ( (c >= 'A') && (c <= 'F') )
-    return (unsigned char)(c - 'A' + 10);
+    return (unsigned char) (c - 'A' + 10);
   if ( (c >= 'a') && (c <= 'f') )
-    return (unsigned char)(c - 'a' + 10);
+    return (unsigned char) (c - 'a' + 10);
 
   return -1;
 }
@@ -216,7 +216,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is lower case letter,
  *         boolean false otherwise
  */
-#define isasciilower(c) (((char)(c)) >= 'a' && ((char)(c)) <= 'z')
+#define isasciilower(c) (((char) (c)) >= 'a' && ((char) (c)) <= 'z')
 
 
 /**
@@ -226,7 +226,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is upper case letter,
  *         boolean false otherwise
  */
-#define isasciiupper(c) (((char)(c)) >= 'A' && ((char)(c)) <= 'Z')
+#define isasciiupper(c) (((char) (c)) >= 'A' && ((char) (c)) <= 'Z')
 
 
 /**
@@ -236,7 +236,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is letter, boolean false
  *         otherwise
  */
-#define isasciialpha(c) (isasciilower(c) || isasciiupper(c))
+#define isasciialpha(c) (isasciilower (c) || isasciiupper (c))
 
 
 /**
@@ -246,7 +246,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is decimal digit, boolean false
  *         otherwise
  */
-#define isasciidigit(c) (((char)(c)) >= '0' && ((char)(c)) <= '9')
+#define isasciidigit(c) (((char) (c)) >= '0' && ((char) (c)) <= '9')
 
 
 /**
@@ -256,9 +256,9 @@ toxdigitvalue (char c)
  * @return boolean true if character is hexadecimal digit,
  *         boolean false otherwise
  */
-#define isasciixdigit(c) (isasciidigit((c)) || \
-                          (((char)(c)) >= 'A' && ((char)(c)) <= 'F') || \
-                          (((char)(c)) >= 'a' && ((char)(c)) <= 'f') )
+#define isasciixdigit(c) (isasciidigit ((c)) || \
+                          (((char) (c)) >= 'A' && ((char) (c)) <= 'F') || \
+                          (((char) (c)) >= 'a' && ((char) (c)) <= 'f') )
 
 
 /**
@@ -268,7 +268,7 @@ toxdigitvalue (char c)
  * @return boolean true if character is decimal digit or letter,
  *         boolean false otherwise
  */
-#define isasciialnum(c) (isasciialpha(c) || isasciidigit(c))
+#define isasciialnum(c) (isasciialpha (c) || isasciidigit (c))
 
 
 /**
@@ -280,7 +280,8 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return converted to lower case character
  */
-#define toasciilower(c) ((isasciiupper(c)) ? (((char)(c)) - 'A' + 'a') : 
((char)(c)))
+#define toasciilower(c) ((isasciiupper (c)) ? (((char) (c)) - 'A' + 'a') : \
+                         ((char) (c)))
 
 
 /**
@@ -292,7 +293,8 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return converted to upper case character
  */
-#define toasciiupper(c) ((isasciilower(c)) ? (((char)(c)) - 'a' + 'A') : 
((char)(c)))
+#define toasciiupper(c) ((isasciilower (c)) ? (((char) (c)) - 'a' + 'A') : \
+                         ((char) (c)))
 
 
 /**
@@ -301,7 +303,8 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return value of hexadecimal digit or -1 if @ c is not hexadecimal digit
  */
-#define todigitvalue(c) (isasciidigit(c) ? (int)(((char)(c)) - '0') : 
(int)(-1))
+#define todigitvalue(c) (isasciidigit (c) ? (int) (((char) (c)) - '0') : \
+                         (int) (-1))
 
 
 /**
@@ -309,11 +312,12 @@ toxdigitvalue (char c)
  * @param c character to convert
  * @return value of hexadecimal digit or -1 if @ c is not hexadecimal digit
  */
-#define toxdigitvalue(c) ( isasciidigit(c) ? (int)(((char)(c)) - '0') : \
-                           ( (((char)(c)) >= 'A' && ((char)(c)) <= 'F') ? \
-                             (int)(((unsigned char)(c)) - 'A' + 10) : \
-                             ( (((char)(c)) >= 'a' && ((char)(c)) <= 'f') ? \
-                               (int)(((unsigned char)(c)) - 'a' + 10) : 
(int)(-1) )))
+#define toxdigitvalue(c) (isasciidigit (c) ? (int) (((char) (c)) - '0') : \
+                          ( (((char) (c)) >= 'A' && ((char) (c)) <= 'F') ? \
+                            (int) (((unsigned char) (c)) - 'A' + 10) : \
+                            ( (((char) (c)) >= 'a' && ((char) (c)) <= 'f') ? \
+                              (int) (((unsigned char) (c)) - 'a' + 10) : \
+                              (int) (-1) )))
 #endif /* !INLINE_FUNC */
 
 
@@ -326,19 +330,19 @@ toxdigitvalue (char c)
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_ (const char * str1,
-                         const char * str2)
+MHD_str_equal_caseless_ (const char *str1,
+                         const char *str2)
 {
   while (0 != (*str1))
-    {
-      const char c1 = *str1;
-      const char c2 = *str2;
-      if ( (c1 != c2) &&
-           (toasciilower (c1) != toasciilower (c2)) )
-        return 0;
-      str1++;
-      str2++;
-    }
+  {
+    const char c1 = *str1;
+    const char c2 = *str2;
+    if ( (c1 != c2) &&
+         (toasciilower (c1) != toasciilower (c2)) )
+      return 0;
+    str1++;
+    str2++;
+  }
   return 0 == (*str2);
 }
 #endif /* ! MHD_FAVOR_SMALL_CODE */
@@ -356,23 +360,23 @@ MHD_str_equal_caseless_ (const char * str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_n_ (const char * const str1,
-                           const char * const str2,
+MHD_str_equal_caseless_n_ (const char *const str1,
+                           const char *const str2,
                            size_t maxlen)
 {
   size_t i;
 
   for (i = 0; i < maxlen; ++i)
-    {
-      const char c1 = str1[i];
-      const char c2 = str2[i];
-      if (0 == c2)
-        return 0 == c1;
-      if ( (c1 != c2) &&
-           (toasciilower (c1) != toasciilower (c2)) )
-        return 0;
-    }
-  return !0;
+  {
+    const char c1 = str1[i];
+    const char c2 = str2[i];
+    if (0 == c2)
+      return 0 == c1;
+    if ( (c1 != c2) &&
+         (toasciilower (c1) != toasciilower (c2)) )
+      return 0;
+  }
+  return ! 0;
 }
 
 
@@ -386,21 +390,21 @@ MHD_str_equal_caseless_n_ (const char * const str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 bool
-MHD_str_equal_caseless_bin_n_ (const char * const str1,
-                  const char * const str2,
-                  size_t len)
+MHD_str_equal_caseless_bin_n_ (const char *const str1,
+                               const char *const str2,
+                               size_t len)
 {
   size_t i;
 
   for (i = 0; i < len; ++i)
-    {
-      const char c1 = str1[i];
-      const char c2 = str2[i];
-      if ( (c1 != c2) &&
-           (toasciilower (c1) != toasciilower (c2)) )
-        return 0;
-    }
-  return !0;
+  {
+    const char c1 = str1[i];
+    const char c2 = str2[i];
+    if ( (c1 != c2) &&
+         (toasciilower (c1) != toasciilower (c2)) )
+      return 0;
+  }
+  return ! 0;
 }
 
 
@@ -419,46 +423,49 @@ MHD_str_equal_caseless_bin_n_ (const char * const str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 bool
-MHD_str_has_token_caseless_ (const char * str,
-                             const char * const token,
+MHD_str_has_token_caseless_ (const char *str,
+                             const char *const token,
                              size_t token_len)
 {
   if (0 == token_len)
     return false;
 
   while (0 != *str)
+  {
+    size_t i;
+    /* Skip all whitespaces and empty tokens. */
+    while (' ' == *str || '\t' == *str || ',' == *str)
+      str++;
+
+    /* Check for token match. */
+    i = 0;
+    while (1)
     {
-      size_t i;
-      /* Skip all whitespaces and empty tokens. */
-      while (' ' == *str || '\t' == *str || ',' == *str) str++;
-
-      /* Check for token match. */
-      i = 0;
-      while (1)
-        {
-          const char sc = *(str++);
-          const char tc = token[i++];
-
-          if (0 == sc)
-            return false;
-          if ( (sc != tc) &&
-               (toasciilower (sc) != toasciilower (tc)) )
-            break;
-          if (i >= token_len)
-            {
-              /* Check whether substring match token fully or
-               * has additional unmatched chars at tail. */
-              while (' ' == *str || '\t' == *str) str++;
-              /* End of (sub)string? */
-              if (0 == *str || ',' == *str)
-                return true;
-              /* Unmatched chars at end of substring. */
-              break;
-            }
-        }
-       /* Find next substring. */
-      while (0 != *str && ',' != *str) str++;
+      const char sc = *(str++);
+      const char tc = token[i++];
+
+      if (0 == sc)
+        return false;
+      if ( (sc != tc) &&
+           (toasciilower (sc) != toasciilower (tc)) )
+        break;
+      if (i >= token_len)
+      {
+        /* Check whether substring match token fully or
+         * has additional unmatched chars at tail. */
+        while (' ' == *str || '\t' == *str)
+          str++;
+        /* End of (sub)string? */
+        if ((0 == *str) ||(',' == *str) )
+          return true;
+        /* Unmatched chars at end of substring. */
+        break;
+      }
     }
+    /* Find next substring. */
+    while (0 != *str && ',' != *str)
+      str++;
+  }
   return false;
 }
 
@@ -479,25 +486,25 @@ size_t
 MHD_str_to_uint64_ (const char *str,
                     uint64_t *out_val)
 {
-  const char * const start = str;
+  const char *const start = str;
   uint64_t res;
 
-  if (!str || !out_val || !isasciidigit(str[0]))
+  if (! str || ! out_val || ! isasciidigit (str[0]))
     return 0;
 
   res = 0;
   do
-    {
-      const int digit = (unsigned char)(*str) - '0';
-      if ( (res > (UINT64_MAX / 10)) ||
-           ( (res == (UINT64_MAX / 10)) &&
-             ((uint64_t)digit > (UINT64_MAX % 10)) ) )
-        return 0;
-
-      res *= 10;
-      res += digit;
-      str++;
-    } while (isasciidigit (*str));
+  {
+    const int digit = (unsigned char) (*str) - '0';
+    if ( (res > (UINT64_MAX / 10)) ||
+         ( (res == (UINT64_MAX / 10)) &&
+           ((uint64_t) digit > (UINT64_MAX % 10)) ) )
+      return 0;
+
+    res *= 10;
+    res += digit;
+    str++;
+  } while (isasciidigit (*str));
 
   *out_val = res;
   return str - start;
@@ -518,34 +525,34 @@ MHD_str_to_uint64_ (const char *str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_str_to_uint64_n_ (const char * str,
+MHD_str_to_uint64_n_ (const char *str,
                       size_t maxlen,
                       uint64_t *out_val)
 {
   uint64_t res;
   size_t i;
 
-  if (!str || !maxlen || !out_val || !isasciidigit (str[0]))
+  if (! str || ! maxlen || ! out_val || ! isasciidigit (str[0]))
     return 0;
 
   res = 0;
   i = 0;
   do
-    {
-      const int digit = (unsigned char)str[i] - '0';
+  {
+    const int digit = (unsigned char) str[i] - '0';
 
-      if ( (res > (UINT64_MAX / 10)) ||
-           ( (res == (UINT64_MAX / 10)) &&
-             ((uint64_t)digit > (UINT64_MAX % 10)) ) )
-        return 0;
+    if ( (res > (UINT64_MAX / 10)) ||
+         ( (res == (UINT64_MAX / 10)) &&
+           ((uint64_t) digit > (UINT64_MAX % 10)) ) )
+      return 0;
 
-      res *= 10;
-      res += digit;
-      i++;
-    } while ( (i < maxlen) &&
-              isasciidigit (str[i]) );
+    res *= 10;
+    res += digit;
+    i++;
+  } while ( (i < maxlen) &&
+            isasciidigit (str[i]) );
 
-  *out_val= res;
+  *out_val = res;
   return i;
 }
 
@@ -561,31 +568,32 @@ MHD_str_to_uint64_n_ (const char * str,
  *         then possible to store in uint32_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint32_ (const char * str,
+MHD_strx_to_uint32_ (const char *str,
                      uint32_t *out_val)
 {
-  const char * const start = str;
+  const char *const start = str;
   uint32_t res;
   int digit;
 
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   digit = toxdigitvalue (*str);
   while (digit >= 0)
+  {
+    if ( (res < (UINT32_MAX / 16)) ||
+         ((res == (UINT32_MAX / 16)) &&( (uint32_t) digit <= (UINT32_MAX
+                                                              % 16)) ) )
     {
-      if ( (res < (UINT32_MAX / 16)) ||
-           (res == (UINT32_MAX / 16) && (uint32_t)digit <= (UINT32_MAX % 16)) )
-        {
-          res *= 16;
-          res += digit;
-        }
-      else
-        return 0;
-      str++;
-      digit = toxdigitvalue (*str);
+      res *= 16;
+      res += digit;
     }
+    else
+      return 0;
+    str++;
+    digit = toxdigitvalue (*str);
+  }
 
   if (str - start > 0)
     *out_val = res;
@@ -614,21 +622,22 @@ MHD_strx_to_uint32_n_ (const char *str,
   size_t i;
   uint32_t res;
   int digit;
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   i = 0;
   while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0)
-    {
-      if ( (res > (UINT32_MAX / 16)) ||
-           (res == (UINT32_MAX / 16) && (uint32_t)digit > (UINT32_MAX % 16)) )
-        return 0;
+  {
+    if ( (res > (UINT32_MAX / 16)) ||
+         ((res == (UINT32_MAX / 16)) &&( (uint32_t) digit > (UINT32_MAX
+                                                             % 16)) ) )
+      return 0;
 
-      res *= 16;
-      res += digit;
-      i++;
-    }
+    res *= 16;
+    res += digit;
+    i++;
+  }
 
   if (i)
     *out_val = res;
@@ -650,27 +659,28 @@ size_t
 MHD_strx_to_uint64_ (const char *str,
                      uint64_t *out_val)
 {
-  const char * const start = str;
+  const char *const start = str;
   uint64_t res;
   int digit;
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   digit = toxdigitvalue (*str);
   while (digit >= 0)
+  {
+    if ( (res < (UINT64_MAX / 16)) ||
+         ((res == (UINT64_MAX / 16)) &&( (uint64_t) digit <= (UINT64_MAX
+                                                              % 16)) ) )
     {
-      if ( (res < (UINT64_MAX / 16)) ||
-           (res == (UINT64_MAX / 16) && (uint64_t)digit <= (UINT64_MAX % 16)) )
-        {
-          res *= 16;
-          res += digit;
-        }
-      else
-        return 0;
-      str++;
-      digit = toxdigitvalue (*str);
+      res *= 16;
+      res += digit;
     }
+    else
+      return 0;
+    str++;
+    digit = toxdigitvalue (*str);
+  }
 
   if (str - start > 0)
     *out_val = res;
@@ -692,28 +702,29 @@ MHD_strx_to_uint64_ (const char *str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint64_n_ (const char * str,
+MHD_strx_to_uint64_n_ (const char *str,
                        size_t maxlen,
                        uint64_t *out_val)
 {
   size_t i;
   uint64_t res;
   int digit;
-  if (!str || !out_val)
+  if (! str || ! out_val)
     return 0;
 
   res = 0;
   i = 0;
   while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0)
-    {
-      if ( (res > (UINT64_MAX / 16)) ||
-           (res == (UINT64_MAX / 16) && (uint64_t)digit > (UINT64_MAX % 16)) )
-        return 0;
+  {
+    if ( (res > (UINT64_MAX / 16)) ||
+         ((res == (UINT64_MAX / 16)) &&( (uint64_t) digit > (UINT64_MAX
+                                                             % 16)) ) )
+      return 0;
 
-      res *= 16;
-      res += digit;
-      i++;
-    }
+    res *= 16;
+    res += digit;
+    i++;
+  }
 
   if (i)
     *out_val = res;
@@ -742,7 +753,7 @@ MHD_strx_to_uint64_n_ (const char * str,
 size_t
 MHD_str_to_uvalue_n_ (const char *str,
                       size_t maxlen,
-                      void * out_val,
+                      void *out_val,
                       size_t val_size,
                       uint64_t max_val,
                       int base)
@@ -754,34 +765,34 @@ MHD_str_to_uvalue_n_ (const char *str,
   const uint64_t max_v_mod_b = max_val % base;
   /* 'digit->value' must be function, not macro */
   int (*const dfunc)(char) = (base == 16) ?
-                              toxdigitvalue : todigitvalue;
+                             toxdigitvalue : todigitvalue;
 
-  if ( !str || !out_val ||
-       (base != 16 && base != 10) )
+  if ( ! str || ! out_val ||
+       ((base != 16)&&(base != 10)) )
     return 0;
 
   res = 0;
   i = 0;
   while (maxlen > i && 0 <= (digit = dfunc (str[i])))
-    {
-      if ( ((max_v_div_b) < res) ||
-          ((max_v_div_b) == res && (max_v_mod_b) < (uint64_t)digit) )
-        return 0;
+  {
+    if ( ((max_v_div_b) < res) ||
+         (( (max_v_div_b) == res) &&( (max_v_mod_b) < (uint64_t) digit) ) )
+      return 0;
 
-      res *= base;
-      res += digit;
-      i++;
-    }
+    res *= base;
+    res += digit;
+    i++;
+  }
 
   if (i)
-    {
-      if (8 == val_size)
-        *(uint64_t*)out_val = res;
-      else if (4 == val_size)
-        *(uint32_t*)out_val = (uint32_t)res;
-      else
-        return 0;
-    }
+  {
+    if (8 == val_size)
+      *(uint64_t*) out_val = res;
+    else if (4 == val_size)
+      *(uint32_t*) out_val = (uint32_t) res;
+    else
+      return 0;
+  }
   return i;
 }
 #endif /* MHD_FAVOR_SMALL_CODE */
diff --git a/src/microhttpd/mhd_str.h b/src/microhttpd/mhd_str.h
index 5c0e0fdc..dd379f52 100644
--- a/src/microhttpd/mhd_str.h
+++ b/src/microhttpd/mhd_str.h
@@ -42,7 +42,7 @@
 /**
  * Determine length of static string / macro strings at compile time.
  */
-#define MHD_STATICSTR_LEN_(macro) (sizeof(macro)/sizeof(char) - 1)
+#define MHD_STATICSTR_LEN_(macro) (sizeof(macro) / sizeof(char) - 1)
 #endif /* ! MHD_STATICSTR_LEN_ */
 
 /*
@@ -58,11 +58,12 @@
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_ (const char * str1,
-                 const char * str2);
+MHD_str_equal_caseless_ (const char *str1,
+                         const char *str2);
 #else  /* MHD_FAVOR_SMALL_CODE */
 /* Reuse MHD_str_equal_caseless_n_() to reduce size */
-#define MHD_str_equal_caseless_(s1,s2) MHD_str_equal_caseless_n_((s1),(s2), 
SIZE_MAX)
+#define MHD_str_equal_caseless_(s1,s2) MHD_str_equal_caseless_n_ ((s1),(s2), \
+                                                                  SIZE_MAX)
 #endif /* MHD_FAVOR_SMALL_CODE */
 
 
@@ -77,9 +78,9 @@ MHD_str_equal_caseless_ (const char * str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 int
-MHD_str_equal_caseless_n_ (const char * const str1,
-                  const char * const str2,
-                  size_t maxlen);
+MHD_str_equal_caseless_n_ (const char *const str1,
+                           const char *const str2,
+                           size_t maxlen);
 
 
 /**
@@ -92,9 +93,9 @@ MHD_str_equal_caseless_n_ (const char * const str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 bool
-MHD_str_equal_caseless_bin_n_ (const char * const str1,
-                  const char * const str2,
-                  size_t len);
+MHD_str_equal_caseless_bin_n_ (const char *const str1,
+                               const char *const str2,
+                               size_t len);
 
 
 /**
@@ -111,8 +112,8 @@ MHD_str_equal_caseless_bin_n_ (const char * const str1,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 bool
-MHD_str_has_token_caseless_ (const char * str,
-                             const char * const token,
+MHD_str_has_token_caseless_ (const char *str,
+                             const char *const token,
                              size_t token_len);
 
 /**
@@ -126,7 +127,7 @@ MHD_str_has_token_caseless_ (const char * str,
  * @return non-zero if two strings are equal, zero otherwise.
  */
 #define MHD_str_has_s_token_caseless_(str,tkn) \
-    MHD_str_has_token_caseless_((str),(tkn),MHD_STATICSTR_LEN_(tkn))
+  MHD_str_has_token_caseless_ ((str),(tkn),MHD_STATICSTR_LEN_ (tkn))
 
 #ifndef MHD_FAVOR_SMALL_CODE
 /* Use individual function for each case to improve speed */
@@ -141,13 +142,13 @@ MHD_str_has_token_caseless_ (const char * str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_str_to_uint64_ (const char * str,
-                    uint64_t * out_val);
+MHD_str_to_uint64_ (const char *str,
+                    uint64_t *out_val);
 
 /**
  * Convert not more then @a maxlen decimal US-ASCII digits in string to
  * number in uint64_t.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * @param str string to convert
  * @param maxlen maximum number of characters to process
@@ -157,9 +158,9 @@ MHD_str_to_uint64_ (const char * str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_str_to_uint64_n_ (const char * str,
+MHD_str_to_uint64_n_ (const char *str,
                       size_t maxlen,
-                      uint64_t * out_val);
+                      uint64_t *out_val);
 
 
 /**
@@ -167,19 +168,19 @@ MHD_str_to_uint64_n_ (const char * str,
  * Conversion stopped at first non-digit character.
  * @param str string to convert
  * @param out_val pointer to uint32_t to store result of conversion
- * @return non-zero number of characters processed on succeed, 
+ * @return non-zero number of characters processed on succeed,
  *         zero if no digit is found, resulting value is larger
  *         then possible to store in uint32_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint32_ (const char * str,
-                     uint32_t * out_val);
+MHD_strx_to_uint32_ (const char *str,
+                     uint32_t *out_val);
 
 
 /**
  * Convert not more then @a maxlen hexadecimal US-ASCII digits in string
  * to number in uint32_t.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * @param str string to convert
  * @param maxlen maximum number of characters to process
@@ -189,9 +190,9 @@ MHD_strx_to_uint32_ (const char * str,
  *         then possible to store in uint32_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint32_n_ (const char * str,
-                      size_t maxlen,
-                      uint32_t * out_val);
+MHD_strx_to_uint32_n_ (const char *str,
+                       size_t maxlen,
+                       uint32_t *out_val);
 
 
 /**
@@ -199,19 +200,19 @@ MHD_strx_to_uint32_n_ (const char * str,
  * Conversion stopped at first non-digit character.
  * @param str string to convert
  * @param out_val pointer to uint64_t to store result of conversion
- * @return non-zero number of characters processed on succeed, 
+ * @return non-zero number of characters processed on succeed,
  *         zero if no digit is found, resulting value is larger
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint64_ (const char * str,
-                     uint64_t * out_val);
+MHD_strx_to_uint64_ (const char *str,
+                     uint64_t *out_val);
 
 
 /**
  * Convert not more then @a maxlen hexadecimal US-ASCII digits in string
  * to number in uint64_t.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * @param str string to convert
  * @param maxlen maximum number of characters to process
@@ -221,9 +222,9 @@ MHD_strx_to_uint64_ (const char * str,
  *         then possible to store in uint64_t or @a out_val is NULL
  */
 size_t
-MHD_strx_to_uint64_n_ (const char * str,
+MHD_strx_to_uint64_n_ (const char *str,
                        size_t maxlen,
-                       uint64_t * out_val);
+                       uint64_t *out_val);
 
 #else  /* MHD_FAVOR_SMALL_CODE */
 /* Use one universal function and macros to reduce size */
@@ -231,7 +232,7 @@ MHD_strx_to_uint64_n_ (const char * str,
 /**
  * Generic function for converting not more then @a maxlen
  * hexadecimal or decimal US-ASCII digits in string to number.
- * Conversion stopped at first non-digit character or after @a maxlen 
+ * Conversion stopped at first non-digit character or after @a maxlen
  * digits.
  * To be used only within macro.
  * @param str the string to convert
@@ -245,36 +246,44 @@ MHD_strx_to_uint64_n_ (const char * str,
  *         then @ max_val or @a out_val is NULL
  */
 size_t
-MHD_str_to_uvalue_n_ (const char * str,
+MHD_str_to_uvalue_n_ (const char *str,
                       size_t maxlen,
-                      void * out_val,
+                      void *out_val,
                       size_t val_size,
                       uint64_t max_val,
                       int base);
 
-#define MHD_str_to_uint64_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,10)
+#define MHD_str_to_uint64_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                       sizeof(uint64_t), \
+                                                       UINT64_MAX,10)
 
-#define MHD_str_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,10)
+#define MHD_str_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                            sizeof(uint64_t), \
+                                                            UINT64_MAX,10)
 
-#define MHD_strx_to_sizet_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(size_t),SIZE_MAX,16)
+#define MHD_strx_to_sizet_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                       
sizeof(size_t),SIZE_MAX, \
+                                                       16)
 
-#define MHD_strx_to_sizet_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(size_t),SIZE_MAX,16)
+#define MHD_strx_to_sizet_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                            sizeof(size_t), \
+                                                            SIZE_MAX,16)
 
-#define MHD_strx_to_uint32_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(uint32_t),UINT32_MAX,16)
+#define MHD_strx_to_uint32_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                        sizeof(uint32_t), \
+                                                        UINT32_MAX,16)
 
-#define MHD_strx_to_uint32_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(uint32_t),UINT32_MAX,16)
+#define MHD_strx_to_uint32_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                             sizeof(uint32_t), 
\
+                                                             UINT32_MAX,16)
 
-#define MHD_strx_to_uint64_(s,ov) MHD_str_to_uvalue_n_((s),SIZE_MAX,(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,16)
+#define MHD_strx_to_uint64_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
+                                                        sizeof(uint64_t), \
+                                                        UINT64_MAX,16)
 
-#define MHD_strx_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_((s),(ml),(ov),\
-                                             sizeof(uint64_t),UINT64_MAX,16)
+#define MHD_strx_to_uint64_n_(s,ml,ov) MHD_str_to_uvalue_n_ ((s),(ml),(ov), \
+                                                             sizeof(uint64_t), 
\
+                                                             UINT64_MAX,16)
 
 #endif /* MHD_FAVOR_SMALL_CODE */
 
diff --git a/src/microhttpd/mhd_threads.h b/src/microhttpd/mhd_threads.h
index 6d69b9ed..79520d53 100644
--- a/src/microhttpd/mhd_threads.h
+++ b/src/microhttpd/mhd_threads.h
@@ -58,23 +58,26 @@
 
 #ifndef MHD_NO_THREAD_NAMES
 #  if defined(MHD_USE_POSIX_THREADS)
-#    if defined(HAVE_PTHREAD_SETNAME_NP_GNU) || 
defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) || \
-        defined(HAVE_PTHREAD_SETNAME_NP_DARWIN) || 
defined(HAVE_PTHREAD_SETNAME_NP_NETBSD) || \
-        defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD) || 
defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
+#    if defined(HAVE_PTHREAD_SETNAME_NP_GNU) || \
+  defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) || \
+  defined(HAVE_PTHREAD_SETNAME_NP_DARWIN) || \
+  defined(HAVE_PTHREAD_SETNAME_NP_NETBSD) || \
+  defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD) || \
+  defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
 #      define MHD_USE_THREAD_NAME_
 #    endif /* HAVE_PTHREAD_SETNAME_NP */
 #  elif defined(MHD_USE_W32_THREADS)
 #    ifdef _MSC_FULL_VER
-       /* Thread names only available with VC compiler */
+/* Thread names only available with VC compiler */
 #      define MHD_USE_THREAD_NAME_
 #    endif /* _MSC_FULL_VER */
 #  endif
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
-  typedef pthread_t MHD_thread_handle_;
+typedef pthread_t MHD_thread_handle_;
 #elif defined(MHD_USE_W32_THREADS)
-  typedef HANDLE MHD_thread_handle_;
+typedef HANDLE MHD_thread_handle_;
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -86,9 +89,9 @@
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
-  typedef pthread_t MHD_thread_ID_;
+typedef pthread_t MHD_thread_ID_;
 #elif defined(MHD_USE_W32_THREADS)
-  typedef DWORD MHD_thread_ID_;
+typedef DWORD MHD_thread_ID_;
 #endif
 
 /* Depending on implementation, pthread_create() MAY set thread ID into
@@ -100,27 +103,27 @@
  * to save some resources. */
 #if defined(MHD_USE_POSIX_THREADS)
 #  ifdef MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD
-  union _MHD_thread_handle_ID_
-  {
-    MHD_thread_handle_  handle; /**< To be used in other threads */
-    MHD_thread_ID_      ID;     /**< To be used in thread itself */
-  };
-  typedef union _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
+union _MHD_thread_handle_ID_
+{
+  MHD_thread_handle_ handle;    /**< To be used in other threads */
+  MHD_thread_ID_ ID;            /**< To be used in thread itself */
+};
+typedef union _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
 #  else  /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
-  struct _MHD_thread_handle_ID_
-  {
-    MHD_thread_handle_  handle; /**< To be used in other threads */
-    MHD_thread_ID_      ID;     /**< To be used in thread itself */
-  };
-  typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
+struct _MHD_thread_handle_ID_
+{
+  MHD_thread_handle_ handle;    /**< To be used in other threads */
+  MHD_thread_ID_ ID;            /**< To be used in thread itself */
+};
+typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
 #  endif /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
 #elif defined(MHD_USE_W32_THREADS)
-  struct _MHD_thread_handle_ID_
-  {
-    MHD_thread_handle_  handle; /**< To be used in other threads */
-    MHD_thread_ID_      ID;     /**< To be used in thread itself */
-  };
-  typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
+struct _MHD_thread_handle_ID_
+{
+  MHD_thread_handle_ handle;    /**< To be used in other threads */
+  MHD_thread_ID_ ID;            /**< To be used in thread itself */
+};
+typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -129,14 +132,17 @@
  * @param thread handle to watch
  * @return nonzero on success, zero otherwise
  */
-#define MHD_join_thread_(thread) (!pthread_join((thread), NULL))
+#define MHD_join_thread_(thread) (! pthread_join ((thread), NULL))
 #elif defined(MHD_USE_W32_THREADS)
 /**
  * Wait until specified thread is ended and free thread handle on success.
  * @param thread handle to watch
  * @return nonzero on success, zero otherwise
  */
-#define MHD_join_thread_(thread) (WAIT_OBJECT_0 == 
WaitForSingleObject((thread), INFINITE) ? (CloseHandle((thread)), !0) : 0)
+#define MHD_join_thread_(thread) (WAIT_OBJECT_0 == WaitForSingleObject ( \
+                                    (thread), INFINITE) ? (CloseHandle ( \
+                                                             (thread)), ! 0) : 
\
+                                  0)
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -145,14 +151,14 @@
  * @param ID thread ID to match
  * @return nonzero on match, zero otherwise
  */
-#define MHD_thread_ID_match_current_(ID) (pthread_equal((ID), pthread_self()))
+#define MHD_thread_ID_match_current_(ID) (pthread_equal ((ID), pthread_self 
()))
 #elif defined(MHD_USE_W32_THREADS)
 /**
  * Check whether provided thread ID match current thread.
  * @param ID thread ID to match
  * @return nonzero on match, zero otherwise
  */
-#define MHD_thread_ID_match_current_(ID) (GetCurrentThreadId() == (ID))
+#define MHD_thread_ID_match_current_(ID) (GetCurrentThreadId () == (ID))
 #endif
 
 #if defined(MHD_USE_POSIX_THREADS)
@@ -161,20 +167,22 @@
  * Initialise thread ID.
  * @param thread_handle_ID_ptr pointer to thread handle-ID
  */
-#define MHD_thread_init_(thread_handle_ID_ptr) (void)0
+#define MHD_thread_init_(thread_handle_ID_ptr) (void) 0
 #  else  /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
 /**
  * Initialise thread ID.
  * @param thread_handle_ID_ptr pointer to thread handle-ID
  */
-#define MHD_thread_init_(thread_handle_ID_ptr) 
((thread_handle_ID_ptr)->ID=pthread_self())
+#define MHD_thread_init_(thread_handle_ID_ptr) ((thread_handle_ID_ptr)->ID = \
+                                                  pthread_self ())
 #  endif /* ! MHD_PTHREAD_CREATE__SET_ID_BEFORE_START_THREAD */
 #elif defined(MHD_USE_W32_THREADS)
 /**
  * Initialise thread ID.
  * @param thread_handle_ID_ptr pointer to thread handle-ID
  */
-#define MHD_thread_init_(thread_handle_ID_ptr) 
((thread_handle_ID_ptr)->ID=GetCurrentThreadId())
+#define MHD_thread_init_(thread_handle_ID_ptr) ((thread_handle_ID_ptr)->ID = \
+                                                  GetCurrentThreadId ())
 #endif
 
 /**
@@ -205,7 +213,7 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
                     void *arg);
 
 #ifndef MHD_USE_THREAD_NAME_
-#define MHD_create_named_thread_(t,n,s,r,a) MHD_create_thread_((t),(s),(r),(a))
+#define MHD_create_named_thread_(t,n,s,r,a) MHD_create_thread_ 
((t),(s),(r),(a))
 #else  /* MHD_USE_THREAD_NAME_ */
 /**
  * Create a named thread and set the attributes according to our options.
@@ -219,7 +227,7 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
  */
 int
 MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
-                          const char* thread_name,
+                          const char*thread_name,
                           size_t stack_size,
                           MHD_THREAD_START_ROUTINE_ start_routine,
                           void *arg);
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index e9d40ef7..8b6a33ea 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -291,44 +291,48 @@ MHD_create_post_processor (struct MHD_Connection 
*connection,
   if (MHD_NO == MHD_lookup_connection_value_n (connection,
                                                MHD_HEADER_KIND,
                                                MHD_HTTP_HEADER_CONTENT_TYPE,
-                                               
MHD_STATICSTR_LEN_(MHD_HTTP_HEADER_CONTENT_TYPE),
+                                               MHD_STATICSTR_LEN_ (
+                                                 MHD_HTTP_HEADER_CONTENT_TYPE),
                                                &encoding,
                                                NULL))
     return NULL;
   boundary = NULL;
   if (! MHD_str_equal_caseless_n_ (MHD_HTTP_POST_ENCODING_FORM_URLENCODED,
                                    encoding,
-                                   MHD_STATICSTR_LEN_ 
(MHD_HTTP_POST_ENCODING_FORM_URLENCODED)))
+                                   MHD_STATICSTR_LEN_ (
+                                     MHD_HTTP_POST_ENCODING_FORM_URLENCODED)))
+  {
+    if (! MHD_str_equal_caseless_n_ (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA,
+                                     encoding,
+                                     MHD_STATICSTR_LEN_ (
+                                       
MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA)))
+      return NULL;
+    boundary =
+      &encoding[MHD_STATICSTR_LEN_ 
(MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA)];
+    /* Q: should this be "strcasestr"? */
+    boundary = strstr (boundary, "boundary=");
+    if (NULL == boundary)
+      return NULL; /* failed to determine boundary */
+    boundary += MHD_STATICSTR_LEN_ ("boundary=");
+    blen = strlen (boundary);
+    if ( (blen == 0) ||
+         (blen * 2 + 2 > buffer_size) )
+      return NULL;              /* (will be) out of memory or invalid boundary 
*/
+    if ( (boundary[0] == '"') &&
+         (boundary[blen - 1] == '"') )
     {
-      if (! MHD_str_equal_caseless_n_ 
(MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA,
-                                       encoding,
-                                       MHD_STATICSTR_LEN_ 
(MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA)))
-        return NULL;
-      boundary =
-        &encoding[MHD_STATICSTR_LEN_ 
(MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA)];
-      /* Q: should this be "strcasestr"? */
-      boundary = strstr (boundary, "boundary=");
-      if (NULL == boundary)
-       return NULL; /* failed to determine boundary */
-      boundary += MHD_STATICSTR_LEN_ ("boundary=");
-      blen = strlen (boundary);
-      if ( (blen == 0) ||
-           (blen * 2 + 2 > buffer_size) )
-        return NULL;            /* (will be) out of memory or invalid boundary 
*/
-      if ( (boundary[0] == '"') &&
-           (boundary[blen - 1] == '"') )
-       {
-         /* remove enclosing quotes */
-         ++boundary;
-         blen -= 2;
-       }
+      /* remove enclosing quotes */
+      ++boundary;
+      blen -= 2;
     }
+  }
   else
     blen = 0;
   buffer_size += 4; /* round up to get nice block sizes despite boundary 
search */
 
   /* add +1 to ensure we ALWAYS have a zero-termination at the end */
-  if (NULL == (ret = MHD_calloc_ (1, sizeof (struct MHD_PostProcessor) + 
buffer_size + 1)))
+  if (NULL == (ret = MHD_calloc_ (1, sizeof (struct MHD_PostProcessor)
+                                  + buffer_size + 1)))
     return NULL;
   ret->connection = connection;
   ret->ikvi = iter;
@@ -354,7 +358,7 @@ MHD_create_post_processor (struct MHD_Connection 
*connection,
 static int
 post_process_urlencoded (struct MHD_PostProcessor *pp,
                          const char *post_data,
-                        size_t post_data_len)
+                         size_t post_data_len)
 {
   size_t equals;
   size_t amper;
@@ -368,149 +372,149 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
   buf = (char *) &pp[1];
   poff = 0;
   while (poff < post_data_len)
+  {
+    switch (pp->state)
     {
-      switch (pp->state)
+    case PP_Error:
+      return MHD_NO;
+    case PP_Done:
+      /* did not expect to receive more data */
+      pp->state = PP_Error;
+      return MHD_NO;
+    case PP_Init:
+      equals = 0;
+      while ((equals + poff < post_data_len) &&
+             (post_data[equals + poff] != '='))
+        equals++;
+      if (equals + pp->buffer_pos > pp->buffer_size)
+      {
+        pp->state = PP_Error;           /* out of memory */
+        return MHD_NO;
+      }
+      memcpy (&buf[pp->buffer_pos], &post_data[poff], equals);
+      pp->buffer_pos += equals;
+      if (equals + poff == post_data_len)
+        return MHD_YES;         /* no '=' yet */
+      buf[pp->buffer_pos] = '\0';       /* 0-terminate key */
+      pp->buffer_pos = 0;       /* reset for next key */
+      MHD_unescape_plus (buf);
+      MHD_http_unescape (buf);
+      poff += equals + 1;
+      pp->state = PP_ProcessValue;
+      pp->value_offset = 0;
+      break;
+    case PP_ProcessValue:
+      /* obtain rest of value from previous iteration */
+      memcpy (xbuf, pp->xbuf, pp->xbuf_pos);
+      xoff = pp->xbuf_pos;
+      pp->xbuf_pos = 0;
+
+      /* find last position in input buffer that is part of the value */
+      amper = 0;
+      while ((amper + poff < post_data_len) &&
+             (amper < XBUF_SIZE) &&
+             (post_data[amper + poff] != '&') &&
+             (post_data[amper + poff] != '\n') &&
+             (post_data[amper + poff] != '\r'))
+        amper++;
+      end_of_value_found = ((amper + poff < post_data_len) &&
+                            ((post_data[amper + poff] == '&') ||
+                             (post_data[amper + poff] == '\n') ||
+                             (post_data[amper + poff] == '\r')));
+      /* compute delta, the maximum number of bytes that we will be able to
+         process right now (either amper-limited of xbuf-size limited) */
+      delta = amper;
+      if (delta > XBUF_SIZE - xoff)
+        delta = XBUF_SIZE - xoff;
+
+      /* move input into processing buffer */
+      memcpy (&xbuf[xoff], &post_data[poff], delta);
+      xoff += delta;
+      poff += delta;
+
+      /* find if escape sequence is at the end of the processing buffer;
+         if so, exclude those from processing (reduce delta to point at
+         end of processed region) */
+      delta = xoff;
+      if ((delta > 0) &&
+          ('%' == xbuf[delta - 1]))
+        delta--;
+      else if ((delta > 1) &&
+               ('%' == xbuf[delta - 2]))
+        delta -= 2;
+
+      /* if we have an incomplete escape sequence, save it to
+         pp->xbuf for later */
+      if (delta < xoff)
+      {
+        memcpy (pp->xbuf,
+                &xbuf[delta],
+                xoff - delta);
+        pp->xbuf_pos = xoff - delta;
+        xoff = delta;
+      }
+
+      /* If we have nothing to do (delta == 0) and
+         not just because the value is empty (are
+         waiting for more data), go for next iteration */
+      if ( (0 == xoff) &&
+           (poff == post_data_len))
+        continue;
+
+      /* unescape */
+      xbuf[xoff] = '\0';        /* 0-terminate in preparation */
+      MHD_unescape_plus (xbuf);
+      xoff = MHD_http_unescape (xbuf);
+      /* finally: call application! */
+      pp->must_ikvi = MHD_NO;
+      if (MHD_NO == pp->ikvi (pp->cls,
+                              MHD_POSTDATA_KIND,
+                              (const char *) &pp[1],        /* key */
+                              NULL,
+                              NULL,
+                              NULL,
+                              xbuf,
+                              pp->value_offset,
+                              xoff))
+      {
+        pp->state = PP_Error;
+        return MHD_NO;
+      }
+      pp->value_offset += xoff;
+
+      /* are we done with the value? */
+      if (end_of_value_found)
+      {
+        /* we found the end of the value! */
+        if ( ('\n' == post_data[poff]) ||
+             ('\r' == post_data[poff]) )
         {
-        case PP_Error:
-          return MHD_NO;
-        case PP_Done:
-          /* did not expect to receive more data */
-          pp->state = PP_Error;
-          return MHD_NO;
-        case PP_Init:
-          equals = 0;
-          while ((equals + poff < post_data_len) &&
-                 (post_data[equals + poff] != '='))
-            equals++;
-          if (equals + pp->buffer_pos > pp->buffer_size)
-            {
-              pp->state = PP_Error;     /* out of memory */
-              return MHD_NO;
-            }
-          memcpy (&buf[pp->buffer_pos], &post_data[poff], equals);
-          pp->buffer_pos += equals;
-          if (equals + poff == post_data_len)
-            return MHD_YES;     /* no '=' yet */
-          buf[pp->buffer_pos] = '\0';   /* 0-terminate key */
-          pp->buffer_pos = 0;   /* reset for next key */
-         MHD_unescape_plus (buf);
-          MHD_http_unescape (buf);
-          poff += equals + 1;
-          pp->state = PP_ProcessValue;
-          pp->value_offset = 0;
-          break;
-        case PP_ProcessValue:
-          /* obtain rest of value from previous iteration */
-          memcpy (xbuf, pp->xbuf, pp->xbuf_pos);
-          xoff = pp->xbuf_pos;
-          pp->xbuf_pos = 0;
-
-          /* find last position in input buffer that is part of the value */
-          amper = 0;
-          while ((amper + poff < post_data_len) &&
-                 (amper < XBUF_SIZE) &&
-                 (post_data[amper + poff] != '&') &&
-                 (post_data[amper + poff] != '\n') &&
-                 (post_data[amper + poff] != '\r'))
-            amper++;
-          end_of_value_found = ((amper + poff < post_data_len) &&
-                                ((post_data[amper + poff] == '&') ||
-                                 (post_data[amper + poff] == '\n') ||
-                                 (post_data[amper + poff] == '\r')));
-          /* compute delta, the maximum number of bytes that we will be able to
-             process right now (either amper-limited of xbuf-size limited) */
-          delta = amper;
-          if (delta > XBUF_SIZE - xoff)
-            delta = XBUF_SIZE - xoff;
-
-          /* move input into processing buffer */
-          memcpy (&xbuf[xoff], &post_data[poff], delta);
-          xoff += delta;
-          poff += delta;
-
-          /* find if escape sequence is at the end of the processing buffer;
-             if so, exclude those from processing (reduce delta to point at
-             end of processed region) */
-          delta = xoff;
-          if ((delta > 0) &&
-              ('%' == xbuf[delta - 1]))
-            delta--;
-          else if ((delta > 1) &&
-                   ('%' == xbuf[delta - 2]))
-            delta -= 2;
-
-          /* if we have an incomplete escape sequence, save it to
-             pp->xbuf for later */
-          if (delta < xoff)
-            {
-              memcpy (pp->xbuf,
-                      &xbuf[delta],
-                      xoff - delta);
-              pp->xbuf_pos = xoff - delta;
-              xoff = delta;
-            }
-
-          /* If we have nothing to do (delta == 0) and
-             not just because the value is empty (are
-             waiting for more data), go for next iteration */
-          if ( (0 == xoff) &&
-               (poff == post_data_len))
-            continue;
-
-          /* unescape */
-          xbuf[xoff] = '\0';    /* 0-terminate in preparation */
-         MHD_unescape_plus (xbuf);
-          xoff = MHD_http_unescape (xbuf);
-          /* finally: call application! */
-         pp->must_ikvi = MHD_NO;
-          if (MHD_NO == pp->ikvi (pp->cls,
-                                  MHD_POSTDATA_KIND,
-                                  (const char *) &pp[1],    /* key */
-                                  NULL,
-                                  NULL,
-                                  NULL,
-                                  xbuf,
-                                  pp->value_offset,
-                                  xoff))
-            {
-              pp->state = PP_Error;
-              return MHD_NO;
-            }
-          pp->value_offset += xoff;
-
-          /* are we done with the value? */
-          if (end_of_value_found)
-            {
-              /* we found the end of the value! */
-              if ( ('\n' == post_data[poff]) ||
-                   ('\r' == post_data[poff]) )
-                {
-                  pp->state = PP_ExpectNewLine;
-                }
-              else if ('&' == post_data[poff])
-                {
-                  poff++;       /* skip '&' */
-                  pp->state = PP_Init;
-                }
-            }
-          break;
-        case PP_ExpectNewLine:
-          if ( ('\n' == post_data[poff]) ||
-               ('\r' == post_data[poff]) )
-            {
-              poff++;
-              /* we are done, report error if we receive any more... */
-              pp->state = PP_Done;
-              return MHD_YES;
-            }
-          return MHD_NO;
-        default:
-          mhd_panic (mhd_panic_cls,
-                     __FILE__,
-                     __LINE__,
-                     NULL);          /* should never happen! */
+          pp->state = PP_ExpectNewLine;
+        }
+        else if ('&' == post_data[poff])
+        {
+          poff++;               /* skip '&' */
+          pp->state = PP_Init;
         }
+      }
+      break;
+    case PP_ExpectNewLine:
+      if ( ('\n' == post_data[poff]) ||
+           ('\r' == post_data[poff]) )
+      {
+        poff++;
+        /* we are done, report error if we receive any more... */
+        pp->state = PP_Done;
+        return MHD_YES;
+      }
+      return MHD_NO;
+    default:
+      mhd_panic (mhd_panic_cls,
+                 __FILE__,
+                 __LINE__,
+                 NULL);              /* should never happen! */
     }
+  }
   return MHD_YES;
 }
 
@@ -534,16 +538,16 @@ try_match_header (const char *prefix,
   if (NULL != *suffix)
     return MHD_NO;
   while (0 != *line)
+  {
+    if (MHD_str_equal_caseless_n_ (prefix,
+                                   line,
+                                   prefix_len))
     {
-      if (MHD_str_equal_caseless_n_ (prefix,
-                                     line,
-                                     prefix_len))
-        {
-          *suffix = strdup (&line[prefix_len]);
-          return MHD_YES;
-        }
-      ++line;
+      *suffix = strdup (&line[prefix_len]);
+      return MHD_YES;
     }
+    ++line;
+  }
   return MHD_NO;
 }
 
@@ -573,40 +577,39 @@ find_boundary (struct MHD_PostProcessor *pp,
   const char *dash;
 
   if (pp->buffer_pos < 2 + blen)
-    {
-      if (pp->buffer_pos == pp->buffer_size)
-        pp->state = PP_Error;   /* out of memory */
-      /* ++(*ioffptr); */
-      return MHD_NO;            /* not enough data */
-    }
+  {
+    if (pp->buffer_pos == pp->buffer_size)
+      pp->state = PP_Error;     /* out of memory */
+    /* ++(*ioffptr); */
+    return MHD_NO;              /* not enough data */
+  }
   if ( (0 != memcmp ("--",
                      buf,
                      2)) ||
        (0 != memcmp (&buf[2],
                      boundary,
                      blen)))
+  {
+    if (pp->state != PP_Init)
     {
-      if (pp->state != PP_Init)
-        {
-          /* garbage not allowed */
-          pp->state = PP_Error;
-        }
+      /* garbage not allowed */
+      pp->state = PP_Error;
+    }
+    else
+    {
+      /* skip over garbage (RFC 2046, 5.1.1) */
+      dash = memchr (buf,
+                     '-',
+                     pp->buffer_pos);
+      if (NULL == dash)
+        (*ioffptr) += pp->buffer_pos;     /* skip entire buffer */
+      else if (dash == buf)
+        (*ioffptr)++;       /* at least skip one byte */
       else
-        {
-          /* skip over garbage (RFC 2046, 5.1.1) */
-          dash = memchr (buf,
-                         '-',
-                         pp->buffer_pos);
-          if (NULL == dash)
-            (*ioffptr) += pp->buffer_pos; /* skip entire buffer */
-          else
-            if (dash == buf)
-              (*ioffptr)++; /* at least skip one byte */
-            else
-              (*ioffptr) += dash - buf; /* skip to first possible boundary */
-        }
-      return MHD_NO;            /* expected boundary */
+        (*ioffptr) += dash - buf;       /* skip to first possible boundary */
     }
+    return MHD_NO;              /* expected boundary */
+  }
   /* remove boundary from buffer */
   (*ioffptr) += 2 + blen;
   /* next: start with headers */
@@ -625,8 +628,8 @@ find_boundary (struct MHD_PostProcessor *pp,
  */
 static void
 try_get_value (const char *buf,
-              const char *key,
-              char **destination)
+               const char *key,
+               char **destination)
 {
   const char *spos;
   const char *bpos;
@@ -639,30 +642,30 @@ try_get_value (const char *buf,
   bpos = buf;
   klen = strlen (key);
   while (NULL != (spos = strstr (bpos, key)))
+  {
+    if ( (spos[klen] != '=') ||
+         ( (spos != buf) &&
+           (spos[-1] != ' ') ) )
     {
-      if ( (spos[klen] != '=') ||
-           ( (spos != buf) &&
-             (spos[-1] != ' ') ) )
-        {
-          /* no match */
-          bpos = spos + 1;
-          continue;
-        }
-      if (spos[klen + 1] != '"')
-        return;                 /* not quoted */
-      if (NULL == (endv = strchr (&spos[klen + 2],
-                                  '\"')))
-        return;                 /* no end-quote */
-      vlen = endv - spos - klen - 1;
-      *destination = malloc (vlen);
-      if (NULL == *destination)
-        return;                 /* out of memory */
-      (*destination)[vlen - 1] = '\0';
-      memcpy (*destination,
-              &spos[klen + 2],
-              vlen - 1);
-      return;                   /* success */
+      /* no match */
+      bpos = spos + 1;
+      continue;
     }
+    if (spos[klen + 1] != '"')
+      return;                   /* not quoted */
+    if (NULL == (endv = strchr (&spos[klen + 2],
+                                '\"')))
+      return;                   /* no end-quote */
+    vlen = endv - spos - klen - 1;
+    *destination = malloc (vlen);
+    if (NULL == *destination)
+      return;                   /* out of memory */
+    (*destination)[vlen - 1] = '\0';
+    memcpy (*destination,
+            &spos[klen + 2],
+            vlen - 1);
+    return;                     /* success */
+  }
 }
 
 
@@ -695,19 +698,19 @@ process_multipart_headers (struct MHD_PostProcessor *pp,
           (buf[newline] != '\n') )
     newline++;
   if (newline == pp->buffer_size)
-    {
-      pp->state = PP_Error;
-      return MHD_NO;            /* out of memory */
-    }
+  {
+    pp->state = PP_Error;
+    return MHD_NO;              /* out of memory */
+  }
   if (newline == pp->buffer_pos)
     return MHD_NO;              /* will need more data */
   if (0 == newline)
-    {
-      /* empty line - end of headers */
-      pp->skip_rn = RN_Full;
-      pp->state = next_state;
-      return MHD_YES;
-    }
+  {
+    /* empty line - end of headers */
+    pp->skip_rn = RN_Full;
+    pp->state = next_state;
+    return MHD_YES;
+  }
   /* got an actual header */
   if (buf[newline] == '\r')
     pp->skip_rn = RN_OptN;
@@ -715,25 +718,25 @@ process_multipart_headers (struct MHD_PostProcessor *pp,
   if (MHD_str_equal_caseless_n_ ("Content-disposition: ",
                                  buf,
                                  MHD_STATICSTR_LEN_ ("Content-disposition: ")))
-    {
-      try_get_value (&buf[MHD_STATICSTR_LEN_ ("Content-disposition: ")],
-                     "name",
-                     &pp->content_name);
-      try_get_value (&buf[MHD_STATICSTR_LEN_ ("Content-disposition: ")],
-                     "filename",
-                     &pp->content_filename);
-    }
+  {
+    try_get_value (&buf[MHD_STATICSTR_LEN_ ("Content-disposition: ")],
+                   "name",
+                   &pp->content_name);
+    try_get_value (&buf[MHD_STATICSTR_LEN_ ("Content-disposition: ")],
+                   "filename",
+                   &pp->content_filename);
+  }
   else
-    {
-      try_match_header ("Content-type: ",
-                        MHD_STATICSTR_LEN_("Content-type: "),
-                        buf,
-                        &pp->content_type);
-      try_match_header ("Content-Transfer-Encoding: ",
-                        MHD_STATICSTR_LEN_("Content-Transfer-Encoding: "),
-                        buf,
-                        &pp->content_transfer_encoding);
-    }
+  {
+    try_match_header ("Content-type: ",
+                      MHD_STATICSTR_LEN_ ("Content-type: "),
+                      buf,
+                      &pp->content_type);
+    try_match_header ("Content-Transfer-Encoding: ",
+                      MHD_STATICSTR_LEN_ ("Content-Transfer-Encoding: "),
+                      buf,
+                      &pp->content_transfer_encoding);
+  }
   (*ioffptr) += newline + 1;
   return MHD_YES;
 }
@@ -771,79 +774,79 @@ process_value_to_boundary (struct MHD_PostProcessor *pp,
      (\r\n--+boundary) is part of the value */
   newline = 0;
   while (1)
+  {
+    while (newline + 4 < pp->buffer_pos)
     {
-      while (newline + 4 < pp->buffer_pos)
-        {
-          r = memchr (&buf[newline],
-                      '\r',
-                      pp->buffer_pos - newline - 4);
-          if (NULL == r)
-          {
-            newline = pp->buffer_pos - 4;
-            break;
-          }
-          newline = r - buf;
-          if (0 == memcmp ("\r\n--",
-                           &buf[newline],
-                           4))
-            break;
-          newline++;
-        }
-      if (newline + blen + 4 <= pp->buffer_pos)
-        {
-          /* can check boundary */
-          if (0 != memcmp (&buf[newline + 4],
-                           boundary,
-                           blen))
-            {
-              /* no boundary, "\r\n--" is part of content, skip */
-              newline += 4;
-              continue;
-            }
-          else
-            {
-              /* boundary found, process until newline then
-                 skip boundary and go back to init */
-              pp->skip_rn = RN_Dash;
-              pp->state = next_state;
-              pp->dash_state = next_dash_state;
-              (*ioffptr) += blen + 4;       /* skip boundary as well */
-              buf[newline] = '\0';
-              break;
-            }
-        }
+      r = memchr (&buf[newline],
+                  '\r',
+                  pp->buffer_pos - newline - 4);
+      if (NULL == r)
+      {
+        newline = pp->buffer_pos - 4;
+        break;
+      }
+      newline = r - buf;
+      if (0 == memcmp ("\r\n--",
+                       &buf[newline],
+                       4))
+        break;
+      newline++;
+    }
+    if (newline + blen + 4 <= pp->buffer_pos)
+    {
+      /* can check boundary */
+      if (0 != memcmp (&buf[newline + 4],
+                       boundary,
+                       blen))
+      {
+        /* no boundary, "\r\n--" is part of content, skip */
+        newline += 4;
+        continue;
+      }
       else
-        {
-          /* cannot check for boundary, process content that
-             we have and check again later; except, if we have
-             no content, abort (out of memory) */
-          if ( (0 == newline) &&
-               (pp->buffer_pos == pp->buffer_size) )
-            {
-              pp->state = PP_Error;
-              return MHD_NO;
-            }
-          break;
-        }
+      {
+        /* boundary found, process until newline then
+           skip boundary and go back to init */
+        pp->skip_rn = RN_Dash;
+        pp->state = next_state;
+        pp->dash_state = next_dash_state;
+        (*ioffptr) += blen + 4;             /* skip boundary as well */
+        buf[newline] = '\0';
+        break;
+      }
     }
+    else
+    {
+      /* cannot check for boundary, process content that
+         we have and check again later; except, if we have
+         no content, abort (out of memory) */
+      if ( (0 == newline) &&
+           (pp->buffer_pos == pp->buffer_size) )
+      {
+        pp->state = PP_Error;
+        return MHD_NO;
+      }
+      break;
+    }
+  }
   /* newline is either at beginning of boundary or
      at least at the last character that we are sure
      is not part of the boundary */
   if ( ( (MHD_YES == pp->must_ikvi) ||
-        (0 != newline) ) &&
+         (0 != newline) ) &&
        (MHD_NO == pp->ikvi (pp->cls,
-                           MHD_POSTDATA_KIND,
-                           pp->content_name,
-                           pp->content_filename,
-                           pp->content_type,
-                           pp->content_transfer_encoding,
-                           buf,
+                            MHD_POSTDATA_KIND,
+                            pp->content_name,
+                            pp->content_filename,
+                            pp->content_type,
+                            pp->content_transfer_encoding,
+                            buf,
                             pp->value_offset,
                             newline)) )
-    {
-      pp->state = PP_Error;
-      return MHD_NO;
-    }
+  {
+    pp->state = PP_Error;
+    return MHD_NO;
+  }
   pp->must_ikvi = MHD_NO;
   pp->value_offset += newline;
   (*ioffptr) += newline;
@@ -860,28 +863,28 @@ free_unmarked (struct MHD_PostProcessor *pp)
 {
   if ( (NULL != pp->content_name) &&
        (0 == (pp->have & NE_content_name)) )
-    {
-      free (pp->content_name);
-      pp->content_name = NULL;
-    }
+  {
+    free (pp->content_name);
+    pp->content_name = NULL;
+  }
   if ( (NULL != pp->content_type) &&
        (0 == (pp->have & NE_content_type)) )
-    {
-      free (pp->content_type);
-      pp->content_type = NULL;
-    }
+  {
+    free (pp->content_type);
+    pp->content_type = NULL;
+  }
   if ( (NULL != pp->content_filename) &&
        (0 == (pp->have & NE_content_filename)) )
-    {
-      free (pp->content_filename);
-      pp->content_filename = NULL;
-    }
+  {
+    free (pp->content_filename);
+    pp->content_filename = NULL;
+  }
   if ( (NULL != pp->content_transfer_encoding) &&
        (0 == (pp->have & NE_content_transfer_encoding)) )
-    {
-      free (pp->content_transfer_encoding);
-      pp->content_transfer_encoding = NULL;
-    }
+  {
+    free (pp->content_transfer_encoding);
+    pp->content_transfer_encoding = NULL;
+  }
 }
 
 
@@ -896,7 +899,7 @@ free_unmarked (struct MHD_PostProcessor *pp)
 static int
 post_process_multipart (struct MHD_PostProcessor *pp,
                         const char *post_data,
-                       size_t post_data_len)
+                        size_t post_data_len)
 {
   char *buf;
   size_t max;
@@ -911,294 +914,294 @@ post_process_multipart (struct MHD_PostProcessor *pp,
   while ( (poff < post_data_len) ||
           ( (pp->buffer_pos > 0) &&
             (0 != state_changed) ) )
+  {
+    /* first, move as much input data
+       as possible to our internal buffer */
+    max = pp->buffer_size - pp->buffer_pos;
+    if (max > post_data_len - poff)
+      max = post_data_len - poff;
+    memcpy (&buf[pp->buffer_pos],
+            &post_data[poff],
+            max);
+    poff += max;
+    pp->buffer_pos += max;
+    if ( (0 == max) &&
+         (0 == state_changed) &&
+         (poff < post_data_len) )
     {
-      /* first, move as much input data
-         as possible to our internal buffer */
-      max = pp->buffer_size - pp->buffer_pos;
-      if (max > post_data_len - poff)
-        max = post_data_len - poff;
-      memcpy (&buf[pp->buffer_pos],
-              &post_data[poff],
-              max);
-      poff += max;
-      pp->buffer_pos += max;
-      if ( (0 == max) &&
-           (0 == state_changed) &&
-           (poff < post_data_len) )
-        {
-          pp->state = PP_Error;
-          return MHD_NO;        /* out of memory */
-        }
-      state_changed = 0;
+      pp->state = PP_Error;
+      return MHD_NO;            /* out of memory */
+    }
+    state_changed = 0;
 
-      /* first state machine for '\r'-'\n' and '--' handling */
-      switch (pp->skip_rn)
+    /* first state machine for '\r'-'\n' and '--' handling */
+    switch (pp->skip_rn)
+    {
+    case RN_Inactive:
+      break;
+    case RN_OptN:
+      if (buf[0] == '\n')
+      {
+        ioff++;
+        pp->skip_rn = RN_Inactive;
+        goto AGAIN;
+      }
+    /* fall-through! */
+    case RN_Dash:
+      if (buf[0] == '-')
+      {
+        ioff++;
+        pp->skip_rn = RN_Dash2;
+        goto AGAIN;
+      }
+      pp->skip_rn = RN_Full;
+    /* fall-through! */
+    case RN_Full:
+      if (buf[0] == '\r')
+      {
+        if ( (pp->buffer_pos > 1) &&
+             ('\n' == buf[1]) )
         {
-        case RN_Inactive:
-          break;
-        case RN_OptN:
-          if (buf[0] == '\n')
-            {
-              ioff++;
-              pp->skip_rn = RN_Inactive;
-              goto AGAIN;
-            }
-          /* fall-through! */
-        case RN_Dash:
-          if (buf[0] == '-')
-            {
-              ioff++;
-              pp->skip_rn = RN_Dash2;
-              goto AGAIN;
-            }
-          pp->skip_rn = RN_Full;
-          /* fall-through! */
-        case RN_Full:
-          if (buf[0] == '\r')
-            {
-              if ( (pp->buffer_pos > 1) &&
-                   ('\n' == buf[1]) )
-                {
-                  pp->skip_rn = RN_Inactive;
-                  ioff += 2;
-                }
-              else
-                {
-                  pp->skip_rn = RN_OptN;
-                  ioff++;
-                }
-              goto AGAIN;
-            }
-          if (buf[0] == '\n')
-            {
-              ioff++;
-              pp->skip_rn = RN_Inactive;
-              goto AGAIN;
-            }
           pp->skip_rn = RN_Inactive;
-          pp->state = PP_Error;
-          return MHD_NO;        /* no '\r\n' */
-        case RN_Dash2:
-          if (buf[0] == '-')
-            {
-              ioff++;
-              pp->skip_rn = RN_Full;
-              pp->state = pp->dash_state;
-              goto AGAIN;
-            }
-          pp->state = PP_Error;
-          break;
+          ioff += 2;
         }
-
-      /* main state engine */
-      switch (pp->state)
+        else
         {
-        case PP_Error:
+          pp->skip_rn = RN_OptN;
+          ioff++;
+        }
+        goto AGAIN;
+      }
+      if (buf[0] == '\n')
+      {
+        ioff++;
+        pp->skip_rn = RN_Inactive;
+        goto AGAIN;
+      }
+      pp->skip_rn = RN_Inactive;
+      pp->state = PP_Error;
+      return MHD_NO;            /* no '\r\n' */
+    case RN_Dash2:
+      if (buf[0] == '-')
+      {
+        ioff++;
+        pp->skip_rn = RN_Full;
+        pp->state = pp->dash_state;
+        goto AGAIN;
+      }
+      pp->state = PP_Error;
+      break;
+    }
+
+    /* main state engine */
+    switch (pp->state)
+    {
+    case PP_Error:
+      return MHD_NO;
+    case PP_Done:
+      /* did not expect to receive more data */
+      pp->state = PP_Error;
+      return MHD_NO;
+    case PP_Init:
+      /**
+       * Per RFC2046 5.1.1 NOTE TO IMPLEMENTORS, consume anything
+       * prior to the first multipart boundary:
+       *
+       * > There appears to be room for additional information prior
+       * > to the first boundary delimiter line and following the
+       * > final boundary delimiter line.  These areas should
+       * > generally be left blank, and implementations must ignore
+       * > anything that appears before the first boundary delimiter
+       * > line or after the last one.
+       */
+      (void) find_boundary (pp,
+                            pp->boundary,
+                            pp->blen,
+                            &ioff,
+                            PP_ProcessEntryHeaders,
+                            PP_Done);
+      break;
+    case PP_NextBoundary:
+      if (MHD_NO == find_boundary (pp,
+                                   pp->boundary,
+                                   pp->blen,
+                                   &ioff,
+                                   PP_ProcessEntryHeaders,
+                                   PP_Done))
+      {
+        if (pp->state == PP_Error)
           return MHD_NO;
-        case PP_Done:
-          /* did not expect to receive more data */
+        goto END;
+      }
+      break;
+    case PP_ProcessEntryHeaders:
+      pp->must_ikvi = MHD_YES;
+      if (MHD_NO ==
+          process_multipart_headers (pp,
+                                     &ioff,
+                                     PP_PerformCheckMultipart))
+      {
+        if (pp->state == PP_Error)
+          return MHD_NO;
+        else
+          goto END;
+      }
+      state_changed = 1;
+      break;
+    case PP_PerformCheckMultipart:
+      if ( (NULL != pp->content_type) &&
+           (MHD_str_equal_caseless_n_ (pp->content_type,
+                                       "multipart/mixed",
+                                       MHD_STATICSTR_LEN_ 
("multipart/mixed"))))
+      {
+        pp->nested_boundary = strstr (pp->content_type,
+                                      "boundary=");
+        if (NULL == pp->nested_boundary)
+        {
           pp->state = PP_Error;
           return MHD_NO;
-        case PP_Init:
-          /**
-           * Per RFC2046 5.1.1 NOTE TO IMPLEMENTORS, consume anything
-           * prior to the first multipart boundary:
-           *
-           * > There appears to be room for additional information prior
-           * > to the first boundary delimiter line and following the
-           * > final boundary delimiter line.  These areas should
-           * > generally be left blank, and implementations must ignore
-           * > anything that appears before the first boundary delimiter
-           * > line or after the last one.
-           */
-          (void) find_boundary (pp,
-                               pp->boundary,
-                               pp->blen,
-                               &ioff,
-                               PP_ProcessEntryHeaders,
-                                PP_Done);
-          break;
-        case PP_NextBoundary:
-          if (MHD_NO == find_boundary (pp,
-                                       pp->boundary,
-                                       pp->blen,
-                                       &ioff,
-                                       PP_ProcessEntryHeaders,
-                                       PP_Done))
-            {
-              if (pp->state == PP_Error)
-                return MHD_NO;
-              goto END;
-            }
-          break;
-        case PP_ProcessEntryHeaders:
-         pp->must_ikvi = MHD_YES;
-          if (MHD_NO ==
-              process_multipart_headers (pp,
-                                         &ioff,
-                                         PP_PerformCheckMultipart))
-            {
-              if (pp->state == PP_Error)
-                return MHD_NO;
-              else
-                goto END;
-            }
-          state_changed = 1;
-          break;
-        case PP_PerformCheckMultipart:
-          if ( (NULL != pp->content_type) &&
-               (MHD_str_equal_caseless_n_ (pp->content_type,
-                                           "multipart/mixed",
-                                           MHD_STATICSTR_LEN_ 
("multipart/mixed"))))
-            {
-              pp->nested_boundary = strstr (pp->content_type,
-                                            "boundary=");
-              if (NULL == pp->nested_boundary)
-                {
-                  pp->state = PP_Error;
-                  return MHD_NO;
-                }
-              pp->nested_boundary =
-                strdup (&pp->nested_boundary[MHD_STATICSTR_LEN_ 
("boundary=")]);
-              if (NULL == pp->nested_boundary)
-                {
-                  /* out of memory */
-                  pp->state = PP_Error;
-                  return MHD_NO;
-                }
-              /* free old content type, we will need that field
-                 for the content type of the nested elements */
-              free (pp->content_type);
-              pp->content_type = NULL;
-              pp->nlen = strlen (pp->nested_boundary);
-              pp->state = PP_Nested_Init;
-              state_changed = 1;
-              break;
-            }
-          pp->state = PP_ProcessValueToBoundary;
-          pp->value_offset = 0;
-          state_changed = 1;
-          break;
-        case PP_ProcessValueToBoundary:
-          if (MHD_NO == process_value_to_boundary (pp,
-                                                   &ioff,
-                                                   pp->boundary,
-                                                   pp->blen,
-                                                   PP_PerformCleanup,
-                                                   PP_Done))
-            {
-              if (pp->state == PP_Error)
-                return MHD_NO;
-              break;
-            }
-          break;
-        case PP_PerformCleanup:
-          /* clean up state of one multipart form-data element! */
-          pp->have = NE_none;
-          free_unmarked (pp);
-          if (NULL != pp->nested_boundary)
-            {
-              free (pp->nested_boundary);
-              pp->nested_boundary = NULL;
-            }
-          pp->state = PP_ProcessEntryHeaders;
-          state_changed = 1;
-          break;
-        case PP_Nested_Init:
-          if (NULL == pp->nested_boundary)
-            {
-              pp->state = PP_Error;
-              return MHD_NO;
-            }
-          if (MHD_NO == find_boundary (pp,
-                                       pp->nested_boundary,
-                                       pp->nlen,
-                                       &ioff,
-                                       PP_Nested_PerformMarking,
-                                       PP_NextBoundary /* or PP_Error? */ ))
-            {
-              if (pp->state == PP_Error)
-                return MHD_NO;
-              goto END;
-            }
-          break;
-        case PP_Nested_PerformMarking:
-          /* remember what headers were given
-             globally */
-          pp->have = NE_none;
-          if (NULL != pp->content_name)
-            pp->have |= NE_content_name;
-          if (NULL != pp->content_type)
-            pp->have |= NE_content_type;
-          if (NULL != pp->content_filename)
-            pp->have |= NE_content_filename;
-          if (NULL != pp->content_transfer_encoding)
-            pp->have |= NE_content_transfer_encoding;
-          pp->state = PP_Nested_ProcessEntryHeaders;
-          state_changed = 1;
-          break;
-        case PP_Nested_ProcessEntryHeaders:
-          pp->value_offset = 0;
-          if (MHD_NO ==
-              process_multipart_headers (pp,
-                                         &ioff,
-                                         PP_Nested_ProcessValueToBoundary))
-            {
-              if (pp->state == PP_Error)
-                return MHD_NO;
-              else
-                goto END;
-            }
-          state_changed = 1;
-          break;
-        case PP_Nested_ProcessValueToBoundary:
-          if (MHD_NO == process_value_to_boundary (pp,
-                                                   &ioff,
-                                                   pp->nested_boundary,
-                                                   pp->nlen,
-                                                   PP_Nested_PerformCleanup,
-                                                   PP_NextBoundary))
-            {
-              if (pp->state == PP_Error)
-                return MHD_NO;
-              break;
-            }
-          break;
-        case PP_Nested_PerformCleanup:
-          free_unmarked (pp);
-          pp->state = PP_Nested_ProcessEntryHeaders;
-          state_changed = 1;
-          break;
-        default:
-          mhd_panic (mhd_panic_cls,
-                     __FILE__,
-                     __LINE__,
-                     NULL);          /* should never happen! */
         }
-    AGAIN:
-      if (ioff > 0)
+        pp->nested_boundary =
+          strdup (&pp->nested_boundary[MHD_STATICSTR_LEN_ ("boundary=")]);
+        if (NULL == pp->nested_boundary)
         {
-          memmove (buf,
-                   &buf[ioff],
-                   pp->buffer_pos - ioff);
-          pp->buffer_pos -= ioff;
-          ioff = 0;
-          state_changed = 1;
+          /* out of memory */
+          pp->state = PP_Error;
+          return MHD_NO;
         }
+        /* free old content type, we will need that field
+           for the content type of the nested elements */
+        free (pp->content_type);
+        pp->content_type = NULL;
+        pp->nlen = strlen (pp->nested_boundary);
+        pp->state = PP_Nested_Init;
+        state_changed = 1;
+        break;
+      }
+      pp->state = PP_ProcessValueToBoundary;
+      pp->value_offset = 0;
+      state_changed = 1;
+      break;
+    case PP_ProcessValueToBoundary:
+      if (MHD_NO == process_value_to_boundary (pp,
+                                               &ioff,
+                                               pp->boundary,
+                                               pp->blen,
+                                               PP_PerformCleanup,
+                                               PP_Done))
+      {
+        if (pp->state == PP_Error)
+          return MHD_NO;
+        break;
+      }
+      break;
+    case PP_PerformCleanup:
+      /* clean up state of one multipart form-data element! */
+      pp->have = NE_none;
+      free_unmarked (pp);
+      if (NULL != pp->nested_boundary)
+      {
+        free (pp->nested_boundary);
+        pp->nested_boundary = NULL;
+      }
+      pp->state = PP_ProcessEntryHeaders;
+      state_changed = 1;
+      break;
+    case PP_Nested_Init:
+      if (NULL == pp->nested_boundary)
+      {
+        pp->state = PP_Error;
+        return MHD_NO;
+      }
+      if (MHD_NO == find_boundary (pp,
+                                   pp->nested_boundary,
+                                   pp->nlen,
+                                   &ioff,
+                                   PP_Nested_PerformMarking,
+                                   PP_NextBoundary /* or PP_Error? */))
+      {
+        if (pp->state == PP_Error)
+          return MHD_NO;
+        goto END;
+      }
+      break;
+    case PP_Nested_PerformMarking:
+      /* remember what headers were given
+         globally */
+      pp->have = NE_none;
+      if (NULL != pp->content_name)
+        pp->have |= NE_content_name;
+      if (NULL != pp->content_type)
+        pp->have |= NE_content_type;
+      if (NULL != pp->content_filename)
+        pp->have |= NE_content_filename;
+      if (NULL != pp->content_transfer_encoding)
+        pp->have |= NE_content_transfer_encoding;
+      pp->state = PP_Nested_ProcessEntryHeaders;
+      state_changed = 1;
+      break;
+    case PP_Nested_ProcessEntryHeaders:
+      pp->value_offset = 0;
+      if (MHD_NO ==
+          process_multipart_headers (pp,
+                                     &ioff,
+                                     PP_Nested_ProcessValueToBoundary))
+      {
+        if (pp->state == PP_Error)
+          return MHD_NO;
+        else
+          goto END;
+      }
+      state_changed = 1;
+      break;
+    case PP_Nested_ProcessValueToBoundary:
+      if (MHD_NO == process_value_to_boundary (pp,
+                                               &ioff,
+                                               pp->nested_boundary,
+                                               pp->nlen,
+                                               PP_Nested_PerformCleanup,
+                                               PP_NextBoundary))
+      {
+        if (pp->state == PP_Error)
+          return MHD_NO;
+        break;
+      }
+      break;
+    case PP_Nested_PerformCleanup:
+      free_unmarked (pp);
+      pp->state = PP_Nested_ProcessEntryHeaders;
+      state_changed = 1;
+      break;
+    default:
+      mhd_panic (mhd_panic_cls,
+                 __FILE__,
+                 __LINE__,
+                 NULL);              /* should never happen! */
     }
-END:
-  if (0 != ioff)
+AGAIN:
+    if (ioff > 0)
     {
       memmove (buf,
                &buf[ioff],
                pp->buffer_pos - ioff);
       pp->buffer_pos -= ioff;
+      ioff = 0;
+      state_changed = 1;
     }
+  }
+END:
+  if (0 != ioff)
+  {
+    memmove (buf,
+             &buf[ioff],
+             pp->buffer_pos - ioff);
+    pp->buffer_pos -= ioff;
+  }
   if (poff < post_data_len)
-    {
-      pp->state = PP_Error;
-      return MHD_NO;            /* serious error */
-    }
+  {
+    pp->state = PP_Error;
+    return MHD_NO;              /* serious error */
+  }
   return MHD_YES;
 }
 
@@ -1227,13 +1230,15 @@ MHD_post_process (struct MHD_PostProcessor *pp,
     return MHD_NO;
   if (MHD_str_equal_caseless_n_ (MHD_HTTP_POST_ENCODING_FORM_URLENCODED,
                                  pp->encoding,
-                                 
MHD_STATICSTR_LEN_(MHD_HTTP_POST_ENCODING_FORM_URLENCODED)))
+                                 MHD_STATICSTR_LEN_ (
+                                   MHD_HTTP_POST_ENCODING_FORM_URLENCODED)))
     return post_process_urlencoded (pp,
                                     post_data,
                                     post_data_len);
   if (MHD_str_equal_caseless_n_ (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA,
                                  pp->encoding,
-                                 MHD_STATICSTR_LEN_ 
(MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA)))
+                                 MHD_STATICSTR_LEN_ (
+                                   MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA)))
     return post_process_multipart (pp,
                                    post_data,
                                    post_data_len);
diff --git a/src/microhttpd/reason_phrase.c b/src/microhttpd/reason_phrase.c
index d6fe8330..7891854a 100644
--- a/src/microhttpd/reason_phrase.c
+++ b/src/microhttpd/reason_phrase.c
@@ -28,7 +28,7 @@
 #include "microhttpd.h"
 
 #ifndef NULL
-#define NULL ((void*)0)
+#define NULL ((void*) 0)
 #endif
 
 static const char *const invalid_hundred[] = {
@@ -36,121 +36,121 @@ static const char *const invalid_hundred[] = {
 };
 
 static const char *const one_hundred[] = {
-  /* 100 */ "Continue"               /* RFC7231, Section 6.2.1 */,
-  /* 101 */ "Switching Protocols"    /* RFC7231, Section 6.2.2 */,
-  /* 102 */ "Processing"             /* RFC2518 */,
+  /* 100 */ "Continue" /* RFC7231, Section 6.2.1 */,
+  /* 101 */ "Switching Protocols" /* RFC7231, Section 6.2.2 */,
+  /* 102 */ "Processing" /* RFC2518 */,
   /* 103 */ "Early Hints"            /* RFC8297 */
 };
 
 static const char *const two_hundred[] = {
-  /* 200 */ "OK"                     /* RFC7231, Section 6.3.1 */,
-  /* 201 */ "Created"                /* RFC7231, Section 6.3.2 */,
-  /* 202 */ "Accepted"               /* RFC7231, Section 6.3.3 */,
+  /* 200 */ "OK" /* RFC7231, Section 6.3.1 */,
+  /* 201 */ "Created" /* RFC7231, Section 6.3.2 */,
+  /* 202 */ "Accepted" /* RFC7231, Section 6.3.3 */,
   /* 203 */ "Non-Authoritative Information" /* RFC7231, Section 6.3.4 */,
-  /* 204 */ "No Content"             /* RFC7231, Section 6.3.5 */,
-  /* 205 */ "Reset Content"          /* RFC7231, Section 6.3.6 */,
-  /* 206 */ "Partial Content"        /* RFC7233, Section 4.1 */,
-  /* 207 */ "Multi-Status"           /* RFC4918 */,
-  /* 208 */ "Already Reported"       /* RFC5842 */,
-  /* 209 */ "Unknown"                /* Not used */,
-  /* 210 */ "Unknown"                /* Not used */,
-  /* 211 */ "Unknown"                /* Not used */,
-  /* 212 */ "Unknown"                /* Not used */,
-  /* 213 */ "Unknown"                /* Not used */,
-  /* 214 */ "Unknown"                /* Not used */,
-  /* 215 */ "Unknown"                /* Not used */,
-  /* 216 */ "Unknown"                /* Not used */,
-  /* 217 */ "Unknown"                /* Not used */,
-  /* 218 */ "Unknown"                /* Not used */,
-  /* 219 */ "Unknown"                /* Not used */,
-  /* 220 */ "Unknown"                /* Not used */,
-  /* 221 */ "Unknown"                /* Not used */,
-  /* 222 */ "Unknown"                /* Not used */,
-  /* 223 */ "Unknown"                /* Not used */,
-  /* 224 */ "Unknown"                /* Not used */,
-  /* 225 */ "Unknown"                /* Not used */,
+  /* 204 */ "No Content" /* RFC7231, Section 6.3.5 */,
+  /* 205 */ "Reset Content" /* RFC7231, Section 6.3.6 */,
+  /* 206 */ "Partial Content" /* RFC7233, Section 4.1 */,
+  /* 207 */ "Multi-Status" /* RFC4918 */,
+  /* 208 */ "Already Reported" /* RFC5842 */,
+  /* 209 */ "Unknown" /* Not used */,
+  /* 210 */ "Unknown" /* Not used */,
+  /* 211 */ "Unknown" /* Not used */,
+  /* 212 */ "Unknown" /* Not used */,
+  /* 213 */ "Unknown" /* Not used */,
+  /* 214 */ "Unknown" /* Not used */,
+  /* 215 */ "Unknown" /* Not used */,
+  /* 216 */ "Unknown" /* Not used */,
+  /* 217 */ "Unknown" /* Not used */,
+  /* 218 */ "Unknown" /* Not used */,
+  /* 219 */ "Unknown" /* Not used */,
+  /* 220 */ "Unknown" /* Not used */,
+  /* 221 */ "Unknown" /* Not used */,
+  /* 222 */ "Unknown" /* Not used */,
+  /* 223 */ "Unknown" /* Not used */,
+  /* 224 */ "Unknown" /* Not used */,
+  /* 225 */ "Unknown" /* Not used */,
   /* 226 */ "IM Used"                /* RFC3229 */
 };
 
 static const char *const three_hundred[] = {
-  /* 300 */ "Multiple Choices"       /* RFC7231, Section 6.4.1 */,
-  /* 301 */ "Moved Permanently"      /* RFC7231, Section 6.4.2 */,
-  /* 302 */ "Found"                  /* RFC7231, Section 6.4.3 */,
-  /* 303 */ "See Other"              /* RFC7231, Section 6.4.4 */,
-  /* 304 */ "Not Modified"           /* RFC7232, Section 4.1 */,
-  /* 305 */ "Use Proxy"              /* RFC7231, Section 6.4.5 */,
-  /* 306 */ "Switch Proxy"           /* Not used! RFC7231, Section 6.4.6 */,
-  /* 307 */ "Temporary Redirect"     /* RFC7231, Section 6.4.7 */,
+  /* 300 */ "Multiple Choices" /* RFC7231, Section 6.4.1 */,
+  /* 301 */ "Moved Permanently" /* RFC7231, Section 6.4.2 */,
+  /* 302 */ "Found" /* RFC7231, Section 6.4.3 */,
+  /* 303 */ "See Other" /* RFC7231, Section 6.4.4 */,
+  /* 304 */ "Not Modified" /* RFC7232, Section 4.1 */,
+  /* 305 */ "Use Proxy" /* RFC7231, Section 6.4.5 */,
+  /* 306 */ "Switch Proxy" /* Not used! RFC7231, Section 6.4.6 */,
+  /* 307 */ "Temporary Redirect" /* RFC7231, Section 6.4.7 */,
   /* 308 */ "Permanent Redirect"     /* RFC7538 */
 };
 
 static const char *const four_hundred[] = {
-  /* 400 */ "Bad Request"            /* RFC7231, Section 6.5.1 */,
-  /* 401 */ "Unauthorized"           /* RFC7235, Section 3.1 */,
-  /* 402 */ "Payment Required"       /* RFC7231, Section 6.5.2 */,
-  /* 403 */ "Forbidden"              /* RFC7231, Section 6.5.3 */,
-  /* 404 */ "Not Found"              /* RFC7231, Section 6.5.4 */,
-  /* 405 */ "Method Not Allowed"     /* RFC7231, Section 6.5.5 */,
-  /* 406 */ "Not Acceptable"         /* RFC7231, Section 6.5.6 */,
+  /* 400 */ "Bad Request" /* RFC7231, Section 6.5.1 */,
+  /* 401 */ "Unauthorized" /* RFC7235, Section 3.1 */,
+  /* 402 */ "Payment Required" /* RFC7231, Section 6.5.2 */,
+  /* 403 */ "Forbidden" /* RFC7231, Section 6.5.3 */,
+  /* 404 */ "Not Found" /* RFC7231, Section 6.5.4 */,
+  /* 405 */ "Method Not Allowed" /* RFC7231, Section 6.5.5 */,
+  /* 406 */ "Not Acceptable" /* RFC7231, Section 6.5.6 */,
   /* 407 */ "Proxy Authentication Required" /* RFC7235, Section 3.2 */,
-  /* 408 */ "Request Timeout"        /* RFC7231, Section 6.5.7 */,
-  /* 409 */ "Conflict"               /* RFC7231, Section 6.5.8 */,
-  /* 410 */ "Gone"                   /* RFC7231, Section 6.5.9 */,
-  /* 411 */ "Length Required"        /* RFC7231, Section 6.5.10 */,
-  /* 412 */ "Precondition Failed"    /* RFC7232, Section 4.2; RFC8144, Section 
3.2 */,
-  /* 413 */ "Payload Too Large"      /* RFC7231, Section 6.5.11 */,
-  /* 414 */ "URI Too Long"           /* RFC7231, Section 6.5.12 */,
+  /* 408 */ "Request Timeout" /* RFC7231, Section 6.5.7 */,
+  /* 409 */ "Conflict" /* RFC7231, Section 6.5.8 */,
+  /* 410 */ "Gone" /* RFC7231, Section 6.5.9 */,
+  /* 411 */ "Length Required" /* RFC7231, Section 6.5.10 */,
+  /* 412 */ "Precondition Failed" /* RFC7232, Section 4.2; RFC8144, Section 
3.2 */,
+  /* 413 */ "Payload Too Large" /* RFC7231, Section 6.5.11 */,
+  /* 414 */ "URI Too Long" /* RFC7231, Section 6.5.12 */,
   /* 415 */ "Unsupported Media Type" /* RFC7231, Section 6.5.13; RFC7694, 
Section 3 */,
-  /* 416 */ "Range Not Satisfiable"  /* RFC7233, Section 4.4 */,
-  /* 417 */ "Expectation Failed"     /* RFC7231, Section 6.5.14 */,
-  /* 418 */ "Unknown"                /* Not used */,
-  /* 419 */ "Unknown"                /* Not used */,
-  /* 420 */ "Unknown"                /* Not used */,
-  /* 421 */ "Misdirected Request"    /* RFC7540, Section 9.1.2 */,
-  /* 422 */ "Unprocessable Entity"   /* RFC4918 */,
-  /* 423 */ "Locked"                 /* RFC4918 */,
-  /* 424 */ "Failed Dependency"      /* RFC4918 */,
-  /* 425 */ "Too Early"              /* RFC8470 */,
-  /* 426 */ "Upgrade Required"       /* RFC7231, Section 6.5.15 */,
-  /* 427 */ "Unknown"                /* Not used */,
-  /* 428 */ "Precondition Required"  /* RFC6585 */,
-  /* 429 */ "Too Many Requests"      /* RFC6585 */,
-  /* 430 */ "Unknown"                /* Not used */,
+  /* 416 */ "Range Not Satisfiable" /* RFC7233, Section 4.4 */,
+  /* 417 */ "Expectation Failed" /* RFC7231, Section 6.5.14 */,
+  /* 418 */ "Unknown" /* Not used */,
+  /* 419 */ "Unknown" /* Not used */,
+  /* 420 */ "Unknown" /* Not used */,
+  /* 421 */ "Misdirected Request" /* RFC7540, Section 9.1.2 */,
+  /* 422 */ "Unprocessable Entity" /* RFC4918 */,
+  /* 423 */ "Locked" /* RFC4918 */,
+  /* 424 */ "Failed Dependency" /* RFC4918 */,
+  /* 425 */ "Too Early" /* RFC8470 */,
+  /* 426 */ "Upgrade Required" /* RFC7231, Section 6.5.15 */,
+  /* 427 */ "Unknown" /* Not used */,
+  /* 428 */ "Precondition Required" /* RFC6585 */,
+  /* 429 */ "Too Many Requests" /* RFC6585 */,
+  /* 430 */ "Unknown" /* Not used */,
   /* 431 */ "Request Header Fields Too Large" /* RFC6585 */,
-  /* 432 */ "Unknown"                /* Not used */,
-  /* 433 */ "Unknown"                /* Not used */,
-  /* 434 */ "Unknown"                /* Not used */,
-  /* 435 */ "Unknown"                /* Not used */,
-  /* 436 */ "Unknown"                /* Not used */,
-  /* 437 */ "Unknown"                /* Not used */,
-  /* 438 */ "Unknown"                /* Not used */,
-  /* 439 */ "Unknown"                /* Not used */,
-  /* 440 */ "Unknown"                /* Not used */,
-  /* 441 */ "Unknown"                /* Not used */,
-  /* 442 */ "Unknown"                /* Not used */,
-  /* 443 */ "Unknown"                /* Not used */,
-  /* 444 */ "Unknown"                /* Not used */,
-  /* 445 */ "Unknown"                /* Not used */,
-  /* 446 */ "Unknown"                /* Not used */,
-  /* 447 */ "Unknown"                /* Not used */,
-  /* 448 */ "Unknown"                /* Not used */,
-  /* 449 */ "Reply With"             /* MS IIS extension */,
+  /* 432 */ "Unknown" /* Not used */,
+  /* 433 */ "Unknown" /* Not used */,
+  /* 434 */ "Unknown" /* Not used */,
+  /* 435 */ "Unknown" /* Not used */,
+  /* 436 */ "Unknown" /* Not used */,
+  /* 437 */ "Unknown" /* Not used */,
+  /* 438 */ "Unknown" /* Not used */,
+  /* 439 */ "Unknown" /* Not used */,
+  /* 440 */ "Unknown" /* Not used */,
+  /* 441 */ "Unknown" /* Not used */,
+  /* 442 */ "Unknown" /* Not used */,
+  /* 443 */ "Unknown" /* Not used */,
+  /* 444 */ "Unknown" /* Not used */,
+  /* 445 */ "Unknown" /* Not used */,
+  /* 446 */ "Unknown" /* Not used */,
+  /* 447 */ "Unknown" /* Not used */,
+  /* 448 */ "Unknown" /* Not used */,
+  /* 449 */ "Reply With" /* MS IIS extension */,
   /* 450 */ "Blocked by Windows Parental Controls" /* MS extension */,
   /* 451 */ "Unavailable For Legal Reasons" /* RFC7725 */
 };
 
 static const char *const five_hundred[] = {
-  /* 500 */ "Internal Server Error"  /* RFC7231, Section 6.6.1 */,
-  /* 501 */ "Not Implemented"        /* RFC7231, Section 6.6.2 */,
-  /* 502 */ "Bad Gateway"            /* RFC7231, Section 6.6.3 */,
-  /* 503 */ "Service Unavailable"    /* RFC7231, Section 6.6.4 */,
-  /* 504 */ "Gateway Timeout"        /* RFC7231, Section 6.6.5 */,
+  /* 500 */ "Internal Server Error" /* RFC7231, Section 6.6.1 */,
+  /* 501 */ "Not Implemented" /* RFC7231, Section 6.6.2 */,
+  /* 502 */ "Bad Gateway" /* RFC7231, Section 6.6.3 */,
+  /* 503 */ "Service Unavailable" /* RFC7231, Section 6.6.4 */,
+  /* 504 */ "Gateway Timeout" /* RFC7231, Section 6.6.5 */,
   /* 505 */ "HTTP Version Not Supported" /* RFC7231, Section 6.6.6 */,
   /* 506 */ "Variant Also Negotiates" /* RFC2295 */,
-  /* 507 */ "Insufficient Storage"   /* RFC4918 */,
-  /* 508 */ "Loop Detected"          /* RFC5842 */,
+  /* 507 */ "Insufficient Storage" /* RFC4918 */,
+  /* 508 */ "Loop Detected" /* RFC5842 */,
   /* 509 */ "Bandwidth Limit Exceeded" /* Apache extension */,
-  /* 510 */ "Not Extended"           /* RFC2774 */,
+  /* 510 */ "Not Extended" /* RFC2774 */,
   /* 511 */ "Network Authentication Required" /* RFC6585 */
 };
 
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 65ea7b09..112a622a 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -101,17 +101,17 @@ add_response_entry (struct MHD_Response *response,
   if (NULL == (hdr = malloc (sizeof (struct MHD_HTTP_Header))))
     return MHD_NO;
   if (NULL == (hdr->header = strdup (header)))
-    {
-      free (hdr);
-      return MHD_NO;
-    }
+  {
+    free (hdr);
+    return MHD_NO;
+  }
   hdr->header_size = strlen (header);
   if (NULL == (hdr->value = strdup (content)))
-    {
-      free (hdr->header);
-      free (hdr);
-      return MHD_NO;
-    }
+  {
+    free (hdr->header);
+    free (hdr);
+    return MHD_NO;
+  }
   hdr->value_size = strlen (content);
   hdr->kind = kind;
   hdr->next = response->first_header;
@@ -140,25 +140,25 @@ MHD_add_response_header (struct MHD_Response *response,
                                    "identity")) &&
        (! MHD_str_equal_caseless_ (content,
                                    "chunked")) )
-    {
-      /* Setting transfer encodings other than "identity" or
-         "chunked" is not allowed.  Note that MHD will set the
-         correct transfer encoding if required automatically. */
-      /* NOTE: for compressed bodies, use the "Content-encoding" header */
-      return MHD_NO;
-    }
+  {
+    /* Setting transfer encodings other than "identity" or
+       "chunked" is not allowed.  Note that MHD will set the
+       correct transfer encoding if required automatically. */
+    /* NOTE: for compressed bodies, use the "Content-encoding" header */
+    return MHD_NO;
+  }
   if (MHD_str_equal_caseless_ (header,
                                MHD_HTTP_HEADER_CONTENT_LENGTH))
-    {
-      /* MHD will set Content-length if allowed and possible,
-         reject attempt by application */
-      return MHD_NO;
-    }
+  {
+    /* MHD will set Content-length if allowed and possible,
+       reject attempt by application */
+    return MHD_NO;
+  }
 
   return add_response_entry (response,
-                            MHD_HEADER_KIND,
-                            header,
-                            content);
+                             MHD_HEADER_KIND,
+                             header,
+                             content);
 }
 
 
@@ -177,9 +177,9 @@ MHD_add_response_footer (struct MHD_Response *response,
                          const char *content)
 {
   return add_response_entry (response,
-                            MHD_FOOTER_KIND,
-                            footer,
-                            content);
+                             MHD_FOOTER_KIND,
+                             footer,
+                             content);
 }
 
 
@@ -203,35 +203,35 @@ MHD_del_response_header (struct MHD_Response *response,
   size_t content_len;
 
   if ( (NULL == header) ||
-  (NULL == content) )
+       (NULL == content) )
     return MHD_NO;
   header_len = strlen (header);
   content_len = strlen (content);
   prev = NULL;
   pos = response->first_header;
   while (NULL != pos)
+  {
+    if ((header_len == pos->header_size) &&
+        (content_len == pos->value_size) &&
+        (0 == memcmp (header,
+                      pos->header,
+                      header_len)) &&
+        (0 == memcmp (content,
+                      pos->value,
+                      content_len)))
     {
-      if ((header_len == pos->header_size) &&
-          (content_len == pos->value_size) &&
-          (0 == memcmp (header,
-                        pos->header,
-                        header_len)) &&
-          (0 == memcmp (content,
-                        pos->value,
-                        content_len)))
-        {
-          free (pos->header);
-          free (pos->value);
-          if (NULL == prev)
-            response->first_header = pos->next;
-          else
-            prev->next = pos->next;
-          free (pos);
-          return MHD_YES;
-        }
-      prev = pos;
-      pos = pos->next;
+      free (pos->header);
+      free (pos->value);
+      if (NULL == prev)
+        response->first_header = pos->next;
+      else
+        prev->next = pos->next;
+      free (pos);
+      return MHD_YES;
     }
+    prev = pos;
+    pos = pos->next;
+  }
   return MHD_NO;
 }
 
@@ -257,15 +257,15 @@ MHD_get_response_headers (struct MHD_Response *response,
   for (pos = response->first_header;
        NULL != pos;
        pos = pos->next)
-    {
-      numHeaders++;
-      if ((NULL != iterator) &&
-          (MHD_YES != iterator (iterator_cls,
-                                pos->kind,
-                                pos->header,
-                                pos->value)))
-        break;
-    }
+  {
+    numHeaders++;
+    if ((NULL != iterator) &&
+        (MHD_YES != iterator (iterator_cls,
+                              pos->kind,
+                              pos->header,
+                              pos->value)))
+      break;
+  }
   return numHeaders;
 }
 
@@ -292,11 +292,11 @@ MHD_get_response_header (struct MHD_Response *response,
   for (pos = response->first_header;
        NULL != pos;
        pos = pos->next)
-    {
-      if ((pos->header_size == key_size) &&
-          (MHD_str_equal_caseless_bin_n_ (pos->header, key, pos->header_size)))
-        return pos->value;
-    }
+  {
+    if ((pos->header_size == key_size) &&
+        (MHD_str_equal_caseless_bin_n_ (pos->header, key, pos->header_size)))
+      return pos->value;
+  }
   return NULL;
 }
 
@@ -333,22 +333,22 @@ MHD_check_response_header_token_ci (const struct 
MHD_Response *response,
     return false;
 
   /* Token must not contain binary zero! */
-  mhd_assert(strlen(token) == token_len);
+  mhd_assert (strlen (token) == token_len);
 
   for (pos = response->first_header;
        NULL != pos;
        pos = pos->next)
-    {
-      if ( (pos->kind == MHD_HEADER_KIND) &&
-           (key_len == pos->header_size) &&
-           MHD_str_equal_caseless_bin_n_ (pos->header,
-                                          key,
-                                          key_len) &&
-           MHD_str_has_token_caseless_ (pos->value,
-                                        token,
-                                        token_len) )
-        return true;
-    }
+  {
+    if ( (pos->kind == MHD_HEADER_KIND) &&
+         (key_len == pos->header_size) &&
+         MHD_str_equal_caseless_bin_n_ (pos->header,
+                                        key,
+                                        key_len) &&
+         MHD_str_has_token_caseless_ (pos->value,
+                                      token,
+                                      token_len) )
+      return true;
+  }
   return false;
 }
 
@@ -380,7 +380,8 @@ MHD_create_response_from_callback (uint64_t size,
 
   if ((NULL == crc) || (0 == block_size))
     return NULL;
-  if (NULL == (response = MHD_calloc_ (1, sizeof (struct MHD_Response) + 
block_size)))
+  if (NULL == (response = MHD_calloc_ (1, sizeof (struct MHD_Response)
+                                       + block_size)))
     return NULL;
   response->fd = -1;
   response->data = (void *) &response[1];
@@ -452,28 +453,28 @@ file_reader (void *cls,
              size_t max)
 {
   struct MHD_Response *response = cls;
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
   ssize_t n;
 #else  /* _WIN32 && !__CYGWIN__ */
   const HANDLE fh = (HANDLE) _get_osfhandle (response->fd);
 #endif /* _WIN32 && !__CYGWIN__ */
-  const int64_t offset64 = (int64_t)(pos + response->fd_off);
+  const int64_t offset64 = (int64_t) (pos + response->fd_off);
 
   if (offset64 < 0)
     return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is 
not possible */
 
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if ! defined(_WIN32) || defined(__CYGWIN__)
   if (max > SSIZE_MAX)
     max = SSIZE_MAX; /* Clamp to maximum return value. */
 
 #if defined(HAVE_PREAD64)
-  n = pread64(response->fd, buf, max, offset64);
+  n = pread64 (response->fd, buf, max, offset64);
 #elif defined(HAVE_PREAD)
   if ( (sizeof(off_t) < sizeof (uint64_t)) &&
-       (offset64 > (uint64_t)INT32_MAX) )
+       (offset64 > (uint64_t) INT32_MAX) )
     return MHD_CONTENT_READER_END_WITH_ERROR; /* Read at required position is 
not possible. */
 
-  n = pread(response->fd, buf, max, (off_t) offset64);
+  n = pread (response->fd, buf, max, (off_t) offset64);
 #else  /* ! HAVE_PREAD */
 #if defined(HAVE_LSEEK64)
   if (lseek64 (response->fd,
@@ -482,7 +483,7 @@ file_reader (void *cls,
     return MHD_CONTENT_READER_END_WITH_ERROR; /* can't seek to required 
position */
 #else  /* ! HAVE_LSEEK64 */
   if ( (sizeof(off_t) < sizeof (uint64_t)) &&
-       (offset64 > (uint64_t)INT32_MAX) )
+       (offset64 > (uint64_t) INT32_MAX) )
     return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is 
not possible */
 
   if (lseek (response->fd,
@@ -504,21 +505,21 @@ file_reader (void *cls,
   if (INVALID_HANDLE_VALUE == fh)
     return MHD_CONTENT_READER_END_WITH_ERROR; /* Value of 'response->fd' is 
not valid. */
   else
-    {
-      OVERLAPPED f_ol = {0, 0, {{0, 0}}, 0}; /* Initialize to zero. */
-      ULARGE_INTEGER pos_uli;
-      DWORD toRead = (max > INT32_MAX) ? INT32_MAX : (DWORD) max;
-      DWORD resRead;
-
-      pos_uli.QuadPart = (uint64_t) offset64; /* Simple transformation 64bit 
-> 2x32bit. */
-      f_ol.Offset = pos_uli.LowPart;
-      f_ol.OffsetHigh = pos_uli.HighPart;
-      if (! ReadFile(fh, (void*)buf, toRead, &resRead, &f_ol))
-        return MHD_CONTENT_READER_END_WITH_ERROR; /* Read error. */
-      if (0 == resRead)
-        return MHD_CONTENT_READER_END_OF_STREAM;
-      return (ssize_t) resRead;
-    }
+  {
+    OVERLAPPED f_ol = {0, 0, {{0, 0}}, 0};   /* Initialize to zero. */
+    ULARGE_INTEGER pos_uli;
+    DWORD toRead = (max > INT32_MAX) ? INT32_MAX : (DWORD) max;
+    DWORD resRead;
+
+    pos_uli.QuadPart = (uint64_t) offset64;   /* Simple transformation 64bit 
-> 2x32bit. */
+    f_ol.Offset = pos_uli.LowPart;
+    f_ol.OffsetHigh = pos_uli.HighPart;
+    if (! ReadFile (fh, (void*) buf, toRead, &resRead, &f_ol))
+      return MHD_CONTENT_READER_END_WITH_ERROR;   /* Read error. */
+    if (0 == resRead)
+      return MHD_CONTENT_READER_END_OF_STREAM;
+    return (ssize_t) resRead;
+  }
 #endif /* _WIN32 && !__CYGWIN__ */
 }
 
@@ -590,16 +591,16 @@ MHD_create_response_from_fd_at_offset64 (uint64_t size,
 {
   struct MHD_Response *response;
 
-#if !defined(HAVE___LSEEKI64) && !defined(HAVE_LSEEK64)
+#if ! defined(HAVE___LSEEKI64) && ! defined(HAVE_LSEEK64)
   if ( (sizeof(uint64_t) > sizeof(off_t)) &&
-       ( (size > (uint64_t)INT32_MAX) ||
-         (offset > (uint64_t)INT32_MAX) ||
-         ((size + offset) >= (uint64_t)INT32_MAX) ) )
+       ( (size > (uint64_t) INT32_MAX) ||
+         (offset > (uint64_t) INT32_MAX) ||
+         ((size + offset) >= (uint64_t) INT32_MAX) ) )
     return NULL;
 #endif
-  if ( ((int64_t)size < 0) ||
-       ((int64_t)offset < 0) ||
-       ((int64_t)(size + offset) < 0) )
+  if ( ((int64_t) size < 0) ||
+       ((int64_t) offset < 0) ||
+       ((int64_t) (size + offset) < 0) )
     return NULL;
 
   response = MHD_create_response_from_callback (size,
@@ -688,30 +689,30 @@ MHD_create_response_from_data (size_t size,
   response->fd = -1;
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   if (! MHD_mutex_init_ (&response->mutex))
-    {
-      free (response);
-      return NULL;
-    }
+  {
+    free (response);
+    return NULL;
+  }
 #endif
   if ((must_copy) && (size > 0))
+  {
+    if (NULL == (tmp = malloc (size)))
     {
-      if (NULL == (tmp = malloc (size)))
-        {
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-          MHD_mutex_destroy_chk_ (&response->mutex);
+      MHD_mutex_destroy_chk_ (&response->mutex);
 #endif
-          free (response);
-          return NULL;
-        }
-      memcpy (tmp, data, size);
-      must_free = MHD_YES;
-      data = tmp;
+      free (response);
+      return NULL;
     }
+    memcpy (tmp, data, size);
+    must_free = MHD_YES;
+    data = tmp;
+  }
   if (must_free)
-    {
-      response->crfc = &free;
-      response->crc_cls = data;
-    }
+  {
+    response->crfc = &free;
+    response->crc_cls = data;
+  }
   response->reference_count = 1;
   response->total_size = size;
   response->data = data;
@@ -736,9 +737,9 @@ MHD_create_response_from_buffer (size_t size,
                                  enum MHD_ResponseMemoryMode mode)
 {
   return MHD_create_response_from_data (size,
-                                       buffer,
-                                       mode == MHD_RESPMEM_MUST_FREE,
-                                       mode == MHD_RESPMEM_MUST_COPY);
+                                        buffer,
+                                        mode == MHD_RESPMEM_MUST_FREE,
+                                        mode == MHD_RESPMEM_MUST_COPY);
 }
 
 
@@ -755,7 +756,8 @@ MHD_create_response_from_buffer (size_t size,
 _MHD_EXTERN struct MHD_Response *
 MHD_create_response_from_buffer_with_free_callback (size_t size,
                                                     void *buffer,
-                                                    
MHD_ContentReaderFreeCallback crfc)
+                                                    
MHD_ContentReaderFreeCallback
+                                                    crfc)
 {
   struct MHD_Response *r;
 
@@ -811,12 +813,12 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
     /* transition to special 'closed' state for start of cleanup */
 #ifdef HTTPS_SUPPORT
     if (0 != (daemon->options & MHD_USE_TLS) )
-      {
-        /* signal that app is done by shutdown() of 'app' socket */
-        /* Application will not use anyway this socket after this command. */
-        shutdown (urh->app.socket,
-                  SHUT_RDWR);
-      }
+    {
+      /* signal that app is done by shutdown() of 'app' socket */
+      /* Application will not use anyway this socket after this command. */
+      shutdown (urh->app.socket,
+                SHUT_RDWR);
+    }
 #endif /* HTTPS_SUPPORT */
     mhd_assert (MHD_CONNECTION_UPGRADE == connection->state);
     urh->was_closed = true;
@@ -830,42 +832,42 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
       return MHD_YES;
 #ifdef HTTPS_SUPPORT
     if (0 != (daemon->options & MHD_USE_TLS) )
-      {
-        gnutls_record_cork (connection->tls_session);
-        connection->sk_cork_on = true;
-        return MHD_YES;
-      }
+    {
+      gnutls_record_cork (connection->tls_session);
+      connection->sk_cork_on = true;
+      return MHD_YES;
+    }
     else
 #else
-      {
-        if (0 ==
-            MHD_socket_cork_ (connection->socket_fd,
-                              true))
-          connection->sk_cork_on = true;
-      }
+    {
+      if (0 ==
+          MHD_socket_cork_ (connection->socket_fd,
+                            true))
+        connection->sk_cork_on = true;
+    }
 #endif
-  case MHD_UPGRADE_ACTION_CORK_OFF:
-    if (! connection->sk_cork_on)
-      return MHD_YES;
+    case MHD_UPGRADE_ACTION_CORK_OFF:
+      if (! connection->sk_cork_on)
+        return MHD_YES;
 #ifdef HTTPS_SUPPORT
     if (0 != (daemon->options & MHD_USE_TLS) )
-      {
-        gnutls_record_uncork (connection->tls_session, 0);
-        connection->sk_cork_on = false;
-        return MHD_YES;
-      }
+    {
+      gnutls_record_uncork (connection->tls_session, 0);
+      connection->sk_cork_on = false;
+      return MHD_YES;
+    }
     else
 #else
-      {
-        if (0 ==
-            MHD_socket_cork_ (connection->socket_fd,
-                              false))
-          connection->sk_cork_on = false;
-      }
+    {
+      if (0 ==
+          MHD_socket_cork_ (connection->socket_fd,
+                            false))
+        connection->sk_cork_on = false;
+    }
 #endif
-  default:
-    /* we don't understand this one */
-    return MHD_NO;
+    default:
+      /* we don't understand this one */
+      return MHD_NO;
   }
 }
 
@@ -897,13 +899,14 @@ MHD_response_execute_upgrade_ (struct MHD_Response 
*response,
   if (NULL ==
       MHD_get_response_header (response,
                                MHD_HTTP_HEADER_UPGRADE))
-    {
+  {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _("Invalid response for upgrade: application failed to set the 
'Upgrade' header!\n"));
+    MHD_DLOG (daemon,
+              _ (
+                "Invalid response for upgrade: application failed to set the 
'Upgrade' header!\n"));
 #endif
-      return MHD_NO;
-    }
+    return MHD_NO;
+  }
 
   urh = MHD_calloc_ (1, sizeof (struct MHD_UpgradeResponseHandle));
   if (NULL == urh)
@@ -918,77 +921,77 @@ MHD_response_execute_upgrade_ (struct MHD_Response 
*response,
     size_t avail;
     char *buf;
     MHD_socket sv[2];
-#if defined(MHD_socket_nosignal_) || !defined(MHD_socket_pair_nblk_)
+#if defined(MHD_socket_nosignal_) || ! defined(MHD_socket_pair_nblk_)
     int res1;
     int res2;
 #endif /* MHD_socket_nosignal_ || !MHD_socket_pair_nblk_ */
 
 #ifdef MHD_socket_pair_nblk_
     if (! MHD_socket_pair_nblk_ (sv))
-      {
-        free (urh);
-        return MHD_NO;
-      }
+    {
+      free (urh);
+      return MHD_NO;
+    }
 #else  /* !MHD_socket_pair_nblk_ */
     if (! MHD_socket_pair_ (sv))
-      {
-        free (urh);
-        return MHD_NO;
-      }
-    res1 = MHD_socket_nonblocking_(sv[0]);
-    res2 = MHD_socket_nonblocking_(sv[1]);
+    {
+      free (urh);
+      return MHD_NO;
+    }
+    res1 = MHD_socket_nonblocking_ (sv[0]);
+    res2 = MHD_socket_nonblocking_ (sv[1]);
     if ( (! res1) || (! res2) )
-      {
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (daemon,
-                 _("Failed to make loopback sockets non-blocking.\n"));
+      MHD_DLOG (daemon,
+                _ ("Failed to make loopback sockets non-blocking.\n"));
 #endif
-        if (! res2)
-          {
-            /* Socketpair cannot be used. */
-            MHD_socket_close_chk_ (sv[0]);
-            MHD_socket_close_chk_ (sv[1]);
-            free (urh);
-            return MHD_NO;
-          }
+      if (! res2)
+      {
+        /* Socketpair cannot be used. */
+        MHD_socket_close_chk_ (sv[0]);
+        MHD_socket_close_chk_ (sv[1]);
+        free (urh);
+        return MHD_NO;
       }
+    }
 #endif /* !MHD_socket_pair_nblk_ */
 #ifdef MHD_socket_nosignal_
-    res1 = MHD_socket_nosignal_(sv[0]);
-    res2 = MHD_socket_nosignal_(sv[1]);
+    res1 = MHD_socket_nosignal_ (sv[0]);
+    res2 = MHD_socket_nosignal_ (sv[1]);
     if ( (! res1) || (! res2) )
-      {
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (daemon,
-                  _("Failed to set SO_NOSIGPIPE on loopback sockets.\n"));
+      MHD_DLOG (daemon,
+                _ ("Failed to set SO_NOSIGPIPE on loopback sockets.\n"));
 #endif
 #ifndef MSG_NOSIGNAL
-        if (!res2)
-          {
-            /* Socketpair cannot be used. */
-            MHD_socket_close_chk_ (sv[0]);
-            MHD_socket_close_chk_ (sv[1]);
-            free (urh);
-            return MHD_NO;
-          }
-#endif /* ! MSG_NOSIGNAL */
+      if (! res2)
+      {
+        /* Socketpair cannot be used. */
+        MHD_socket_close_chk_ (sv[0]);
+        MHD_socket_close_chk_ (sv[1]);
+        free (urh);
+        return MHD_NO;
       }
+#endif /* ! MSG_NOSIGNAL */
+    }
 #endif /* MHD_socket_nosignal_ */
     if ( (! MHD_SCKT_FD_FITS_FDSET_ (sv[1],
                                      NULL)) &&
          (0 == (daemon->options & (MHD_USE_POLL | MHD_USE_EPOLL))) )
-      {
+    {
 #ifdef HAVE_MESSAGES
-        MHD_DLOG (daemon,
-                  _("Socketpair descriptor larger than FD_SETSIZE: %d > %d\n"),
-                  (int) sv[1],
-                  (int) FD_SETSIZE);
+      MHD_DLOG (daemon,
+                _ ("Socketpair descriptor larger than FD_SETSIZE: %d > %d\n"),
+                (int) sv[1],
+                (int) FD_SETSIZE);
 #endif
-        MHD_socket_close_chk_ (sv[0]);
-        MHD_socket_close_chk_ (sv[1]);
-        free (urh);
-        return MHD_NO;
-      }
+      MHD_socket_close_chk_ (sv[0]);
+      MHD_socket_close_chk_ (sv[1]);
+      free (urh);
+      return MHD_NO;
+    }
     urh->app.socket = sv[0];
     urh->app.urh = urh;
     urh->app.celi = MHD_EPOLL_STATE_UNREADY;
@@ -998,22 +1001,22 @@ MHD_response_execute_upgrade_ (struct MHD_Response 
*response,
     pool = connection->pool;
     avail = MHD_pool_get_free (pool);
     if (avail < RESERVE_EBUF_SIZE)
-      {
-        /* connection's pool is totally at the limit,
-           use our 'emergency' buffer of #RESERVE_EBUF_SIZE bytes. */
-        avail = RESERVE_EBUF_SIZE;
-        buf = urh->e_buf;
-      }
+    {
+      /* connection's pool is totally at the limit,
+         use our 'emergency' buffer of #RESERVE_EBUF_SIZE bytes. */
+      avail = RESERVE_EBUF_SIZE;
+      buf = urh->e_buf;
+    }
     else
-      {
-        /* Normal case: grab all remaining memory from the
-           connection's pool for the IO buffers; the connection
-           certainly won't need it anymore as we've upgraded
-           to another protocol. */
-        buf = MHD_pool_allocate (pool,
-                                 avail,
-                                 false);
-      }
+    {
+      /* Normal case: grab all remaining memory from the
+         connection's pool for the IO buffers; the connection
+         certainly won't need it anymore as we've upgraded
+         to another protocol. */
+      buf = MHD_pool_allocate (pool,
+                               avail,
+                               false);
+    }
     /* use half the buffer for inbound, half for outbound */
     urh->in_buffer_size = avail / 2;
     urh->out_buffer_size = avail - urh->in_buffer_size;
@@ -1022,81 +1025,81 @@ MHD_response_execute_upgrade_ (struct MHD_Response 
*response,
 #ifdef EPOLL_SUPPORT
     /* Launch IO processing by the event loop */
     if (0 != (daemon->options & MHD_USE_EPOLL))
+    {
+      /* We're running with epoll(), need to add the sockets
+         to the event set of the daemon's `epoll_upgrade_fd` */
+      struct epoll_event event;
+
+      mhd_assert (-1 != daemon->epoll_upgrade_fd);
+      /* First, add network socket */
+      event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
+      event.data.ptr = &urh->app;
+      if (0 != epoll_ctl (daemon->epoll_upgrade_fd,
+                          EPOLL_CTL_ADD,
+                          connection->socket_fd,
+                          &event))
       {
-        /* We're running with epoll(), need to add the sockets
-           to the event set of the daemon's `epoll_upgrade_fd` */
-        struct epoll_event event;
+#ifdef HAVE_MESSAGES
+        MHD_DLOG (daemon,
+                  _ ("Call to epoll_ctl failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
+#endif
+        MHD_socket_close_chk_ (sv[0]);
+        MHD_socket_close_chk_ (sv[1]);
+        free (urh);
+        return MHD_NO;
+      }
 
-        mhd_assert (-1 != daemon->epoll_upgrade_fd);
-        /* First, add network socket */
-        event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
+      /* Second, add our end of the UNIX socketpair() */
+      event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
+      event.data.ptr = &urh->mhd;
+      if (0 != epoll_ctl (daemon->epoll_upgrade_fd,
+                          EPOLL_CTL_ADD,
+                          urh->mhd.socket,
+                          &event))
+      {
+        event.events = EPOLLIN | EPOLLOUT | EPOLLPRI;
         event.data.ptr = &urh->app;
         if (0 != epoll_ctl (daemon->epoll_upgrade_fd,
-                            EPOLL_CTL_ADD,
+                            EPOLL_CTL_DEL,
                             connection->socket_fd,
                             &event))
-          {
+          MHD_PANIC (_ ("Error cleaning up while handling epoll error"));
 #ifdef HAVE_MESSAGES
-            MHD_DLOG (daemon,
-                      _("Call to epoll_ctl failed: %s\n"),
-                      MHD_socket_last_strerr_ ());
-#endif
-            MHD_socket_close_chk_ (sv[0]);
-            MHD_socket_close_chk_ (sv[1]);
-            free (urh);
-            return MHD_NO;
-          }
-
-        /* Second, add our end of the UNIX socketpair() */
-        event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
-        event.data.ptr = &urh->mhd;
-        if (0 != epoll_ctl (daemon->epoll_upgrade_fd,
-                            EPOLL_CTL_ADD,
-                            urh->mhd.socket,
-                            &event))
-          {
-            event.events = EPOLLIN | EPOLLOUT | EPOLLPRI;
-            event.data.ptr = &urh->app;
-            if (0 != epoll_ctl (daemon->epoll_upgrade_fd,
-                                EPOLL_CTL_DEL,
-                                connection->socket_fd,
-                                &event))
-              MHD_PANIC (_("Error cleaning up while handling epoll error"));
-#ifdef HAVE_MESSAGES
-            MHD_DLOG (daemon,
-                      _("Call to epoll_ctl failed: %s\n"),
-                      MHD_socket_last_strerr_ ());
+        MHD_DLOG (daemon,
+                  _ ("Call to epoll_ctl failed: %s\n"),
+                  MHD_socket_last_strerr_ ());
 #endif
-            MHD_socket_close_chk_ (sv[0]);
-            MHD_socket_close_chk_ (sv[1]);
-            free (urh);
-            return MHD_NO;
-          }
-        EDLL_insert (daemon->eready_urh_head,
-                     daemon->eready_urh_tail,
-                     urh);
-        urh->in_eready_list = true;
+        MHD_socket_close_chk_ (sv[0]);
+        MHD_socket_close_chk_ (sv[1]);
+        free (urh);
+        return MHD_NO;
       }
+      EDLL_insert (daemon->eready_urh_head,
+                   daemon->eready_urh_tail,
+                   urh);
+      urh->in_eready_list = true;
+    }
 #endif /* EPOLL_SUPPORT */
     if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION) )
-      {
-        /* This takes care of further processing for most event loops:
-           simply add to DLL for bi-direcitonal processing */
-        DLL_insert (daemon->urh_head,
-                    daemon->urh_tail,
-                    urh);
-      }
+    {
+      /* This takes care of further processing for most event loops:
+         simply add to DLL for bi-direcitonal processing */
+      DLL_insert (daemon->urh_head,
+                  daemon->urh_tail,
+                  urh);
+    }
     /* In thread-per-connection mode, thread will switch to forwarding once
      * connection.urh is not NULL and connection.state == 
MHD_CONNECTION_UPGRADE.
      */
   }
   else
-    {
-      urh->app.socket = MHD_INVALID_SOCKET;
-      urh->mhd.socket = MHD_INVALID_SOCKET;
-      /* Non-TLS connection do not hold any additional resources. */
-      urh->clean_ready = true;
-    }
+  {
+    urh->app.socket = MHD_INVALID_SOCKET;
+    urh->mhd.socket = MHD_INVALID_SOCKET;
+    /* Non-TLS connection do not hold any additional resources. */
+    urh->clean_ready = true;
+  }
 #else  /* ! HTTPS_SUPPORT */
   urh->clean_ready = true;
 #endif /* ! HTTPS_SUPPORT */
@@ -1154,7 +1157,7 @@ MHD_response_execute_upgrade_ (struct MHD_Response 
*response,
  */
 _MHD_EXTERN struct MHD_Response *
 MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
-                                void *upgrade_handler_cls)
+                                 void *upgrade_handler_cls)
 {
   struct MHD_Response *response;
 
@@ -1165,10 +1168,10 @@ MHD_create_response_for_upgrade (MHD_UpgradeHandler 
upgrade_handler,
     return NULL;
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   if (! MHD_mutex_init_ (&response->mutex))
-    {
-      free (response);
-      return NULL;
-    }
+  {
+    free (response);
+    return NULL;
+  }
 #endif
   response->upgrade_handler = upgrade_handler;
   response->upgrade_handler_cls = upgrade_handler_cls;
@@ -1178,10 +1181,10 @@ MHD_create_response_for_upgrade (MHD_UpgradeHandler 
upgrade_handler,
       MHD_add_response_header (response,
                                MHD_HTTP_HEADER_CONNECTION,
                                "Upgrade"))
-    {
-      MHD_destroy_response (response);
-      return NULL;
-    }
+  {
+    MHD_destroy_response (response);
+    return NULL;
+  }
   return response;
 }
 #endif /* UPGRADE_SUPPORT */
@@ -1207,12 +1210,12 @@ MHD_destroy_response (struct MHD_Response *response)
   MHD_mutex_lock_chk_ (&response->mutex);
 #endif
   if (0 != --(response->reference_count))
-    {
+  {
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-      MHD_mutex_unlock_chk_ (&response->mutex);
+    MHD_mutex_unlock_chk_ (&response->mutex);
 #endif
-      return;
-    }
+    return;
+  }
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
   MHD_mutex_unlock_chk_ (&response->mutex);
   MHD_mutex_destroy_chk_ (&response->mutex);
@@ -1220,13 +1223,13 @@ MHD_destroy_response (struct MHD_Response *response)
   if (NULL != response->crfc)
     response->crfc (response->crc_cls);
   while (NULL != response->first_header)
-    {
-      pos = response->first_header;
-      response->first_header = pos->next;
-      free (pos->header);
-      free (pos->value);
-      free (pos);
-    }
+  {
+    pos = response->first_header;
+    response->first_header = pos->next;
+    free (pos->header);
+    free (pos->value);
+    free (pos);
+  }
   free (response);
 }
 
diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c
index b47a773b..846a43b7 100644
--- a/src/microhttpd/sha256.c
+++ b/src/microhttpd/sha256.c
@@ -104,10 +104,12 @@ sha256_transform (uint32_t H[_SHA256_DIGEST_LENGTH],
 
   /* Four 'Sigma' macro functions.
      See FIPS PUB 180-4 formulae 4.4, 4.5, 4.6, 4.7. */
-#define SIG0(x)  ( _MHD_ROTR32((x),2) ^ _MHD_ROTR32((x),13) ^ 
_MHD_ROTR32((x),22) )
-#define SIG1(x)  ( _MHD_ROTR32((x),6) ^ _MHD_ROTR32((x),11) ^ 
_MHD_ROTR32((x),25) )
-#define sig0(x)  ( _MHD_ROTR32((x),7)  ^ _MHD_ROTR32((x),18) ^ ((x) >> 3)  )
-#define sig1(x)  ( _MHD_ROTR32((x),17) ^ _MHD_ROTR32((x),19) ^ ((x) >> 10) )
+#define SIG0(x)  (_MHD_ROTR32 ((x),2) ^ _MHD_ROTR32 ((x),13) ^ _MHD_ROTR32 
((x), \
+                                                                            
22) )
+#define SIG1(x)  (_MHD_ROTR32 ((x),6) ^ _MHD_ROTR32 ((x),11) ^ _MHD_ROTR32 
((x), \
+                                                                            
25) )
+#define sig0(x)  (_MHD_ROTR32 ((x),7)  ^ _MHD_ROTR32 ((x),18) ^ ((x) >> 3)  )
+#define sig1(x)  (_MHD_ROTR32 ((x),17) ^ _MHD_ROTR32 ((x),19) ^ ((x) >> 10) )
 
   /* Single step of SHA-256 computation,
      see FIPS PUB 180-4 paragraph 6.2.2 step 3.
@@ -122,99 +124,115 @@ sha256_transform (uint32_t H[_SHA256_DIGEST_LENGTH],
    * Note: 'wt' must be used exactly one time in this macro as it change other 
data as well
            every time when used. */
 #define SHA2STEP32(vA,vB,vC,vD,vE,vF,vG,vH,kt,wt) do {                    \
-       (vD) += ((vH) += SIG1((vE)) + Ch((vE),(vF),(vG)) + (kt) + (wt));  \
-        (vH) += SIG0((vA)) + Maj((vA),(vB),(vC)); } while (0)
+    (vD) += ((vH) += SIG1 ((vE)) + Ch ((vE),(vF),(vG)) + (kt) + (wt));  \
+    (vH) += SIG0 ((vA)) + Maj ((vA),(vB),(vC)); } while (0)
 
   /* Get value of W(t) from input data buffer,
      See FIPS PUB 180-4 paragraph 6.2.
      Input data must be read in big-endian bytes order,
      see FIPS PUB 180-4 paragraph 3.1.2. */
 #define GET_W_FROM_DATA(buf,t) \
-        _MHD_GET_32BIT_BE(((const uint8_t*)(buf)) + (t) * SHA256_BYTES_IN_WORD)
+  _MHD_GET_32BIT_BE (((const uint8_t*) (buf)) + (t) * SHA256_BYTES_IN_WORD)
 
   /* During first 16 steps, before making any calculations on each step,
      the W element is read from input data buffer as big-endian value and
      stored in array of W elements. */
   /* Note: instead of using K constants as array, all K values are specified
      individually for each step, see FIPS PUB 180-4 paragraph 4.2.2 for K 
values. */
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0x428a2f98UL, W[0]  = 
GET_W_FROM_DATA(data,0));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0x71374491UL, W[1]  = 
GET_W_FROM_DATA(data,1));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0xb5c0fbcfUL, W[2]  = 
GET_W_FROM_DATA(data,2));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0xe9b5dba5UL, W[3]  = 
GET_W_FROM_DATA(data,3));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0x3956c25bUL, W[4]  = 
GET_W_FROM_DATA(data,4));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0x59f111f1UL, W[5]  = 
GET_W_FROM_DATA(data,5));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0x923f82a4UL, W[6]  = 
GET_W_FROM_DATA(data,6));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0xab1c5ed5UL, W[7]  = 
GET_W_FROM_DATA(data,7));
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0xd807aa98UL, W[8]  = 
GET_W_FROM_DATA(data,8));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0x12835b01UL, W[9]  = 
GET_W_FROM_DATA(data,9));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0x243185beUL, W[10] = 
GET_W_FROM_DATA(data,10));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0x550c7dc3UL, W[11] = 
GET_W_FROM_DATA(data,11));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0x72be5d74UL, W[12] = 
GET_W_FROM_DATA(data,12));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0x80deb1feUL, W[13] = 
GET_W_FROM_DATA(data,13));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0x9bdc06a7UL, W[14] = 
GET_W_FROM_DATA(data,14));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0xc19bf174UL, W[15] = 
GET_W_FROM_DATA(data,15));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0x428a2f98UL, W[0]  = GET_W_FROM_DATA (
+                data,0));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0x71374491UL, W[1]  = GET_W_FROM_DATA (
+                data,1));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0xb5c0fbcfUL, W[2]  = GET_W_FROM_DATA (
+                data,2));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0xe9b5dba5UL, W[3]  = GET_W_FROM_DATA (
+                data,3));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0x3956c25bUL, W[4]  = GET_W_FROM_DATA (
+                data,4));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0x59f111f1UL, W[5]  = GET_W_FROM_DATA (
+                data,5));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0x923f82a4UL, W[6]  = GET_W_FROM_DATA (
+                data,6));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0xab1c5ed5UL, W[7]  = GET_W_FROM_DATA (
+                data,7));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0xd807aa98UL, W[8]  = GET_W_FROM_DATA (
+                data,8));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0x12835b01UL, W[9]  = GET_W_FROM_DATA (
+                data,9));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0x243185beUL, W[10] = GET_W_FROM_DATA (
+                data,10));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0x550c7dc3UL, W[11] = GET_W_FROM_DATA (
+                data,11));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0x72be5d74UL, W[12] = GET_W_FROM_DATA (
+                data,12));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0x80deb1feUL, W[13] = GET_W_FROM_DATA (
+                data,13));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0x9bdc06a7UL, W[14] = GET_W_FROM_DATA (
+                data,14));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0xc19bf174UL, W[15] = GET_W_FROM_DATA (
+                data,15));
 
   /* 'W' generation and assignment for 16 <= t <= 63.
      See FIPS PUB 180-4 paragraph 6.2.2.
      As only last 16 'W' are used in calculations, it is possible to
      use 16 elements array of W as cyclic buffer.
    * Note: ((t-16)&0xf) have same value as (t&0xf) */
-#define Wgen(w,t) ( (w)[(t-16)&0xf] + sig1((w)[((t)-2)&0xf]) + \
-                    (w)[((t)-7)&0xf] + sig0((w)[((t)-15)&0xf]) )
+#define Wgen(w,t) ( (w)[(t - 16) & 0xf] + sig1 ((w)[((t) - 2) & 0xf])   \
+                    + (w)[((t) - 7) & 0xf] + sig0 ((w)[((t) - 15) & 0xf]) )
 
   /* During last 48 steps, before making any calculations on each step,
      W element is generated from W elements of cyclic buffer and generated 
value
      stored back in cyclic buffer. */
   /* Note: instead of using K constants as array, all K values are specified
      individually for each step, see FIPS PUB 180-4 paragraph 4.2.2 for K 
values. */
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0xe49b69c1UL, W[16&0xf] = Wgen(W,16));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0xefbe4786UL, W[17&0xf] = Wgen(W,17));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0x0fc19dc6UL, W[18&0xf] = Wgen(W,18));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0x240ca1ccUL, W[19&0xf] = Wgen(W,19));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0x2de92c6fUL, W[20&0xf] = Wgen(W,20));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0x4a7484aaUL, W[21&0xf] = Wgen(W,21));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0x5cb0a9dcUL, W[22&0xf] = Wgen(W,22));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0x76f988daUL, W[23&0xf] = Wgen(W,23));
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0x983e5152UL, W[24&0xf] = Wgen(W,24));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0xa831c66dUL, W[25&0xf] = Wgen(W,25));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0xb00327c8UL, W[26&0xf] = Wgen(W,26));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0xbf597fc7UL, W[27&0xf] = Wgen(W,27));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0xc6e00bf3UL, W[28&0xf] = Wgen(W,28));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0xd5a79147UL, W[29&0xf] = Wgen(W,29));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0x06ca6351UL, W[30&0xf] = Wgen(W,30));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0x14292967UL, W[31&0xf] = Wgen(W,31));
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0x27b70a85UL, W[32&0xf] = Wgen(W,32));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0x2e1b2138UL, W[33&0xf] = Wgen(W,33));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0x4d2c6dfcUL, W[34&0xf] = Wgen(W,34));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0x53380d13UL, W[35&0xf] = Wgen(W,35));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0x650a7354UL, W[36&0xf] = Wgen(W,36));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0x766a0abbUL, W[37&0xf] = Wgen(W,37));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0x81c2c92eUL, W[38&0xf] = Wgen(W,38));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0x92722c85UL, W[39&0xf] = Wgen(W,39));
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0xa2bfe8a1UL, W[40&0xf] = Wgen(W,40));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0xa81a664bUL, W[41&0xf] = Wgen(W,41));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0xc24b8b70UL, W[42&0xf] = Wgen(W,42));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0xc76c51a3UL, W[43&0xf] = Wgen(W,43));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0xd192e819UL, W[44&0xf] = Wgen(W,44));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0xd6990624UL, W[45&0xf] = Wgen(W,45));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0xf40e3585UL, W[46&0xf] = Wgen(W,46));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0x106aa070UL, W[47&0xf] = Wgen(W,47));
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0x19a4c116UL, W[48&0xf] = Wgen(W,48));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0x1e376c08UL, W[49&0xf] = Wgen(W,49));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0x2748774cUL, W[50&0xf] = Wgen(W,50));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0x34b0bcb5UL, W[51&0xf] = Wgen(W,51));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0x391c0cb3UL, W[52&0xf] = Wgen(W,52));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0x4ed8aa4aUL, W[53&0xf] = Wgen(W,53));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0x5b9cca4fUL, W[54&0xf] = Wgen(W,54));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0x682e6ff3UL, W[55&0xf] = Wgen(W,55));
-  SHA2STEP32(a, b, c, d, e, f, g, h, 0x748f82eeUL, W[56&0xf] = Wgen(W,56));
-  SHA2STEP32(h, a, b, c, d, e, f, g, 0x78a5636fUL, W[57&0xf] = Wgen(W,57));
-  SHA2STEP32(g, h, a, b, c, d, e, f, 0x84c87814UL, W[58&0xf] = Wgen(W,58));
-  SHA2STEP32(f, g, h, a, b, c, d, e, 0x8cc70208UL, W[59&0xf] = Wgen(W,59));
-  SHA2STEP32(e, f, g, h, a, b, c, d, 0x90befffaUL, W[60&0xf] = Wgen(W,60));
-  SHA2STEP32(d, e, f, g, h, a, b, c, 0xa4506cebUL, W[61&0xf] = Wgen(W,61));
-  SHA2STEP32(c, d, e, f, g, h, a, b, 0xbef9a3f7UL, W[62&0xf] = Wgen(W,62));
-  SHA2STEP32(b, c, d, e, f, g, h, a, 0xc67178f2UL, W[63&0xf] = Wgen(W,63));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0xe49b69c1UL, W[16 & 0xf] = Wgen (W,16));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0xefbe4786UL, W[17 & 0xf] = Wgen (W,17));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0x0fc19dc6UL, W[18 & 0xf] = Wgen (W,18));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0x240ca1ccUL, W[19 & 0xf] = Wgen (W,19));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0x2de92c6fUL, W[20 & 0xf] = Wgen (W,20));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0x4a7484aaUL, W[21 & 0xf] = Wgen (W,21));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0x5cb0a9dcUL, W[22 & 0xf] = Wgen (W,22));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0x76f988daUL, W[23 & 0xf] = Wgen (W,23));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0x983e5152UL, W[24 & 0xf] = Wgen (W,24));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0xa831c66dUL, W[25 & 0xf] = Wgen (W,25));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0xb00327c8UL, W[26 & 0xf] = Wgen (W,26));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0xbf597fc7UL, W[27 & 0xf] = Wgen (W,27));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0xc6e00bf3UL, W[28 & 0xf] = Wgen (W,28));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0xd5a79147UL, W[29 & 0xf] = Wgen (W,29));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0x06ca6351UL, W[30 & 0xf] = Wgen (W,30));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0x14292967UL, W[31 & 0xf] = Wgen (W,31));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0x27b70a85UL, W[32 & 0xf] = Wgen (W,32));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0x2e1b2138UL, W[33 & 0xf] = Wgen (W,33));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0x4d2c6dfcUL, W[34 & 0xf] = Wgen (W,34));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0x53380d13UL, W[35 & 0xf] = Wgen (W,35));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0x650a7354UL, W[36 & 0xf] = Wgen (W,36));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0x766a0abbUL, W[37 & 0xf] = Wgen (W,37));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0x81c2c92eUL, W[38 & 0xf] = Wgen (W,38));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0x92722c85UL, W[39 & 0xf] = Wgen (W,39));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0xa2bfe8a1UL, W[40 & 0xf] = Wgen (W,40));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0xa81a664bUL, W[41 & 0xf] = Wgen (W,41));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0xc24b8b70UL, W[42 & 0xf] = Wgen (W,42));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0xc76c51a3UL, W[43 & 0xf] = Wgen (W,43));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0xd192e819UL, W[44 & 0xf] = Wgen (W,44));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0xd6990624UL, W[45 & 0xf] = Wgen (W,45));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0xf40e3585UL, W[46 & 0xf] = Wgen (W,46));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0x106aa070UL, W[47 & 0xf] = Wgen (W,47));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0x19a4c116UL, W[48 & 0xf] = Wgen (W,48));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0x1e376c08UL, W[49 & 0xf] = Wgen (W,49));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0x2748774cUL, W[50 & 0xf] = Wgen (W,50));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0x34b0bcb5UL, W[51 & 0xf] = Wgen (W,51));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0x391c0cb3UL, W[52 & 0xf] = Wgen (W,52));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0x4ed8aa4aUL, W[53 & 0xf] = Wgen (W,53));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0x5b9cca4fUL, W[54 & 0xf] = Wgen (W,54));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0x682e6ff3UL, W[55 & 0xf] = Wgen (W,55));
+  SHA2STEP32 (a, b, c, d, e, f, g, h, 0x748f82eeUL, W[56 & 0xf] = Wgen (W,56));
+  SHA2STEP32 (h, a, b, c, d, e, f, g, 0x78a5636fUL, W[57 & 0xf] = Wgen (W,57));
+  SHA2STEP32 (g, h, a, b, c, d, e, f, 0x84c87814UL, W[58 & 0xf] = Wgen (W,58));
+  SHA2STEP32 (f, g, h, a, b, c, d, e, 0x8cc70208UL, W[59 & 0xf] = Wgen (W,59));
+  SHA2STEP32 (e, f, g, h, a, b, c, d, 0x90befffaUL, W[60 & 0xf] = Wgen (W,60));
+  SHA2STEP32 (d, e, f, g, h, a, b, c, 0xa4506cebUL, W[61 & 0xf] = Wgen (W,61));
+  SHA2STEP32 (c, d, e, f, g, h, a, b, 0xbef9a3f7UL, W[62 & 0xf] = Wgen (W,62));
+  SHA2STEP32 (b, c, d, e, f, g, h, a, 0xc67178f2UL, W[63 & 0xf] = Wgen (W,63));
 
   /* Compute intermediate hash.
      See FIPS PUB 180-4 paragraph 4.2.2 step 4. */
@@ -237,51 +255,51 @@ sha256_transform (uint32_t H[_SHA256_DIGEST_LENGTH],
  */
 void
 MHD_SHA256_update (void *ctx_,
-               const uint8_t *data,
-               size_t length)
+                   const uint8_t *data,
+                   size_t length)
 {
   struct sha256_ctx *const ctx = ctx_;
   unsigned bytes_have; /**< Number of bytes in buffer */
 
-  mhd_assert((data != NULL) || (length == 0));
+  mhd_assert ((data != NULL) || (length == 0));
 
   if (0 == length)
     return; /* Do nothing */
 
   /* Note: (count & (SHA256_BLOCK_SIZE-1))
            equal (count % SHA256_BLOCK_SIZE) for this block size. */
-  bytes_have = (unsigned)(ctx->count & (SHA256_BLOCK_SIZE-1));
+  bytes_have = (unsigned) (ctx->count & (SHA256_BLOCK_SIZE - 1));
   ctx->count += length;
 
   if (0 != bytes_have)
-    {
-      unsigned bytes_left = SHA256_BLOCK_SIZE - bytes_have;
-      if (length >= bytes_left)
-        { /* Combine new data with data in buffer and
+  {
+    unsigned bytes_left = SHA256_BLOCK_SIZE - bytes_have;
+    if (length >= bytes_left)
+    {     /* Combine new data with data in buffer and
              process full block. */
-          memcpy (ctx->buffer + bytes_have,
-                  data,
-                  bytes_left);
-          data += bytes_left;
-          length -= bytes_left;
-          sha256_transform (ctx->H, ctx->buffer);
-          bytes_have = 0;
-        }
+      memcpy (ctx->buffer + bytes_have,
+              data,
+              bytes_left);
+      data += bytes_left;
+      length -= bytes_left;
+      sha256_transform (ctx->H, ctx->buffer);
+      bytes_have = 0;
     }
+  }
 
   while (SHA256_BLOCK_SIZE <= length)
-    { /* Process any full blocks of new data directly,
+  {   /* Process any full blocks of new data directly,
          without copying to buffer. */
-      sha256_transform (ctx->H, data);
-      data += SHA256_BLOCK_SIZE;
-      length -= SHA256_BLOCK_SIZE;
-    }
+    sha256_transform (ctx->H, data);
+    data += SHA256_BLOCK_SIZE;
+    length -= SHA256_BLOCK_SIZE;
+  }
 
   if (0 != length)
-    { /* Copy incomplete block of new data (if any)
+  {   /* Copy incomplete block of new data (if any)
          to buffer. */
-      memcpy (ctx->buffer + bytes_have, data, length);
-    }
+    memcpy (ctx->buffer + bytes_have, data, length);
+  }
 }
 
 
@@ -308,7 +326,7 @@ sha256_finish (void *ctx_,
   num_bits = ctx->count << 3;
   /* Note: (count & (SHA256_BLOCK_SIZE-1))
            equal (count % SHA256_BLOCK_SIZE) for this block size. */
-  bytes_have = (unsigned)(ctx->count & (SHA256_BLOCK_SIZE-1));
+  bytes_have = (unsigned) (ctx->count & (SHA256_BLOCK_SIZE - 1));
 
   /* Input data must be padded with bit "1" and with length of data in bits.
      See FIPS PUB 180-4 paragraph 5.1.1. */
@@ -319,33 +337,35 @@ sha256_finish (void *ctx_,
   ctx->buffer[bytes_have++] = 0x80;
 
   if (SHA256_BLOCK_SIZE - bytes_have < SHA256_SIZE_OF_LEN_ADD)
-    { /* No space in current block to put total length of message.
+  {   /* No space in current block to put total length of message.
          Pad current block with zeros and process it. */
-      while (bytes_have < SHA256_BLOCK_SIZE) ctx->buffer[bytes_have++] = 0;
-      /* Process full block. */
-      sha256_transform (ctx->H, ctx->buffer);
-      /* Start new block. */
-      bytes_have = 0;
-    }
+    while (bytes_have < SHA256_BLOCK_SIZE)
+      ctx->buffer[bytes_have++] = 0;
+    /* Process full block. */
+    sha256_transform (ctx->H, ctx->buffer);
+    /* Start new block. */
+    bytes_have = 0;
+  }
 
   /* Pad the rest of the buffer with zeros. */
-  memset(ctx->buffer + bytes_have, 0,
-         SHA256_BLOCK_SIZE - SHA256_SIZE_OF_LEN_ADD - bytes_have);
+  memset (ctx->buffer + bytes_have, 0,
+          SHA256_BLOCK_SIZE - SHA256_SIZE_OF_LEN_ADD - bytes_have);
   /* Put number of bits in processed message as big-endian value. */
-  _MHD_PUT_64BIT_BE(ctx->buffer + SHA256_BLOCK_SIZE - SHA256_SIZE_OF_LEN_ADD, 
num_bits);
+  _MHD_PUT_64BIT_BE (ctx->buffer + SHA256_BLOCK_SIZE - SHA256_SIZE_OF_LEN_ADD,
+                     num_bits);
   /* Process full final block. */
   sha256_transform (ctx->H, ctx->buffer);
 
   /* Put final hash/digest in BE mode */
-  _MHD_PUT_32BIT_BE(digest + 0 * SHA256_BYTES_IN_WORD, ctx->H[0]);
-  _MHD_PUT_32BIT_BE(digest + 1 * SHA256_BYTES_IN_WORD, ctx->H[1]);
-  _MHD_PUT_32BIT_BE(digest + 2 * SHA256_BYTES_IN_WORD, ctx->H[2]);
-  _MHD_PUT_32BIT_BE(digest + 3 * SHA256_BYTES_IN_WORD, ctx->H[3]);
-  _MHD_PUT_32BIT_BE(digest + 4 * SHA256_BYTES_IN_WORD, ctx->H[4]);
-  _MHD_PUT_32BIT_BE(digest + 5 * SHA256_BYTES_IN_WORD, ctx->H[5]);
-  _MHD_PUT_32BIT_BE(digest + 6 * SHA256_BYTES_IN_WORD, ctx->H[6]);
-  _MHD_PUT_32BIT_BE(digest + 7 * SHA256_BYTES_IN_WORD, ctx->H[7]);
+  _MHD_PUT_32BIT_BE (digest + 0 * SHA256_BYTES_IN_WORD, ctx->H[0]);
+  _MHD_PUT_32BIT_BE (digest + 1 * SHA256_BYTES_IN_WORD, ctx->H[1]);
+  _MHD_PUT_32BIT_BE (digest + 2 * SHA256_BYTES_IN_WORD, ctx->H[2]);
+  _MHD_PUT_32BIT_BE (digest + 3 * SHA256_BYTES_IN_WORD, ctx->H[3]);
+  _MHD_PUT_32BIT_BE (digest + 4 * SHA256_BYTES_IN_WORD, ctx->H[4]);
+  _MHD_PUT_32BIT_BE (digest + 5 * SHA256_BYTES_IN_WORD, ctx->H[5]);
+  _MHD_PUT_32BIT_BE (digest + 6 * SHA256_BYTES_IN_WORD, ctx->H[6]);
+  _MHD_PUT_32BIT_BE (digest + 7 * SHA256_BYTES_IN_WORD, ctx->H[7]);
 
   /* Erase potentially sensitive data. */
-  memset(ctx, 0, sizeof(struct sha256_ctx));
+  memset (ctx, 0, sizeof(struct sha256_ctx));
 }
diff --git a/src/microhttpd/sha256.h b/src/microhttpd/sha256.h
index 319277ff..f4c84e2c 100644
--- a/src/microhttpd/sha256.h
+++ b/src/microhttpd/sha256.h
@@ -76,8 +76,8 @@ MHD_SHA256_init (void *ctx_);
  */
 void
 MHD_SHA256_update (void *ctx_,
-               const uint8_t *data,
-               size_t length);
+                   const uint8_t *data,
+                   size_t length);
 
 
 /**
diff --git a/src/microhttpd/sysfdsetsize.c b/src/microhttpd/sysfdsetsize.c
index fe7fba75..4929b3d2 100644
--- a/src/microhttpd/sysfdsetsize.c
+++ b/src/microhttpd/sysfdsetsize.c
@@ -56,7 +56,7 @@
 #include <sys/socket.h>
 #endif /* HAVE_SYS_SOCKET_H */
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__)
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #endif /* !WIN32_LEAN_AND_MEAN */
diff --git a/src/microhttpd/test_daemon.c b/src/microhttpd/test_daemon.c
index af59b86d..4f600ef0 100644
--- a/src/microhttpd/test_daemon.c
+++ b/src/microhttpd/test_daemon.c
@@ -57,7 +57,7 @@ apc_nothing (void *cls,
              const struct sockaddr *addr,
              socklen_t addrlen)
 {
-  (void)cls; (void)addr; (void)addrlen; /* Unused. Silent compiler warning. */
+  (void) cls; (void) addr; (void) addrlen; /* Unused. Silent compiler warning. 
*/
 
   return MHD_NO;
 }
@@ -68,7 +68,7 @@ apc_all (void *cls,
          const struct sockaddr *addr,
          socklen_t addrlen)
 {
-  (void)cls; (void)addr; (void)addrlen; /* Unused. Silent compiler warning. */
+  (void) cls; (void) addr; (void) addrlen; /* Unused. Silent compiler warning. 
*/
 
   return MHD_YES;
 }
@@ -83,9 +83,9 @@ ahc_nothing (void *cls,
              const char *upload_data, size_t *upload_data_size,
              void **unused)
 {
-  (void)cls;(void)connection;(void)url;          /* Unused. Silent compiler 
warning. */
-  (void)method;(void)version;(void)upload_data;  /* Unused. Silent compiler 
warning. */
-  (void)upload_data_size;(void)unused;           /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) connection; (void) url;          /* Unused. Silent 
compiler warning. */
+  (void) method; (void) version; (void) upload_data;  /* Unused. Silent 
compiler warning. */
+  (void) upload_data_size; (void) unused;           /* Unused. Silent compiler 
warning. */
 
   return MHD_NO;
 }
@@ -136,25 +136,25 @@ testExternalRun ()
   }
   i = 0;
   while (i < 15)
+  {
+    maxfd = 0;
+    FD_ZERO (&rs);
+    if (MHD_YES != MHD_get_fdset (d, &rs, &rs, &rs, &maxfd))
+    {
+      MHD_stop_daemon (d);
+      fprintf (stderr,
+               "Failed in MHD_get_fdset()\n");
+      return 256;
+    }
+    if (MHD_run (d) == MHD_NO)
     {
-      maxfd = 0;
-      FD_ZERO (&rs);
-      if (MHD_YES != MHD_get_fdset (d, &rs, &rs, &rs, &maxfd))
-        {
-          MHD_stop_daemon (d);
-          fprintf (stderr,
-                   "Failed in MHD_get_fdset()\n");
-          return 256;
-        }
-      if (MHD_run (d) == MHD_NO)
-        {
-          MHD_stop_daemon (d);
-          fprintf (stderr,
-                   "Failed in MHD_run()\n");
-          return 8;
-        }
-      i++;
+      MHD_stop_daemon (d);
+      fprintf (stderr,
+               "Failed in MHD_run()\n");
+      return 8;
     }
+    i++;
+  }
   MHD_stop_daemon (d);
   return 0;
 }
@@ -179,11 +179,11 @@ testThread ()
     exit (77);
   }
   if (MHD_run (d) != MHD_NO)
-    {
-      fprintf (stderr,
-               "Failed in MHD_run()\n");
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "Failed in MHD_run()\n");
+    return 32;
+  }
   MHD_stop_daemon (d);
   return 0;
 }
@@ -194,7 +194,8 @@ testMultithread ()
 {
   struct MHD_Daemon *d;
 
-  d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_THREAD_PER_CONNECTION,
+  d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_INTERNAL_POLLING_THREAD
+                        | MHD_USE_THREAD_PER_CONNECTION,
                         0,
                         &apc_all, NULL,
                         &ahc_nothing, NULL,
@@ -208,11 +209,11 @@ testMultithread ()
     exit (77);
   }
   if (MHD_run (d) != MHD_NO)
-    {
-      fprintf (stderr,
-               "Failed in MHD_run()\n");
-      return 128;
-    }
+  {
+    fprintf (stderr,
+             "Failed in MHD_run()\n");
+    return 128;
+  }
   MHD_stop_daemon (d);
   return 0;
 }
@@ -223,7 +224,7 @@ main (int argc,
       char *const *argv)
 {
   int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   errorCount += testStartError ();
   errorCount += testStartStop ();
diff --git a/src/microhttpd/test_helpers.h b/src/microhttpd/test_helpers.h
index 4f015ef2..d47f7168 100644
--- a/src/microhttpd/test_helpers.h
+++ b/src/microhttpd/test_helpers.h
@@ -39,29 +39,29 @@
  *         name.
  */
 static int
-has_in_name(const char *prog_name, const char *marker)
+has_in_name (const char *prog_name, const char *marker)
 {
   size_t name_pos;
   size_t pos;
 
-  if (!prog_name || !marker || !prog_name[0] || !marker[0])
+  if (! prog_name || ! marker || ! prog_name[0] || ! marker[0])
     return 0;
 
   pos = 0;
   name_pos = 0;
   while (prog_name[pos])
-    {
-      if ('/' == prog_name[pos])
-        name_pos = pos + 1;
+  {
+    if ('/' == prog_name[pos])
+      name_pos = pos + 1;
 #if defined(_WIN32) || defined(__CYGWIN__)
-      else if ('\\' == prog_name[pos])
-        name_pos = pos + 1;
+    else if ('\\' == prog_name[pos])
+      name_pos = pos + 1;
 #endif /* _WIN32 || __CYGWIN__ */
-      pos++;
-    }
+    pos++;
+  }
   if (name_pos == pos)
     return 0;
-  return strstr(prog_name + name_pos, marker) != (char*)0;
+  return strstr (prog_name + name_pos, marker) != (char*) 0;
 }
 
 /**
@@ -75,17 +75,17 @@ has_in_name(const char *prog_name, const char *marker)
  *         non-zero if one of strings in @a argv is equal to @a param.
  */
 static int
-has_param(int argc, char * const argv[], const char * param)
+has_param (int argc, char *const argv[], const char *param)
 {
   int i;
-  if (!argv || !param || !param[0])
+  if (! argv || ! param || ! param[0])
     return 0;
 
-  for(i = 1; i < argc; i++)
-    {
-      if(argv[i] && strcmp(argv[i], param) == 0)
-        return !0;
-    }
+  for (i = 1; i < argc; i++)
+  {
+    if (argv[i] &&(strcmp (argv[i], param) == 0) )
+      return ! 0;
+  }
 
   return 0;
 }
diff --git a/src/microhttpd/test_http_reasons.c 
b/src/microhttpd/test_http_reasons.c
index 62721439..4d0484ad 100644
--- a/src/microhttpd/test_http_reasons.c
+++ b/src/microhttpd/test_http_reasons.c
@@ -28,105 +28,111 @@
 #include "microhttpd.h"
 #include "mhd_str.h"
 
-static int expect_result(int code, const char* expected)
+static int expect_result (int code, const char*expected)
 {
-  const char* const reason = MHD_get_reason_phrase_for(code);
-  if (MHD_str_equal_caseless_(reason, expected))
+  const char*const reason = MHD_get_reason_phrase_for (code);
+  if (MHD_str_equal_caseless_ (reason, expected))
     return 0;
-  fprintf(stderr, "Incorrect reason returned for code %d:\n  Returned: \"%s\"  
\tExpected: \"%s\"\n",
-          code, reason, expected);
+  fprintf (stderr,
+           "Incorrect reason returned for code %d:\n  Returned: \"%s\"  
\tExpected: \"%s\"\n",
+           code, reason, expected);
   return 1;
 }
 
-static int expect_absent(int code)
+static int expect_absent (int code)
 {
-  return expect_result(code, "unknown");
+  return expect_result (code, "unknown");
 }
 
-static int test_absent_codes(void)
+static int test_absent_codes (void)
 {
   int errcount = 0;
-  errcount += expect_absent(0);
-  errcount += expect_absent(1);
-  errcount += expect_absent(50);
-  errcount += expect_absent(99);
-  errcount += expect_absent(600);
-  errcount += expect_absent(601);
-  errcount += expect_absent(900);
-  errcount += expect_absent(10000);
+  errcount += expect_absent (0);
+  errcount += expect_absent (1);
+  errcount += expect_absent (50);
+  errcount += expect_absent (99);
+  errcount += expect_absent (600);
+  errcount += expect_absent (601);
+  errcount += expect_absent (900);
+  errcount += expect_absent (10000);
   return errcount;
 }
 
-static int test_1xx(void)
+static int test_1xx (void)
 {
   int errcount = 0;
-  errcount += expect_result(MHD_HTTP_CONTINUE, "continue");
-  errcount += expect_result(MHD_HTTP_PROCESSING, "processing");
-  errcount += expect_absent(110);
-  errcount += expect_absent(190);
+  errcount += expect_result (MHD_HTTP_CONTINUE, "continue");
+  errcount += expect_result (MHD_HTTP_PROCESSING, "processing");
+  errcount += expect_absent (110);
+  errcount += expect_absent (190);
   return errcount;
 }
 
-static int test_2xx(void)
+static int test_2xx (void)
 {
   int errcount = 0;
-  errcount += expect_result(MHD_HTTP_OK, "ok");
-  errcount += expect_result(MHD_HTTP_ALREADY_REPORTED, "already reported");
-  errcount += expect_absent(217);
-  errcount += expect_result(MHD_HTTP_IM_USED, "im used");
-  errcount += expect_absent(230);
-  errcount += expect_absent(295);
+  errcount += expect_result (MHD_HTTP_OK, "ok");
+  errcount += expect_result (MHD_HTTP_ALREADY_REPORTED, "already reported");
+  errcount += expect_absent (217);
+  errcount += expect_result (MHD_HTTP_IM_USED, "im used");
+  errcount += expect_absent (230);
+  errcount += expect_absent (295);
   return errcount;
 }
 
-static int test_3xx(void)
+static int test_3xx (void)
 {
   int errcount = 0;
-  errcount += expect_result(MHD_HTTP_MULTIPLE_CHOICES, "multiple choices");
-  errcount += expect_result(MHD_HTTP_SEE_OTHER, "see other");
-  errcount += expect_result(MHD_HTTP_PERMANENT_REDIRECT, "permanent redirect");
-  errcount += expect_absent(311);
-  errcount += expect_absent(399);
+  errcount += expect_result (MHD_HTTP_MULTIPLE_CHOICES, "multiple choices");
+  errcount += expect_result (MHD_HTTP_SEE_OTHER, "see other");
+  errcount += expect_result (MHD_HTTP_PERMANENT_REDIRECT, "permanent 
redirect");
+  errcount += expect_absent (311);
+  errcount += expect_absent (399);
   return errcount;
 }
 
-static int test_4xx(void)
+static int test_4xx (void)
 {
   int errcount = 0;
-  errcount += expect_result(MHD_HTTP_BAD_REQUEST, "bad request");
-  errcount += expect_result(MHD_HTTP_NOT_FOUND, "not found");
-  errcount += expect_result(MHD_HTTP_URI_TOO_LONG, "uri too long");
-  errcount += expect_result(MHD_HTTP_EXPECTATION_FAILED, "expectation failed");
-  errcount += expect_result(MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE, "request 
header fields too large");
-  errcount += expect_absent(441);
-  errcount += expect_result(MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS, 
"unavailable for legal reasons");
-  errcount += expect_absent(470);
-  errcount += expect_absent(493);
+  errcount += expect_result (MHD_HTTP_BAD_REQUEST, "bad request");
+  errcount += expect_result (MHD_HTTP_NOT_FOUND, "not found");
+  errcount += expect_result (MHD_HTTP_URI_TOO_LONG, "uri too long");
+  errcount += expect_result (MHD_HTTP_EXPECTATION_FAILED, "expectation 
failed");
+  errcount += expect_result (MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
+                             "request header fields too large");
+  errcount += expect_absent (441);
+  errcount += expect_result (MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS,
+                             "unavailable for legal reasons");
+  errcount += expect_absent (470);
+  errcount += expect_absent (493);
   return errcount;
 }
 
-static int test_5xx(void)
+static int test_5xx (void)
 {
   int errcount = 0;
-  errcount += expect_result(MHD_HTTP_INTERNAL_SERVER_ERROR, "internal server 
error");
-  errcount += expect_result(MHD_HTTP_BAD_GATEWAY, "bad gateway");
-  errcount += expect_result(MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED, "http version 
not supported");
-  errcount += expect_result(MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED, "network 
authentication required");
-  errcount += expect_absent(520);
-  errcount += expect_absent(597);
+  errcount += expect_result (MHD_HTTP_INTERNAL_SERVER_ERROR,
+                             "internal server error");
+  errcount += expect_result (MHD_HTTP_BAD_GATEWAY, "bad gateway");
+  errcount += expect_result (MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED,
+                             "http version not supported");
+  errcount += expect_result (MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED,
+                             "network authentication required");
+  errcount += expect_absent (520);
+  errcount += expect_absent (597);
   return errcount;
 }
 
-int main(int argc, char * argv[])
+int main (int argc, char *argv[])
 {
   int errcount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
-  errcount += test_absent_codes();
-  errcount += test_1xx();
-  errcount += test_2xx();
-  errcount += test_3xx();
-  errcount += test_4xx();
-  errcount += test_5xx();
+  errcount += test_absent_codes ();
+  errcount += test_1xx ();
+  errcount += test_2xx ();
+  errcount += test_3xx ();
+  errcount += test_4xx ();
+  errcount += test_5xx ();
   return errcount == 0 ? 0 : 1;
 }
diff --git a/src/microhttpd/test_options.c b/src/microhttpd/test_options.c
index 3198c731..be033ae8 100644
--- a/src/microhttpd/test_options.c
+++ b/src/microhttpd/test_options.c
@@ -44,33 +44,33 @@ ahc_echo (void *cls,
           const char *upload_data, size_t *upload_data_size,
           void **unused)
 {
-  (void)cls;
-  (void)connection;
-  (void)url;
-  (void)method;
-  (void)version;
-  (void)upload_data;
-  (void)upload_data_size;
-  (void)unused;
+  (void) cls;
+  (void) connection;
+  (void) url;
+  (void) method;
+  (void) version;
+  (void) upload_data;
+  (void) upload_data_size;
+  (void) unused;
 
   return 0;
 }
 
 static int
-test_wrap_loc (char *test_name, int (*test) (void))
+test_wrap_loc (char *test_name, int (*test)(void))
 {
   int ret;
 
   fprintf (stdout, "running test: %s ", test_name);
   ret = test ();
   if (ret == 0)
-    {
-      fprintf (stdout, "[pass]\n");
-    }
+  {
+    fprintf (stdout, "[pass]\n");
+  }
   else
-    {
-      fprintf (stdout, "[fail]\n");
-    }
+  {
+    fprintf (stdout, "[fail]\n");
+  }
   return ret;
 }
 
@@ -127,7 +127,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   errorCount += test_wrap_loc ("ip addr option", &test_ip_addr_option);
 
diff --git a/src/microhttpd/test_postprocessor.c 
b/src/microhttpd/test_postprocessor.c
index acbb5b02..e1a167e7 100644
--- a/src/microhttpd/test_postprocessor.c
+++ b/src/microhttpd/test_postprocessor.c
@@ -48,13 +48,15 @@ const char *want[] = {
   "x", NULL, NULL, NULL, "5",
 #define URL_END (URL_START + 10)
   NULL, NULL, NULL, NULL, NULL,
-#define FORM_DATA "--AaB03x\r\ncontent-disposition: form-data; 
name=\"field1\"\r\n\r\nJoe Blow\r\n--AaB03x\r\ncontent-disposition: form-data; 
name=\"pics\"; filename=\"file1.txt\"\r\nContent-Type: 
text/plain\r\nContent-Transfer-Encoding: 
binary\r\n\r\nfiledata\r\n--AaB03x--\r\n"
+#define FORM_DATA \
+  "--AaB03x\r\ncontent-disposition: form-data; name=\"field1\"\r\n\r\nJoe 
Blow\r\n--AaB03x\r\ncontent-disposition: form-data; name=\"pics\"; 
filename=\"file1.txt\"\r\nContent-Type: 
text/plain\r\nContent-Transfer-Encoding: 
binary\r\n\r\nfiledata\r\n--AaB03x--\r\n"
 #define FORM_START (URL_END + 5)
   "field1", NULL, NULL, NULL, "Joe Blow",
   "pics", "file1.txt", "text/plain", "binary", "filedata",
 #define FORM_END (FORM_START + 10)
   NULL, NULL, NULL, NULL, NULL,
-#define FORM_NESTED_DATA "--AaB03x\r\ncontent-disposition: form-data; 
name=\"field1\"\r\n\r\nJane Blow\r\n--AaB03x\r\ncontent-disposition: form-data; 
name=\"pics\"\r\nContent-type: multipart/mixed, 
boundary=BbC04y\r\n\r\n--BbC04y\r\nContent-disposition: attachment; 
filename=\"file1.txt\"\r\nContent-Type: 
text/plain\r\n\r\nfiledata1\r\n--BbC04y\r\nContent-disposition: attachment; 
filename=\"file2.gif\"\r\nContent-type: image/gif\r\nContent-Transfer-Encoding: 
binary\r\n\r\nfiledata2\r\n--B [...]
+#define FORM_NESTED_DATA \
+  "--AaB03x\r\ncontent-disposition: form-data; name=\"field1\"\r\n\r\nJane 
Blow\r\n--AaB03x\r\ncontent-disposition: form-data; 
name=\"pics\"\r\nContent-type: multipart/mixed, 
boundary=BbC04y\r\n\r\n--BbC04y\r\nContent-disposition: attachment; 
filename=\"file1.txt\"\r\nContent-Type: 
text/plain\r\n\r\nfiledata1\r\n--BbC04y\r\nContent-disposition: attachment; 
filename=\"file2.gif\"\r\nContent-type: image/gif\r\nContent-Transfer-Encoding: 
binary\r\n\r\nfiledata2\r\n--BbC04y--\r\n--AaB03x--"
 #define FORM_NESTED_START (FORM_END + 5)
   "field1", NULL, NULL, NULL, "Jane Blow",
   "pics", "file1.txt", "text/plain", NULL, "filedata1",
@@ -91,7 +93,7 @@ value_checker (void *cls,
 {
   int *want_off = cls;
   int idx = *want_off;
-  (void)kind;  /* Unused. Silent compiler warning. */
+  (void) kind;  /* Unused. Silent compiler warning. */
 
 
 #if 0
@@ -110,10 +112,10 @@ value_checker (void *cls,
       (mismatch (content_type, want[idx + 2])) ||
       (mismatch (transfer_encoding, want[idx + 3])) ||
       (0 != memcmp (data, &want[idx + 4][off], size)))
-    {
-      *want_off = -1;
-      return MHD_NO;
-    }
+  {
+    *want_off = -1;
+    return MHD_NO;
+  }
   if (off + size == strlen (want[idx + 4]))
     *want_off = idx + 5;
   return MHD_YES;
@@ -137,19 +139,20 @@ test_urlencoding (void)
   connection.headers_received = &header;
   header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
   header.value = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
-  header.header_size = MHD_STATICSTR_LEN_(MHD_HTTP_HEADER_CONTENT_TYPE);
-  header.value_size = 
MHD_STATICSTR_LEN_(MHD_HTTP_POST_ENCODING_FORM_URLENCODED);
+  header.header_size = MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_TYPE);
+  header.value_size = MHD_STATICSTR_LEN_ (
+    MHD_HTTP_POST_ENCODING_FORM_URLENCODED);
   header.kind = MHD_HEADER_KIND;
   pp = MHD_create_post_processor (&connection,
                                   1024, &value_checker, &want_off);
   i = 0;
   size = strlen (URL_DATA);
   while (i < size)
-    {
-      delta = 1 + MHD_random_ () % (size - i);
-      MHD_post_process (pp, &URL_DATA[i], delta);
-      i += delta;
-    }
+  {
+    delta = 1 + MHD_random_ () % (size - i);
+    MHD_post_process (pp, &URL_DATA[i], delta);
+    i += delta;
+  }
   MHD_destroy_post_processor (pp);
   if (want_off != URL_END)
     return 1;
@@ -183,8 +186,9 @@ test_multipart_garbage (void)
     header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
     header.value =
       MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x";
-    header.header_size = MHD_STATICSTR_LEN_(MHD_HTTP_HEADER_CONTENT_TYPE);
-    header.value_size = 
MHD_STATICSTR_LEN_(MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", 
boundary=AaB03x");
+    header.header_size = MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_TYPE);
+    header.value_size = MHD_STATICSTR_LEN_ (
+      MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x");
     header.kind = MHD_HEADER_KIND;
     pp = MHD_create_post_processor (&connection,
                                     1024, &value_checker, &want_off);
@@ -258,11 +262,11 @@ test_multipart (void)
   i = 0;
   size = strlen (FORM_DATA);
   while (i < size)
-    {
-      delta = 1 + MHD_random_ () % (size - i);
-      MHD_post_process (pp, &FORM_DATA[i], delta);
-      i += delta;
-    }
+  {
+    delta = 1 + MHD_random_ () % (size - i);
+    MHD_post_process (pp, &FORM_DATA[i], delta);
+    i += delta;
+  }
   MHD_destroy_post_processor (pp);
   if (want_off != FORM_END)
     return 2;
@@ -295,11 +299,11 @@ test_nested_multipart (void)
   i = 0;
   size = strlen (FORM_NESTED_DATA);
   while (i < size)
-    {
-      delta = 1 + MHD_random_ () % (size - i);
-      MHD_post_process (pp, &FORM_NESTED_DATA[i], delta);
-      i += delta;
-    }
+  {
+    delta = 1 + MHD_random_ () % (size - i);
+    MHD_post_process (pp, &FORM_NESTED_DATA[i], delta);
+    i += delta;
+  }
   MHD_destroy_post_processor (pp);
   if (want_off != FORM_NESTED_END)
     return 4;
@@ -331,11 +335,11 @@ test_empty_value (void)
   i = 0;
   size = strlen (URL_EMPTY_VALUE_DATA);
   while (i < size)
-    {
-      delta = 1 + MHD_random_ () % (size - i);
-      MHD_post_process (pp, &URL_EMPTY_VALUE_DATA[i], delta);
-      i += delta;
-    }
+  {
+    delta = 1 + MHD_random_ () % (size - i);
+    MHD_post_process (pp, &URL_EMPTY_VALUE_DATA[i], delta);
+    i += delta;
+  }
   MHD_destroy_post_processor (pp);
   if (want_off != URL_EMPTY_VALUE_END)
     return 8;
@@ -349,7 +353,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv;  /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv;  /* Unused. Silent compiler warning. */
 
   errorCount += test_multipart_splits ();
   errorCount += test_multipart_garbage ();
diff --git a/src/microhttpd/test_postprocessor_amp.c 
b/src/microhttpd/test_postprocessor_amp.c
index 6c0ebff4..e2ea4a54 100644
--- a/src/microhttpd/test_postprocessor_amp.c
+++ b/src/microhttpd/test_postprocessor_amp.c
@@ -7,18 +7,18 @@
 
 uint64_t num_errors;
 
-int check_post(void *cls, enum MHD_ValueKind kind, const char* key,
-                 const char* filename, const char* content_type,
-                 const char* content_encoding, const char* data,
-                 uint64_t off, size_t size)
+int check_post (void *cls, enum MHD_ValueKind kind, const char*key,
+                const char*filename, const char*content_type,
+                const char*content_encoding, const char*data,
+                uint64_t off, size_t size)
 {
-  (void)cls; (void)kind; (void)filename; (void)content_type;  /* Unused. 
Silent compiler warning. */
-  (void)content_encoding; (void)data; (void)off; (void)size;  /* Unused. 
Silent compiler warning. */
-  if ((0 != strcmp(key, "a")) && (0 != strcmp(key, "b")))
-    {
-      printf("ERROR: got unexpected '%s'\n", key);
-      num_errors++;
-    }
+  (void) cls; (void) kind; (void) filename; (void) content_type;  /* Unused. 
Silent compiler warning. */
+  (void) content_encoding; (void) data; (void) off; (void) size;  /* Unused. 
Silent compiler warning. */
+  if ((0 != strcmp (key, "a")) && (0 != strcmp (key, "b")))
+  {
+    printf ("ERROR: got unexpected '%s'\n", key);
+    num_errors++;
+  }
 
   return MHD_YES;
 }
@@ -30,7 +30,7 @@ main (int argc, char *const *argv)
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
   struct MHD_PostProcessor *pp;
-  (void)argc; (void)argv;  /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv;  /* Unused. Silent compiler warning. */
 
   num_errors = 0;
   memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -47,12 +47,12 @@ main (int argc, char *const *argv)
   if (NULL == pp)
     return 1;
 
-  const char* post = 
"a=xx+xx+xxx+xxxxx+xxxx+xxxxxxxx+xxx+xxxxxx+xxx+xxx+xxxxxxx+xxxxx%0A+++++++xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%0A+++++++--%3E%0A++++++++++++++%3Cxxxxx+xxxxx%3D%22xxx%25%22%3E%0A+++++++++++%3Cxx%3E%0A+++++++++++++++%3Cxx+xxxxxxx%3D%22x%22+xxxxx%3D%22xxxxx%22%3E%0A+++++++++++++++++++%3Cxxxxx+xxxxx%3D%22xxx%25%22%3E%0A+++++++++++++++++++++++%3Cxx%3E%0A+++++++++++++++++++++++++++%3Cxx+xxxxx%3D%22xxxx%22%3E%0A++++++++++++++++++
 [...]
+  const char*post =
+    
"a=xx+xx+xxx+xxxxx+xxxx+xxxxxxxx+xxx+xxxxxx+xxx+xxx+xxxxxxx+xxxxx%0A+++++++xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%0A+++++++--%3E%0A++++++++++++++%3Cxxxxx+xxxxx%3D%22xxx%25%22%3E%0A+++++++++++%3Cxx%3E%0A+++++++++++++++%3Cxx+xxxxxxx%3D%22x%22+xxxxx%3D%22xxxxx%22%3E%0A+++++++++++++++++++%3Cxxxxx+xxxxx%3D%22xxx%25%22%3E%0A+++++++++++++++++++++++%3Cxx%3E%0A+++++++++++++++++++++++++++%3Cxx+xxxxx%3D%22xxxx%22%3E%0A+++++++++++++++++++++++++++++++%3Cx
 [...]
 
-  if (MHD_YES != MHD_post_process (pp, post, strlen(post)))
+  if (MHD_YES != MHD_post_process (pp, post, strlen (post)))
     num_errors++;
   MHD_destroy_post_processor (pp);
 
   return num_errors == 0 ? 0 : 2;
 }
-
diff --git a/src/microhttpd/test_postprocessor_large.c 
b/src/microhttpd/test_postprocessor_large.c
index 3421f734..68e5f671 100644
--- a/src/microhttpd/test_postprocessor_large.c
+++ b/src/microhttpd/test_postprocessor_large.c
@@ -43,8 +43,8 @@ value_checker (void *cls,
                const char *data, uint64_t off, size_t size)
 {
   unsigned int *pos = cls;
-  (void)kind; (void)key; (void)filename; (void)content_type;  /* Unused. 
Silent compiler warning. */
-  (void)transfer_encoding; (void)data; (void)off;             /* Unused. 
Silent compiler warning. */
+  (void) kind; (void) key; (void) filename; (void) content_type;  /* Unused. 
Silent compiler warning. */
+  (void) transfer_encoding; (void) data; (void) off;             /* Unused. 
Silent compiler warning. */
 #if 0
   fprintf (stderr,
            "VC: %llu %u `%s' `%s' `%s' `%s' `%.*s'\n",
@@ -87,11 +87,11 @@ test_simple_large ()
   i = 0;
   size = strlen (data);
   while (i < size)
-    {
-      delta = 1 + MHD_random_ () % (size - i);
-      MHD_post_process (pp, &data[i], delta);
-      i += delta;
-    }
+  {
+    delta = 1 + MHD_random_ () % (size - i);
+    MHD_post_process (pp, &data[i], delta);
+    i += delta;
+  }
   MHD_destroy_post_processor (pp);
   if (pos != sizeof (data) - 5) /* minus 0-termination and 'key=' */
     return 1;
@@ -102,7 +102,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv;  /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv;  /* Unused. Silent compiler warning. */
 
   errorCount += test_simple_large ();
   if (errorCount != 0)
diff --git a/src/microhttpd/test_shutdown_select.c 
b/src/microhttpd/test_shutdown_select.c
index a334f63f..ae88658d 100644
--- a/src/microhttpd/test_shutdown_select.c
+++ b/src/microhttpd/test_shutdown_select.c
@@ -50,7 +50,7 @@
 #if defined(MHD_WINSOCK_SOCKETS)
 #include <winsock2.h>
 #include <windows.h>
-#define sock_errno (WSAGetLastError())
+#define sock_errno (WSAGetLastError ())
 #elif defined(MHD_POSIX_SOCKETS)
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -83,7 +83,7 @@
 #define SOMAXCONN 511
 #endif /* ! SOMAXCONN */
 
-#if !defined(SHUT_RDWR) && defined(SD_BOTH)
+#if ! defined(SHUT_RDWR) && defined(SD_BOTH)
 #define SHUT_RDWR SD_BOTH
 #endif
 
@@ -91,34 +91,34 @@ static bool check_err;
 
 
 static bool
-has_in_name(const char *prog_name, const char *marker)
+has_in_name (const char *prog_name, const char *marker)
 {
   size_t name_pos;
   size_t pos;
 
-  if (!prog_name || !marker)
+  if (! prog_name || ! marker)
     return 0;
 
   pos = 0;
   name_pos = 0;
   while (prog_name[pos])
-    {
-      if ('/' == prog_name[pos])
-        name_pos = pos + 1;
+  {
+    if ('/' == prog_name[pos])
+      name_pos = pos + 1;
 #if defined(_WIN32) || defined(__CYGWIN__)
-      else if ('\\' == prog_name[pos])
-        name_pos = pos + 1;
+    else if ('\\' == prog_name[pos])
+      name_pos = pos + 1;
 #endif /* _WIN32 || __CYGWIN__ */
-      pos++;
-    }
+    pos++;
+  }
   if (name_pos == pos)
     return true;
-  return strstr(prog_name + name_pos, marker) != NULL;
+  return strstr (prog_name + name_pos, marker) != NULL;
 }
 
 
 static MHD_socket
-start_socket_listen(int domain)
+start_socket_listen (int domain)
 {
 /* Create sockets similarly to daemon.c */
   MHD_socket fd;
@@ -143,23 +143,23 @@ start_socket_listen(int domain)
   cloexec_set = 0;
 #endif /* !SOCK_CLOEXEC */
   if ( (MHD_INVALID_SOCKET == fd) && (cloexec_set) )
-    {
-      fd = socket (domain, SOCK_STREAM, 0);
-      cloexec_set = 0;
-    }
+  {
+    fd = socket (domain, SOCK_STREAM, 0);
+    cloexec_set = 0;
+  }
   if (MHD_INVALID_SOCKET == fd)
-    {
-      fprintf (stderr, "Can't create socket: %u\n",
-               (unsigned)sock_errno);
-      return MHD_INVALID_SOCKET;
-    }
-
-  if (!cloexec_set)
-    {
+  {
+    fprintf (stderr, "Can't create socket: %u\n",
+             (unsigned) sock_errno);
+    return MHD_INVALID_SOCKET;
+  }
+
+  if (! cloexec_set)
+  {
 #ifdef MHD_WINSOCK_SOCKETS
-    if (!SetHandleInformation ((HANDLE)fd, HANDLE_FLAG_INHERIT, 0))
+    if (! SetHandleInformation ((HANDLE) fd, HANDLE_FLAG_INHERIT, 0))
       fprintf (stderr, "Failed to make socket non-inheritable: %u\n",
-               (unsigned int)GetLastError ());
+               (unsigned int) GetLastError ());
 #else  /* MHD_POSIX_SOCKETS */
     flags = fcntl (fd, F_GETFD);
     if ( ( (-1 == flags) ||
@@ -168,7 +168,7 @@ start_socket_listen(int domain)
       fprintf (stderr, "Failed to make socket non-inheritable: %s\n",
                MHD_socket_last_strerr_ ());
 #endif /* MHD_POSIX_SOCKETS */
-    }
+  }
 
   memset (&sock_addr, 0, sizeof (struct sockaddr_in));
   sock_addr.sin_family = AF_INET;
@@ -179,73 +179,73 @@ start_socket_listen(int domain)
   addrlen = sizeof (struct sockaddr_in);
 
   if (bind (fd, (const struct sockaddr*) &sock_addr, addrlen) < 0)
-    {
-      fprintf (stderr, "Failed to bind socket: %u\n",
-               (unsigned)sock_errno);
-      MHD_socket_close_chk_ (fd);
-      return MHD_INVALID_SOCKET;
-    }
+  {
+    fprintf (stderr, "Failed to bind socket: %u\n",
+             (unsigned) sock_errno);
+    MHD_socket_close_chk_ (fd);
+    return MHD_INVALID_SOCKET;
+  }
 
 #ifdef MHD_WINSOCK_SOCKETS
   if (0 != ioctlsocket (fd, FIONBIO, &flags))
-    {
-      fprintf (stderr, "Failed to make socket non-blocking: %u\n",
-               (unsigned)sock_errno);
-      MHD_socket_close_chk_ (fd);
-      return MHD_INVALID_SOCKET;
-    }
+  {
+    fprintf (stderr, "Failed to make socket non-blocking: %u\n",
+             (unsigned) sock_errno);
+    MHD_socket_close_chk_ (fd);
+    return MHD_INVALID_SOCKET;
+  }
 #else  /* MHD_POSIX_SOCKETS */
   flags = fcntl (fd, F_GETFL);
   if ( ( (-1 == flags) ||
          ( (flags != (flags | O_NONBLOCK)) &&
            (0 != fcntl (fd, F_SETFL, flags | O_NONBLOCK)) ) ) )
-    {
-      fprintf (stderr, "Failed to make socket non-blocking: %s\n",
-              MHD_socket_last_strerr_ ());
-      MHD_socket_close_chk_ (fd);
-      return MHD_INVALID_SOCKET;
-    }
+  {
+    fprintf (stderr, "Failed to make socket non-blocking: %s\n",
+             MHD_socket_last_strerr_ ());
+    MHD_socket_close_chk_ (fd);
+    return MHD_INVALID_SOCKET;
+  }
 #endif /* MHD_POSIX_SOCKETS */
 
-  if (listen(fd, SOMAXCONN) < 0)
-    {
-      fprintf (stderr, "Failed to listen on socket: %u\n",
-               (unsigned)sock_errno);
-      MHD_socket_close_chk_ (fd);
-      return MHD_INVALID_SOCKET;
-    }
+  if (listen (fd, SOMAXCONN) < 0)
+  {
+    fprintf (stderr, "Failed to listen on socket: %u\n",
+             (unsigned) sock_errno);
+    MHD_socket_close_chk_ (fd);
+    return MHD_INVALID_SOCKET;
+  }
 
   return fd;
 }
 
 
 MHD_THRD_RTRN_TYPE_ MHD_THRD_CALL_SPEC_
-select_thread(void* data)
+select_thread (void*data)
 {
   /* use select() like in daemon.c */
-  MHD_socket listen_sock = *((MHD_socket*)data);
+  MHD_socket listen_sock = *((MHD_socket*) data);
   fd_set rs, ws;
   struct timeval timeout;
 
-  FD_ZERO(&rs);
-  FD_ZERO(&ws);
-  FD_SET(listen_sock, &rs);
+  FD_ZERO (&rs);
+  FD_ZERO (&ws);
+  FD_SET (listen_sock, &rs);
   timeout.tv_usec = 0;
   timeout.tv_sec = 7;
 
-  check_err = (0 > MHD_SYS_select_(listen_sock + 1, &rs, &ws, NULL, &timeout));
+  check_err = (0 > MHD_SYS_select_ (listen_sock + 1, &rs, &ws, NULL, 
&timeout));
 
-  return (MHD_THRD_RTRN_TYPE_)0;
+  return (MHD_THRD_RTRN_TYPE_) 0;
 }
 
 
 #ifdef HAVE_POLL
 MHD_THRD_RTRN_TYPE_ MHD_THRD_CALL_SPEC_
-poll_thread(void* data)
+poll_thread (void*data)
 {
   /* use poll() like in daemon.c */
   struct pollfd p[1];
-  MHD_socket listen_sock = *((MHD_socket*)data);
+  MHD_socket listen_sock = *((MHD_socket*) data);
 
   p[0].fd = listen_sock;
   p[0].events = POLLIN;
@@ -253,22 +253,22 @@ poll_thread(void* data)
 
   check_err = (0 > MHD_sys_poll_ (p, 1, 7000));
 
-  return (MHD_THRD_RTRN_TYPE_)0;
+  return (MHD_THRD_RTRN_TYPE_) 0;
 }
 #endif /* HAVE_POLL */
 
 
 static void
-local_sleep(unsigned seconds)
+local_sleep (unsigned seconds)
 {
-#if defined(_WIN32) && !defined(__CYGWIN__)
-  Sleep(seconds * 1000);
+#if defined(_WIN32) && ! defined(__CYGWIN__)
+  Sleep (seconds * 1000);
 #else
   unsigned seconds_left = seconds;
   do
-    {
-      seconds_left = sleep(seconds_left);
-    } while (seconds_left > 0);
+  {
+    seconds_left = sleep (seconds_left);
+  } while (seconds_left > 0);
 #endif
 }
 
@@ -279,7 +279,7 @@ main (int argc, char *const *argv)
   int i;
   time_t start_t, end_t;
   int result = 0;
-  MHD_THRD_RTRN_TYPE_ (MHD_THRD_CALL_SPEC_ *test_func)(void* data);
+  MHD_THRD_RTRN_TYPE_ (MHD_THRD_CALL_SPEC_ * test_func)(void*data);
 #ifdef MHD_WINSOCK_SOCKETS
   WORD ver_req;
   WSADATA wsa_data;
@@ -287,101 +287,102 @@ main (int argc, char *const *argv)
 #endif /* MHD_WINSOCK_SOCKETS */
   bool test_poll;
   bool must_ignore;
-  (void)argc; /* Unused. Silent compiler warning. */
+  (void) argc; /* Unused. Silent compiler warning. */
 
-  test_poll = has_in_name(argv[0], "_poll");
-  must_ignore = has_in_name(argv[0], "_ignore");
+  test_poll = has_in_name (argv[0], "_poll");
+  must_ignore = has_in_name (argv[0], "_ignore");
   if (! test_poll)
     test_func = &select_thread;
   else
-    {
+  {
 #ifndef HAVE_POLL
-      return 77;
+    return 77;
 #else  /* ! HAVE_POLL */
-      test_func = &poll_thread;
+    test_func = &poll_thread;
 #endif /* ! HAVE_POLL */
-    }
+  }
 
 #ifdef MHD_WINSOCK_SOCKETS
-  ver_req = MAKEWORD(2, 2);
-
-  err = WSAStartup(ver_req, &wsa_data);
-  if (err != 0 || MAKEWORD(2, 2) != wsa_data.wVersion)
-    {
-      printf("WSAStartup() failed\n");
-      WSACleanup();
-      return 99;
-    }
+  ver_req = MAKEWORD (2, 2);
+
+  err = WSAStartup (ver_req, &wsa_data);
+  if ((err != 0)||(MAKEWORD (2, 2) != wsa_data.wVersion))
+  {
+    printf ("WSAStartup() failed\n");
+    WSACleanup ();
+    return 99;
+  }
 #endif /* MHD_WINSOCK_SOCKETS */
 
   /* try several times to ensure that accidental incoming connection
    * didn't interfere with test results
    */
   for (i = 0; i < 5 && result == 0; i++)
-    {
-      MHD_thread_handle_ sel_thrd;
-      /* fprintf(stdout, "Creating, binding and listening socket...\n"); */
-      MHD_socket listen_socket = start_socket_listen (AF_INET);
-      if (MHD_INVALID_SOCKET == listen_socket)
-        return 99;
-
-      check_err = true;
-      /* fprintf (stdout, "Starting select() thread...\n"); */
+  {
+    MHD_thread_handle_ sel_thrd;
+    /* fprintf(stdout, "Creating, binding and listening socket...\n"); */
+    MHD_socket listen_socket = start_socket_listen (AF_INET);
+    if (MHD_INVALID_SOCKET == listen_socket)
+      return 99;
+
+    check_err = true;
+    /* fprintf (stdout, "Starting select() thread...\n"); */
 #if defined(MHD_USE_POSIX_THREADS)
-      if (0 != pthread_create (&sel_thrd, NULL, test_func, &listen_socket))
-        {
-          MHD_socket_close_chk_ (listen_socket);
-          fprintf (stderr, "Can't start thread\n");
-          return 99;
-        }
+    if (0 != pthread_create (&sel_thrd, NULL, test_func, &listen_socket))
+    {
+      MHD_socket_close_chk_ (listen_socket);
+      fprintf (stderr, "Can't start thread\n");
+      return 99;
+    }
 #elif defined(MHD_USE_W32_THREADS)
-      sel_thrd = (HANDLE)_beginthreadex (NULL, 0, test_func, &listen_socket, 
0, NULL);
-      if (0 == (sel_thrd))
-        {
-          MHD_socket_close_chk_ (listen_socket);
-          fprintf (stderr, "Can't start select() thread\n");
-          return 99;
-        }
+    sel_thrd = (HANDLE) _beginthreadex (NULL, 0, test_func, &listen_socket, 0,
+                                        NULL);
+    if (0 == (sel_thrd))
+    {
+      MHD_socket_close_chk_ (listen_socket);
+      fprintf (stderr, "Can't start select() thread\n");
+      return 99;
+    }
 #else
 #error No threading lib available
 #endif
-      /* fprintf (stdout, "Waiting...\n"); */
-      local_sleep(1); /* make sure that select() is started */
-
-      /* fprintf (stdout, "Shutting down socket...\n"); */
-      start_t = time (NULL);
-      shutdown (listen_socket, SHUT_RDWR);
-
-      /* fprintf (stdout, "Waiting for thread to finish...\n"); */
-      if (!MHD_join_thread_(sel_thrd))
-        {
-          MHD_socket_close_chk_(listen_socket);
-          fprintf (stderr, "Can't join select() thread\n");
-          return 99;
-        }
-      if (check_err)
-        {
-          MHD_socket_close_chk_(listen_socket);
-          fprintf (stderr, "Error in waiting thread\n");
-          return 99;
-        }
-      end_t = time (NULL);
-      /* fprintf (stdout, "Thread finished.\n"); */
-      MHD_socket_close_chk_(listen_socket);
-
-      if (start_t == (time_t)-1 || end_t == (time_t)-1)
-        {
-          MHD_socket_close_chk_(listen_socket);
-          fprintf (stderr, "Can't get current time\n");
-          return 99;
-        }
-      if (end_t - start_t > 3)
-        result++;
+    /* fprintf (stdout, "Waiting...\n"); */
+    local_sleep (1);  /* make sure that select() is started */
+
+    /* fprintf (stdout, "Shutting down socket...\n"); */
+    start_t = time (NULL);
+    shutdown (listen_socket, SHUT_RDWR);
+
+    /* fprintf (stdout, "Waiting for thread to finish...\n"); */
+    if (! MHD_join_thread_ (sel_thrd))
+    {
+      MHD_socket_close_chk_ (listen_socket);
+      fprintf (stderr, "Can't join select() thread\n");
+      return 99;
+    }
+    if (check_err)
+    {
+      MHD_socket_close_chk_ (listen_socket);
+      fprintf (stderr, "Error in waiting thread\n");
+      return 99;
+    }
+    end_t = time (NULL);
+    /* fprintf (stdout, "Thread finished.\n"); */
+    MHD_socket_close_chk_ (listen_socket);
+
+    if ((start_t == (time_t) -1) ||(end_t == (time_t) -1) )
+    {
+      MHD_socket_close_chk_ (listen_socket);
+      fprintf (stderr, "Can't get current time\n");
+      return 99;
     }
+    if (end_t - start_t > 3)
+      result++;
+  }
 
 #ifdef MHD_WINSOCK_SOCKETS
-  WSACleanup();
+  WSACleanup ();
 #endif /* MHD_WINSOCK_SOCKETS */
 
-  return must_ignore ? (!result) : (result);
+  return must_ignore ? (! result) : (result);
 }
diff --git a/src/microhttpd/test_start_stop.c b/src/microhttpd/test_start_stop.c
index d27291b8..541cc5c5 100644
--- a/src/microhttpd/test_start_stop.c
+++ b/src/microhttpd/test_start_stop.c
@@ -27,10 +27,10 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -44,9 +44,9 @@ ahc_echo (void *cls,
           const char *upload_data, size_t *upload_data_size,
           void **unused)
 {
-  (void)cls;(void)connection;(void)url;          /* Unused. Silent compiler 
warning. */
-  (void)method;(void)version;(void)upload_data;  /* Unused. Silent compiler 
warning. */
-  (void)upload_data_size;(void)unused;           /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) connection; (void) url;          /* Unused. Silent 
compiler warning. */
+  (void) method; (void) version; (void) upload_data;  /* Unused. Silent 
compiler warning. */
+  (void) upload_data_size; (void) unused;           /* Unused. Silent compiler 
warning. */
 
   return MHD_NO;
 }
@@ -58,7 +58,8 @@ testInternalGet (int poll_flag)
 {
   struct MHD_Daemon *d;
 
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         0, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 1;
@@ -71,7 +72,9 @@ testMultithreadedGet (int poll_flag)
 {
   struct MHD_Daemon *d;
 
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | poll_flag,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         0, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 2;
@@ -85,7 +88,8 @@ testMultithreadedPoolGet (int poll_flag)
 {
   struct MHD_Daemon *d;
 
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         0, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
@@ -103,8 +107,8 @@ testExternalGet ()
 
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         0, NULL, NULL,
-                       &ahc_echo, "GET",
-                       MHD_OPTION_END);
+                        &ahc_echo, "GET",
+                        MHD_OPTION_END);
   if (NULL == d)
     return 8;
   MHD_stop_daemon (d);
@@ -127,21 +131,21 @@ main (int argc,
 #endif
   errorCount += testExternalGet ();
 #if defined (MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
-    {
-      errorCount += testInternalGet(MHD_USE_POLL);
-      errorCount += testMultithreadedGet(MHD_USE_POLL);
-      errorCount += testMultithreadedPoolGet(MHD_USE_POLL);
-    }
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
-    {
-      errorCount += testInternalGet(MHD_USE_EPOLL);
-      errorCount += testMultithreadedPoolGet(MHD_USE_EPOLL);
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_POLL))
+  {
+    errorCount += testInternalGet (MHD_USE_POLL);
+    errorCount += testMultithreadedGet (MHD_USE_POLL);
+    errorCount += testMultithreadedPoolGet (MHD_USE_POLL);
+  }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL))
+  {
+    errorCount += testInternalGet (MHD_USE_EPOLL);
+    errorCount += testMultithreadedPoolGet (MHD_USE_EPOLL);
+  }
 #endif
   if (0 != errorCount)
     fprintf (stderr,
-            "Error (code: %u)\n",
-            errorCount);
+             "Error (code: %u)\n",
+             errorCount);
   return errorCount != 0;       /* 0 == pass */
 }
diff --git a/src/microhttpd/test_str.c b/src/microhttpd/test_str.c
index 12e12a85..8739a23a 100644
--- a/src/microhttpd/test_str.c
+++ b/src/microhttpd/test_str.c
@@ -46,235 +46,237 @@ static int verbose = 0; /* verbose level (0-3)*/
  * Functions must not depend of current current locale,
  * so result must be the same in any locale.
  */
-static const char * const locale_names[] = {
-    "C",
-    "",      /* System default locale */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-    ".OCP",   /* W32 system default OEM code page */
-    ".ACP",   /* W32 system default ANSI code page */
-    ".65001", /* UTF-8 */
-    ".437",
-    ".850",
-    ".857",
-    ".866",
-    ".1250",
-    ".1251",
-    ".1252",
-    ".1254",
-    ".20866", /* number for KOI8-R */
-    ".28591", /* number for ISO-8859-1 */
-    ".28595", /* number for ISO-8859-5 */
-    ".28599", /* number for ISO-8859-9 */
-    ".28605", /* number for ISO-8859-15 */
-    "en",
-    "english",
-    "en-US",
-    "English-US",
-    "en-US.437",
-    "English_United States.437",
-    "en-US.1252",
-    "English_United States.1252",
-    "English_United States.28591",
-    "English_United States.65001",
-    "fra",
-    "french",
-    "fr-FR",
-    "French_France",
-    "fr-FR.850",
-    "french_france.850",
-    "fr-FR.1252",
-    "French_france.1252",
-    "French_france.28605",
-    "French_France.65001",
-    "de",
-    "de-DE",
-    "de-DE.850",
-    "German_Germany.850",
-    "German_Germany.1250",
-    "de-DE.1252",
-    "German_Germany.1252",
-    "German_Germany.28605",
-    "German_Germany.65001",
-    "tr",
-    "trk",
-    "turkish",
-    "tr-TR",
-    "tr-TR.1254",
-    "Turkish_Turkey.1254",
-    "tr-TR.857",
-    "Turkish_Turkey.857",
-    "Turkish_Turkey.28599",
-    "Turkish_Turkey.65001",
-    "ru",
-    "ru-RU",
-    "Russian",
-    "ru-RU.866",
-    "Russian_Russia.866",
-    "ru-RU.1251",
-    "Russian_Russia.1251",
-    "Russian_Russia.20866",
-    "Russian_Russia.28595",
-    "Russian_Russia.65001",
-    "zh-Hans",
-    "zh-Hans.936",
-    "chinese-simplified"
+static const char *const locale_names[] = {
+  "C",
+  "",        /* System default locale */
+#if defined(_WIN32) && ! defined(__CYGWIN__)
+  ".OCP",     /* W32 system default OEM code page */
+  ".ACP",     /* W32 system default ANSI code page */
+  ".65001",   /* UTF-8 */
+  ".437",
+  ".850",
+  ".857",
+  ".866",
+  ".1250",
+  ".1251",
+  ".1252",
+  ".1254",
+  ".20866",   /* number for KOI8-R */
+  ".28591",   /* number for ISO-8859-1 */
+  ".28595",   /* number for ISO-8859-5 */
+  ".28599",   /* number for ISO-8859-9 */
+  ".28605",   /* number for ISO-8859-15 */
+  "en",
+  "english",
+  "en-US",
+  "English-US",
+  "en-US.437",
+  "English_United States.437",
+  "en-US.1252",
+  "English_United States.1252",
+  "English_United States.28591",
+  "English_United States.65001",
+  "fra",
+  "french",
+  "fr-FR",
+  "French_France",
+  "fr-FR.850",
+  "french_france.850",
+  "fr-FR.1252",
+  "French_france.1252",
+  "French_france.28605",
+  "French_France.65001",
+  "de",
+  "de-DE",
+  "de-DE.850",
+  "German_Germany.850",
+  "German_Germany.1250",
+  "de-DE.1252",
+  "German_Germany.1252",
+  "German_Germany.28605",
+  "German_Germany.65001",
+  "tr",
+  "trk",
+  "turkish",
+  "tr-TR",
+  "tr-TR.1254",
+  "Turkish_Turkey.1254",
+  "tr-TR.857",
+  "Turkish_Turkey.857",
+  "Turkish_Turkey.28599",
+  "Turkish_Turkey.65001",
+  "ru",
+  "ru-RU",
+  "Russian",
+  "ru-RU.866",
+  "Russian_Russia.866",
+  "ru-RU.1251",
+  "Russian_Russia.1251",
+  "Russian_Russia.20866",
+  "Russian_Russia.28595",
+  "Russian_Russia.65001",
+  "zh-Hans",
+  "zh-Hans.936",
+  "chinese-simplified"
 #else /* ! _WIN32 || __CYGWIN__ */
-    "C.UTF-8",
-    "POSIX",
-    "en",
-    "en_US",
-    "en_US.ISO-8859-1",
-    "en_US.ISO_8859-1",
-    "en_US.ISO8859-1",
-    "en_US.iso88591",
-    "en_US.ISO-8859-15",
-    "en_US.DIS_8859-15",
-    "en_US.ISO8859-15",
-    "en_US.iso885915",
-    "en_US.1252",
-    "en_US.CP1252",
-    "en_US.UTF-8",
-    "en_US.utf8",
-    "fr",
-    "fr_FR",
-    "fr_FR.850",
-    "fr_FR.IBM850",
-    "fr_FR.1252",
-    "fr_FR.CP1252",
-    "fr_FR.ISO-8859-1",
-    "fr_FR.ISO_8859-1",
-    "fr_FR.ISO8859-1",
-    "fr_FR.iso88591",
-    "fr_FR.ISO-8859-15",
-    "fr_FR.DIS_8859-15",
-    "fr_FR.ISO8859-15",
-    "fr_FR.iso8859-15",
-    "fr_FR.UTF-8",
-    "fr_FR.utf8",
-    "de",
-    "de_DE",
-    "de_DE.850",
-    "de_DE.IBM850",
-    "de_DE.1250",
-    "de_DE.CP1250",
-    "de_DE.1252",
-    "de_DE.CP1252",
-    "de_DE.ISO-8859-1",
-    "de_DE.ISO_8859-1",
-    "de_DE.ISO8859-1",
-    "de_DE.iso88591",
-    "de_DE.ISO-8859-15",
-    "de_DE.DIS_8859-15",
-    "de_DE.ISO8859-15",
-    "de_DE.iso885915",
-    "de_DE.UTF-8",
-    "de_DE.utf8",
-    "tr",
-    "tr_TR",
-    "tr_TR.1254",
-    "tr_TR.CP1254",
-    "tr_TR.857",
-    "tr_TR.IBM857",
-    "tr_TR.ISO-8859-9",
-    "tr_TR.ISO8859-9",
-    "tr_TR.iso88599",
-    "tr_TR.UTF-8",
-    "tr_TR.utf8",
-    "ru",
-    "ru_RU",
-    "ru_RU.1251",
-    "ru_RU.CP1251",
-    "ru_RU.866",
-    "ru_RU.IBM866",
-    "ru_RU.KOI8-R",
-    "ru_RU.koi8-r",
-    "ru_RU.KOI8-RU",
-    "ru_RU.ISO-8859-5",
-    "ru_RU.ISO_8859-5",
-    "ru_RU.ISO8859-5",
-    "ru_RU.iso88595",
-    "ru_RU.UTF-8",
-    "zh_CN",
-    "zh_CN.GB2312",
-    "zh_CN.UTF-8",
+  "C.UTF-8",
+  "POSIX",
+  "en",
+  "en_US",
+  "en_US.ISO-8859-1",
+  "en_US.ISO_8859-1",
+  "en_US.ISO8859-1",
+  "en_US.iso88591",
+  "en_US.ISO-8859-15",
+  "en_US.DIS_8859-15",
+  "en_US.ISO8859-15",
+  "en_US.iso885915",
+  "en_US.1252",
+  "en_US.CP1252",
+  "en_US.UTF-8",
+  "en_US.utf8",
+  "fr",
+  "fr_FR",
+  "fr_FR.850",
+  "fr_FR.IBM850",
+  "fr_FR.1252",
+  "fr_FR.CP1252",
+  "fr_FR.ISO-8859-1",
+  "fr_FR.ISO_8859-1",
+  "fr_FR.ISO8859-1",
+  "fr_FR.iso88591",
+  "fr_FR.ISO-8859-15",
+  "fr_FR.DIS_8859-15",
+  "fr_FR.ISO8859-15",
+  "fr_FR.iso8859-15",
+  "fr_FR.UTF-8",
+  "fr_FR.utf8",
+  "de",
+  "de_DE",
+  "de_DE.850",
+  "de_DE.IBM850",
+  "de_DE.1250",
+  "de_DE.CP1250",
+  "de_DE.1252",
+  "de_DE.CP1252",
+  "de_DE.ISO-8859-1",
+  "de_DE.ISO_8859-1",
+  "de_DE.ISO8859-1",
+  "de_DE.iso88591",
+  "de_DE.ISO-8859-15",
+  "de_DE.DIS_8859-15",
+  "de_DE.ISO8859-15",
+  "de_DE.iso885915",
+  "de_DE.UTF-8",
+  "de_DE.utf8",
+  "tr",
+  "tr_TR",
+  "tr_TR.1254",
+  "tr_TR.CP1254",
+  "tr_TR.857",
+  "tr_TR.IBM857",
+  "tr_TR.ISO-8859-9",
+  "tr_TR.ISO8859-9",
+  "tr_TR.iso88599",
+  "tr_TR.UTF-8",
+  "tr_TR.utf8",
+  "ru",
+  "ru_RU",
+  "ru_RU.1251",
+  "ru_RU.CP1251",
+  "ru_RU.866",
+  "ru_RU.IBM866",
+  "ru_RU.KOI8-R",
+  "ru_RU.koi8-r",
+  "ru_RU.KOI8-RU",
+  "ru_RU.ISO-8859-5",
+  "ru_RU.ISO_8859-5",
+  "ru_RU.ISO8859-5",
+  "ru_RU.iso88595",
+  "ru_RU.UTF-8",
+  "zh_CN",
+  "zh_CN.GB2312",
+  "zh_CN.UTF-8",
 #endif /* ! _WIN32 || __CYGWIN__ */
 };
 
-static const unsigned int locale_name_count = sizeof(locale_names) / 
sizeof(locale_names[0]);
+static const unsigned int locale_name_count = sizeof(locale_names)
+                                              / sizeof(locale_names[0]);
 
 
 /*
  *  Helper functions
  */
 
-int set_test_locale(unsigned int num)
+int set_test_locale (unsigned int num)
 {
   if (num >= locale_name_count)
     return -1;
   if (verbose > 2)
-    printf("Setting locale \"%s\":", locale_names[num]);
-   if (setlocale(LC_ALL, locale_names[num]))
-     {
-       if (verbose > 2)
-         printf(" succeed.\n");
-       return 1;
-     }
-   if (verbose > 2)
-     printf(" failed.\n");
-   return 0;
+    printf ("Setting locale \"%s\":", locale_names[num]);
+  if (setlocale (LC_ALL, locale_names[num]))
+  {
+    if (verbose > 2)
+      printf (" succeed.\n");
+    return 1;
+  }
+  if (verbose > 2)
+    printf (" failed.\n");
+  return 0;
 }
 
-const char * get_current_locale_str(void)
+const char *get_current_locale_str (void)
 {
-  char const * loc_str = setlocale(LC_ALL, NULL);
+  char const *loc_str = setlocale (LC_ALL, NULL);
   return loc_str ? loc_str : "unknown";
 }
 
-static char tmp_bufs[4][4*1024]; /* should be enough for testing */
+static char tmp_bufs[4][4 * 1024]; /* should be enough for testing */
 static size_t buf_idx = 0;
 
 /* print non-printable chars as char codes */
-char * n_prnt(const char * str)
+char *n_prnt (const char *str)
 {
-  static char * buf; /* should be enough for testing */
+  static char *buf;  /* should be enough for testing */
   static const size_t buf_size = sizeof(tmp_bufs[0]);
-  const unsigned char * p = (const unsigned char*)str;
+  const unsigned char *p = (const unsigned char*) str;
   size_t w_pos = 0;
   if (++buf_idx > 3)
     buf_idx = 0;
   buf = tmp_bufs[buf_idx];
 
-  while(*p && w_pos + 1 < buf_size)
+  while (*p && w_pos + 1 < buf_size)
+  {
+    const unsigned char c = *p;
+    if ((c == '\\') ||(c == '"') )
     {
-      const unsigned char c = *p;
-      if (c == '\\' || c == '"')
-        {
-          if (w_pos + 2 >= buf_size)
-            break;
-          buf[w_pos++] = '\\';
-          buf[w_pos++] = c;
-        }
-      else if (c >= 0x20 && c <= 0x7E)
-          buf[w_pos++] = c;
-      else
-        {
-          if (w_pos + 4 >= buf_size)
-            break;
-          if (snprintf(buf + w_pos, buf_size - w_pos, "\\x%02hX", (short 
unsigned int)c) != 4)
-            break;
-          w_pos += 4;
-        }
-      p++;
+      if (w_pos + 2 >= buf_size)
+        break;
+      buf[w_pos++] = '\\';
+      buf[w_pos++] = c;
     }
+    else if ((c >= 0x20) &&(c <= 0x7E) )
+      buf[w_pos++] = c;
+    else
+    {
+      if (w_pos + 4 >= buf_size)
+        break;
+      if (snprintf (buf + w_pos, buf_size - w_pos, "\\x%02hX", (short unsigned
+                                                                int) c) != 4)
+        break;
+      w_pos += 4;
+    }
+    p++;
+  }
   if (*p)
-    { /* not full string is printed */
+  {   /* not full string is printed */
       /* enough space for "..." ? */
-      if (w_pos + 3 > buf_size)
-        w_pos = buf_size - 4;
-      buf[w_pos++] = '.';
-      buf[w_pos++] = '.';
-      buf[w_pos++] = '.';
-    }
+    if (w_pos + 3 > buf_size)
+      w_pos = buf_size - 4;
+    buf[w_pos++] = '.';
+    buf[w_pos++] = '.';
+    buf[w_pos++] = '.';
+  }
   buf[w_pos] = 0;
   return buf;
 }
@@ -282,7 +284,7 @@ char * n_prnt(const char * str)
 
 struct str_with_len
 {
-  const char * const str;
+  const char *const str;
   const size_t len;
 };
 
@@ -299,118 +301,129 @@ struct two_eq_strs
 };
 
 static const struct two_eq_strs eq_strings[] = {
-    {D_STR_W_LEN("1234567890!@~%&$@#{}[]\\/!?`."), 
D_STR_W_LEN("1234567890!@~%&$@#{}[]\\/!?`.")},
-    {D_STR_W_LEN("Simple string."), D_STR_W_LEN("Simple string.")},
-    {D_STR_W_LEN("SIMPLE STRING."), D_STR_W_LEN("SIMPLE STRING.")},
-    {D_STR_W_LEN("simple string."), D_STR_W_LEN("simple string.")},
-    {D_STR_W_LEN("simple string."), D_STR_W_LEN("Simple String.")},
-    {D_STR_W_LEN("sImPlE StRiNg."), D_STR_W_LEN("SiMpLe sTrInG.")},
-    {D_STR_W_LEN("SIMPLE STRING."), D_STR_W_LEN("simple string.")},
-    {D_STR_W_LEN("abcdefghijklmnopqrstuvwxyz"), 
D_STR_W_LEN("abcdefghijklmnopqrstuvwxyz")},
-    {D_STR_W_LEN("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 
D_STR_W_LEN("ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
-    {D_STR_W_LEN("abcdefghijklmnopqrstuvwxyz"), 
D_STR_W_LEN("ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
-    {D_STR_W_LEN("zyxwvutsrqponMLKJIHGFEDCBA"), 
D_STR_W_LEN("ZYXWVUTSRQPONmlkjihgfedcba")},
-
-    {D_STR_W_LEN("Cha\x8cne pour le test."),
-     D_STR_W_LEN("Cha\x8cne pour le test.")},     /* "Chaîne pour le test." in 
CP850 */
-    {D_STR_W_LEN("cha\x8cne pOur Le TEst."),
-     D_STR_W_LEN("Cha\x8cne poUr Le teST.")},
-    {D_STR_W_LEN("Cha\xeene pour le test."),
-     D_STR_W_LEN("Cha\xeene pour le test.")},     /* "Chaîne pour le test." in 
CP1252/ISO-8859-1/ISO-8859-15 */
-    {D_STR_W_LEN("CHa\xeene POUR le test."),
-     D_STR_W_LEN("Cha\xeeNe pour lE TEST.")},
-    {D_STR_W_LEN("Cha\xc3\xaene pour le Test."),
-     D_STR_W_LEN("Cha\xc3\xaene pour le Test.")}, /* "Chaîne pour le test." in 
UTF-8 */
-    {D_STR_W_LEN("ChA\xc3\xaene pouR lE TesT."),
-     D_STR_W_LEN("Cha\xc3\xaeNe Pour le teSt.")},
-
-    {D_STR_W_LEN(".Beispiel Zeichenfolge"),
-     D_STR_W_LEN(".Beispiel Zeichenfolge")},
-    {D_STR_W_LEN(".bEisPiel ZEIchenfoLgE"),
-     D_STR_W_LEN(".BEiSpiEl zeIcheNfolge")},
-
-    {D_STR_W_LEN("Do\xa7rulama \x87izgi!"),
-     D_STR_W_LEN("Do\xa7rulama \x87izgi!")},      /* "Doğrulama çizgi!" in 
CP857 */
-    {D_STR_W_LEN("Do\xa7rulama \x87IzgI!"),       /* Spelling intentionally 
incorrect here */
-     D_STR_W_LEN("Do\xa7rulama \x87izgi!")},      /* Note: 'i' is not caseless 
equal to 'I' in Turkish */
-    {D_STR_W_LEN("Do\xf0rulama \xe7izgi!"),
-     D_STR_W_LEN("Do\xf0rulama \xe7izgi!")},      /* "Doğrulama çizgi!" in 
CP1254/ISO-8859-9 */
-    {D_STR_W_LEN("Do\xf0rulamA \xe7Izgi!"),
-     D_STR_W_LEN("do\xf0rulama \xe7izgi!")},
-    {D_STR_W_LEN("Do\xc4\x9frulama \xc3\xa7izgi!"),
-     D_STR_W_LEN("Do\xc4\x9frulama \xc3\xa7izgi!")},        /* "Doğrulama 
çizgi!" in UTF-8 */
-    {D_STR_W_LEN("do\xc4\x9fruLAMA \xc3\xa7Izgi!"),         /* Spelling 
intentionally incorrect here */
-     D_STR_W_LEN("DO\xc4\x9frulama \xc3\xa7izgI!")},        /* Spelling 
intentionally incorrect here */
-
-    {D_STR_W_LEN("\x92\xa5\xe1\xe2\xae\xa2\xa0\xef \x91\xe2\xe0\xae\xaa\xa0."),
-     D_STR_W_LEN("\x92\xa5\xe1\xe2\xae\xa2\xa0\xef 
\x91\xe2\xe0\xae\xaa\xa0.")}, /* "Тестовая Строка." in CP866 */
-    {D_STR_W_LEN("\xd2\xe5\xf1\xf2\xee\xe2\xe0\xff \xd1\xf2\xf0\xee\xea\xe0."),
-     D_STR_W_LEN("\xd2\xe5\xf1\xf2\xee\xe2\xe0\xff 
\xd1\xf2\xf0\xee\xea\xe0.")}, /* "Тестовая Строка." in CP1251 */
-    {D_STR_W_LEN("\xf4\xc5\xd3\xd4\xcf\xd7\xc1\xd1 \xf3\xd4\xd2\xcf\xcb\xc1."),
-     D_STR_W_LEN("\xf4\xc5\xd3\xd4\xcf\xd7\xc1\xd1 
\xf3\xd4\xd2\xcf\xcb\xc1.")}, /* "Тестовая Строка." in KOI8-R */
-    {D_STR_W_LEN("\xc2\xd5\xe1\xe2\xde\xd2\xd0\xef \xc1\xe2\xe0\xde\xda\xd0."),
-     D_STR_W_LEN("\xc2\xd5\xe1\xe2\xde\xd2\xd0\xef 
\xc1\xe2\xe0\xde\xda\xd0.")}, /* "Тестовая Строка." in ISO-8859-5 */
-    {D_STR_W_LEN("\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbe\xd0\xb2\xd0\xb0\xd1"
-                 "\x8f \xd0\xa1\xd1\x82\xd1\x80\xd0\xbe\xd0\xba\xd0\xb0."),
-     D_STR_W_LEN("\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbe\xd0\xb2\xd0\xb0\xd1"
-                 "\x8f \xd0\xa1\xd1\x82\xd1\x80\xd0\xbe\xd0\xba\xd0\xb0.")},   
  /* "Тестовая Строка." in UTF-8 */
-
-    
{D_STR_W_LEN("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-                 "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@[\\]"
-                 
"^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
-                 
"\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4"
-                 
"\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
-                 
"\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"
-                 
"\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
-                 
"\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4"
-                 "\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
-     
D_STR_W_LEN("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-                 "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@[\\]"
-                 
"^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
-                 
"\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4"
-                 
"\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
-                 
"\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"
-                 
"\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
-                 
"\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4"
-                 "\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff")}, /* Full 
sequence without a-z */
-    
{D_STR_W_LEN("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-                 "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@AB"
-                 
"CDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83"
-                 
"\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97"
-                 
"\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab"
-                 
"\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-                 
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3"
-                 
"\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
-                 
"\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb"
-                 "\xfc\xfd\xfe\xff"),
-     
D_STR_W_LEN("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-                 "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@AB"
-                 
"CDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83"
-                 
"\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97"
-                 
"\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab"
-                 
"\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-                 
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3"
-                 
"\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
-                 
"\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb"
-                 "\xfc\xfd\xfe\xff")}, /* Full sequence */
-    
{D_STR_W_LEN("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-                 "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@AB"
-                 
"CDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89"
-                 
"\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d"
-                 
"\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1"
-                 
"\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5"
-                 
"\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9"
-                 
"\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed"
-                 
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
-     
D_STR_W_LEN("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-                 "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@ab"
-                 
"cdefghijklmnopqrstuvwxyz[\\]^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89"
-                 
"\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d"
-                 
"\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1"
-                 
"\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5"
-                 
"\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9"
-                 
"\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed"
-                 
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff")} /* 
Full with A/a match */
+  {D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`."), D_STR_W_LEN (
+     "1234567890!@~%&$@#{}[]\\/!?`.")},
+  {D_STR_W_LEN ("Simple string."), D_STR_W_LEN ("Simple string.")},
+  {D_STR_W_LEN ("SIMPLE STRING."), D_STR_W_LEN ("SIMPLE STRING.")},
+  {D_STR_W_LEN ("simple string."), D_STR_W_LEN ("simple string.")},
+  {D_STR_W_LEN ("simple string."), D_STR_W_LEN ("Simple String.")},
+  {D_STR_W_LEN ("sImPlE StRiNg."), D_STR_W_LEN ("SiMpLe sTrInG.")},
+  {D_STR_W_LEN ("SIMPLE STRING."), D_STR_W_LEN ("simple string.")},
+  {D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz"), D_STR_W_LEN (
+     "abcdefghijklmnopqrstuvwxyz")},
+  {D_STR_W_LEN ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), D_STR_W_LEN (
+     "ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
+  {D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz"), D_STR_W_LEN (
+     "ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
+  {D_STR_W_LEN ("zyxwvutsrqponMLKJIHGFEDCBA"), D_STR_W_LEN (
+     "ZYXWVUTSRQPONmlkjihgfedcba")},
+
+  {D_STR_W_LEN ("Cha\x8cne pour le test."),
+   D_STR_W_LEN ("Cha\x8cne pour le test.")},      /* "Chaîne pour le test." in 
CP850 */
+  {D_STR_W_LEN ("cha\x8cne pOur Le TEst."),
+   D_STR_W_LEN ("Cha\x8cne poUr Le teST.")},
+  {D_STR_W_LEN ("Cha\xeene pour le test."),
+   D_STR_W_LEN ("Cha\xeene pour le test.")},      /* "Chaîne pour le test." in 
CP1252/ISO-8859-1/ISO-8859-15 */
+  {D_STR_W_LEN ("CHa\xeene POUR le test."),
+   D_STR_W_LEN ("Cha\xeeNe pour lE TEST.")},
+  {D_STR_W_LEN ("Cha\xc3\xaene pour le Test."),
+   D_STR_W_LEN ("Cha\xc3\xaene pour le Test.")},  /* "Chaîne pour le test." in 
UTF-8 */
+  {D_STR_W_LEN ("ChA\xc3\xaene pouR lE TesT."),
+   D_STR_W_LEN ("Cha\xc3\xaeNe Pour le teSt.")},
+
+  {D_STR_W_LEN (".Beispiel Zeichenfolge"),
+   D_STR_W_LEN (".Beispiel Zeichenfolge")},
+  {D_STR_W_LEN (".bEisPiel ZEIchenfoLgE"),
+   D_STR_W_LEN (".BEiSpiEl zeIcheNfolge")},
+
+  {D_STR_W_LEN ("Do\xa7rulama \x87izgi!"),
+   D_STR_W_LEN ("Do\xa7rulama \x87izgi!")},       /* "Doğrulama çizgi!" in 
CP857 */
+  {D_STR_W_LEN ("Do\xa7rulama \x87IzgI!"),        /* Spelling intentionally 
incorrect here */
+   D_STR_W_LEN ("Do\xa7rulama \x87izgi!")},       /* Note: 'i' is not caseless 
equal to 'I' in Turkish */
+  {D_STR_W_LEN ("Do\xf0rulama \xe7izgi!"),
+   D_STR_W_LEN ("Do\xf0rulama \xe7izgi!")},       /* "Doğrulama çizgi!" in 
CP1254/ISO-8859-9 */
+  {D_STR_W_LEN ("Do\xf0rulamA \xe7Izgi!"),
+   D_STR_W_LEN ("do\xf0rulama \xe7izgi!")},
+  {D_STR_W_LEN ("Do\xc4\x9frulama \xc3\xa7izgi!"),
+   D_STR_W_LEN ("Do\xc4\x9frulama \xc3\xa7izgi!")},         /* "Doğrulama 
çizgi!" in UTF-8 */
+  {D_STR_W_LEN ("do\xc4\x9fruLAMA \xc3\xa7Izgi!"),          /* Spelling 
intentionally incorrect here */
+   D_STR_W_LEN ("DO\xc4\x9frulama \xc3\xa7izgI!")},         /* Spelling 
intentionally incorrect here */
+
+  {D_STR_W_LEN ("\x92\xa5\xe1\xe2\xae\xa2\xa0\xef \x91\xe2\xe0\xae\xaa\xa0."),
+   D_STR_W_LEN ("\x92\xa5\xe1\xe2\xae\xa2\xa0\xef 
\x91\xe2\xe0\xae\xaa\xa0.")},  /* "Тестовая Строка." in CP866 */
+  {D_STR_W_LEN ("\xd2\xe5\xf1\xf2\xee\xe2\xe0\xff \xd1\xf2\xf0\xee\xea\xe0."),
+   D_STR_W_LEN ("\xd2\xe5\xf1\xf2\xee\xe2\xe0\xff 
\xd1\xf2\xf0\xee\xea\xe0.")},  /* "Тестовая Строка." in CP1251 */
+  {D_STR_W_LEN ("\xf4\xc5\xd3\xd4\xcf\xd7\xc1\xd1 \xf3\xd4\xd2\xcf\xcb\xc1."),
+   D_STR_W_LEN ("\xf4\xc5\xd3\xd4\xcf\xd7\xc1\xd1 
\xf3\xd4\xd2\xcf\xcb\xc1.")},  /* "Тестовая Строка." in KOI8-R */
+  {D_STR_W_LEN ("\xc2\xd5\xe1\xe2\xde\xd2\xd0\xef \xc1\xe2\xe0\xde\xda\xd0."),
+   D_STR_W_LEN ("\xc2\xd5\xe1\xe2\xde\xd2\xd0\xef 
\xc1\xe2\xe0\xde\xda\xd0.")},  /* "Тестовая Строка." in ISO-8859-5 */
+  {D_STR_W_LEN ("\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbe\xd0\xb2\xd0\xb0\xd1"
+                "\x8f \xd0\xa1\xd1\x82\xd1\x80\xd0\xbe\xd0\xba\xd0\xb0."),
+   D_STR_W_LEN ("\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbe\xd0\xb2\xd0\xb0\xd1"
+                "\x8f \xd0\xa1\xd1\x82\xd1\x80\xd0\xbe\xd0\xba\xd0\xb0.")},    
  /* "Тестовая Строка." in UTF-8 */
+
+  {D_STR_W_LEN (
+     
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+     "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@[\\]"
+     
"^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
+     
"\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4"
+     
"\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
+     
"\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"
+     
"\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
+     
"\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4"
+     "\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
+   D_STR_W_LEN (
+     
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+     "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@[\\]"
+     
"^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
+     
"\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4"
+     
"\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
+     
"\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"
+     
"\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
+     
"\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4"
+     "\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff")},             /* Full 
sequence without a-z */
+  {D_STR_W_LEN (
+     
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+     "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@AB"
+     
"CDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83"
+     
"\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97"
+     
"\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab"
+     
"\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+     
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3"
+     
"\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+     
"\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb"
+     "\xfc\xfd\xfe\xff"),
+   D_STR_W_LEN (
+     
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+     "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@AB"
+     
"CDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83"
+     
"\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97"
+     
"\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab"
+     
"\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+     
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3"
+     
"\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+     
"\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb"
+     "\xfc\xfd\xfe\xff")},             /* Full sequence */
+  {D_STR_W_LEN (
+     
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+     "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@AB"
+     
"CDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89"
+     
"\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d"
+     
"\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1"
+     
"\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5"
+     
"\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9"
+     
"\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed"
+     
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
+   D_STR_W_LEN (
+     
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+     "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@ab"
+     
"cdefghijklmnopqrstuvwxyz[\\]^_`{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89"
+     
"\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d"
+     
"\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1"
+     
"\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5"
+     
"\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9"
+     
"\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed"
+     
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff")}    
         /* Full with A/a match */
 };
 
 struct two_neq_strs
@@ -421,367 +434,419 @@ struct two_neq_strs
 };
 
 static const struct two_neq_strs neq_strings[] = {
-    {D_STR_W_LEN("1234567890!@~%&$@#{}[]\\/!?`."), 
D_STR_W_LEN("1234567890!@~%&$@#{}[]\\/!?`"), 27},
-    {D_STR_W_LEN(".1234567890!@~%&$@#{}[]\\/!?`."), 
D_STR_W_LEN("1234567890!@~%&$@#{}[]\\/!?`"), 0},
-    {D_STR_W_LEN("Simple string."), D_STR_W_LEN("Simple ctring."), 7},
-    {D_STR_W_LEN("simple string."), D_STR_W_LEN("simple string"), 13},
-    {D_STR_W_LEN("simple strings"), D_STR_W_LEN("Simple String."), 13},
-    {D_STR_W_LEN("sImPlE StRiNg."), D_STR_W_LEN("SYMpLe sTrInG."), 1},
-    {D_STR_W_LEN("SIMPLE STRING."), D_STR_W_LEN("simple string.2"), 14},
-    {D_STR_W_LEN("abcdefghijklmnopqrstuvwxyz,"), 
D_STR_W_LEN("abcdefghijklmnopqrstuvwxyz."), 26},
-    {D_STR_W_LEN("abcdefghijklmnopqrstuvwxyz!"), 
D_STR_W_LEN("ABCDEFGHIJKLMNOPQRSTUVWXYZ?"), 26},
-    {D_STR_W_LEN("zyxwvutsrqponwMLKJIHGFEDCBA"), 
D_STR_W_LEN("ZYXWVUTSRQPON%mlkjihgfedcba"), 13},
-
-    {D_STR_W_LEN("S\xbdur veulent plus d'\xbdufs."),    /* "Sœur veulent plus 
d'œufs." in ISO-8859-15 */
-     D_STR_W_LEN("S\xbcUR VEULENT PLUS D'\xbcUFS."), 1},/* "SŒUR VEULENT PLUS 
D'ŒUFS." in ISO-8859-15 */
-    {D_STR_W_LEN("S\x9cur veulent plus d'\x9cufs."),    /* "Sœur veulent plus 
d'œufs." in CP1252 */
-     D_STR_W_LEN("S\x8cUR VEULENT PLUS D'\x8cUFS."), 1},/* "SŒUR VEULENT PLUS 
D'ŒUFS." in CP1252 */
-    {D_STR_W_LEN("S\xc5\x93ur veulent plus d'\xc5\x93ufs."),    /* "Sœur 
veulent plus d'œufs." in UTF-8 */
-     D_STR_W_LEN("S\xc5\x92UR VEULENT PLUS D'\xc5\x92UFS."), 2},/* "SŒUR 
VEULENT PLUS D'ŒUFS." in UTF-8 */
-
-    {D_STR_W_LEN("Um ein sch\x94nes M\x84" "dchen zu k\x81ssen."),     /* "Um 
ein schönes Mädchen zu küssen." in CP850 */
-     D_STR_W_LEN("UM EIN SCH\x99NES M\x8e" "DCHEN ZU K\x9aSSEN."), 10},/* "UM 
EIN SCHÖNES MÄDCHEN ZU KÜSSEN." in CP850 */
-    {D_STR_W_LEN("Um ein sch\xf6nes M\xe4" "dchen zu k\xfcssen."),     /* "Um 
ein schönes Mädchen zu küssen." in ISO-8859-1/ISO-8859-15/CP1250/CP1252 */
-     D_STR_W_LEN("UM EIN SCH\xd6NES M\xc4" "DCHEN ZU K\xdcSSEN."), 10},/* "UM 
EIN SCHÖNES MÄDCHEN ZU KÜSSEN." in ISO-8859-1/ISO-8859-15/CP1250/CP1252 */
-    {D_STR_W_LEN("Um ein sch\xc3\xb6nes M\xc3\xa4" "dchen zu k\xc3\xbcssen."), 
    /* "Um ein schönes Mädchen zu küssen." in UTF-8 */
-     D_STR_W_LEN("UM EIN SCH\xc3\x96NES M\xc3\x84" "DCHEN ZU K\xc3\x9cSSEN."), 
11},/* "UM EIN SCHÖNES MÄDCHEN ZU KÜSSEN." in UTF-8 */
-
-    {D_STR_W_LEN("\x98stanbul"),           /* "İstanbul" in CP857 */
-     D_STR_W_LEN("istanbul"), 0},          /* "istanbul" in CP857 */
-    {D_STR_W_LEN("\xddstanbul"),           /* "İstanbul" in ISO-8859-9/CP1254 
*/
-     D_STR_W_LEN("istanbul"), 0},          /* "istanbul" in ISO-8859-9/CP1254 
*/
-    {D_STR_W_LEN("\xc4\xb0stanbul"),       /* "İstanbul" in UTF-8 */
-     D_STR_W_LEN("istanbul"), 0},          /* "istanbul" in UTF-8 */
-    {D_STR_W_LEN("Diyarbak\x8dr"),         /* "Diyarbakır" in CP857 */
-     D_STR_W_LEN("DiyarbakIR"), 8},        /* "DiyarbakIR" in CP857 */
-    {D_STR_W_LEN("Diyarbak\xfdr"),         /* "Diyarbakır" in 
ISO-8859-9/CP1254 */
-     D_STR_W_LEN("DiyarbakIR"), 8},        /* "DiyarbakIR" in 
ISO-8859-9/CP1254 */
-    {D_STR_W_LEN("Diyarbak\xc4\xb1r"),     /* "Diyarbakır" in UTF-8 */
-     D_STR_W_LEN("DiyarbakIR"), 8},        /* "DiyarbakIR" in UTF-8 */
-
-    {D_STR_W_LEN("\x92\xa5\xe1\xe2\xae\xa2\xa0\xef 
\x91\xe2\xe0\xae\xaa\xa0."),     /* "Тестовая Строка." in CP866 */
-     D_STR_W_LEN("\x92\x85\x91\x92\x8e\x82\x80\x9f 
\x91\x92\x90\x8e\x8a\x80."), 1}, /* "ТЕСТОВАЯ СТРОКА." in CP866 */
-    {D_STR_W_LEN("\xd2\xe5\xf1\xf2\xee\xe2\xe0\xff 
\xd1\xf2\xf0\xee\xea\xe0."),     /* "Тестовая Строка." in CP1251 */
-     D_STR_W_LEN("\xd2\xc5\xd1\xd2\xce\xc2\xc0\xdf 
\xd1\xd2\xd0\xce\xca\xc0."), 1}, /* "ТЕСТОВАЯ СТРОКА." in CP1251 */
-    {D_STR_W_LEN("\xf4\xc5\xd3\xd4\xcf\xd7\xc1\xd1 
\xf3\xd4\xd2\xcf\xcb\xc1."),     /* "Тестовая Строка." in KOI8-R */
-     D_STR_W_LEN("\xf4\xe5\xf3\xf4\xef\xf7\xe1\xf1 
\xf3\xf4\xf2\xef\xeb\xe1."), 1}, /* "ТЕСТОВАЯ СТРОКА." in KOI8-R */
-    {D_STR_W_LEN("\xc2\xd5\xe1\xe2\xde\xd2\xd0\xef 
\xc1\xe2\xe0\xde\xda\xd0."),     /* "Тестовая Строка." in ISO-8859-5 */
-     D_STR_W_LEN("\xc2\xb5\xc1\xc2\xbe\xb2\xb0\xcf 
\xc1\xc2\xc0\xbe\xba\xb0."), 1}, /* "ТЕСТОВАЯ СТРОКА." in ISO-8859-5 */
-    {D_STR_W_LEN("\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbe\xd0\xb2\xd0\xb0\xd1"
-                 "\x8f \xd0\xa1\xd1\x82\xd1\x80\xd0\xbe\xd0\xba\xd0\xb0."),    
     /* "Тестовая Строка." in UTF-8 */
-     D_STR_W_LEN("\xd0\xa2\xd0\x95\xd0\xa1\xd0\xa2\xd0\x9e\xd0\x92\xd0\x90\xd0"
-                 "\xaf \xd0\xa1\xd0\xa2\xd0\xa0\xd0\x9e\xd0\x9a\xd0\x90."), 3} 
     /* "ТЕСТОВАЯ СТРОКА." in UTF-8 */
+  {D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`."), D_STR_W_LEN (
+     "1234567890!@~%&$@#{}[]\\/!?`"), 27},
+  {D_STR_W_LEN (".1234567890!@~%&$@#{}[]\\/!?`."), D_STR_W_LEN (
+     "1234567890!@~%&$@#{}[]\\/!?`"), 0},
+  {D_STR_W_LEN ("Simple string."), D_STR_W_LEN ("Simple ctring."), 7},
+  {D_STR_W_LEN ("simple string."), D_STR_W_LEN ("simple string"), 13},
+  {D_STR_W_LEN ("simple strings"), D_STR_W_LEN ("Simple String."), 13},
+  {D_STR_W_LEN ("sImPlE StRiNg."), D_STR_W_LEN ("SYMpLe sTrInG."), 1},
+  {D_STR_W_LEN ("SIMPLE STRING."), D_STR_W_LEN ("simple string.2"), 14},
+  {D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz,"), D_STR_W_LEN (
+     "abcdefghijklmnopqrstuvwxyz."), 26},
+  {D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz!"), D_STR_W_LEN (
+     "ABCDEFGHIJKLMNOPQRSTUVWXYZ?"), 26},
+  {D_STR_W_LEN ("zyxwvutsrqponwMLKJIHGFEDCBA"), D_STR_W_LEN (
+     "ZYXWVUTSRQPON%mlkjihgfedcba"), 13},
+
+  {D_STR_W_LEN ("S\xbdur veulent plus d'\xbdufs."),     /* "Sœur veulent plus 
d'œufs." in ISO-8859-15 */
+   D_STR_W_LEN ("S\xbcUR VEULENT PLUS D'\xbcUFS."), 1}, /* "SŒUR VEULENT PLUS 
D'ŒUFS." in ISO-8859-15 */
+  {D_STR_W_LEN ("S\x9cur veulent plus d'\x9cufs."),     /* "Sœur veulent plus 
d'œufs." in CP1252 */
+   D_STR_W_LEN ("S\x8cUR VEULENT PLUS D'\x8cUFS."), 1}, /* "SŒUR VEULENT PLUS 
D'ŒUFS." in CP1252 */
+  {D_STR_W_LEN ("S\xc5\x93ur veulent plus d'\xc5\x93ufs."),     /* "Sœur 
veulent plus d'œufs." in UTF-8 */
+   D_STR_W_LEN ("S\xc5\x92UR VEULENT PLUS D'\xc5\x92UFS."), 2}, /* "SŒUR 
VEULENT PLUS D'ŒUFS." in UTF-8 */
+
+  {D_STR_W_LEN ("Um ein sch\x94nes M\x84" "dchen zu k\x81ssen."),      /* "Um 
ein schönes Mädchen zu küssen." in CP850 */
+   D_STR_W_LEN ("UM EIN SCH\x99NES M\x8e" "DCHEN ZU K\x9aSSEN."), 10}, /* "UM 
EIN SCHÖNES MÄDCHEN ZU KÜSSEN." in CP850 */
+  {D_STR_W_LEN ("Um ein sch\xf6nes M\xe4" "dchen zu k\xfcssen."),      /* "Um 
ein schönes Mädchen zu küssen." in ISO-8859-1/ISO-8859-15/CP1250/CP1252 */
+   D_STR_W_LEN ("UM EIN SCH\xd6NES M\xc4" "DCHEN ZU K\xdcSSEN."), 10}, /* "UM 
EIN SCHÖNES MÄDCHEN ZU KÜSSEN." in ISO-8859-1/ISO-8859-15/CP1250/CP1252 */
+  {D_STR_W_LEN ("Um ein sch\xc3\xb6nes M\xc3\xa4" "dchen zu k\xc3\xbcssen."),  
    /* "Um ein schönes Mädchen zu küssen." in UTF-8 */
+   D_STR_W_LEN ("UM EIN SCH\xc3\x96NES M\xc3\x84" "DCHEN ZU K\xc3\x9cSSEN."),
+   11},                                                                        
    /* "UM EIN SCHÖNES MÄDCHEN ZU KÜSSEN." in UTF-8 */
+
+  {D_STR_W_LEN ("\x98stanbul"),            /* "İstanbul" in CP857 */
+   D_STR_W_LEN ("istanbul"), 0},           /* "istanbul" in CP857 */
+  {D_STR_W_LEN ("\xddstanbul"),            /* "İstanbul" in ISO-8859-9/CP1254 
*/
+   D_STR_W_LEN ("istanbul"), 0},           /* "istanbul" in ISO-8859-9/CP1254 
*/
+  {D_STR_W_LEN ("\xc4\xb0stanbul"),        /* "İstanbul" in UTF-8 */
+   D_STR_W_LEN ("istanbul"), 0},           /* "istanbul" in UTF-8 */
+  {D_STR_W_LEN ("Diyarbak\x8dr"),          /* "Diyarbakır" in CP857 */
+   D_STR_W_LEN ("DiyarbakIR"), 8},         /* "DiyarbakIR" in CP857 */
+  {D_STR_W_LEN ("Diyarbak\xfdr"),          /* "Diyarbakır" in 
ISO-8859-9/CP1254 */
+   D_STR_W_LEN ("DiyarbakIR"), 8},         /* "DiyarbakIR" in 
ISO-8859-9/CP1254 */
+  {D_STR_W_LEN ("Diyarbak\xc4\xb1r"),      /* "Diyarbakır" in UTF-8 */
+   D_STR_W_LEN ("DiyarbakIR"), 8},         /* "DiyarbakIR" in UTF-8 */
+
+  {D_STR_W_LEN ("\x92\xa5\xe1\xe2\xae\xa2\xa0\xef \x91\xe2\xe0\xae\xaa\xa0."), 
     /* "Тестовая Строка." in CP866 */
+   D_STR_W_LEN ("\x92\x85\x91\x92\x8e\x82\x80\x9f \x91\x92\x90\x8e\x8a\x80."),
+   1},                                                                         
     /* "ТЕСТОВАЯ СТРОКА." in CP866 */
+  {D_STR_W_LEN ("\xd2\xe5\xf1\xf2\xee\xe2\xe0\xff \xd1\xf2\xf0\xee\xea\xe0."), 
     /* "Тестовая Строка." in CP1251 */
+   D_STR_W_LEN ("\xd2\xc5\xd1\xd2\xce\xc2\xc0\xdf \xd1\xd2\xd0\xce\xca\xc0."),
+   1},                                                                         
     /* "ТЕСТОВАЯ СТРОКА." in CP1251 */
+  {D_STR_W_LEN ("\xf4\xc5\xd3\xd4\xcf\xd7\xc1\xd1 \xf3\xd4\xd2\xcf\xcb\xc1."), 
     /* "Тестовая Строка." in KOI8-R */
+   D_STR_W_LEN ("\xf4\xe5\xf3\xf4\xef\xf7\xe1\xf1 \xf3\xf4\xf2\xef\xeb\xe1."),
+   1},                                                                         
     /* "ТЕСТОВАЯ СТРОКА." in KOI8-R */
+  {D_STR_W_LEN ("\xc2\xd5\xe1\xe2\xde\xd2\xd0\xef \xc1\xe2\xe0\xde\xda\xd0."), 
     /* "Тестовая Строка." in ISO-8859-5 */
+   D_STR_W_LEN ("\xc2\xb5\xc1\xc2\xbe\xb2\xb0\xcf \xc1\xc2\xc0\xbe\xba\xb0."),
+   1},                                                                         
     /* "ТЕСТОВАЯ СТРОКА." in ISO-8859-5 */
+  {D_STR_W_LEN ("\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbe\xd0\xb2\xd0\xb0\xd1"
+                "\x8f \xd0\xa1\xd1\x82\xd1\x80\xd0\xbe\xd0\xba\xd0\xb0."),     
     /* "Тестовая Строка." in UTF-8 */
+   D_STR_W_LEN ("\xd0\xa2\xd0\x95\xd0\xa1\xd0\xa2\xd0\x9e\xd0\x92\xd0\x90\xd0"
+                "\xaf \xd0\xa1\xd0\xa2\xd0\xa0\xd0\x9e\xd0\x9a\xd0\x90."), 3}  
     /* "ТЕСТОВАЯ СТРОКА." in UTF-8 */
 };
 
 
-int check_eq_strings(void)
+int check_eq_strings (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(eq_strings) / sizeof(eq_strings[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
-        {
-          const struct two_eq_strs * const t = eq_strings + i;
-          if (c_failed[i])
-            continue; /* skip already failed checks */
-          if (!MHD_str_equal_caseless_(t->s1.str, t->s2.str))
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") 
returned zero, while expected non-zero."
-                      " Locale: %s\n", n_prnt(t->s1.str), n_prnt(t->s2.str), 
get_current_locale_str());
-            }
-          else if (!MHD_str_equal_caseless_(t->s2.str, t->s1.str))
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") 
returned zero, while expected non-zero."
-                      " Locale: %s\n", n_prnt(t->s2.str), n_prnt(t->s1.str), 
get_current_locale_str());
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_equal_caseless_(\"%s\", \"%s\") != 0 && 
\\\n"
-                   "        MHD_str_equal_caseless_(\"%s\", \"%s\") != 0\n", 
n_prnt(t->s1.str), n_prnt(t->s2.str),
-                   n_prnt(t->s2.str), n_prnt(t->s1.str));
-        }
+      const struct two_eq_strs *const t = eq_strings + i;
+      if (c_failed[i])
+        continue;     /* skip already failed checks */
+      if (! MHD_str_equal_caseless_ (t->s1.str, t->s2.str))
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") returned 
zero, while expected non-zero."
+                 " Locale: %s\n", n_prnt (t->s1.str), n_prnt (t->s2.str),
+                 get_current_locale_str ());
+      }
+      else if (! MHD_str_equal_caseless_ (t->s2.str, t->s1.str))
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") returned 
zero, while expected non-zero."
+                 " Locale: %s\n", n_prnt (t->s2.str), n_prnt (t->s1.str),
+                 get_current_locale_str ());
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf ("PASSED: MHD_str_equal_caseless_(\"%s\", \"%s\") != 0 && \\\n"
+                "        MHD_str_equal_caseless_(\"%s\", \"%s\") != 0\n",
+                n_prnt (t->s1.str), n_prnt (t->s2.str),
+                n_prnt (t->s2.str), n_prnt (t->s1.str));
     }
+  }
   return t_failed;
 }
 
-int check_neq_strings(void)
+int check_neq_strings (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(neq_strings) / sizeof(neq_strings[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
-        {
-          const struct two_neq_strs * const t = neq_strings + i;
-          if (c_failed[i])
-            continue; /* skip already failed checks */
-          if (MHD_str_equal_caseless_(t->s1.str, t->s2.str))
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") 
returned non-zero, while expected zero."
-                      " Locale: %s\n", n_prnt(t->s1.str), n_prnt(t->s2.str), 
get_current_locale_str());
-            }
-          else if (MHD_str_equal_caseless_(t->s2.str, t->s1.str))
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") 
returned non-zero, while expected zero."
-                      " Locale: %s\n", n_prnt(t->s2.str), n_prnt(t->s1.str), 
get_current_locale_str());
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_equal_caseless_(\"%s\", \"%s\") == 0 && 
\\\n"
-                   "        MHD_str_equal_caseless_(\"%s\", \"%s\") == 0\n", 
n_prnt(t->s1.str), n_prnt(t->s2.str),
-                   n_prnt(t->s2.str), n_prnt(t->s1.str));
-        }
+      const struct two_neq_strs *const t = neq_strings + i;
+      if (c_failed[i])
+        continue;     /* skip already failed checks */
+      if (MHD_str_equal_caseless_ (t->s1.str, t->s2.str))
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") returned 
non-zero, while expected zero."
+                 " Locale: %s\n", n_prnt (t->s1.str), n_prnt (t->s2.str),
+                 get_current_locale_str ());
+      }
+      else if (MHD_str_equal_caseless_ (t->s2.str, t->s1.str))
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_str_equal_caseless_(\"%s\", \"%s\") returned 
non-zero, while expected zero."
+                 " Locale: %s\n", n_prnt (t->s2.str), n_prnt (t->s1.str),
+                 get_current_locale_str ());
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf ("PASSED: MHD_str_equal_caseless_(\"%s\", \"%s\") == 0 && \\\n"
+                "        MHD_str_equal_caseless_(\"%s\", \"%s\") == 0\n",
+                n_prnt (t->s1.str), n_prnt (t->s2.str),
+                n_prnt (t->s2.str), n_prnt (t->s1.str));
     }
+  }
   return t_failed;
 }
 
-int check_eq_strings_n(void)
+int check_eq_strings_n (void)
 {
   size_t t_failed = 0;
   size_t i, j, k;
   static const size_t n_checks = sizeof(eq_strings) / sizeof(eq_strings[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t m_len;
+      const struct two_eq_strs *const t = eq_strings + i;
+      m_len = (t->s1.len > t->s2.len) ? t->s1.len : t->s2.len;
+      for (k = 0; k <= m_len + 1 && ! c_failed[i]; k++)
+      {
+        if (! MHD_str_equal_caseless_n_ (t->s1.str, t->s2.str, k))
         {
-          size_t m_len;
-          const struct two_eq_strs * const t = eq_strings + i;
-          m_len = (t->s1.len > t->s2.len) ? t->s1.len : t->s2.len;
-          for(k = 0; k <= m_len + 1 && !c_failed[i]; k++)
-            {
-              if (!MHD_str_equal_caseless_n_(t->s1.str, t->s2.str, k))
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_equal_caseless_n_(\"%s\", 
\"%s\", %u) returned zero,"
-                                  " while expected non-zero. Locale: %s\n",
-                                  n_prnt(t->s1.str), n_prnt(t->s2.str), 
(unsigned int) k, get_current_locale_str());
-                }
-              else if (!MHD_str_equal_caseless_n_(t->s2.str, t->s1.str, k))
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_equal_caseless_n_(\"%s\", 
\"%s\", %u) returned zero,"
-                                  " while expected non-zero. Locale: %s\n",
-                                  n_prnt(t->s2.str), n_prnt(t->s1.str), 
(unsigned int) k, get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0 
&& \\\n"
-                   "        MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0, 
where N is 0..%u\n",
-                   n_prnt(t->s1.str), n_prnt(t->s2.str), n_prnt(t->s2.str), 
n_prnt(t->s1.str), (unsigned int) m_len + 1);
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) 
returned zero,"
+                   " while expected non-zero. Locale: %s\n",
+                   n_prnt (t->s1.str), n_prnt (t->s2.str), (unsigned int) k,
+                   get_current_locale_str ());
         }
+        else if (! MHD_str_equal_caseless_n_ (t->s2.str, t->s1.str, k))
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) 
returned zero,"
+                   " while expected non-zero. Locale: %s\n",
+                   n_prnt (t->s2.str), n_prnt (t->s1.str), (unsigned int) k,
+                   get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0 && \\\n"
+          "        MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0, where N 
is 0..%u\n",
+          n_prnt (t->s1.str), n_prnt (t->s2.str), n_prnt (t->s2.str),
+          n_prnt (t->s1.str), (unsigned int) m_len + 1);
     }
+  }
   return t_failed;
 }
 
-int check_neq_strings_n(void)
+int check_neq_strings_n (void)
 {
   size_t t_failed = 0;
   size_t i, j, k;
   static const size_t n_checks = sizeof(neq_strings) / sizeof(neq_strings[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t m_len;
+      const struct two_neq_strs *const t = neq_strings + i;
+      m_len = t->s1.len > t->s2.len ? t->s1.len : t->s2.len;
+      if (t->dif_pos >= m_len)
+      {
+        fprintf (stderr,
+                 "ERROR: neq_strings[%u] has wrong dif_pos (%u): dif_pos is 
expected to be less than "
+                 "s1.len (%u) or s2.len (%u).\n", (unsigned int) i, (unsigned
+                                                                     int) t->
+                 dif_pos,
+                 (unsigned int) t->s1.len, (unsigned int) t->s2.len);
+        return -1;
+      }
+      if (t->dif_pos > t->s1.len)
+      {
+        fprintf (stderr,
+                 "ERROR: neq_strings[%u] has wrong dif_pos (%u): dif_pos is 
expected to be less or "
+                 "equal to s1.len (%u).\n", (unsigned int) i, (unsigned
+                                                               int) t->dif_pos,
+                 (unsigned int) t->s1.len);
+        return -1;
+      }
+      if (t->dif_pos > t->s2.len)
+      {
+        fprintf (stderr,
+                 "ERROR: neq_strings[%u] has wrong dif_pos (%u): dif_pos is 
expected to be less or "
+                 "equal to s2.len (%u).\n", (unsigned int) i, (unsigned
+                                                               int) t->dif_pos,
+                 (unsigned int) t->s2.len);
+        return -1;
+      }
+      for (k = 0; k <= m_len + 1 && ! c_failed[i]; k++)
+      {
+        if (k <= t->dif_pos)
+        {
+          if (! MHD_str_equal_caseless_n_ (t->s1.str, t->s2.str, k))
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) 
returned zero,"
+                     " while expected non-zero. Locale: %s\n",
+                     n_prnt (t->s1.str), n_prnt (t->s2.str), (unsigned int) k,
+                     get_current_locale_str ());
+          }
+          else if (! MHD_str_equal_caseless_n_ (t->s2.str, t->s1.str, k))
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) 
returned zero,"
+                     " while expected non-zero. Locale: %s\n",
+                     n_prnt (t->s2.str), n_prnt (t->s1.str), (unsigned int) k,
+                     get_current_locale_str ());
+          }
+        }
+        else
         {
-          size_t m_len;
-          const struct two_neq_strs * const t = neq_strings + i;
-          m_len = t->s1.len > t->s2.len ? t->s1.len : t->s2.len;
-          if (t->dif_pos >= m_len)
-            {
-              fprintf(stderr, "ERROR: neq_strings[%u] has wrong dif_pos (%u): 
dif_pos is expected to be less than "
-                              "s1.len (%u) or s2.len (%u).\n", (unsigned int) 
i, (unsigned int) t->dif_pos,
-                              (unsigned int) t->s1.len, (unsigned int) 
t->s2.len);
-              return -1;
-            }
-          if (t->dif_pos > t->s1.len)
-            {
-              fprintf(stderr, "ERROR: neq_strings[%u] has wrong dif_pos (%u): 
dif_pos is expected to be less or "
-                              "equal to s1.len (%u).\n", (unsigned int) i, 
(unsigned int) t->dif_pos,
-                              (unsigned int) t->s1.len);
-              return -1;
-            }
-          if (t->dif_pos > t->s2.len)
-            {
-              fprintf(stderr, "ERROR: neq_strings[%u] has wrong dif_pos (%u): 
dif_pos is expected to be less or "
-                              "equal to s2.len (%u).\n", (unsigned int) i, 
(unsigned int) t->dif_pos,
-                              (unsigned int) t->s2.len);
-              return -1;
-            }
-          for(k = 0; k <= m_len + 1 && !c_failed[i]; k++)
-            {
-              if (k <= t->dif_pos)
-                {
-                  if (!MHD_str_equal_caseless_n_(t->s1.str, t->s2.str, k))
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: 
MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) returned zero,"
-                                      " while expected non-zero. Locale: %s\n",
-                                      n_prnt(t->s1.str), n_prnt(t->s2.str), 
(unsigned int) k, get_current_locale_str());
-                    }
-                  else if (!MHD_str_equal_caseless_n_(t->s2.str, t->s1.str, k))
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: 
MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) returned zero,"
-                                      " while expected non-zero. Locale: %s\n",
-                                      n_prnt(t->s2.str), n_prnt(t->s1.str), 
(unsigned int) k, get_current_locale_str());
-                    }
-                }
-              else
-                {
-                  if (MHD_str_equal_caseless_n_(t->s1.str, t->s2.str, k))
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: 
MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) returned non-zero,"
-                                      " while expected zero. Locale: %s\n",
-                                      n_prnt(t->s1.str), n_prnt(t->s2.str), 
(unsigned int) k, get_current_locale_str());
-                    }
-                  else if (MHD_str_equal_caseless_n_(t->s2.str, t->s1.str, k))
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: 
MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) returned non-zero,"
-                                      " while expected zero. Locale: %s\n",
-                                      n_prnt(t->s2.str), n_prnt(t->s1.str), 
(unsigned int) k, get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            {
-              printf("PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 
0 && \\\n"
-                     "        MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 
0, where N is 0..%u\n",
-                     n_prnt(t->s1.str), n_prnt(t->s2.str), n_prnt(t->s2.str), 
n_prnt(t->s1.str),
-                     (unsigned int) t->dif_pos);
-
-              printf("PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) == 
0 && \\\n"
-                     "        MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) == 
0, where N is %u..%u\n",
-                     n_prnt(t->s1.str), n_prnt(t->s2.str), n_prnt(t->s2.str), 
n_prnt(t->s1.str),
-                     (unsigned int) t->dif_pos + 1, (unsigned int) m_len + 1);
-            }
+          if (MHD_str_equal_caseless_n_ (t->s1.str, t->s2.str, k))
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) 
returned non-zero,"
+                     " while expected zero. Locale: %s\n",
+                     n_prnt (t->s1.str), n_prnt (t->s2.str), (unsigned int) k,
+                     get_current_locale_str ());
+          }
+          else if (MHD_str_equal_caseless_n_ (t->s2.str, t->s1.str, k))
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", %u) 
returned non-zero,"
+                     " while expected zero. Locale: %s\n",
+                     n_prnt (t->s2.str), n_prnt (t->s1.str), (unsigned int) k,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+      {
+        printf (
+          "PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0 && \\\n"
+          "        MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0, where N 
is 0..%u\n",
+          n_prnt (t->s1.str), n_prnt (t->s2.str), n_prnt (t->s2.str),
+          n_prnt (t->s1.str),
+          (unsigned int) t->dif_pos);
+
+        printf (
+          "PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) == 0 && \\\n"
+          "        MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) == 0, where N 
is %u..%u\n",
+          n_prnt (t->s1.str), n_prnt (t->s2.str), n_prnt (t->s2.str),
+          n_prnt (t->s1.str),
+          (unsigned int) t->dif_pos + 1, (unsigned int) m_len + 1);
+      }
     }
+  }
   return t_failed;
 }
 
 /*
  * Run eq/neq strings tests
  */
-int run_eq_neq_str_tests(void)
+int run_eq_neq_str_tests (void)
 {
   int str_equal_caseless_fails = 0;
   int str_equal_caseless_n_fails = 0;
   int res;
 
-  res = check_eq_strings();
+  res = check_eq_strings ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_eq_strings().\n");
-          return 99;
-        }
-      str_equal_caseless_fails += res;
-      fprintf(stderr, "FAILED: testcase check_eq_strings() failed.\n\n");
+      fprintf (stderr, "ERROR: test internal error in check_eq_strings().\n");
+      return 99;
     }
+    str_equal_caseless_fails += res;
+    fprintf (stderr, "FAILED: testcase check_eq_strings() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_eq_strings() successfully passed.\n\n");
+    printf ("PASSED: testcase check_eq_strings() successfully passed.\n\n");
 
-  res = check_neq_strings();
+  res = check_neq_strings ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_neq_strings().\n");
-          return 99;
-        }
-      str_equal_caseless_fails += res;
-      fprintf(stderr, "FAILED: testcase check_neq_strings() failed.\n\n");
+      fprintf (stderr, "ERROR: test internal error in check_neq_strings().\n");
+      return 99;
     }
+    str_equal_caseless_fails += res;
+    fprintf (stderr, "FAILED: testcase check_neq_strings() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_neq_strings() successfully passed.\n\n");
+    printf ("PASSED: testcase check_neq_strings() successfully passed.\n\n");
 
   if (str_equal_caseless_fails)
-    fprintf(stderr, "FAILED: function MHD_str_equal_caseless_() failed %d 
time%s.\n\n",
-                     str_equal_caseless_fails, str_equal_caseless_fails == 1 ? 
"" : "s");
+    fprintf (stderr,
+             "FAILED: function MHD_str_equal_caseless_() failed %d 
time%s.\n\n",
+             str_equal_caseless_fails, str_equal_caseless_fails == 1 ? "" :
+             "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_str_equal_caseless_() successfully passed all 
checks.\n\n");
+    printf (
+      "PASSED: function MHD_str_equal_caseless_() successfully passed all 
checks.\n\n");
 
-  res = check_eq_strings_n();
+  res = check_eq_strings_n ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_eq_strings_n().\n");
-          return 99;
-        }
-      str_equal_caseless_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_eq_strings_n() failed.\n\n");
+      fprintf (stderr, "ERROR: test internal error in 
check_eq_strings_n().\n");
+      return 99;
     }
+    str_equal_caseless_n_fails += res;
+    fprintf (stderr, "FAILED: testcase check_eq_strings_n() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_eq_strings_n() successfully passed.\n\n");
+    printf ("PASSED: testcase check_eq_strings_n() successfully passed.\n\n");
 
-  res = check_neq_strings_n();
+  res = check_neq_strings_n ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_neq_strings_n().\n");
-          return 99;
-        }
-      str_equal_caseless_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_neq_strings_n() failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in check_neq_strings_n().\n");
+      return 99;
     }
+    str_equal_caseless_n_fails += res;
+    fprintf (stderr, "FAILED: testcase check_neq_strings_n() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_neq_strings_n() successfully passed.\n\n");
+    printf ("PASSED: testcase check_neq_strings_n() successfully passed.\n\n");
 
   if (str_equal_caseless_n_fails)
-    fprintf(stderr, "FAILED: function MHD_str_equal_caseless_n_() failed %d 
time%s.\n\n",
-                     str_equal_caseless_n_fails, str_equal_caseless_n_fails == 
1 ? "" : "s");
+    fprintf (stderr,
+             "FAILED: function MHD_str_equal_caseless_n_() failed %d 
time%s.\n\n",
+             str_equal_caseless_n_fails, str_equal_caseless_n_fails == 1 ? "" :
+             "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_str_equal_caseless_n_() successfully passed 
all checks.\n\n");
+    printf (
+      "PASSED: function MHD_str_equal_caseless_n_() successfully passed all 
checks.\n\n");
 
   if (str_equal_caseless_fails || str_equal_caseless_n_fails)
-    {
-      if (verbose > 0)
-        printf("At least one test failed.\n");
+  {
+    if (verbose > 0)
+      printf ("At least one test failed.\n");
 
-      return 1;
-    }
+    return 1;
+  }
 
   if (verbose > 0)
-    printf("All tests passed successfully.\n");
+    printf ("All tests passed successfully.\n");
 
   return 0;
 }
@@ -790,7 +855,8 @@ int run_eq_neq_str_tests(void)
  * Digits in string -> value tests
  */
 
-struct str_with_value {
+struct str_with_value
+{
   const struct str_with_len str;
   const size_t num_of_digt;
   const uint64_t val;
@@ -798,1646 +864,1930 @@ struct str_with_value {
 
 /* valid string for conversion to unsigned integer value */
 static const struct str_with_value dstrs_w_values[] = {
-    /* simplest strings */
-    {D_STR_W_LEN("1"), 1, 1},
-    {D_STR_W_LEN("0"), 1, 0},
-    {D_STR_W_LEN("10000"), 5, 10000},
-
-    /* all digits */
-    {D_STR_W_LEN("1234"), 4, 1234},
-    {D_STR_W_LEN("4567"), 4, 4567},
-    {D_STR_W_LEN("7890"), 4, 7890},
-    {D_STR_W_LEN("8021"), 4, 8021},
-    {D_STR_W_LEN("9754"), 4, 9754},
-    {D_STR_W_LEN("6392"), 4, 6392},
-
-    /* various prefixes */
-    {D_STR_W_LEN("00000000"), 8, 0},
-    {D_STR_W_LEN("0755"), 4, 755}, /* not to be interpreted as octal value! */
-    {D_STR_W_LEN("002"), 3, 2},
-    {D_STR_W_LEN("0001"), 4, 1},
-    {D_STR_W_LEN("00000000000000000000000031295483"), 32, 31295483},
-
-    /* numbers below and above limits */
-    {D_STR_W_LEN("127"), 3, 127}, /* 0x7F, SCHAR_MAX */
-    {D_STR_W_LEN("128"), 3, 128}, /* 0x80, SCHAR_MAX+1 */
-    {D_STR_W_LEN("255"), 3, 255}, /* 0xFF, UCHAR_MAX */
-    {D_STR_W_LEN("256"), 3, 256}, /* 0x100, UCHAR_MAX+1 */
-    {D_STR_W_LEN("32767"), 5, 32767}, /* 0x7FFF, INT16_MAX */
-    {D_STR_W_LEN("32768"), 5, 32768}, /* 0x8000, INT16_MAX+1 */
-    {D_STR_W_LEN("65535"), 5, 65535}, /* 0xFFFF, UINT16_MAX */
-    {D_STR_W_LEN("65536"), 5, 65536}, /* 0x10000, UINT16_MAX+1 */
-    {D_STR_W_LEN("2147483647"), 10, 2147483647}, /* 0x7FFFFFFF, INT32_MAX */
-    {D_STR_W_LEN("2147483648"), 10, UINT64_C(2147483648)}, /* 0x80000000, 
INT32_MAX+1 */
-    {D_STR_W_LEN("4294967295"), 10, UINT64_C(4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
-    {D_STR_W_LEN("4294967296"), 10, UINT64_C(4294967296)}, /* 0x100000000, 
UINT32_MAX+1 */
-    {D_STR_W_LEN("9223372036854775807"), 19, UINT64_C(9223372036854775807)}, 
/* 0x7FFFFFFFFFFFFFFF, INT64_MAX */
-    {D_STR_W_LEN("9223372036854775808"), 19, UINT64_C(9223372036854775808)}, 
/* 0x8000000000000000, INT64_MAX+1 */
-    {D_STR_W_LEN("18446744073709551615"), 20, UINT64_C(18446744073709551615)}, 
 /* 0xFFFFFFFFFFFFFFFF, UINT64_MAX */
-
-    /* random numbers */
-    {D_STR_W_LEN("10186753"), 8, 10186753},
-    {D_STR_W_LEN("144402566"), 9, 144402566},
-    {D_STR_W_LEN("151903144"), 9, 151903144},
-    {D_STR_W_LEN("139264621"), 9, 139264621},
-    {D_STR_W_LEN("730348"), 6, 730348},
-    {D_STR_W_LEN("21584377"), 8, 21584377},
-    {D_STR_W_LEN("709"), 3, 709},
-    {D_STR_W_LEN("54"), 2, 54},
-    {D_STR_W_LEN("8452"), 4, 8452},
-    {D_STR_W_LEN("17745098750013624977"), 20, UINT64_C(17745098750013624977)},
-    {D_STR_W_LEN("06786878769931678000"), 20, UINT64_C(6786878769931678000)},
-
-    /* non-digit suffixes */
-    {D_STR_W_LEN("1234oa"), 4, 1234},
-    {D_STR_W_LEN("20h"), 2, 20}, /* not to be interpreted as hex value! */
-    {D_STR_W_LEN("0x1F"), 1, 0}, /* not to be interpreted as hex value! */
-    {D_STR_W_LEN("0564`~}"), 4, 564},
-    {D_STR_W_LEN("7240146.724"), 7, 7240146},
-    {D_STR_W_LEN("2,9"), 1, 2},
-    {D_STR_W_LEN("200+1"), 3, 200},
-    {D_STR_W_LEN("1a"), 1, 1},
-    {D_STR_W_LEN("2E"), 1, 2},
-    {D_STR_W_LEN("6c"), 1, 6},
-    {D_STR_W_LEN("8F"), 1, 8},
-    {D_STR_W_LEN("287416997! And the not too long string."), 9, 287416997}
+  /* simplest strings */
+  {D_STR_W_LEN ("1"), 1, 1},
+  {D_STR_W_LEN ("0"), 1, 0},
+  {D_STR_W_LEN ("10000"), 5, 10000},
+
+  /* all digits */
+  {D_STR_W_LEN ("1234"), 4, 1234},
+  {D_STR_W_LEN ("4567"), 4, 4567},
+  {D_STR_W_LEN ("7890"), 4, 7890},
+  {D_STR_W_LEN ("8021"), 4, 8021},
+  {D_STR_W_LEN ("9754"), 4, 9754},
+  {D_STR_W_LEN ("6392"), 4, 6392},
+
+  /* various prefixes */
+  {D_STR_W_LEN ("00000000"), 8, 0},
+  {D_STR_W_LEN ("0755"), 4, 755},  /* not to be interpreted as octal value! */
+  {D_STR_W_LEN ("002"), 3, 2},
+  {D_STR_W_LEN ("0001"), 4, 1},
+  {D_STR_W_LEN ("00000000000000000000000031295483"), 32, 31295483},
+
+  /* numbers below and above limits */
+  {D_STR_W_LEN ("127"), 3, 127},  /* 0x7F, SCHAR_MAX */
+  {D_STR_W_LEN ("128"), 3, 128},  /* 0x80, SCHAR_MAX+1 */
+  {D_STR_W_LEN ("255"), 3, 255},  /* 0xFF, UCHAR_MAX */
+  {D_STR_W_LEN ("256"), 3, 256},  /* 0x100, UCHAR_MAX+1 */
+  {D_STR_W_LEN ("32767"), 5, 32767},  /* 0x7FFF, INT16_MAX */
+  {D_STR_W_LEN ("32768"), 5, 32768},  /* 0x8000, INT16_MAX+1 */
+  {D_STR_W_LEN ("65535"), 5, 65535},  /* 0xFFFF, UINT16_MAX */
+  {D_STR_W_LEN ("65536"), 5, 65536},  /* 0x10000, UINT16_MAX+1 */
+  {D_STR_W_LEN ("2147483647"), 10, 2147483647},  /* 0x7FFFFFFF, INT32_MAX */
+  {D_STR_W_LEN ("2147483648"), 10, UINT64_C (2147483648)}, /* 0x80000000, 
INT32_MAX+1 */
+  {D_STR_W_LEN ("4294967295"), 10, UINT64_C (4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
+  {D_STR_W_LEN ("4294967296"), 10, UINT64_C (4294967296)}, /* 0x100000000, 
UINT32_MAX+1 */
+  {D_STR_W_LEN ("9223372036854775807"), 19, UINT64_C (9223372036854775807)}, 
/* 0x7FFFFFFFFFFFFFFF, INT64_MAX */
+  {D_STR_W_LEN ("9223372036854775808"), 19, UINT64_C (9223372036854775808)}, 
/* 0x8000000000000000, INT64_MAX+1 */
+  {D_STR_W_LEN ("18446744073709551615"), 20, UINT64_C (18446744073709551615)}, 
 /* 0xFFFFFFFFFFFFFFFF, UINT64_MAX */
+
+  /* random numbers */
+  {D_STR_W_LEN ("10186753"), 8, 10186753},
+  {D_STR_W_LEN ("144402566"), 9, 144402566},
+  {D_STR_W_LEN ("151903144"), 9, 151903144},
+  {D_STR_W_LEN ("139264621"), 9, 139264621},
+  {D_STR_W_LEN ("730348"), 6, 730348},
+  {D_STR_W_LEN ("21584377"), 8, 21584377},
+  {D_STR_W_LEN ("709"), 3, 709},
+  {D_STR_W_LEN ("54"), 2, 54},
+  {D_STR_W_LEN ("8452"), 4, 8452},
+  {D_STR_W_LEN ("17745098750013624977"), 20, UINT64_C (17745098750013624977)},
+  {D_STR_W_LEN ("06786878769931678000"), 20, UINT64_C (6786878769931678000)},
+
+  /* non-digit suffixes */
+  {D_STR_W_LEN ("1234oa"), 4, 1234},
+  {D_STR_W_LEN ("20h"), 2, 20},  /* not to be interpreted as hex value! */
+  {D_STR_W_LEN ("0x1F"), 1, 0},  /* not to be interpreted as hex value! */
+  {D_STR_W_LEN ("0564`~}"), 4, 564},
+  {D_STR_W_LEN ("7240146.724"), 7, 7240146},
+  {D_STR_W_LEN ("2,9"), 1, 2},
+  {D_STR_W_LEN ("200+1"), 3, 200},
+  {D_STR_W_LEN ("1a"), 1, 1},
+  {D_STR_W_LEN ("2E"), 1, 2},
+  {D_STR_W_LEN ("6c"), 1, 6},
+  {D_STR_W_LEN ("8F"), 1, 8},
+  {D_STR_W_LEN ("287416997! And the not too long string."), 9, 287416997}
 };
 
 /* strings that should overflow uint64_t */
 const struct str_with_len str_ovflw[] = {
-    D_STR_W_LEN("18446744073709551616"), /* 0x10000000000000000, UINT64_MAX+1 
*/
-    D_STR_W_LEN("18446744073709551620"),
-    D_STR_W_LEN("18446744083709551615"),
-    D_STR_W_LEN("19234761020556472143"),
-    D_STR_W_LEN("184467440737095516150"),
-    D_STR_W_LEN("1844674407370955161500"),
-    D_STR_W_LEN("000018446744073709551616"), /* 0x10000000000000000, 
UINT64_MAX+1 */
-    D_STR_W_LEN("20000000000000000000"),
-    D_STR_W_LEN("020000000000000000000"),
-    D_STR_W_LEN("0020000000000000000000"),
-    D_STR_W_LEN("100000000000000000000"),
-    D_STR_W_LEN("434532891232591226417"),
-    D_STR_W_LEN("99999999999999999999"),
-    D_STR_W_LEN("18446744073709551616abcd"), /* 0x10000000000000000, 
UINT64_MAX+1 */
-    D_STR_W_LEN("20000000000000000000 suffix"),
-    D_STR_W_LEN("020000000000000000000x")
+  D_STR_W_LEN ("18446744073709551616"),  /* 0x10000000000000000, UINT64_MAX+1 
*/
+  D_STR_W_LEN ("18446744073709551620"),
+  D_STR_W_LEN ("18446744083709551615"),
+  D_STR_W_LEN ("19234761020556472143"),
+  D_STR_W_LEN ("184467440737095516150"),
+  D_STR_W_LEN ("1844674407370955161500"),
+  D_STR_W_LEN ("000018446744073709551616"),  /* 0x10000000000000000, 
UINT64_MAX+1 */
+  D_STR_W_LEN ("20000000000000000000"),
+  D_STR_W_LEN ("020000000000000000000"),
+  D_STR_W_LEN ("0020000000000000000000"),
+  D_STR_W_LEN ("100000000000000000000"),
+  D_STR_W_LEN ("434532891232591226417"),
+  D_STR_W_LEN ("99999999999999999999"),
+  D_STR_W_LEN ("18446744073709551616abcd"),  /* 0x10000000000000000, 
UINT64_MAX+1 */
+  D_STR_W_LEN ("20000000000000000000 suffix"),
+  D_STR_W_LEN ("020000000000000000000x")
 };
 
 /* strings that should not be convertible to numeric value */
 const struct str_with_len str_no_num[] = {
-    D_STR_W_LEN("zero"),
-    D_STR_W_LEN("one"),
-    D_STR_W_LEN("\xb9\xb2\xb3"),                /* superscript "123" in 
ISO-8859-1/CP1252 */
-    D_STR_W_LEN("\xc2\xb9\xc2\xb2\xc2\xb3"),    /* superscript "123" in UTF-8 
*/
-    D_STR_W_LEN("\xd9\xa1\xd9\xa2\xd9\xa3"),    /* Arabic-Indic "١٢٣" in UTF-8 
*/
-    D_STR_W_LEN("\xdb\xb1\xdb\xb2\xdb\xb3"),    /* Ext Arabic-Indic "۱۲۳" in 
UTF-8 */
-    D_STR_W_LEN("\xe0\xa5\xa7\xe0\xa5\xa8\xe0\xa5\xa9"), /* Devanagari "१२३" 
in UTF-8 */
-    D_STR_W_LEN("\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89"), /* Chinese "一二三" in 
UTF-8 */
-    D_STR_W_LEN("\xd2\xbb\xb6\xfe\xc8\xfd"),    /* Chinese "一二三" in 
GB2312/CP936 */
-    D_STR_W_LEN("\x1B\x24\x29\x41\x0E\x52\x3B\x36\x7E\x48\x7D\x0F") /* Chinese 
"一二三" in ISO-2022-CN */
+  D_STR_W_LEN ("zero"),
+  D_STR_W_LEN ("one"),
+  D_STR_W_LEN ("\xb9\xb2\xb3"),                 /* superscript "123" in 
ISO-8859-1/CP1252 */
+  D_STR_W_LEN ("\xc2\xb9\xc2\xb2\xc2\xb3"),     /* superscript "123" in UTF-8 
*/
+  D_STR_W_LEN ("\xd9\xa1\xd9\xa2\xd9\xa3"),     /* Arabic-Indic "١٢٣" in UTF-8 
*/
+  D_STR_W_LEN ("\xdb\xb1\xdb\xb2\xdb\xb3"),     /* Ext Arabic-Indic "۱۲۳" in 
UTF-8 */
+  D_STR_W_LEN ("\xe0\xa5\xa7\xe0\xa5\xa8\xe0\xa5\xa9"),  /* Devanagari "१२३" 
in UTF-8 */
+  D_STR_W_LEN ("\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89"),  /* Chinese "一二三" in 
UTF-8 */
+  D_STR_W_LEN ("\xd2\xbb\xb6\xfe\xc8\xfd"),     /* Chinese "一二三" in 
GB2312/CP936 */
+  D_STR_W_LEN ("\x1B\x24\x29\x41\x0E\x52\x3B\x36\x7E\x48\x7D\x0F")  /* Chinese 
"一二三" in ISO-2022-CN */
 };
 
 /* valid hex string for conversion to unsigned integer value */
 static const struct str_with_value xdstrs_w_values[] = {
-    /* simplest strings */
-    {D_STR_W_LEN("1"), 1, 0x1},
-    {D_STR_W_LEN("0"), 1, 0x0},
-    {D_STR_W_LEN("10000"), 5, 0x10000},
-
-    /* all digits */
-    {D_STR_W_LEN("1234"), 4, 0x1234},
-    {D_STR_W_LEN("4567"), 4, 0x4567},
-    {D_STR_W_LEN("7890"), 4, 0x7890},
-    {D_STR_W_LEN("8021"), 4, 0x8021},
-    {D_STR_W_LEN("9754"), 4, 0x9754},
-    {D_STR_W_LEN("6392"), 4, 0x6392},
-    {D_STR_W_LEN("abcd"), 4, 0xABCD},
-    {D_STR_W_LEN("cdef"), 4, 0xCDEF},
-    {D_STR_W_LEN("FEAB"), 4, 0xFEAB},
-    {D_STR_W_LEN("BCED"), 4, 0xBCED},
-    {D_STR_W_LEN("bCeD"), 4, 0xBCED},
-    {D_STR_W_LEN("1A5F"), 4, 0x1A5F},
-    {D_STR_W_LEN("12AB"), 4, 0x12AB},
-    {D_STR_W_LEN("CD34"), 4, 0xCD34},
-    {D_STR_W_LEN("56EF"), 4, 0x56EF},
-    {D_STR_W_LEN("7a9f"), 4, 0x7A9F},
-
-    /* various prefixes */
-    {D_STR_W_LEN("00000000"), 8, 0x0},
-    {D_STR_W_LEN("0755"), 4, 0x755}, /* not to be interpreted as octal value! 
*/
-    {D_STR_W_LEN("002"), 3, 0x2},
-    {D_STR_W_LEN("0001"), 4, 0x1},
-    {D_STR_W_LEN("00a"), 3, 0xA},
-    {D_STR_W_LEN("0F"), 2, 0xF},
-    {D_STR_W_LEN("0000000000000000000000003A29e4C3"), 32, 0x3A29E4C3},
-
-    /* numbers below and above limits */
-    {D_STR_W_LEN("7F"), 2, 127}, /* 0x7F, SCHAR_MAX */
-    {D_STR_W_LEN("7f"), 2, 127}, /* 0x7F, SCHAR_MAX */
-    {D_STR_W_LEN("80"), 2, 128}, /* 0x80, SCHAR_MAX+1 */
-    {D_STR_W_LEN("fF"), 2, 255}, /* 0xFF, UCHAR_MAX */
-    {D_STR_W_LEN("Ff"), 2, 255}, /* 0xFF, UCHAR_MAX */
-    {D_STR_W_LEN("FF"), 2, 255}, /* 0xFF, UCHAR_MAX */
-    {D_STR_W_LEN("ff"), 2, 255}, /* 0xFF, UCHAR_MAX */
-    {D_STR_W_LEN("100"), 3, 256}, /* 0x100, UCHAR_MAX+1 */
-    {D_STR_W_LEN("7fff"), 4, 32767}, /* 0x7FFF, INT16_MAX */
-    {D_STR_W_LEN("7FFF"), 4, 32767}, /* 0x7FFF, INT16_MAX */
-    {D_STR_W_LEN("7Fff"), 4, 32767}, /* 0x7FFF, INT16_MAX */
-    {D_STR_W_LEN("8000"), 4, 32768}, /* 0x8000, INT16_MAX+1 */
-    {D_STR_W_LEN("ffff"), 4, 65535}, /* 0xFFFF, UINT16_MAX */
-    {D_STR_W_LEN("FFFF"), 4, 65535}, /* 0xFFFF, UINT16_MAX */
-    {D_STR_W_LEN("FffF"), 4, 65535}, /* 0xFFFF, UINT16_MAX */
-    {D_STR_W_LEN("10000"), 5, 65536}, /* 0x10000, UINT16_MAX+1 */
-    {D_STR_W_LEN("7FFFFFFF"), 8, 2147483647}, /* 0x7FFFFFFF, INT32_MAX */
-    {D_STR_W_LEN("7fffffff"), 8, 2147483647}, /* 0x7FFFFFFF, INT32_MAX */
-    {D_STR_W_LEN("7FFffFff"), 8, 2147483647}, /* 0x7FFFFFFF, INT32_MAX */
-    {D_STR_W_LEN("80000000"), 8, UINT64_C(2147483648)}, /* 0x80000000, 
INT32_MAX+1 */
-    {D_STR_W_LEN("FFFFFFFF"), 8, UINT64_C(4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
-    {D_STR_W_LEN("ffffffff"), 8, UINT64_C(4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
-    {D_STR_W_LEN("FfFfFfFf"), 8, UINT64_C(4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
-    {D_STR_W_LEN("100000000"), 9, UINT64_C(4294967296)}, /* 0x100000000, 
UINT32_MAX+1 */
-    {D_STR_W_LEN("7fffffffffffffff"), 16, UINT64_C(9223372036854775807)}, /* 
0x7FFFFFFFFFFFFFFF, INT64_MAX */
-    {D_STR_W_LEN("7FFFFFFFFFFFFFFF"), 16, UINT64_C(9223372036854775807)}, /* 
0x7FFFFFFFFFFFFFFF, INT64_MAX */
-    {D_STR_W_LEN("7FfffFFFFffFFffF"), 16, UINT64_C(9223372036854775807)}, /* 
0x7FFFFFFFFFFFFFFF, INT64_MAX */
-    {D_STR_W_LEN("8000000000000000"), 16, UINT64_C(9223372036854775808)}, /* 
0x8000000000000000, INT64_MAX+1 */
-    {D_STR_W_LEN("ffffffffffffffff"), 16, UINT64_C(18446744073709551615)},  /* 
0xFFFFFFFFFFFFFFFF, UINT64_MAX */
-    {D_STR_W_LEN("FFFFFFFFFFFFFFFF"), 16, UINT64_C(18446744073709551615)},  /* 
0xFFFFFFFFFFFFFFFF, UINT64_MAX */
-    {D_STR_W_LEN("FffFffFFffFFfFFF"), 16, UINT64_C(18446744073709551615)},  /* 
0xFFFFFFFFFFFFFFFF, UINT64_MAX */
-
-    /* random numbers */
-    {D_STR_W_LEN("10186753"), 8, 0x10186753},
-    {D_STR_W_LEN("144402566"), 9, 0x144402566},
-    {D_STR_W_LEN("151903144"), 9, 0x151903144},
-    {D_STR_W_LEN("139264621"), 9, 0x139264621},
-    {D_STR_W_LEN("730348"), 6, 0x730348},
-    {D_STR_W_LEN("21584377"), 8, 0x21584377},
-    {D_STR_W_LEN("709"), 3, 0x709},
-    {D_STR_W_LEN("54"), 2, 0x54},
-    {D_STR_W_LEN("8452"), 4, 0x8452},
-    {D_STR_W_LEN("22353EC6"), 8, 0x22353EC6},
-    {D_STR_W_LEN("307F1655"), 8, 0x307F1655},
-    {D_STR_W_LEN("1FCB7226"), 8, 0x1FCB7226},
-    {D_STR_W_LEN("82480560"), 8, 0x82480560},
-    {D_STR_W_LEN("7386D95"), 7, 0x7386D95},
-    {D_STR_W_LEN("EC3AB"), 5, 0xEC3AB},
-    {D_STR_W_LEN("6DD05"), 5, 0x6DD05},
-    {D_STR_W_LEN("C5DF"), 4, 0xC5DF},
-    {D_STR_W_LEN("6CE"), 3, 0x6CE},
-    {D_STR_W_LEN("CE6"), 3, 0xCE6},
-    {D_STR_W_LEN("ce6"), 3, 0xCE6},
-    {D_STR_W_LEN("F27"), 3, 0xF27},
-    {D_STR_W_LEN("8497D54277D7E1"), 14, UINT64_C(37321639124785121)},
-    {D_STR_W_LEN("8497d54277d7e1"), 14, UINT64_C(37321639124785121)},
-    {D_STR_W_LEN("8497d54277d7E1"), 14, UINT64_C(37321639124785121)},
-    {D_STR_W_LEN("8C8112D0A06"), 11, UINT64_C(9655374645766)},
-    {D_STR_W_LEN("8c8112d0a06"), 11, UINT64_C(9655374645766)},
-    {D_STR_W_LEN("8c8112d0A06"), 11, UINT64_C(9655374645766)},
-    {D_STR_W_LEN("1774509875001362"), 16, UINT64_C(1690064375898968930)},
-    {D_STR_W_LEN("0678687876998000"), 16, UINT64_C(466237428027981824)},
-
-    /* non-digit suffixes */
-    {D_STR_W_LEN("1234oa"), 4, 0x1234},
-    {D_STR_W_LEN("20h"), 2, 0x20},
-    {D_STR_W_LEN("2CH"), 2, 0x2C},
-    {D_STR_W_LEN("2ch"), 2, 0x2C},
-    {D_STR_W_LEN("0x1F"), 1, 0x0}, /* not to be interpreted as hex prefix! */
-    {D_STR_W_LEN("0564`~}"), 4, 0x564},
-    {D_STR_W_LEN("0A64`~}"), 4, 0xA64},
-    {D_STR_W_LEN("056c`~}"), 4, 0X56C},
-    {D_STR_W_LEN("7240146.724"), 7, 0x7240146},
-    {D_STR_W_LEN("7E4c1AB.724"), 7, 0X7E4C1AB},
-    {D_STR_W_LEN("F24B1B6.724"), 7, 0xF24B1B6},
-    {D_STR_W_LEN("2,9"), 1, 0x2},
-    {D_STR_W_LEN("a,9"), 1, 0xA},
-    {D_STR_W_LEN("200+1"), 3, 0x200},
-    {D_STR_W_LEN("2cc+1"), 3, 0x2CC},
-    {D_STR_W_LEN("2cC+1"), 3, 0x2CC},
-    {D_STR_W_LEN("27416997! And the not too long string."), 8, 0x27416997},
-    {D_STR_W_LEN("27555416997! And the not too long string."), 11, 
0x27555416997},
-    {D_STR_W_LEN("416997And the not too long string."), 7, 0x416997A},
-    {D_STR_W_LEN("0F4C3Dabstract addition to make string even longer"), 8, 
0xF4C3DAB}
+  /* simplest strings */
+  {D_STR_W_LEN ("1"), 1, 0x1},
+  {D_STR_W_LEN ("0"), 1, 0x0},
+  {D_STR_W_LEN ("10000"), 5, 0x10000},
+
+  /* all digits */
+  {D_STR_W_LEN ("1234"), 4, 0x1234},
+  {D_STR_W_LEN ("4567"), 4, 0x4567},
+  {D_STR_W_LEN ("7890"), 4, 0x7890},
+  {D_STR_W_LEN ("8021"), 4, 0x8021},
+  {D_STR_W_LEN ("9754"), 4, 0x9754},
+  {D_STR_W_LEN ("6392"), 4, 0x6392},
+  {D_STR_W_LEN ("abcd"), 4, 0xABCD},
+  {D_STR_W_LEN ("cdef"), 4, 0xCDEF},
+  {D_STR_W_LEN ("FEAB"), 4, 0xFEAB},
+  {D_STR_W_LEN ("BCED"), 4, 0xBCED},
+  {D_STR_W_LEN ("bCeD"), 4, 0xBCED},
+  {D_STR_W_LEN ("1A5F"), 4, 0x1A5F},
+  {D_STR_W_LEN ("12AB"), 4, 0x12AB},
+  {D_STR_W_LEN ("CD34"), 4, 0xCD34},
+  {D_STR_W_LEN ("56EF"), 4, 0x56EF},
+  {D_STR_W_LEN ("7a9f"), 4, 0x7A9F},
+
+  /* various prefixes */
+  {D_STR_W_LEN ("00000000"), 8, 0x0},
+  {D_STR_W_LEN ("0755"), 4, 0x755},  /* not to be interpreted as octal value! 
*/
+  {D_STR_W_LEN ("002"), 3, 0x2},
+  {D_STR_W_LEN ("0001"), 4, 0x1},
+  {D_STR_W_LEN ("00a"), 3, 0xA},
+  {D_STR_W_LEN ("0F"), 2, 0xF},
+  {D_STR_W_LEN ("0000000000000000000000003A29e4C3"), 32, 0x3A29E4C3},
+
+  /* numbers below and above limits */
+  {D_STR_W_LEN ("7F"), 2, 127},  /* 0x7F, SCHAR_MAX */
+  {D_STR_W_LEN ("7f"), 2, 127},  /* 0x7F, SCHAR_MAX */
+  {D_STR_W_LEN ("80"), 2, 128},  /* 0x80, SCHAR_MAX+1 */
+  {D_STR_W_LEN ("fF"), 2, 255},  /* 0xFF, UCHAR_MAX */
+  {D_STR_W_LEN ("Ff"), 2, 255},  /* 0xFF, UCHAR_MAX */
+  {D_STR_W_LEN ("FF"), 2, 255},  /* 0xFF, UCHAR_MAX */
+  {D_STR_W_LEN ("ff"), 2, 255},  /* 0xFF, UCHAR_MAX */
+  {D_STR_W_LEN ("100"), 3, 256},  /* 0x100, UCHAR_MAX+1 */
+  {D_STR_W_LEN ("7fff"), 4, 32767},  /* 0x7FFF, INT16_MAX */
+  {D_STR_W_LEN ("7FFF"), 4, 32767},  /* 0x7FFF, INT16_MAX */
+  {D_STR_W_LEN ("7Fff"), 4, 32767},  /* 0x7FFF, INT16_MAX */
+  {D_STR_W_LEN ("8000"), 4, 32768},  /* 0x8000, INT16_MAX+1 */
+  {D_STR_W_LEN ("ffff"), 4, 65535},  /* 0xFFFF, UINT16_MAX */
+  {D_STR_W_LEN ("FFFF"), 4, 65535},  /* 0xFFFF, UINT16_MAX */
+  {D_STR_W_LEN ("FffF"), 4, 65535},  /* 0xFFFF, UINT16_MAX */
+  {D_STR_W_LEN ("10000"), 5, 65536},  /* 0x10000, UINT16_MAX+1 */
+  {D_STR_W_LEN ("7FFFFFFF"), 8, 2147483647},  /* 0x7FFFFFFF, INT32_MAX */
+  {D_STR_W_LEN ("7fffffff"), 8, 2147483647},  /* 0x7FFFFFFF, INT32_MAX */
+  {D_STR_W_LEN ("7FFffFff"), 8, 2147483647},  /* 0x7FFFFFFF, INT32_MAX */
+  {D_STR_W_LEN ("80000000"), 8, UINT64_C (2147483648)}, /* 0x80000000, 
INT32_MAX+1 */
+  {D_STR_W_LEN ("FFFFFFFF"), 8, UINT64_C (4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
+  {D_STR_W_LEN ("ffffffff"), 8, UINT64_C (4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
+  {D_STR_W_LEN ("FfFfFfFf"), 8, UINT64_C (4294967295)}, /* 0xFFFFFFFF, 
UINT32_MAX */
+  {D_STR_W_LEN ("100000000"), 9, UINT64_C (4294967296)}, /* 0x100000000, 
UINT32_MAX+1 */
+  {D_STR_W_LEN ("7fffffffffffffff"), 16, UINT64_C (9223372036854775807)}, /* 
0x7FFFFFFFFFFFFFFF, INT64_MAX */
+  {D_STR_W_LEN ("7FFFFFFFFFFFFFFF"), 16, UINT64_C (9223372036854775807)}, /* 
0x7FFFFFFFFFFFFFFF, INT64_MAX */
+  {D_STR_W_LEN ("7FfffFFFFffFFffF"), 16, UINT64_C (9223372036854775807)}, /* 
0x7FFFFFFFFFFFFFFF, INT64_MAX */
+  {D_STR_W_LEN ("8000000000000000"), 16, UINT64_C (9223372036854775808)}, /* 
0x8000000000000000, INT64_MAX+1 */
+  {D_STR_W_LEN ("ffffffffffffffff"), 16, UINT64_C (18446744073709551615)},  /* 
0xFFFFFFFFFFFFFFFF, UINT64_MAX */
+  {D_STR_W_LEN ("FFFFFFFFFFFFFFFF"), 16, UINT64_C (18446744073709551615)},  /* 
0xFFFFFFFFFFFFFFFF, UINT64_MAX */
+  {D_STR_W_LEN ("FffFffFFffFFfFFF"), 16, UINT64_C (18446744073709551615)},  /* 
0xFFFFFFFFFFFFFFFF, UINT64_MAX */
+
+  /* random numbers */
+  {D_STR_W_LEN ("10186753"), 8, 0x10186753},
+  {D_STR_W_LEN ("144402566"), 9, 0x144402566},
+  {D_STR_W_LEN ("151903144"), 9, 0x151903144},
+  {D_STR_W_LEN ("139264621"), 9, 0x139264621},
+  {D_STR_W_LEN ("730348"), 6, 0x730348},
+  {D_STR_W_LEN ("21584377"), 8, 0x21584377},
+  {D_STR_W_LEN ("709"), 3, 0x709},
+  {D_STR_W_LEN ("54"), 2, 0x54},
+  {D_STR_W_LEN ("8452"), 4, 0x8452},
+  {D_STR_W_LEN ("22353EC6"), 8, 0x22353EC6},
+  {D_STR_W_LEN ("307F1655"), 8, 0x307F1655},
+  {D_STR_W_LEN ("1FCB7226"), 8, 0x1FCB7226},
+  {D_STR_W_LEN ("82480560"), 8, 0x82480560},
+  {D_STR_W_LEN ("7386D95"), 7, 0x7386D95},
+  {D_STR_W_LEN ("EC3AB"), 5, 0xEC3AB},
+  {D_STR_W_LEN ("6DD05"), 5, 0x6DD05},
+  {D_STR_W_LEN ("C5DF"), 4, 0xC5DF},
+  {D_STR_W_LEN ("6CE"), 3, 0x6CE},
+  {D_STR_W_LEN ("CE6"), 3, 0xCE6},
+  {D_STR_W_LEN ("ce6"), 3, 0xCE6},
+  {D_STR_W_LEN ("F27"), 3, 0xF27},
+  {D_STR_W_LEN ("8497D54277D7E1"), 14, UINT64_C (37321639124785121)},
+  {D_STR_W_LEN ("8497d54277d7e1"), 14, UINT64_C (37321639124785121)},
+  {D_STR_W_LEN ("8497d54277d7E1"), 14, UINT64_C (37321639124785121)},
+  {D_STR_W_LEN ("8C8112D0A06"), 11, UINT64_C (9655374645766)},
+  {D_STR_W_LEN ("8c8112d0a06"), 11, UINT64_C (9655374645766)},
+  {D_STR_W_LEN ("8c8112d0A06"), 11, UINT64_C (9655374645766)},
+  {D_STR_W_LEN ("1774509875001362"), 16, UINT64_C (1690064375898968930)},
+  {D_STR_W_LEN ("0678687876998000"), 16, UINT64_C (466237428027981824)},
+
+  /* non-digit suffixes */
+  {D_STR_W_LEN ("1234oa"), 4, 0x1234},
+  {D_STR_W_LEN ("20h"), 2, 0x20},
+  {D_STR_W_LEN ("2CH"), 2, 0x2C},
+  {D_STR_W_LEN ("2ch"), 2, 0x2C},
+  {D_STR_W_LEN ("0x1F"), 1, 0x0},  /* not to be interpreted as hex prefix! */
+  {D_STR_W_LEN ("0564`~}"), 4, 0x564},
+  {D_STR_W_LEN ("0A64`~}"), 4, 0xA64},
+  {D_STR_W_LEN ("056c`~}"), 4, 0X56C},
+  {D_STR_W_LEN ("7240146.724"), 7, 0x7240146},
+  {D_STR_W_LEN ("7E4c1AB.724"), 7, 0X7E4C1AB},
+  {D_STR_W_LEN ("F24B1B6.724"), 7, 0xF24B1B6},
+  {D_STR_W_LEN ("2,9"), 1, 0x2},
+  {D_STR_W_LEN ("a,9"), 1, 0xA},
+  {D_STR_W_LEN ("200+1"), 3, 0x200},
+  {D_STR_W_LEN ("2cc+1"), 3, 0x2CC},
+  {D_STR_W_LEN ("2cC+1"), 3, 0x2CC},
+  {D_STR_W_LEN ("27416997! And the not too long string."), 8, 0x27416997},
+  {D_STR_W_LEN ("27555416997! And the not too long string."), 11,
+   0x27555416997},
+  {D_STR_W_LEN ("416997And the not too long string."), 7, 0x416997A},
+  {D_STR_W_LEN ("0F4C3Dabstract addition to make string even longer"), 8,
+   0xF4C3DAB}
 };
 
 /* hex strings that should overflow uint64_t */
 const struct str_with_len strx_ovflw[] = {
-    D_STR_W_LEN("10000000000000000"),           /* 0x10000000000000000, 
UINT64_MAX+1 */
-    D_STR_W_LEN("10000000000000001"),
-    D_STR_W_LEN("10000000000000002"),
-    D_STR_W_LEN("1000000000000000A"),
-    D_STR_W_LEN("11000000000000000"),
-    D_STR_W_LEN("010000000000000000"),          /* 0x10000000000000000, 
UINT64_MAX+1 */
-    D_STR_W_LEN("000010000000000000000"),       /* 0x10000000000000000, 
UINT64_MAX+1 */
-    D_STR_W_LEN("20000000000000000000"),
-    D_STR_W_LEN("020000000000000000000"),
-    D_STR_W_LEN("0020000000000000000000"),
-    D_STR_W_LEN("20000000000000000"),
-    D_STR_W_LEN("A0000000000000000"),
-    D_STR_W_LEN("F0000000000000000"),
-    D_STR_W_LEN("a0000000000000000"),
-    D_STR_W_LEN("11111111111111111"),
-    D_STR_W_LEN("CcCcCCccCCccCCccC"),
-    D_STR_W_LEN("f0000000000000000"),
-    D_STR_W_LEN("100000000000000000000"),
-    D_STR_W_LEN("434532891232591226417"),
-    D_STR_W_LEN("10000000000000000a"),
-    D_STR_W_LEN("10000000000000000E"),
-    D_STR_W_LEN("100000000000000000 and nothing"), /* 0x10000000000000000, 
UINT64_MAX+1 */
-    D_STR_W_LEN("100000000000000000xx"),        /* 0x10000000000000000, 
UINT64_MAX+1 */
-    D_STR_W_LEN("99999999999999999999"),
-    D_STR_W_LEN("18446744073709551616abcd"),
-    D_STR_W_LEN("20000000000000000000 suffix"),
-    D_STR_W_LEN("020000000000000000000x")
+  D_STR_W_LEN ("10000000000000000"),            /* 0x10000000000000000, 
UINT64_MAX+1 */
+  D_STR_W_LEN ("10000000000000001"),
+  D_STR_W_LEN ("10000000000000002"),
+  D_STR_W_LEN ("1000000000000000A"),
+  D_STR_W_LEN ("11000000000000000"),
+  D_STR_W_LEN ("010000000000000000"),           /* 0x10000000000000000, 
UINT64_MAX+1 */
+  D_STR_W_LEN ("000010000000000000000"),        /* 0x10000000000000000, 
UINT64_MAX+1 */
+  D_STR_W_LEN ("20000000000000000000"),
+  D_STR_W_LEN ("020000000000000000000"),
+  D_STR_W_LEN ("0020000000000000000000"),
+  D_STR_W_LEN ("20000000000000000"),
+  D_STR_W_LEN ("A0000000000000000"),
+  D_STR_W_LEN ("F0000000000000000"),
+  D_STR_W_LEN ("a0000000000000000"),
+  D_STR_W_LEN ("11111111111111111"),
+  D_STR_W_LEN ("CcCcCCccCCccCCccC"),
+  D_STR_W_LEN ("f0000000000000000"),
+  D_STR_W_LEN ("100000000000000000000"),
+  D_STR_W_LEN ("434532891232591226417"),
+  D_STR_W_LEN ("10000000000000000a"),
+  D_STR_W_LEN ("10000000000000000E"),
+  D_STR_W_LEN ("100000000000000000 and nothing"),  /* 0x10000000000000000, 
UINT64_MAX+1 */
+  D_STR_W_LEN ("100000000000000000xx"),         /* 0x10000000000000000, 
UINT64_MAX+1 */
+  D_STR_W_LEN ("99999999999999999999"),
+  D_STR_W_LEN ("18446744073709551616abcd"),
+  D_STR_W_LEN ("20000000000000000000 suffix"),
+  D_STR_W_LEN ("020000000000000000000x")
 };
 
 
-int check_str_to_uint64_valid(void)
+int check_str_to_uint64_valid (void)
 {
   size_t t_failed = 0;
   size_t i, j;
-  static const size_t n_checks = sizeof(dstrs_w_values) / 
sizeof(dstrs_w_values[0]);
+  static const size_t n_checks = sizeof(dstrs_w_values)
+                                 / sizeof(dstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
-        {
-          uint64_t rv;
-          size_t rs;
-          const struct str_with_value * const t = dstrs_w_values + i;
-
-          if (c_failed[i])
-            continue; /* skip already failed checks */
-
-          if (t->str.len < t->num_of_digt)
-            {
-              fprintf(stderr, "ERROR: dstrs_w_values[%u] has wrong num_of_digt 
(%u): num_of_digt is expected"
-                              " to be less or equal to str.len (%u).\n",
-                              (unsigned int) i, (unsigned int) t->num_of_digt, 
(unsigned int) t->str.len);
-              return -1;
-            }
-          rv = 9435223; /* some random value */
-          rs = MHD_str_to_uint64_(t->str.str, &rv);
-          if (rs != t->num_of_digt)
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 
") returned %" PRIuPTR ", while expecting %d."
-                      " Locale: %s\n", n_prnt(t->str.str), rv, (intptr_t)rs, 
(int)t->num_of_digt, get_current_locale_str());
-            }
-          if (rv != t->val)
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 
") converted string to value %" PRIu64 ","
-                      " while expecting result %" PRIu64 ". Locale: %s\n", 
n_prnt(t->str.str), rv, rv,
-                      t->val, get_current_locale_str());
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 ") == %" 
PRIuPTR "\n",
-                   n_prnt(t->str.str), rv, rs);
-        }
+      uint64_t rv;
+      size_t rs;
+      const struct str_with_value *const t = dstrs_w_values + i;
+
+      if (c_failed[i])
+        continue;     /* skip already failed checks */
+
+      if (t->str.len < t->num_of_digt)
+      {
+        fprintf (stderr,
+                 "ERROR: dstrs_w_values[%u] has wrong num_of_digt (%u): 
num_of_digt is expected"
+                 " to be less or equal to str.len (%u).\n",
+                 (unsigned int) i, (unsigned int) t->num_of_digt, (unsigned
+                                                                   int) t->str.
+                 len);
+        return -1;
+      }
+      rv = 9435223;     /* some random value */
+      rs = MHD_str_to_uint64_ (t->str.str, &rv);
+      if (rs != t->num_of_digt)
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 ") returned %"
+                 PRIuPTR
+                 ", while expecting %d."
+                 " Locale: %s\n", n_prnt (t->str.str), rv, (intptr_t) rs,
+                 (int) t->num_of_digt, get_current_locale_str ());
+      }
+      if (rv != t->val)
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64
+                 ") converted string to value %"
+                 PRIu64 ","
+                 " while expecting result %" PRIu64 ". Locale: %s\n", n_prnt (
+                   t->str.str), rv, rv,
+                 t->val, get_current_locale_str ());
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 ") == %" PRIuPTR 
"\n",
+          n_prnt (t->str.str), rv, rs);
     }
+  }
   return t_failed;
 }
 
 
-int check_str_to_uint64_all_chars(void)
+int check_str_to_uint64_all_chars (void)
 {
   static const size_t n_checks = 256; /* from 0 to 255 */
   int c_failed[n_checks];
   size_t t_failed = 0;
   size_t j;
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
-    {
-      unsigned int c;
-      uint64_t test_val;
+  for (j = 0; j < locale_name_count; j++)
+  {
+    unsigned int c;
+    uint64_t test_val;
 
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(c = 0; c < n_checks; c++)
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (c = 0; c < n_checks; c++)
+    {
+      static const uint64_t rnd_val = 24941852;
+      size_t rs;
+      if ((c >= '0') &&(c <= '9') )
+        continue;     /* skip digits */
+      for (test_val = 0; test_val <= rnd_val&& ! c_failed[c]; test_val +=
+             rnd_val)
+      {
+        char test_str[] = "0123";
+        uint64_t rv = test_val;
+
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+        rs = MHD_str_to_uint64_ (test_str, &rv);
+        if (rs != 0)
+        {
+          t_failed++;
+          c_failed[c] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64
+                   ") returned %" PRIuPTR
+                   ", while expecting zero."
+                   " Locale: %s\n", n_prnt (test_str), rv, (uintptr_t) rs,
+                   get_current_locale_str ());
+        }
+        else if (rv != test_val)
         {
-          static const uint64_t rnd_val = 24941852;
-          size_t rs;
-          if (c >= '0' && c <= '9')
-            continue; /* skip digits */
-          for(test_val = 0; test_val <= rnd_val&& !c_failed[c]; test_val += 
rnd_val)
-            {
-              char test_str[] = "0123";
-              uint64_t rv = test_val;
-
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-              rs = MHD_str_to_uint64_(test_str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[c] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", ->%" 
PRIu64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(test_str), rv, 
(uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[c] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: %" PRIu64 ", after call %" 
PRIu64 "). Locale: %s\n",
-                                  n_prnt(test_str), test_val, rv, 
get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[c])
-            {
-              char test_str[] = "0123";
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-
-              printf("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value 
of ret_val is unmodified\n",
-                     n_prnt(test_str));
-            }
+          t_failed++;
+          c_failed[c] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: %" PRIu64 ", after call %" PRIu64
+                   "). Locale: %s\n",
+                   n_prnt (test_str), test_val, rv, get_current_locale_str ());
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[c])
+      {
+        char test_str[] = "0123";
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+
+        printf (
+          "PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val 
is unmodified\n",
+          n_prnt (test_str));
+      }
     }
+  }
   return t_failed;
 }
 
 
-int check_str_to_uint64_overflow(void)
+int check_str_to_uint64_overflow (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_ovflw) / sizeof(str_ovflw[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_ovflw + i;
+      static const uint64_t rnd_val = 2;
+      uint64_t test_val;
+
+      for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+             rnd_val)
+      {
+        uint64_t rv = test_val;
+
+        rs = MHD_str_to_uint64_ (t->str, &rv);
+        if (rs != 0)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_ovflw + i;
-          static const uint64_t rnd_val = 2;
-          uint64_t test_val;
-
-          for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val += 
rnd_val)
-            {
-              uint64_t rv = test_val;
-
-              rs = MHD_str_to_uint64_(t->str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", ->%" 
PRIu64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(t->str), rv, 
(uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: %" PRIu64 ", after call %" 
PRIu64 "). Locale: %s\n",
-                                  n_prnt(t->str), test_val, rv, 
get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value 
of ret_val is unmodified\n",
-                   n_prnt(t->str));
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64
+                   ") returned %" PRIuPTR
+                   ", while expecting zero."
+                   " Locale: %s\n", n_prnt (t->str), rv, (uintptr_t) rs,
+                   get_current_locale_str ());
         }
+        else if (rv != test_val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: %" PRIu64 ", after call %" PRIu64
+                   "). Locale: %s\n",
+                   n_prnt (t->str), test_val, rv, get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val 
is unmodified\n",
+          n_prnt (t->str));
     }
+  }
   return t_failed;
 }
 
 
-int check_str_to_uint64_no_val(void)
+int check_str_to_uint64_no_val (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_no_num + i;
+      static const uint64_t rnd_val = 74218431;
+      uint64_t test_val;
+
+      for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+             rnd_val)
+      {
+        uint64_t rv = test_val;
+
+        rs = MHD_str_to_uint64_ (t->str, &rv);
+        if (rs != 0)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_no_num + i;
-          static const uint64_t rnd_val = 74218431;
-          uint64_t test_val;
-
-          for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val += 
rnd_val)
-            {
-              uint64_t rv = test_val;
-
-              rs = MHD_str_to_uint64_(t->str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", ->%" 
PRIu64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(t->str), rv, 
(uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: %" PRIu64 ", after call %" 
PRIu64 "). Locale: %s\n",
-                                  n_prnt(t->str), test_val, rv, 
get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value 
of ret_val is unmodified\n",
-                   n_prnt(t->str));
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64
+                   ") returned %" PRIuPTR
+                   ", while expecting zero."
+                   " Locale: %s\n", n_prnt (t->str), rv, (uintptr_t) rs,
+                   get_current_locale_str ());
         }
+        else if (rv != test_val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: %" PRIu64 ", after call %" PRIu64
+                   "). Locale: %s\n",
+                   n_prnt (t->str), test_val, rv, get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val 
is unmodified\n",
+          n_prnt (t->str));
     }
+  }
   return t_failed;
 }
 
 
-int check_str_to_uint64_n_valid(void)
+int check_str_to_uint64_n_valid (void)
 {
   size_t t_failed = 0;
   size_t i, j;
-  static const size_t n_checks = sizeof(dstrs_w_values) / 
sizeof(dstrs_w_values[0]);
+  static const size_t n_checks = sizeof(dstrs_w_values)
+                                 / sizeof(dstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      uint64_t rv = 1235572;     /* some random value */
+      size_t rs = 0;
+      size_t len;
+      const struct str_with_value *const t = dstrs_w_values + i;
+
+      if (t->str.len < t->num_of_digt)
+      {
+        fprintf (stderr,
+                 "ERROR: dstrs_w_values[%u] has wrong num_of_digt (%u): 
num_of_digt is expected"
+                 " to be less or equal to str.len (%u).\n",
+                 (unsigned int) i, (unsigned int) t->num_of_digt, (unsigned
+                                                                   int) t->str.
+                 len);
+        return -1;
+      }
+      for (len = t->num_of_digt; len <= t->str.len + 1 && ! c_failed[i]; len++)
+      {
+        rs = MHD_str_to_uint64_n_ (t->str.str, len, &rv);
+        if (rs != t->num_of_digt)
         {
-          uint64_t rv = 1235572; /* some random value */
-          size_t rs = 0;
-          size_t len;
-          const struct str_with_value * const t = dstrs_w_values + i;
-
-          if (t->str.len < t->num_of_digt)
-            {
-              fprintf(stderr, "ERROR: dstrs_w_values[%u] has wrong num_of_digt 
(%u): num_of_digt is expected"
-                              " to be less or equal to str.len (%u).\n",
-                              (unsigned int) i, (unsigned int) t->num_of_digt, 
(unsigned int) t->str.len);
-              return -1;
-            }
-          for (len = t->num_of_digt; len <= t->str.len + 1 && !c_failed[i]; 
len++)
-            {
-              rs = MHD_str_to_uint64_n_(t->str.str, len, &rv);
-              if (rs != t->num_of_digt)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", ->%" PRIu64 ")"
-                          " returned %" PRIuPTR ", while expecting %d. Locale: 
%s\n",
-                          n_prnt(t->str.str), (intptr_t)len, rv, (intptr_t)rs,
-                          (int)t->num_of_digt, get_current_locale_str());
-                }
-              if (rv != t->val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", ->%" PRIu64 ")"
-                          " converted string to value %" PRIu64 ", while 
expecting result %" PRIu64
-                          ". Locale: %s\n", n_prnt(t->str.str), (intptr_t)len, 
rv, rv,
-                          t->val, get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%" 
PRIuPTR ", ->%" PRIu64 ")"
-                   " == %" PRIuPTR "\n", n_prnt(t->str.str), 
(intptr_t)t->num_of_digt,
-                   (intptr_t)t->str.len + 1, rv, rs);
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR ", ->%"
+                   PRIu64 ")"
+                   " returned %" PRIuPTR ", while expecting %d. Locale: %s\n",
+                   n_prnt (t->str.str), (intptr_t) len, rv, (intptr_t) rs,
+                   (int) t->num_of_digt, get_current_locale_str ());
         }
+        if (rv != t->val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR ", ->%"
+                   PRIu64 ")"
+                   " converted string to value %" PRIu64
+                   ", while expecting result %" PRIu64
+                   ". Locale: %s\n", n_prnt (t->str.str), (intptr_t) len, rv,
+                   rv,
+                   t->val, get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR ", 
->%"
+          PRIu64 ")"
+          " == %" PRIuPTR "\n", n_prnt (t->str.str),
+          (intptr_t) t->num_of_digt,
+          (intptr_t) t->str.len + 1, rv, rs);
     }
+  }
   return t_failed;
 }
 
 
-int check_str_to_uint64_n_all_chars(void)
+int check_str_to_uint64_n_all_chars (void)
 {
   static const size_t n_checks = 256; /* from 0 to 255 */
   int c_failed[n_checks];
   size_t t_failed = 0;
   size_t j;
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
+
+  for (j = 0; j < locale_name_count; j++)
+  {
+    unsigned int c;
+    uint64_t test_val;
 
-  for(j = 0; j < locale_name_count; j++)
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (c = 0; c < n_checks; c++)
     {
-      unsigned int c;
-      uint64_t test_val;
+      static const uint64_t rnd_val = 98372558;
+      size_t rs;
+      size_t len;
 
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(c = 0; c < n_checks; c++)
+      if ((c >= '0') &&(c <= '9') )
+        continue;     /* skip digits */
+
+      for (len = 0; len <= 5; len++)
+      {
+        for (test_val = 0; test_val <= rnd_val&& ! c_failed[c]; test_val +=
+               rnd_val)
         {
-          static const uint64_t rnd_val = 98372558;
-          size_t rs;
-          size_t len;
-
-          if (c >= '0' && c <= '9')
-            continue; /* skip digits */
-
-          for (len = 0; len <= 5; len++)
-            {
-              for(test_val = 0; test_val <= rnd_val&& !c_failed[c]; test_val 
+= rnd_val)
-                {
-                  char test_str[] = "0123";
-                  uint64_t rv = test_val;
-
-                  test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-                  rs = MHD_str_to_uint64_n_(test_str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[c] = !0;
-                      fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", ->%" PRIu64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(test_str), (uintptr_t)len, rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[c] = !0;
-                      fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: %" 
PRIu64 ", after call %" PRIu64 ")."
-                              " Locale: %s\n",
-                              n_prnt(test_str), (uintptr_t)len, test_val, rv, 
get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[c])
-            {
-              char test_str[] = "0123";
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-
-              printf("PASSED: MHD_str_to_uint64_n_(\"%s\", 0..5, &ret_val) == 
0, value of ret_val is unmodified\n",
-                     n_prnt(test_str));
-            }
+          char test_str[] = "0123";
+          uint64_t rv = test_val;
+
+          test_str[0] = (char) (unsigned char) c;        /* replace first char 
with non-digit char */
+          rs = MHD_str_to_uint64_n_ (test_str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[c] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR ", ->%"
+                     PRIu64 ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (test_str), (uintptr_t) len, rv, (uintptr_t) rs,
+                     get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[c] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: %" PRIu64
+                     ", after call %" PRIu64 ")."
+                     " Locale: %s\n",
+                     n_prnt (test_str), (uintptr_t) len, test_val, rv,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[c])
+      {
+        char test_str[] = "0123";
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+
+        printf (
+          "PASSED: MHD_str_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, value of 
ret_val is unmodified\n",
+          n_prnt (test_str));
+      }
     }
+  }
   return t_failed;
 }
 
 
-int check_str_to_uint64_n_overflow(void)
+int check_str_to_uint64_n_overflow (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_ovflw) / sizeof(str_ovflw[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_ovflw + i;
+      static const uint64_t rnd_val = 3;
+      size_t len;
+
+      for (len = t->len; len <= t->len + 1; len++)
+      {
+        uint64_t test_val;
+        for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+               rnd_val)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_ovflw + i;
-          static const uint64_t rnd_val = 3;
-          size_t len;
-
-          for (len = t->len; len <= t->len + 1; len++)
-            {
-              uint64_t test_val;
-              for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val 
+= rnd_val)
-                {
-                  uint64_t rv = test_val;
-
-                  rs = MHD_str_to_uint64_n_(t->str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", ->%" PRIu64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(t->str), (uintptr_t)len, rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: %" 
PRIu64 ", after call %" PRIu64 ")."
-                              " Locale: %s\n", n_prnt(t->str), (uintptr_t)len, 
test_val, rv,
-                              get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%" 
PRIuPTR ", &ret_val) == 0,"
-                   " value of ret_val is unmodified\n", n_prnt(t->str), 
(uintptr_t)t->len,
-                   (uintptr_t)t->len + 1);
+          uint64_t rv = test_val;
+
+          rs = MHD_str_to_uint64_n_ (t->str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR ", ->%"
+                     PRIu64 ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (t->str), (uintptr_t) len, rv, (uintptr_t) rs,
+                     get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: %" PRIu64
+                     ", after call %" PRIu64 ")."
+                     " Locale: %s\n", n_prnt (t->str), (uintptr_t) len,
+                     test_val, rv,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
+          ", &ret_val) == 0,"
+          " value of ret_val is unmodified\n", n_prnt (t->str),
+          (uintptr_t) t->len,
+          (uintptr_t) t->len + 1);
     }
+  }
   return t_failed;
 }
 
 
-int check_str_to_uint64_n_no_val(void)
+int check_str_to_uint64_n_no_val (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_no_num + i;
+      static const uint64_t rnd_val = 43255654342;
+      size_t len;
+
+      for (len = 0; len <= t->len + 1; len++)
+      {
+        uint64_t test_val;
+        for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+               rnd_val)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_no_num + i;
-          static const uint64_t rnd_val = 43255654342;
-          size_t len;
-
-          for (len = 0; len <= t->len + 1; len++)
-            {
-              uint64_t test_val;
-              for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val 
+= rnd_val)
-                {
-                  uint64_t rv = test_val;
-
-                  rs = MHD_str_to_uint64_n_(t->str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", ->%" PRIu64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(t->str), (uintptr_t)len, rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_str_to_uint64_n_(\"%s\", %" 
PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: %" 
PRIu64 ", after call %" PRIu64 ")."
-                              " Locale: %s\n", n_prnt(t->str), (uintptr_t)len, 
test_val, rv,
-                              get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_str_to_uint64_n_(\"%s\", 0..%" PRIuPTR ", 
&ret_val) == 0,"
-                   " value of ret_val is unmodified\n", n_prnt(t->str),
-                   (uintptr_t)t->len + 1);
+          uint64_t rv = test_val;
+
+          rs = MHD_str_to_uint64_n_ (t->str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR ", ->%"
+                     PRIu64 ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (t->str), (uintptr_t) len, rv, (uintptr_t) rs,
+                     get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: %" PRIu64
+                     ", after call %" PRIu64 ")."
+                     " Locale: %s\n", n_prnt (t->str), (uintptr_t) len,
+                     test_val, rv,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_str_to_uint64_n_(\"%s\", 0..%" PRIuPTR
+          ", &ret_val) == 0,"
+          " value of ret_val is unmodified\n", n_prnt (t->str),
+          (uintptr_t) t->len + 1);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_valid(void)
+int check_strx_to_uint32_valid (void)
 {
   size_t t_failed = 0;
   size_t i, j;
-  static const size_t n_checks = sizeof(xdstrs_w_values) / 
sizeof(xdstrs_w_values[0]);
+  static const size_t n_checks = sizeof(xdstrs_w_values)
+                                 / sizeof(xdstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
-        {
-          uint32_t rv;
-          size_t rs;
-          const struct str_with_value * const t = xdstrs_w_values + i;
-
-          if (t->val > UINT32_MAX)
-            continue; /* number is too high for this function */
-
-          if (c_failed[i])
-            continue; /* skip already failed checks */
-
-          if (t->str.len < t->num_of_digt)
-            {
-              fprintf(stderr, "ERROR: xdstrs_w_values[%u] has wrong 
num_of_digt (%u): num_of_digt is expected"
-                              " to be less or equal to str.len (%u).\n",
-                              (unsigned int) i, (unsigned int) t->num_of_digt, 
(unsigned int) t->str.len);
-              return -1;
-            }
-          rv = 1458532; /* some random value */
-          rs = MHD_strx_to_uint32_(t->str.str, &rv);
-          if (rs != t->num_of_digt)
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting %d."
-                      " Locale: %s\n", n_prnt(t->str.str), (uint64_t)rv, 
(intptr_t)rs, (int)t->num_of_digt, get_current_locale_str());
-            }
-          if (rv != t->val)
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" 
PRIX64 ") converted string to value 0x%" PRIX64 ","
-                      " while expecting result 0x%" PRIX64 ". Locale: %s\n", 
n_prnt(t->str.str), (uint64_t)rv, (uint64_t)rv,
-                      t->val, get_current_locale_str());
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64 ") == %" 
PRIuPTR "\n",
-                   n_prnt(t->str.str), (uint64_t)rv, rs);
-        }
+      uint32_t rv;
+      size_t rs;
+      const struct str_with_value *const t = xdstrs_w_values + i;
+
+      if (t->val > UINT32_MAX)
+        continue;     /* number is too high for this function */
+
+      if (c_failed[i])
+        continue;     /* skip already failed checks */
+
+      if (t->str.len < t->num_of_digt)
+      {
+        fprintf (stderr,
+                 "ERROR: xdstrs_w_values[%u] has wrong num_of_digt (%u): 
num_of_digt is expected"
+                 " to be less or equal to str.len (%u).\n",
+                 (unsigned int) i, (unsigned int) t->num_of_digt, (unsigned
+                                                                   int) t->str.
+                 len);
+        return -1;
+      }
+      rv = 1458532;     /* some random value */
+      rs = MHD_strx_to_uint32_ (t->str.str, &rv);
+      if (rs != t->num_of_digt)
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64
+                 ") returned %"
+                 PRIuPTR ", while expecting %d."
+                 " Locale: %s\n", n_prnt (t->str.str), (uint64_t) rv,
+                 (intptr_t) rs, (int) t->num_of_digt,
+                 get_current_locale_str ());
+      }
+      if (rv != t->val)
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64
+                 ") converted string to value 0x%"
+                 PRIX64 ","
+                 " while expecting result 0x%" PRIX64 ". Locale: %s\n", n_prnt 
(
+                   t->str.str), (uint64_t) rv, (uint64_t) rv,
+                 t->val, get_current_locale_str ());
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64 ") == %" PRIuPTR
+          "\n",
+          n_prnt (t->str.str), (uint64_t) rv, rs);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_all_chars(void)
+int check_strx_to_uint32_all_chars (void)
 {
   static const size_t n_checks = 256; /* from 0 to 255 */
   int c_failed[n_checks];
   size_t t_failed = 0;
   size_t j;
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
-    {
-      unsigned int c;
-      uint32_t test_val;
+  for (j = 0; j < locale_name_count; j++)
+  {
+    unsigned int c;
+    uint32_t test_val;
 
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(c = 0; c < n_checks; c++)
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (c = 0; c < n_checks; c++)
+    {
+      static const uint32_t rnd_val = 234234;
+      size_t rs;
+      if (((c >= '0') &&(c <= '9') ) || ((c >= 'A') &&(c <= 'F') ) ||((c >=
+                                                                       'a') &&
+                                                                      (c <=
+                                                                       'f') ))
+        continue;     /* skip xdigits */
+      for (test_val = 0; test_val <= rnd_val&& ! c_failed[c]; test_val +=
+             rnd_val)
+      {
+        char test_str[] = "0123";
+        uint32_t rv = test_val;
+
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+        rs = MHD_strx_to_uint32_ (test_str, &rv);
+        if (rs != 0)
         {
-          static const uint32_t rnd_val = 234234;
-          size_t rs;
-          if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||(c >= 'a' && 
c <= 'f'))
-            continue; /* skip xdigits */
-          for(test_val = 0; test_val <= rnd_val&& !c_failed[c]; test_val += 
rnd_val)
-            {
-              char test_str[] = "0123";
-              uint32_t rv = test_val;
-
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-              rs = MHD_strx_to_uint32_(test_str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[c] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(test_str), 
(uint64_t)rv, (uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[c] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: 0x%" PRIX64 ", after call 
0x%" PRIX64 "). Locale: %s\n",
-                                  n_prnt(test_str), (uint64_t)test_val, 
(uint64_t)rv, get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[c])
-            {
-              char test_str[] = "0123";
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-
-              printf("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, 
value of ret_val is unmodified\n",
-                     n_prnt(test_str));
-            }
+          t_failed++;
+          c_failed[c] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64
+                   ") returned %"
+                   PRIuPTR ", while expecting zero."
+                   " Locale: %s\n", n_prnt (test_str), (uint64_t) rv,
+                   (uintptr_t) rs, get_current_locale_str ());
         }
+        else if (rv != test_val)
+        {
+          t_failed++;
+          c_failed[c] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: 0x%" PRIX64 ", after call 0x%" PRIX64
+                   "). Locale: %s\n",
+                   n_prnt (test_str), (uint64_t) test_val, (uint64_t) rv,
+                   get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[c])
+      {
+        char test_str[] = "0123";
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+
+        printf (
+          "PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value of 
ret_val is unmodified\n",
+          n_prnt (test_str));
+      }
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_overflow(void)
+int check_strx_to_uint32_overflow (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks1 = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
-  static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]) +
-                                 sizeof(xdstrs_w_values) / 
sizeof(xdstrs_w_values[0]);
+  static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
+                                 + sizeof(xdstrs_w_values)
+                                 / sizeof(xdstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      static const uint32_t rnd_val = 74218431;
+      uint32_t test_val;
+      const char *str;
+      if (i < n_checks1)
+      {
+        const struct str_with_len *const t = strx_ovflw + i;
+        str = t->str;
+      }
+      else
+      {
+        const struct str_with_value *const t = xdstrs_w_values + (i
+                                                                  - n_checks1);
+        if (t->val <= UINT32_MAX)
+          continue;       /* check only strings that should overflow uint32_t 
*/
+        str = t->str.str;
+      }
+
+
+      for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+             rnd_val)
+      {
+        uint32_t rv = test_val;
+
+        rs = MHD_strx_to_uint32_ (str, &rv);
+        if (rs != 0)
         {
-          size_t rs;
-          static const uint32_t rnd_val = 74218431;
-          uint32_t test_val;
-          const char * str;
-          if (i < n_checks1)
-            {
-              const struct str_with_len * const t = strx_ovflw + i;
-              str = t->str;
-            }
-          else
-            {
-              const struct str_with_value * const t = xdstrs_w_values + (i - 
n_checks1);
-              if (t->val <= UINT32_MAX)
-                continue; /* check only strings that should overflow uint32_t 
*/
-              str = t->str.str;
-            }
-
-
-          for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val += 
rnd_val)
-            {
-              uint32_t rv = test_val;
-
-              rs = MHD_strx_to_uint32_(str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(str), (uint64_t)rv, 
(uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: 0x%" PRIX64 ", after call 
0x%" PRIX64 "). Locale: %s\n",
-                                  n_prnt(str), (uint64_t)test_val, 
(uint64_t)rv, get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value 
of ret_val is unmodified\n",
-                   n_prnt(str));
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64
+                   ") returned %"
+                   PRIuPTR ", while expecting zero."
+                   " Locale: %s\n", n_prnt (str), (uint64_t) rv, (uintptr_t) 
rs,
+                   get_current_locale_str ());
         }
+        else if (rv != test_val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: 0x%" PRIX64 ", after call 0x%" PRIX64
+                   "). Locale: %s\n",
+                   n_prnt (str), (uint64_t) test_val, (uint64_t) rv,
+                   get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value of 
ret_val is unmodified\n",
+          n_prnt (str));
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_no_val(void)
+int check_strx_to_uint32_no_val (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_no_num + i;
+      static const uint32_t rnd_val = 74218431;
+      uint32_t test_val;
+
+      for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+             rnd_val)
+      {
+        uint32_t rv = test_val;
+
+        rs = MHD_strx_to_uint32_ (t->str, &rv);
+        if (rs != 0)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_no_num + i;
-          static const uint32_t rnd_val = 74218431;
-          uint32_t test_val;
-
-          for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val += 
rnd_val)
-            {
-              uint32_t rv = test_val;
-
-              rs = MHD_strx_to_uint32_(t->str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(t->str), 
(uint64_t)rv, (uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: 0x%" PRIX64 ", after call 
0x%" PRIX64 "). Locale: %s\n",
-                                  n_prnt(t->str), (uint64_t)test_val, 
(uint64_t)rv, get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value 
of ret_val is unmodified\n",
-                   n_prnt(t->str));
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64
+                   ") returned %"
+                   PRIuPTR ", while expecting zero."
+                   " Locale: %s\n", n_prnt (t->str), (uint64_t) rv,
+                   (uintptr_t) rs, get_current_locale_str ());
         }
+        else if (rv != test_val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: 0x%" PRIX64 ", after call 0x%" PRIX64
+                   "). Locale: %s\n",
+                   n_prnt (t->str), (uint64_t) test_val, (uint64_t) rv,
+                   get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value of 
ret_val is unmodified\n",
+          n_prnt (t->str));
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_n_valid(void)
+int check_strx_to_uint32_n_valid (void)
 {
   size_t t_failed = 0;
   size_t i, j;
-  static const size_t n_checks = sizeof(xdstrs_w_values) / 
sizeof(xdstrs_w_values[0]);
+  static const size_t n_checks = sizeof(xdstrs_w_values)
+                                 / sizeof(xdstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      uint32_t rv = 2352932;      /* some random value */
+      size_t rs = 0;
+      size_t len;
+      const struct str_with_value *const t = xdstrs_w_values + i;
+
+      if (t->val > UINT32_MAX)
+        continue;     /* number is too high for this function */
+
+      if (t->str.len < t->num_of_digt)
+      {
+        fprintf (stderr,
+                 "ERROR: xdstrs_w_values[%u] has wrong num_of_digt (%u): 
num_of_digt is expected"
+                 " to be less or equal to str.len (%u).\n",
+                 (unsigned int) i, (unsigned int) t->num_of_digt, (unsigned
+                                                                   int) t->str.
+                 len);
+        return -1;
+      }
+      for (len = t->num_of_digt; len <= t->str.len + 1 && ! c_failed[i]; len++)
+      {
+        rs = MHD_strx_to_uint32_n_ (t->str.str, len, &rv);
+        if (rs != t->num_of_digt)
         {
-          uint32_t rv = 2352932;  /* some random value */
-          size_t rs = 0;
-          size_t len;
-          const struct str_with_value * const t = xdstrs_w_values + i;
-
-          if (t->val > UINT32_MAX)
-            continue; /* number is too high for this function */
-
-          if (t->str.len < t->num_of_digt)
-            {
-              fprintf(stderr, "ERROR: xdstrs_w_values[%u] has wrong 
num_of_digt (%u): num_of_digt is expected"
-                              " to be less or equal to str.len (%u).\n",
-                              (unsigned int) i, (unsigned int) t->num_of_digt, 
(unsigned int) t->str.len);
-              return -1;
-            }
-          for (len = t->num_of_digt; len <= t->str.len + 1 && !c_failed[i]; 
len++)
-            {
-              rs = MHD_strx_to_uint32_n_(t->str.str, len, &rv);
-              if (rs != t->num_of_digt)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" 
PRIuPTR ", ->0x%" PRIX64 ")"
-                          " returned %" PRIuPTR ", while expecting %d. Locale: 
%s\n",
-                          n_prnt(t->str.str), (intptr_t)len, (uint64_t)rv, 
(intptr_t)rs,
-                          (int)t->num_of_digt, get_current_locale_str());
-                }
-              if (rv != t->val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" 
PRIuPTR ", ->0x%" PRIX64 ")"
-                          " converted string to value 0x%" PRIX64 ", while 
expecting result 0x%" PRIX64
-                          ". Locale: %s\n", n_prnt(t->str.str), (intptr_t)len, 
(uint64_t)rv, (uint64_t)rv,
-                          t->val, get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR "..%" 
PRIuPTR ", ->0x%" PRIX64 ")"
-                   " == %" PRIuPTR "\n", n_prnt(t->str.str), 
(intptr_t)t->num_of_digt,
-                   (intptr_t)t->str.len + 1, (uint64_t)rv, rs);
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR ", ->0x%"
+                   PRIX64 ")"
+                   " returned %" PRIuPTR ", while expecting %d. Locale: %s\n",
+                   n_prnt (t->str.str), (intptr_t) len, (uint64_t) rv,
+                   (intptr_t) rs,
+                   (int) t->num_of_digt, get_current_locale_str ());
         }
+        if (rv != t->val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR ", ->0x%"
+                   PRIX64 ")"
+                   " converted string to value 0x%" PRIX64
+                   ", while expecting result 0x%" PRIX64
+                   ". Locale: %s\n", n_prnt (t->str.str), (intptr_t) len,
+                   (uint64_t) rv, (uint64_t) rv,
+                   t->val, get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
+          ", ->0x%"
+          PRIX64 ")"
+          " == %" PRIuPTR "\n", n_prnt (t->str.str),
+          (intptr_t) t->num_of_digt,
+          (intptr_t) t->str.len + 1, (uint64_t) rv, rs);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_n_all_chars(void)
+int check_strx_to_uint32_n_all_chars (void)
 {
   static const size_t n_checks = 256; /* from 0 to 255 */
   int c_failed[n_checks];
   size_t t_failed = 0;
   size_t j;
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
-    {
-      unsigned int c;
-      uint32_t test_val;
+  for (j = 0; j < locale_name_count; j++)
+  {
+    unsigned int c;
+    uint32_t test_val;
 
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(c = 0; c < n_checks; c++)
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (c = 0; c < n_checks; c++)
+    {
+      static const uint32_t rnd_val = 98372558;
+      size_t rs;
+      size_t len;
+
+      if (((c >= '0') &&(c <= '9') ) || ((c >= 'A') &&(c <= 'F') ) || ((c >=
+                                                                        'a') &&
+                                                                       (c <=
+                                                                        'f') ))
+        continue;     /* skip xdigits */
+
+      for (len = 0; len <= 5; len++)
+      {
+        for (test_val = 0; test_val <= rnd_val&& ! c_failed[c]; test_val +=
+               rnd_val)
         {
-          static const uint32_t rnd_val = 98372558;
-          size_t rs;
-          size_t len;
-
-          if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && 
c <= 'f'))
-            continue; /* skip xdigits */
-
-          for (len = 0; len <= 5; len++)
-            {
-              for(test_val = 0; test_val <= rnd_val&& !c_failed[c]; test_val 
+= rnd_val)
-                {
-                  char test_str[] = "0123";
-                  uint32_t rv = test_val;
-
-                  test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-                  rs = MHD_strx_to_uint32_n_(test_str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[c] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", 
%" PRIuPTR ", ->0x%" PRIX64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(test_str), (uintptr_t)len, (uint64_t)rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[c] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", 
%" PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: 0x%" 
PRIX64 ", after call 0x%" PRIX64 ")."
-                              " Locale: %s\n",
-                              n_prnt(test_str), (uintptr_t)len, 
(uint64_t)test_val, (uint64_t)rv, get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[c])
-            {
-              char test_str[] = "0123";
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-
-              printf("PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..5, &ret_val) == 
0, value of ret_val is unmodified\n",
-                     n_prnt(test_str));
-            }
+          char test_str[] = "0123";
+          uint32_t rv = test_val;
+
+          test_str[0] = (char) (unsigned char) c;        /* replace first char 
with non-digit char */
+          rs = MHD_strx_to_uint32_n_ (test_str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[c] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR ", 
->0x%"
+                     PRIX64
+                     ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (test_str), (uintptr_t) len, (uint64_t) rv,
+                     (uintptr_t) rs, get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[c] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: 0x%" PRIX64
+                     ", after call 0x%" PRIX64 ")."
+                     " Locale: %s\n",
+                     n_prnt (test_str), (uintptr_t) len, (uint64_t) test_val,
+                     (uint64_t) rv, get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[c])
+      {
+        char test_str[] = "0123";
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+
+        printf (
+          "PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..5, &ret_val) == 0, value 
of ret_val is unmodified\n",
+          n_prnt (test_str));
+      }
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_n_overflow(void)
+int check_strx_to_uint32_n_overflow (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks1 = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
-  static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]) +
-                                 sizeof(xdstrs_w_values) / 
sizeof(xdstrs_w_values[0]);
+  static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
+                                 + sizeof(xdstrs_w_values)
+                                 / sizeof(xdstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      static const uint32_t rnd_val = 4;
+      size_t len;
+      const char *str;
+      size_t min_len, max_len;
+      if (i < n_checks1)
+      {
+        const struct str_with_len *const t = strx_ovflw + i;
+        str = t->str;
+        min_len = t->len;
+        max_len = t->len + 1;
+      }
+      else
+      {
+        const struct str_with_value *const t = xdstrs_w_values + (i
+                                                                  - n_checks1);
+        if (t->val <= UINT32_MAX)
+          continue;       /* check only strings that should overflow uint32_t 
*/
+
+        if (t->str.len < t->num_of_digt)
         {
-          size_t rs;
-          static const uint32_t rnd_val = 4;
-          size_t len;
-          const char * str;
-          size_t min_len, max_len;
-          if (i < n_checks1)
-            {
-              const struct str_with_len * const t = strx_ovflw + i;
-              str = t->str;
-              min_len = t->len;
-              max_len = t->len + 1;
-            }
-          else
-            {
-              const struct str_with_value * const t = xdstrs_w_values + (i - 
n_checks1);
-              if (t->val <= UINT32_MAX)
-                continue; /* check only strings that should overflow uint32_t 
*/
-
-              if (t->str.len < t->num_of_digt)
-                {
-                  fprintf(stderr, "ERROR: xdstrs_w_values[%u] has wrong 
num_of_digt (%u): num_of_digt is expected"
-                                  " to be less or equal to str.len (%u).\n",
-                                  (unsigned int) (i - n_checks1), (unsigned 
int) t->num_of_digt,
-                                  (unsigned int) t->str.len);
-                  return -1;
-                }
-              str = t->str.str;
-              min_len = t->num_of_digt;
-              max_len = t->str.len + 1;
-            }
-
-          for (len = min_len; len <= max_len; len++)
-            {
-              uint32_t test_val;
-              for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val 
+= rnd_val)
-                {
-                  uint32_t rv = test_val;
-
-                  rs = MHD_strx_to_uint32_n_(str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", 
%" PRIuPTR ", ->0x%" PRIX64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(str), (uintptr_t)len, (uint64_t)rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", 
%" PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: 0x%" 
PRIX64 ", after call 0x%" PRIX64 ")."
-                              " Locale: %s\n", n_prnt(str), (uintptr_t)len, 
(uint64_t)test_val, (uint64_t)rv,
-                              get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR "..%" 
PRIuPTR ", &ret_val) == 0,"
-                   " value of ret_val is unmodified\n", n_prnt(str), 
(uintptr_t)min_len,
-                   (uintptr_t)max_len);
+          fprintf (stderr,
+                   "ERROR: xdstrs_w_values[%u] has wrong num_of_digt (%u): 
num_of_digt is expected"
+                   " to be less or equal to str.len (%u).\n",
+                   (unsigned int) (i - n_checks1), (unsigned
+                                                    int) t->num_of_digt,
+                   (unsigned int) t->str.len);
+          return -1;
         }
+        str = t->str.str;
+        min_len = t->num_of_digt;
+        max_len = t->str.len + 1;
+      }
+
+      for (len = min_len; len <= max_len; len++)
+      {
+        uint32_t test_val;
+        for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+               rnd_val)
+        {
+          uint32_t rv = test_val;
+
+          rs = MHD_strx_to_uint32_n_ (str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR ", 
->0x%"
+                     PRIX64
+                     ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (str), (uintptr_t) len, (uint64_t) rv,
+                     (uintptr_t) rs, get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: 0x%" PRIX64
+                     ", after call 0x%" PRIX64 ")."
+                     " Locale: %s\n", n_prnt (str), (uintptr_t) len,
+                     (uint64_t) test_val, (uint64_t) rv,
+                     get_current_locale_str ());
+          }
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
+          ", &ret_val) == 0,"
+          " value of ret_val is unmodified\n", n_prnt (str),
+          (uintptr_t) min_len,
+          (uintptr_t) max_len);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint32_n_no_val(void)
+int check_strx_to_uint32_n_no_val (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_no_num + i;
+      static const uint32_t rnd_val = 3214314212UL;
+      size_t len;
+
+      for (len = 0; len <= t->len + 1; len++)
+      {
+        uint32_t test_val;
+        for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+               rnd_val)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_no_num + i;
-          static const uint32_t rnd_val = 3214314212UL;
-          size_t len;
-
-          for (len = 0; len <= t->len + 1; len++)
-            {
-              uint32_t test_val;
-              for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val 
+= rnd_val)
-                {
-                  uint32_t rv = test_val;
-
-                  rs = MHD_strx_to_uint32_n_(t->str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", 
%" PRIuPTR ", ->0x%" PRIX64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(t->str), (uintptr_t)len, (uint64_t)rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint32_n_(\"%s\", 
%" PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: 0x%" 
PRIX64 ", after call 0x%" PRIX64 ")."
-                              " Locale: %s\n", n_prnt(t->str), (uintptr_t)len, 
(uint64_t)test_val, (uint64_t)rv,
-                              get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..%" PRIuPTR ", 
&ret_val) == 0,"
-                   " value of ret_val is unmodified\n", n_prnt(t->str),
-                   (uintptr_t)t->len + 1);
+          uint32_t rv = test_val;
+
+          rs = MHD_strx_to_uint32_n_ (t->str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR ", 
->0x%"
+                     PRIX64
+                     ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (t->str), (uintptr_t) len, (uint64_t) rv,
+                     (uintptr_t) rs, get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: 0x%" PRIX64
+                     ", after call 0x%" PRIX64 ")."
+                     " Locale: %s\n", n_prnt (t->str), (uintptr_t) len,
+                     (uint64_t) test_val, (uint64_t) rv,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..%" PRIuPTR
+          ", &ret_val) == 0,"
+          " value of ret_val is unmodified\n", n_prnt (t->str),
+          (uintptr_t) t->len + 1);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_valid(void)
+int check_strx_to_uint64_valid (void)
 {
   size_t t_failed = 0;
   size_t i, j;
-  static const size_t n_checks = sizeof(xdstrs_w_values) / 
sizeof(xdstrs_w_values[0]);
+  static const size_t n_checks = sizeof(xdstrs_w_values)
+                                 / sizeof(xdstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
-        {
-          uint64_t rv;
-          size_t rs;
-          const struct str_with_value * const t = xdstrs_w_values + i;
-
-          if (c_failed[i])
-            continue; /* skip already failed checks */
-
-          if (t->str.len < t->num_of_digt)
-            {
-              fprintf(stderr, "ERROR: xdstrs_w_values[%u] has wrong 
num_of_digt (%u): num_of_digt is expected"
-                              " to be less or equal to str.len (%u).\n",
-                              (unsigned int) i, (unsigned int) t->num_of_digt, 
(unsigned int) t->str.len);
-              return -1;
-            }
-          rv = 1458532; /* some random value */
-          rs = MHD_strx_to_uint64_(t->str.str, &rv);
-          if (rs != t->num_of_digt)
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting %d."
-                      " Locale: %s\n", n_prnt(t->str.str), rv, (intptr_t)rs, 
(int)t->num_of_digt, get_current_locale_str());
-            }
-          if (rv != t->val)
-            {
-              t_failed++;
-              c_failed[i] = !0;
-              fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" 
PRIX64 ") converted string to value 0x%" PRIX64 ","
-                      " while expecting result 0x%" PRIX64 ". Locale: %s\n", 
n_prnt(t->str.str), rv, rv,
-                      t->val, get_current_locale_str());
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64 ") == %" 
PRIuPTR "\n",
-                   n_prnt(t->str.str), rv, rs);
-        }
+      uint64_t rv;
+      size_t rs;
+      const struct str_with_value *const t = xdstrs_w_values + i;
+
+      if (c_failed[i])
+        continue;     /* skip already failed checks */
+
+      if (t->str.len < t->num_of_digt)
+      {
+        fprintf (stderr,
+                 "ERROR: xdstrs_w_values[%u] has wrong num_of_digt (%u): 
num_of_digt is expected"
+                 " to be less or equal to str.len (%u).\n",
+                 (unsigned int) i, (unsigned int) t->num_of_digt, (unsigned
+                                                                   int) t->str.
+                 len);
+        return -1;
+      }
+      rv = 1458532;     /* some random value */
+      rs = MHD_strx_to_uint64_ (t->str.str, &rv);
+      if (rs != t->num_of_digt)
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64
+                 ") returned %"
+                 PRIuPTR ", while expecting %d."
+                 " Locale: %s\n", n_prnt (t->str.str), rv, (intptr_t) rs,
+                 (int) t->num_of_digt, get_current_locale_str ());
+      }
+      if (rv != t->val)
+      {
+        t_failed++;
+        c_failed[i] = ! 0;
+        fprintf (stderr,
+                 "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64
+                 ") converted string to value 0x%"
+                 PRIX64 ","
+                 " while expecting result 0x%" PRIX64 ". Locale: %s\n", n_prnt 
(
+                   t->str.str), rv, rv,
+                 t->val, get_current_locale_str ());
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64 ") == %" PRIuPTR
+          "\n",
+          n_prnt (t->str.str), rv, rs);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_all_chars(void)
+int check_strx_to_uint64_all_chars (void)
 {
   static const size_t n_checks = 256; /* from 0 to 255 */
   int c_failed[n_checks];
   size_t t_failed = 0;
   size_t j;
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
-    {
-      unsigned int c;
-      uint64_t test_val;
+  for (j = 0; j < locale_name_count; j++)
+  {
+    unsigned int c;
+    uint64_t test_val;
 
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(c = 0; c < n_checks; c++)
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (c = 0; c < n_checks; c++)
+    {
+      static const uint64_t rnd_val = 234234;
+      size_t rs;
+      if (((c >= '0') &&(c <= '9') ) || ((c >= 'A') &&(c <= 'F') ) || ((c >=
+                                                                        'a') &&
+                                                                       (c <=
+                                                                        'f') ))
+        continue;     /* skip xdigits */
+      for (test_val = 0; test_val <= rnd_val&& ! c_failed[c]; test_val +=
+             rnd_val)
+      {
+        char test_str[] = "0123";
+        uint64_t rv = test_val;
+
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+        rs = MHD_strx_to_uint64_ (test_str, &rv);
+        if (rs != 0)
         {
-          static const uint64_t rnd_val = 234234;
-          size_t rs;
-          if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && 
c <= 'f'))
-            continue; /* skip xdigits */
-          for(test_val = 0; test_val <= rnd_val&& !c_failed[c]; test_val += 
rnd_val)
-            {
-              char test_str[] = "0123";
-              uint64_t rv = test_val;
-
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-              rs = MHD_strx_to_uint64_(test_str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[c] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(test_str), rv, 
(uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[c] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: 0x%" PRIX64 ", after call 
0x%" PRIX64 "). Locale: %s\n",
-                                  n_prnt(test_str), test_val, rv, 
get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[c])
-            {
-              char test_str[] = "0123";
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-
-              printf("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, 
value of ret_val is unmodified\n",
-                     n_prnt(test_str));
-            }
+          t_failed++;
+          c_failed[c] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64
+                   ") returned %"
+                   PRIuPTR ", while expecting zero."
+                   " Locale: %s\n", n_prnt (test_str), rv, (uintptr_t) rs,
+                   get_current_locale_str ());
         }
+        else if (rv != test_val)
+        {
+          t_failed++;
+          c_failed[c] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: 0x%" PRIX64 ", after call 0x%" PRIX64
+                   "). Locale: %s\n",
+                   n_prnt (test_str), test_val, rv, get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[c])
+      {
+        char test_str[] = "0123";
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+
+        printf (
+          "PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value of 
ret_val is unmodified\n",
+          n_prnt (test_str));
+      }
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_overflow(void)
+int check_strx_to_uint64_overflow (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = strx_ovflw + i;
+      static const uint64_t rnd_val = 74218431;
+      uint64_t test_val;
+
+      for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+             rnd_val)
+      {
+        uint64_t rv = test_val;
+
+        rs = MHD_strx_to_uint64_ (t->str, &rv);
+        if (rs != 0)
         {
-          size_t rs;
-          const struct str_with_len * const t = strx_ovflw + i;
-          static const uint64_t rnd_val = 74218431;
-          uint64_t test_val;
-
-          for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val += 
rnd_val)
-            {
-              uint64_t rv = test_val;
-
-              rs = MHD_strx_to_uint64_(t->str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(t->str), rv, 
(uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: 0x%" PRIX64 ", after call 
0x%" PRIX64 "). Locale: %s\n",
-                                  n_prnt(t->str), test_val, rv, 
get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value 
of ret_val is unmodified\n",
-                   n_prnt(t->str));
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64
+                   ") returned %"
+                   PRIuPTR ", while expecting zero."
+                   " Locale: %s\n", n_prnt (t->str), rv, (uintptr_t) rs,
+                   get_current_locale_str ());
         }
+        else if (rv != test_val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: 0x%" PRIX64 ", after call 0x%" PRIX64
+                   "). Locale: %s\n",
+                   n_prnt (t->str), test_val, rv, get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value of 
ret_val is unmodified\n",
+          n_prnt (t->str));
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_no_val(void)
+int check_strx_to_uint64_no_val (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_no_num + i;
+      static const uint64_t rnd_val = 74218431;
+      uint64_t test_val;
+
+      for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+             rnd_val)
+      {
+        uint64_t rv = test_val;
+
+        rs = MHD_strx_to_uint64_ (t->str, &rv);
+        if (rs != 0)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64
+                   ") returned %"
+                   PRIuPTR ", while expecting zero."
+                   " Locale: %s\n", n_prnt (t->str), rv, (uintptr_t) rs,
+                   get_current_locale_str ());
+        }
+        else if (rv != test_val)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_no_num + i;
-          static const uint64_t rnd_val = 74218431;
-          uint64_t test_val;
-
-          for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val += 
rnd_val)
-            {
-              uint64_t rv = test_val;
-
-              rs = MHD_strx_to_uint64_(t->str, &rv);
-              if (rs != 0)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", ->0x%" 
PRIX64 ") returned %" PRIuPTR ", while expecting zero."
-                                  " Locale: %s\n", n_prnt(t->str), rv, 
(uintptr_t)rs, get_current_locale_str());
-                }
-              else if (rv != test_val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_(\"%s\", 
&ret_val) modified value of ret_val"
-                                  " (before call: 0x%" PRIX64 ", after call 
0x%" PRIX64 "). Locale: %s\n",
-                                  n_prnt(t->str), test_val, rv, 
get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value 
of ret_val is unmodified\n",
-                   n_prnt(t->str));
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_(\"%s\", &ret_val) modified 
value of ret_val"
+                   " (before call: 0x%" PRIX64 ", after call 0x%" PRIX64
+                   "). Locale: %s\n",
+                   n_prnt (t->str), test_val, rv, get_current_locale_str ());
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value of 
ret_val is unmodified\n",
+          n_prnt (t->str));
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_n_valid(void)
+int check_strx_to_uint64_n_valid (void)
 {
   size_t t_failed = 0;
   size_t i, j;
-  static const size_t n_checks = sizeof(xdstrs_w_values) / 
sizeof(xdstrs_w_values[0]);
+  static const size_t n_checks = sizeof(xdstrs_w_values)
+                                 / sizeof(xdstrs_w_values[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      uint64_t rv = 2352932;     /* some random value */
+      size_t rs = 0;
+      size_t len;
+      const struct str_with_value *const t = xdstrs_w_values + i;
+
+      if (t->str.len < t->num_of_digt)
+      {
+        fprintf (stderr,
+                 "ERROR: xdstrs_w_values[%u] has wrong num_of_digt (%u): 
num_of_digt is expected"
+                 " to be less or equal to str.len (%u).\n",
+                 (unsigned int) i, (unsigned int) t->num_of_digt, (unsigned
+                                                                   int) t->str.
+                 len);
+        return -1;
+      }
+      for (len = t->num_of_digt; len <= t->str.len + 1 && ! c_failed[i]; len++)
+      {
+        rs = MHD_strx_to_uint64_n_ (t->str.str, len, &rv);
+        if (rs != t->num_of_digt)
         {
-          uint64_t rv = 2352932; /* some random value */
-          size_t rs = 0;
-          size_t len;
-          const struct str_with_value * const t = xdstrs_w_values + i;
-
-          if (t->str.len < t->num_of_digt)
-            {
-              fprintf(stderr, "ERROR: xdstrs_w_values[%u] has wrong 
num_of_digt (%u): num_of_digt is expected"
-                              " to be less or equal to str.len (%u).\n",
-                              (unsigned int) i, (unsigned int) t->num_of_digt, 
(unsigned int) t->str.len);
-              return -1;
-            }
-          for (len = t->num_of_digt; len <= t->str.len + 1 && !c_failed[i]; 
len++)
-            {
-              rs = MHD_strx_to_uint64_n_(t->str.str, len, &rv);
-              if (rs != t->num_of_digt)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" 
PRIuPTR ", ->0x%" PRIX64 ")"
-                          " returned %" PRIuPTR ", while expecting %d. Locale: 
%s\n",
-                          n_prnt(t->str.str), (intptr_t)len, rv, (intptr_t)rs,
-                          (int)t->num_of_digt, get_current_locale_str());
-                }
-              if (rv != t->val)
-                {
-                  t_failed++;
-                  c_failed[i] = !0;
-                  fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" 
PRIuPTR ", ->0x%" PRIX64 ")"
-                          " converted string to value 0x%" PRIX64 ", while 
expecting result 0x%" PRIX64
-                          ". Locale: %s\n", n_prnt(t->str.str), (intptr_t)len, 
rv, rv,
-                          t->val, get_current_locale_str());
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" 
PRIuPTR ", ->0x%" PRIX64 ")"
-                   " == %" PRIuPTR "\n", n_prnt(t->str.str), 
(intptr_t)t->num_of_digt,
-                   (intptr_t)t->str.len + 1, rv, rs);
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR ", ->0x%"
+                   PRIX64 ")"
+                   " returned %" PRIuPTR ", while expecting %d. Locale: %s\n",
+                   n_prnt (t->str.str), (intptr_t) len, rv, (intptr_t) rs,
+                   (int) t->num_of_digt, get_current_locale_str ());
         }
+        if (rv != t->val)
+        {
+          t_failed++;
+          c_failed[i] = ! 0;
+          fprintf (stderr,
+                   "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR ", ->0x%"
+                   PRIX64 ")"
+                   " converted string to value 0x%" PRIX64
+                   ", while expecting result 0x%" PRIX64
+                   ". Locale: %s\n", n_prnt (t->str.str), (intptr_t) len, rv,
+                   rv,
+                   t->val, get_current_locale_str ());
+        }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
+          ", ->0x%"
+          PRIX64 ")"
+          " == %" PRIuPTR "\n", n_prnt (t->str.str),
+          (intptr_t) t->num_of_digt,
+          (intptr_t) t->str.len + 1, rv, rs);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_n_all_chars(void)
+int check_strx_to_uint64_n_all_chars (void)
 {
   static const size_t n_checks = 256; /* from 0 to 255 */
   int c_failed[n_checks];
   size_t t_failed = 0;
   size_t j;
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
-    {
-      unsigned int c;
-      uint64_t test_val;
+  for (j = 0; j < locale_name_count; j++)
+  {
+    unsigned int c;
+    uint64_t test_val;
 
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(c = 0; c < n_checks; c++)
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (c = 0; c < n_checks; c++)
+    {
+      static const uint64_t rnd_val = 98372558;
+      size_t rs;
+      size_t len;
+
+      if (((c >= '0') &&(c <= '9') ) || ((c >= 'A') &&(c <= 'F') ) || ((c >=
+                                                                        'a') &&
+                                                                       (c <=
+                                                                        'f') ))
+        continue;     /* skip xdigits */
+
+      for (len = 0; len <= 5; len++)
+      {
+        for (test_val = 0; test_val <= rnd_val&& ! c_failed[c]; test_val +=
+               rnd_val)
         {
-          static const uint64_t rnd_val = 98372558;
-          size_t rs;
-          size_t len;
-
-          if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && 
c <= 'f'))
-            continue; /* skip xdigits */
-
-          for (len = 0; len <= 5; len++)
-            {
-              for(test_val = 0; test_val <= rnd_val&& !c_failed[c]; test_val 
+= rnd_val)
-                {
-                  char test_str[] = "0123";
-                  uint64_t rv = test_val;
-
-                  test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-                  rs = MHD_strx_to_uint64_n_(test_str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[c] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", 
%" PRIuPTR ", ->0x%" PRIX64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(test_str), (uintptr_t)len, rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[c] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", 
%" PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: 0x%" 
PRIX64 ", after call 0x%" PRIX64 ")."
-                              " Locale: %s\n",
-                              n_prnt(test_str), (uintptr_t)len, test_val, rv, 
get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[c])
-            {
-              char test_str[] = "0123";
-              test_str[0] = (char) (unsigned char)c; /* replace first char 
with non-digit char */
-
-              printf("PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..5, &ret_val) == 
0, value of ret_val is unmodified\n",
-                     n_prnt(test_str));
-            }
+          char test_str[] = "0123";
+          uint64_t rv = test_val;
+
+          test_str[0] = (char) (unsigned char) c;        /* replace first char 
with non-digit char */
+          rs = MHD_strx_to_uint64_n_ (test_str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[c] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR ", 
->0x%"
+                     PRIX64
+                     ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (test_str), (uintptr_t) len, rv, (uintptr_t) rs,
+                     get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[c] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: 0x%" PRIX64
+                     ", after call 0x%" PRIX64 ")."
+                     " Locale: %s\n",
+                     n_prnt (test_str), (uintptr_t) len, test_val, rv,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[c])
+      {
+        char test_str[] = "0123";
+        test_str[0] = (char) (unsigned char) c;      /* replace first char 
with non-digit char */
+
+        printf (
+          "PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, value 
of ret_val is unmodified\n",
+          n_prnt (test_str));
+      }
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_n_overflow(void)
+int check_strx_to_uint64_n_overflow (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = strx_ovflw + i;
+      static const uint64_t rnd_val = 4;
+      size_t len;
+
+      for (len = t->len; len <= t->len + 1; len++)
+      {
+        uint64_t test_val;
+        for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+               rnd_val)
         {
-          size_t rs;
-          const struct str_with_len * const t = strx_ovflw + i;
-          static const uint64_t rnd_val = 4;
-          size_t len;
-
-          for (len = t->len; len <= t->len + 1; len++)
-            {
-              uint64_t test_val;
-              for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val 
+= rnd_val)
-                {
-                  uint64_t rv = test_val;
-
-                  rs = MHD_strx_to_uint64_n_(t->str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", 
%" PRIuPTR ", ->0x%" PRIX64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(t->str), (uintptr_t)len, rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", 
%" PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: 0x%" 
PRIX64 ", after call 0x%" PRIX64 ")."
-                              " Locale: %s\n", n_prnt(t->str), (uintptr_t)len, 
test_val, rv,
-                              get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" 
PRIuPTR ", &ret_val) == 0,"
-                   " value of ret_val is unmodified\n", n_prnt(t->str), 
(uintptr_t)t->len,
-                   (uintptr_t)t->len + 1);
+          uint64_t rv = test_val;
+
+          rs = MHD_strx_to_uint64_n_ (t->str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR ", 
->0x%"
+                     PRIX64
+                     ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (t->str), (uintptr_t) len, rv, (uintptr_t) rs,
+                     get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: 0x%" PRIX64
+                     ", after call 0x%" PRIX64 ")."
+                     " Locale: %s\n", n_prnt (t->str), (uintptr_t) len,
+                     test_val, rv,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
+          ", &ret_val) == 0,"
+          " value of ret_val is unmodified\n", n_prnt (t->str),
+          (uintptr_t) t->len,
+          (uintptr_t) t->len + 1);
     }
+  }
   return t_failed;
 }
 
 
-int check_strx_to_uint64_n_no_val(void)
+int check_strx_to_uint64_n_no_val (void)
 {
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
   int c_failed[n_checks];
 
-  memset(c_failed, 0, sizeof(c_failed));
+  memset (c_failed, 0, sizeof(c_failed));
 
-  for(j = 0; j < locale_name_count; j++)
+  for (j = 0; j < locale_name_count; j++)
+  {
+    set_test_locale (j);  /* setlocale() can be slow! */
+    for (i = 0; i < n_checks; i++)
     {
-      set_test_locale(j); /* setlocale() can be slow! */
-      for(i = 0; i < n_checks; i++)
+      size_t rs;
+      const struct str_with_len *const t = str_no_num + i;
+      static const uint64_t rnd_val = 3214314212UL;
+      size_t len;
+
+      for (len = 0; len <= t->len + 1; len++)
+      {
+        uint64_t test_val;
+        for (test_val = 0; test_val <= rnd_val && ! c_failed[i]; test_val +=
+               rnd_val)
         {
-          size_t rs;
-          const struct str_with_len * const t = str_no_num + i;
-          static const uint64_t rnd_val = 3214314212UL;
-          size_t len;
-
-          for (len = 0; len <= t->len + 1; len++)
-            {
-              uint64_t test_val;
-              for(test_val = 0; test_val <= rnd_val && !c_failed[i]; test_val 
+= rnd_val)
-                {
-                  uint64_t rv = test_val;
-
-                  rs = MHD_strx_to_uint64_n_(t->str, len, &rv);
-                  if (rs != 0)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", 
%" PRIuPTR ", ->0x%" PRIX64 ")"
-                              " returned %" PRIuPTR ", while expecting zero. 
Locale: %s\n",
-                              n_prnt(t->str), (uintptr_t)len, rv, 
(uintptr_t)rs, get_current_locale_str());
-                    }
-                  else if (rv != test_val)
-                    {
-                      t_failed++;
-                      c_failed[i] = !0;
-                      fprintf(stderr, "FAILED: MHD_strx_to_uint64_n_(\"%s\", 
%" PRIuPTR ", &ret_val)"
-                              " modified value of ret_val (before call: 0x%" 
PRIX64 ", after call 0x%" PRIX64 ")."
-                              " Locale: %s\n", n_prnt(t->str), (uintptr_t)len, 
test_val, rv,
-                              get_current_locale_str());
-                    }
-                }
-            }
-          if (verbose > 1 && j == locale_name_count - 1 && !c_failed[i])
-            printf("PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..%" PRIuPTR ", 
&ret_val) == 0,"
-                   " value of ret_val is unmodified\n", n_prnt(t->str),
-                   (uintptr_t)t->len + 1);
+          uint64_t rv = test_val;
+
+          rs = MHD_strx_to_uint64_n_ (t->str, len, &rv);
+          if (rs != 0)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR ", 
->0x%"
+                     PRIX64
+                     ")"
+                     " returned %" PRIuPTR
+                     ", while expecting zero. Locale: %s\n",
+                     n_prnt (t->str), (uintptr_t) len, rv, (uintptr_t) rs,
+                     get_current_locale_str ());
+          }
+          else if (rv != test_val)
+          {
+            t_failed++;
+            c_failed[i] = ! 0;
+            fprintf (stderr,
+                     "FAILED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR
+                     ", &ret_val)"
+                     " modified value of ret_val (before call: 0x%" PRIX64
+                     ", after call 0x%" PRIX64 ")."
+                     " Locale: %s\n", n_prnt (t->str), (uintptr_t) len,
+                     test_val, rv,
+                     get_current_locale_str ());
+          }
         }
+      }
+      if ((verbose > 1) &&(j == locale_name_count - 1) && ! c_failed[i])
+        printf (
+          "PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..%" PRIuPTR
+          ", &ret_val) == 0,"
+          " value of ret_val is unmodified\n", n_prnt (t->str),
+          (uintptr_t) t->len + 1);
     }
+  }
   return t_failed;
 }
 
 
-int run_str_to_X_tests(void)
+int run_str_to_X_tests (void)
 {
   int str_to_uint64_fails = 0;
   int str_to_uint64_n_fails = 0;
@@ -2447,406 +2797,491 @@ int run_str_to_X_tests(void)
   int strx_to_uint64_n_fails = 0;
   int res;
 
-  res = check_str_to_uint64_valid();
+  res = check_str_to_uint64_valid ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_valid().\n");
-          return 99;
-        }
-      str_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_valid() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in check_str_to_uint64_valid().\n");
+      return 99;
     }
+    str_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_valid() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_valid() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_valid() successfully passed.\n\n");
 
-  res = check_str_to_uint64_all_chars();
+  res = check_str_to_uint64_all_chars ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_all_chars().\n");
-          return 99;
-        }
-      str_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_all_chars() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_str_to_uint64_all_chars().\n");
+      return 99;
     }
+    str_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_all_chars() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_all_chars() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_all_chars() successfully 
passed.\n\n");
 
-  res = check_str_to_uint64_overflow();
+  res = check_str_to_uint64_overflow ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_overflow().\n");
-          return 99;
-        }
-      str_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_overflow() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_str_to_uint64_overflow().\n");
+      return 99;
     }
+    str_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_overflow() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_overflow() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_overflow() successfully 
passed.\n\n");
 
-  res = check_str_to_uint64_no_val();
+  res = check_str_to_uint64_no_val ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_no_val().\n");
-          return 99;
-        }
-      str_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_no_val() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_str_to_uint64_no_val().\n");
+      return 99;
     }
+    str_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_no_val() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_no_val() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_no_val() successfully 
passed.\n\n");
 
   if (str_to_uint64_fails)
-    fprintf(stderr, "FAILED: function MHD_str_to_uint64_() failed %d 
time%s.\n\n",
-                    str_to_uint64_fails, str_to_uint64_fails == 1 ? "" : "s");
+    fprintf (stderr,
+             "FAILED: function MHD_str_to_uint64_() failed %d time%s.\n\n",
+             str_to_uint64_fails, str_to_uint64_fails == 1 ? "" : "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_str_to_uint64_() successfully passed all 
checks.\n\n");
+    printf (
+      "PASSED: function MHD_str_to_uint64_() successfully passed all 
checks.\n\n");
 
-  res = check_str_to_uint64_n_valid();
+  res = check_str_to_uint64_n_valid ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_n_valid().\n");
-          return 99;
-        }
-      str_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_n_valid() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_str_to_uint64_n_valid().\n");
+      return 99;
     }
+    str_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_n_valid() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_n_valid() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_n_valid() successfully 
passed.\n\n");
 
-  res = check_str_to_uint64_n_all_chars();
+  res = check_str_to_uint64_n_all_chars ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_n_all_chars().\n");
-          return 99;
-        }
-      str_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_n_all_chars() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_str_to_uint64_n_all_chars().\n");
+      return 99;
     }
+    str_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_n_all_chars() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_n_all_chars() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_n_all_chars() successfully 
passed.\n\n");
 
-  res = check_str_to_uint64_n_overflow();
+  res = check_str_to_uint64_n_overflow ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_n_overflow().\n");
-          return 99;
-        }
-      str_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_n_overflow() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_str_to_uint64_n_overflow().\n");
+      return 99;
     }
+    str_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_n_overflow() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_n_overflow() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_n_overflow() successfully 
passed.\n\n");
 
-  res = check_str_to_uint64_n_no_val();
+  res = check_str_to_uint64_n_no_val ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_str_to_uint64_n_no_val().\n");
-          return 99;
-        }
-      str_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_str_to_uint64_n_no_val() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_str_to_uint64_n_no_val().\n");
+      return 99;
     }
+    str_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_str_to_uint64_n_no_val() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_str_to_uint64_n_no_val() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_str_to_uint64_n_no_val() successfully 
passed.\n\n");
 
   if (str_to_uint64_n_fails)
-    fprintf(stderr, "FAILED: function MHD_str_to_uint64_n_() failed %d 
time%s.\n\n",
-                    str_to_uint64_n_fails, str_to_uint64_n_fails == 1 ? "" : 
"s");
+    fprintf (stderr,
+             "FAILED: function MHD_str_to_uint64_n_() failed %d time%s.\n\n",
+             str_to_uint64_n_fails, str_to_uint64_n_fails == 1 ? "" : "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_str_to_uint64_n_() successfully passed all 
checks.\n\n");
+    printf (
+      "PASSED: function MHD_str_to_uint64_n_() successfully passed all 
checks.\n\n");
 
-  res = check_strx_to_uint32_valid();
+  res = check_strx_to_uint32_valid ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_valid().\n");
-          return 99;
-        }
-      strx_to_uint32_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_valid() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_valid().\n");
+      return 99;
     }
+    strx_to_uint32_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_valid() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_valid() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_valid() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint32_all_chars();
+  res = check_strx_to_uint32_all_chars ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_all_chars().\n");
-          return 99;
-        }
-      strx_to_uint32_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_all_chars() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_all_chars().\n");
+      return 99;
     }
+    strx_to_uint32_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_all_chars() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_all_chars() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_all_chars() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint32_overflow();
+  res = check_strx_to_uint32_overflow ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_overflow().\n");
-          return 99;
-        }
-      strx_to_uint32_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_overflow() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_overflow().\n");
+      return 99;
     }
+    strx_to_uint32_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_overflow() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_overflow() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_overflow() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint32_no_val();
+  res = check_strx_to_uint32_no_val ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_no_val().\n");
-          return 99;
-        }
-      strx_to_uint32_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_no_val() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_no_val().\n");
+      return 99;
     }
+    strx_to_uint32_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_no_val() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_no_val() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_no_val() successfully 
passed.\n\n");
 
   if (strx_to_uint32_fails)
-    fprintf(stderr, "FAILED: function MHD_strx_to_uint32_() failed %d 
time%s.\n\n",
-                    strx_to_uint32_fails, strx_to_uint32_fails == 1 ? "" : 
"s");
+    fprintf (stderr,
+             "FAILED: function MHD_strx_to_uint32_() failed %d time%s.\n\n",
+             strx_to_uint32_fails, strx_to_uint32_fails == 1 ? "" : "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_strx_to_uint32_() successfully passed all 
checks.\n\n");
+    printf (
+      "PASSED: function MHD_strx_to_uint32_() successfully passed all 
checks.\n\n");
 
-  res = check_strx_to_uint32_n_valid();
+  res = check_strx_to_uint32_n_valid ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_n_valid().\n");
-          return 99;
-        }
-      strx_to_uint32_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_n_valid() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_n_valid().\n");
+      return 99;
     }
+    strx_to_uint32_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_n_valid() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_n_valid() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_n_valid() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint32_n_all_chars();
+  res = check_strx_to_uint32_n_all_chars ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_n_all_chars().\n");
-          return 99;
-        }
-      strx_to_uint32_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_n_all_chars() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_n_all_chars().\n");
+      return 99;
     }
+    strx_to_uint32_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_n_all_chars() 
failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_n_all_chars() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_n_all_chars() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint32_n_overflow();
+  res = check_strx_to_uint32_n_overflow ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_n_overflow().\n");
-          return 99;
-        }
-      strx_to_uint32_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_n_overflow() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_n_overflow().\n");
+      return 99;
     }
+    strx_to_uint32_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_n_overflow() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_n_overflow() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_n_overflow() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint32_n_no_val();
+  res = check_strx_to_uint32_n_no_val ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint32_n_no_val().\n");
-          return 99;
-        }
-      strx_to_uint32_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint32_n_no_val() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint32_n_no_val().\n");
+      return 99;
     }
+    strx_to_uint32_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint32_n_no_val() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint32_n_no_val() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint32_n_no_val() successfully 
passed.\n\n");
 
   if (strx_to_uint32_n_fails)
-    fprintf(stderr, "FAILED: function MHD_strx_to_uint32_n_() failed %d 
time%s.\n\n",
-                    strx_to_uint32_n_fails, strx_to_uint32_n_fails == 1 ? "" : 
"s");
+    fprintf (stderr,
+             "FAILED: function MHD_strx_to_uint32_n_() failed %d time%s.\n\n",
+             strx_to_uint32_n_fails, strx_to_uint32_n_fails == 1 ? "" : "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_strx_to_uint32_n_() successfully passed all 
checks.\n\n");
+    printf (
+      "PASSED: function MHD_strx_to_uint32_n_() successfully passed all 
checks.\n\n");
 
-  res = check_strx_to_uint64_valid();
+  res = check_strx_to_uint64_valid ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_valid().\n");
-          return 99;
-        }
-      strx_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_valid() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_valid().\n");
+      return 99;
     }
+    strx_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_valid() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_valid() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_valid() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint64_all_chars();
+  res = check_strx_to_uint64_all_chars ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_all_chars().\n");
-          return 99;
-        }
-      strx_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_all_chars() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_all_chars().\n");
+      return 99;
     }
+    strx_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_all_chars() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_all_chars() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_all_chars() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint64_overflow();
+  res = check_strx_to_uint64_overflow ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_overflow().\n");
-          return 99;
-        }
-      strx_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_overflow() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_overflow().\n");
+      return 99;
     }
+    strx_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_overflow() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_overflow() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_overflow() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint64_no_val();
+  res = check_strx_to_uint64_no_val ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_no_val().\n");
-          return 99;
-        }
-      strx_to_uint64_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_no_val() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_no_val().\n");
+      return 99;
     }
+    strx_to_uint64_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_no_val() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_no_val() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_no_val() successfully 
passed.\n\n");
 
   if (strx_to_uint64_fails)
-    fprintf(stderr, "FAILED: function MHD_strx_to_uint64_() failed %d 
time%s.\n\n",
-                    strx_to_uint64_fails, strx_to_uint64_fails == 1 ? "" : 
"s");
+    fprintf (stderr,
+             "FAILED: function MHD_strx_to_uint64_() failed %d time%s.\n\n",
+             strx_to_uint64_fails, strx_to_uint64_fails == 1 ? "" : "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_strx_to_uint64_() successfully passed all 
checks.\n\n");
+    printf (
+      "PASSED: function MHD_strx_to_uint64_() successfully passed all 
checks.\n\n");
 
-  res = check_strx_to_uint64_n_valid();
+  res = check_strx_to_uint64_n_valid ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_n_valid().\n");
-          return 99;
-        }
-      strx_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_n_valid() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_n_valid().\n");
+      return 99;
     }
+    strx_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_n_valid() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_n_valid() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_n_valid() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint64_n_all_chars();
+  res = check_strx_to_uint64_n_all_chars ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_n_all_chars().\n");
-          return 99;
-        }
-      strx_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_n_all_chars() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_n_all_chars().\n");
+      return 99;
     }
+    strx_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_n_all_chars() 
failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_n_all_chars() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_n_all_chars() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint64_n_overflow();
+  res = check_strx_to_uint64_n_overflow ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_n_overflow().\n");
-          return 99;
-        }
-      strx_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_n_overflow() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_n_overflow().\n");
+      return 99;
     }
+    strx_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_n_overflow() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_n_overflow() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_n_overflow() successfully 
passed.\n\n");
 
-  res = check_strx_to_uint64_n_no_val();
+  res = check_strx_to_uint64_n_no_val ();
   if (res != 0)
+  {
+    if (res < 0)
     {
-      if (res < 0)
-        {
-          fprintf(stderr, "ERROR: test internal error in 
check_strx_to_uint64_n_no_val().\n");
-          return 99;
-        }
-      strx_to_uint64_n_fails += res;
-      fprintf(stderr, "FAILED: testcase check_strx_to_uint64_n_no_val() 
failed.\n\n");
+      fprintf (stderr,
+               "ERROR: test internal error in 
check_strx_to_uint64_n_no_val().\n");
+      return 99;
     }
+    strx_to_uint64_n_fails += res;
+    fprintf (stderr,
+             "FAILED: testcase check_strx_to_uint64_n_no_val() failed.\n\n");
+  }
   else if (verbose > 1)
-    printf("PASSED: testcase check_strx_to_uint64_n_no_val() successfully 
passed.\n\n");
+    printf (
+      "PASSED: testcase check_strx_to_uint64_n_no_val() successfully 
passed.\n\n");
 
   if (strx_to_uint64_n_fails)
-    fprintf(stderr, "FAILED: function MHD_strx_to_uint64_n_() failed %d 
time%s.\n\n",
-                    strx_to_uint64_n_fails, strx_to_uint64_n_fails == 1 ? "" : 
"s");
+    fprintf (stderr,
+             "FAILED: function MHD_strx_to_uint64_n_() failed %d time%s.\n\n",
+             strx_to_uint64_n_fails, strx_to_uint64_n_fails == 1 ? "" : "s");
   else if (verbose > 0)
-    printf("PASSED: function MHD_strx_to_uint64_n_() successfully passed all 
checks.\n\n");
+    printf (
+      "PASSED: function MHD_strx_to_uint64_n_() successfully passed all 
checks.\n\n");
 
   if (str_to_uint64_fails || str_to_uint64_n_fails ||
       strx_to_uint32_fails || strx_to_uint32_n_fails ||
       strx_to_uint64_fails || strx_to_uint64_n_fails)
-    {
-      if (verbose > 0)
-        printf("At least one test failed.\n");
+  {
+    if (verbose > 0)
+      printf ("At least one test failed.\n");
 
-      return 1;
-    }
+    return 1;
+  }
 
   if (verbose > 0)
-    printf("All tests passed successfully.\n");
+    printf ("All tests passed successfully.\n");
 
   return 0;
 }
 
 
-int main(int argc, char * argv[])
+int main (int argc, char *argv[])
 {
-  if (has_param(argc, argv, "-v") || has_param(argc, argv, "--verbose") || 
has_param(argc, argv, "--verbose1"))
+  if (has_param (argc, argv, "-v") || has_param (argc, argv, "--verbose") ||
+      has_param (argc, argv, "--verbose1"))
     verbose = 1;
-  if (has_param(argc, argv, "-vv") || has_param(argc, argv, "--verbose2"))
+  if (has_param (argc, argv, "-vv") || has_param (argc, argv, "--verbose2"))
     verbose = 2;
-  if (has_param(argc, argv, "-vvv") || has_param(argc, argv, "--verbose3"))
+  if (has_param (argc, argv, "-vvv") || has_param (argc, argv, "--verbose3"))
     verbose = 3;
 
-  if (has_in_name(argv[0], "_to_value"))
-    return run_str_to_X_tests();
+  if (has_in_name (argv[0], "_to_value"))
+    return run_str_to_X_tests ();
 
-  return run_eq_neq_str_tests();
+  return run_eq_neq_str_tests ();
 }
diff --git a/src/microhttpd/test_str_token.c b/src/microhttpd/test_str_token.c
index 15f3f406..0baca53d 100644
--- a/src/microhttpd/test_str_token.c
+++ b/src/microhttpd/test_str_token.c
@@ -29,90 +29,93 @@
 
 
 static int
-expect_found_n(const char *str, const char *token, size_t token_len)
+expect_found_n (const char *str, const char *token, size_t token_len)
 {
-  if (!MHD_str_has_token_caseless_(str, token, token_len))
-    {
-      fprintf(stderr, "MHD_str_has_token_caseless_() 
FAILED:\n\tMHD_str_has_token_caseless_(%s, %s, %lu) return false\n",
-              str, token, (unsigned long) token_len);
-      return 1;
-    }
+  if (! MHD_str_has_token_caseless_ (str, token, token_len))
+  {
+    fprintf (stderr,
+             "MHD_str_has_token_caseless_() 
FAILED:\n\tMHD_str_has_token_caseless_(%s, %s, %lu) return false\n",
+             str, token, (unsigned long) token_len);
+    return 1;
+  }
   return 0;
 }
 
-#define expect_found(s,t) expect_found_n((s),(t),MHD_STATICSTR_LEN_(t))
+#define expect_found(s,t) expect_found_n ((s),(t),MHD_STATICSTR_LEN_ (t))
 
 static int
-expect_not_found_n(const char *str, const char *token, size_t token_len)
+expect_not_found_n (const char *str, const char *token, size_t token_len)
 {
-  if (MHD_str_has_token_caseless_(str, token, token_len))
-    {
-      fprintf(stderr, "MHD_str_has_token_caseless_() 
FAILED:\n\tMHD_str_has_token_caseless_(%s, %s, %lu) return true\n",
-              str, token, (unsigned long) token_len);
-      return 1;
-    }
+  if (MHD_str_has_token_caseless_ (str, token, token_len))
+  {
+    fprintf (stderr,
+             "MHD_str_has_token_caseless_() 
FAILED:\n\tMHD_str_has_token_caseless_(%s, %s, %lu) return true\n",
+             str, token, (unsigned long) token_len);
+    return 1;
+  }
   return 0;
 }
 
-#define expect_not_found(s,t) expect_not_found_n((s),(t),MHD_STATICSTR_LEN_(t))
+#define expect_not_found(s,t) expect_not_found_n ((s),(t),MHD_STATICSTR_LEN_ ( 
\
+                                                    t))
 
-int check_match(void)
+int check_match (void)
 {
   int errcount = 0;
-  errcount += expect_found("string", "string");
-  errcount += expect_found("String", "string");
-  errcount += expect_found("string", "String");
-  errcount += expect_found("strinG", "String");
-  errcount += expect_found("\t strinG", "String");
-  errcount += expect_found("strinG\t ", "String");
-  errcount += expect_found(" \t tOkEn  ", "toKEN");
-  errcount += expect_found("not token\t,  tOkEn  ", "toKEN");
-  errcount += expect_found("not token,\t  tOkEn, more token", "toKEN");
-  errcount += expect_found("not token,\t  tOkEn\t, more token", "toKEN");
-  errcount += expect_found(",,,,,,test,,,,", "TESt");
-  errcount += expect_found(",,,,,\t,test,,,,", "TESt");
-  errcount += expect_found(",,,,,,test, ,,,", "TESt");
-  errcount += expect_found(",,,,,, test,,,,", "TESt");
-  errcount += expect_found(",,,,,, test not,test,,", "TESt");
-  errcount += expect_found(",,,,,, test not,,test,,", "TESt");
-  errcount += expect_found(",,,,,, test not ,test,,", "TESt");
-  errcount += expect_found(",,,,,, test", "TESt");
-  errcount += expect_found(",,,,,, test      ", "TESt");
-  errcount += expect_found("no test,,,,,, test      ", "TESt");
+  errcount += expect_found ("string", "string");
+  errcount += expect_found ("String", "string");
+  errcount += expect_found ("string", "String");
+  errcount += expect_found ("strinG", "String");
+  errcount += expect_found ("\t strinG", "String");
+  errcount += expect_found ("strinG\t ", "String");
+  errcount += expect_found (" \t tOkEn  ", "toKEN");
+  errcount += expect_found ("not token\t,  tOkEn  ", "toKEN");
+  errcount += expect_found ("not token,\t  tOkEn, more token", "toKEN");
+  errcount += expect_found ("not token,\t  tOkEn\t, more token", "toKEN");
+  errcount += expect_found (",,,,,,test,,,,", "TESt");
+  errcount += expect_found (",,,,,\t,test,,,,", "TESt");
+  errcount += expect_found (",,,,,,test, ,,,", "TESt");
+  errcount += expect_found (",,,,,, test,,,,", "TESt");
+  errcount += expect_found (",,,,,, test not,test,,", "TESt");
+  errcount += expect_found (",,,,,, test not,,test,,", "TESt");
+  errcount += expect_found (",,,,,, test not ,test,,", "TESt");
+  errcount += expect_found (",,,,,, test", "TESt");
+  errcount += expect_found (",,,,,, test      ", "TESt");
+  errcount += expect_found ("no test,,,,,, test      ", "TESt");
   return errcount;
 }
 
-int check_not_match(void)
+int check_not_match (void)
 {
   int errcount = 0;
-  errcount += expect_not_found("strin", "string");
-  errcount += expect_not_found("Stringer", "string");
-  errcount += expect_not_found("sstring", "String");
-  errcount += expect_not_found("string", "Strin");
-  errcount += expect_not_found("\t( strinG", "String");
-  errcount += expect_not_found(")strinG\t ", "String");
-  errcount += expect_not_found(" \t tOkEn t ", "toKEN");
-  errcount += expect_not_found("not token\t,  tOkEner  ", "toKEN");
-  errcount += expect_not_found("not token,\t  tOkEns, more token", "toKEN");
-  errcount += expect_not_found("not token,\t  tOkEns\t, more token", "toKEN");
-  errcount += expect_not_found(",,,,,,testing,,,,", "TESt");
-  errcount += expect_not_found(",,,,,\t,test,,,,", "TESting");
-  errcount += expect_not_found("tests,,,,,,quest, ,,,", "TESt");
-  errcount += expect_not_found(",,,,,, testы,,,,", "TESt");
-  errcount += expect_not_found(",,,,,, test not,хtest,,", "TESt");
-  errcount += expect_not_found("testing,,,,,, test not,,test2,,", "TESt");
-  errcount += expect_not_found(",testi,,,,, test not ,test,,", "TESting");
-  errcount += expect_not_found(",,,,,,2 test", "TESt");
-  errcount += expect_not_found(",,,,,,test test      ", "test");
-  errcount += expect_not_found("no test,,,,,, test      test", "test");
+  errcount += expect_not_found ("strin", "string");
+  errcount += expect_not_found ("Stringer", "string");
+  errcount += expect_not_found ("sstring", "String");
+  errcount += expect_not_found ("string", "Strin");
+  errcount += expect_not_found ("\t( strinG", "String");
+  errcount += expect_not_found (")strinG\t ", "String");
+  errcount += expect_not_found (" \t tOkEn t ", "toKEN");
+  errcount += expect_not_found ("not token\t,  tOkEner  ", "toKEN");
+  errcount += expect_not_found ("not token,\t  tOkEns, more token", "toKEN");
+  errcount += expect_not_found ("not token,\t  tOkEns\t, more token", "toKEN");
+  errcount += expect_not_found (",,,,,,testing,,,,", "TESt");
+  errcount += expect_not_found (",,,,,\t,test,,,,", "TESting");
+  errcount += expect_not_found ("tests,,,,,,quest, ,,,", "TESt");
+  errcount += expect_not_found (",,,,,, testы,,,,", "TESt");
+  errcount += expect_not_found (",,,,,, test not,хtest,,", "TESt");
+  errcount += expect_not_found ("testing,,,,,, test not,,test2,,", "TESt");
+  errcount += expect_not_found (",testi,,,,, test not ,test,,", "TESting");
+  errcount += expect_not_found (",,,,,,2 test", "TESt");
+  errcount += expect_not_found (",,,,,,test test      ", "test");
+  errcount += expect_not_found ("no test,,,,,, test      test", "test");
   return errcount;
 }
 
-int main(int argc, char * argv[])
+int main (int argc, char *argv[])
 {
   int errcount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
-  errcount += check_match();
-  errcount += check_not_match();
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
+  errcount += check_match ();
+  errcount += check_not_match ();
   return errcount == 0 ? 0 : 1;
 }
diff --git a/src/microhttpd/tsearch.c b/src/microhttpd/tsearch.c
index fe5fcd5b..e43d758f 100644
--- a/src/microhttpd/tsearch.c
+++ b/src/microhttpd/tsearch.c
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 
 
-typedef        struct node
+typedef struct node
 {
   const void   *key;
   struct node  *llink;
@@ -24,35 +24,35 @@ typedef     struct node
 /*     $NetBSD: tsearch.c,v 1.5 2005/11/29 03:12:00 christos Exp $     */
 /* find or insert datum into search tree */
 void *
-tsearch (const void *vkey,             /* key to be located */
-         void **vrootp,                        /* address of tree root */
+tsearch (const void *vkey,    /* key to be located */
+         void **vrootp,     /* address of tree root */
          int (*compar)(const void *, const void *))
 {
   node_t *q;
-  node_t **rootp = (node_t **)vrootp;
+  node_t **rootp = (node_t **) vrootp;
 
   if (NULL == rootp)
     return NULL;
 
   while (*rootp != NULL)
-    {  /* Knuth's T1: */
-      int r;
+  {   /* Knuth's T1: */
+    int r;
 
-      if ((r = (*compar)(vkey, (*rootp)->key)) == 0)   /* T2: */
-        return *rootp;         /* we found it! */
+    if ((r = (*compar)(vkey, (*rootp)->key)) == 0)    /* T2: */
+      return *rootp;      /* we found it! */
 
-      rootp = (r < 0) ?
-        &(*rootp)->llink :             /* T3: follow left branch */
-        &(*rootp)->rlink;              /* T4: follow right branch */
-    }
+    rootp = (r < 0) ?
+            &(*rootp)->llink : /* T3: follow left branch */
+            &(*rootp)->rlink; /* T4: follow right branch */
+  }
 
-  q = malloc (sizeof(node_t));         /* T5: key not found */
+  q = malloc (sizeof(node_t));    /* T5: key not found */
   if (q)
-    {                          /* make new node */
-      *rootp = q;                      /* link new node to old */
-      q->key = vkey;           /* initialize new node */
-      q->llink = q->rlink = NULL;
-    }
+  {         /* make new node */
+    *rootp = q;       /* link new node to old */
+    q->key = vkey;      /* initialize new node */
+    q->llink = q->rlink = NULL;
+  }
   return q;
 }
 
@@ -61,24 +61,24 @@ tsearch (const void *vkey,          /* key to be located */
 /* find a node, or return NULL */
 void *
 tfind (const void *vkey,         /* key to be found */
-       void * const *vrootp,     /* address of the tree root */
+       void *const *vrootp,      /* address of the tree root */
        int (*compar)(const void *, const void *))
 {
-  node_t * const *rootp = (node_t * const*)vrootp;
+  node_t *const *rootp = (node_t *const*) vrootp;
 
   if (NULL == rootp)
     return NULL;
 
   while (*rootp != NULL)
-    {          /* T1: */
-      int r;
-
-      if ((r = (*compar)(vkey, (*rootp)->key)) == 0)   /* T2: */
-        return *rootp;         /* key found */
-      rootp = (r < 0) ?
-        &(*rootp)->llink :             /* T3: follow left branch */
-        &(*rootp)->rlink;              /* T4: follow right branch */
-    }
+  {     /* T1: */
+    int r;
+
+    if ((r = (*compar)(vkey, (*rootp)->key)) == 0)    /* T2: */
+      return *rootp;      /* key found */
+    rootp = (r < 0) ?
+            &(*rootp)->llink : /* T3: follow left branch */
+            &(*rootp)->rlink; /* T4: follow right branch */
+  }
   return NULL;
 }
 
@@ -92,51 +92,51 @@ tfind (const void *vkey,         /* key to be found */
  * compar: function to carry out node comparisons
  */
 void *
-tdelete (const void * __restrict vkey,
-         void ** __restrict vrootp,
+tdelete (const void *__restrict vkey,
+         void **__restrict vrootp,
          int (*compar)(const void *, const void *))
 {
-  node_t **rootp = (node_t **)vrootp;
+  node_t **rootp = (node_t **) vrootp;
   node_t *p;
   node_t *q;
   node_t *r;
   int cmp;
 
-  if (rootp == NULL || (p = *rootp) == NULL)
+  if ((rootp == NULL)||((p = *rootp) == NULL))
     return NULL;
 
   while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0)
-    {
-      p = *rootp;
-      rootp = (cmp < 0) ?
-        &(*rootp)->llink :             /* follow llink branch */
-        &(*rootp)->rlink;              /* follow rlink branch */
-      if (*rootp == NULL)
-        return NULL;           /* key not found */
-    }
-  r = (*rootp)->rlink;                 /* D1: */
-  if ((q = (*rootp)->llink) == NULL)   /* Left NULL? */
-    {
+  {
+    p = *rootp;
+    rootp = (cmp < 0) ?
+            &(*rootp)->llink : /* follow llink branch */
+            &(*rootp)->rlink; /* follow rlink branch */
+    if (*rootp == NULL)
+      return NULL;      /* key not found */
+  }
+  r = (*rootp)->rlink;      /* D1: */
+  if ((q = (*rootp)->llink) == NULL)  /* Left NULL? */
+  {
+    q = r;
+  }
+  else if (r != NULL)
+  {       /* Right link is NULL? */
+    if (r->llink == NULL)
+    {       /* D2: Find successor */
+      r->llink = q;
       q = r;
     }
-  else if (r != NULL)
-    {                  /* Right link is NULL? */
-      if (r->llink == NULL)
-        {              /* D2: Find successor */
-          r->llink = q;
-          q = r;
-        }
-      else
-        {                      /* D3: Find NULL link */
-          for (q = r->llink; q->llink != NULL; q = r->llink)
-            r = q;
-          r->llink = q->rlink;
-          q->llink = (*rootp)->llink;
-          q->rlink = (*rootp)->rlink;
-        }
+    else
+    {         /* D3: Find NULL link */
+      for (q = r->llink; q->llink != NULL; q = r->llink)
+        r = q;
+      r->llink = q->rlink;
+      q->llink = (*rootp)->llink;
+      q->rlink = (*rootp)->rlink;
     }
-  free(*rootp);                                /* D4: Free node */
-  *rootp = q;                          /* link parent to new node */
+  }
+  free (*rootp);       /* D4: Free node */
+  *rootp = q;       /* link parent to new node */
   return p;
 }
 
diff --git a/src/microhttpd/tsearch.h b/src/microhttpd/tsearch.h
index aa186495..0cfe16a7 100644
--- a/src/microhttpd/tsearch.h
+++ b/src/microhttpd/tsearch.h
@@ -14,22 +14,22 @@ extern "C" {
 #endif /* __cplusplus */
 
 
-void   *
-tdelete (const void * __restrict,
-         void ** __restrict,
-         int (*)(const void *, const void *));
+void  *
+  tdelete (const void *__restrict,
+           void **__restrict,
+           int (*)(const void *, const void *));
 
 
-void   *
-tfind (const void *,
-       void * const *,
-       int (*)(const void *, const void *));
+void  *
+  tfind (const void *,
+         void *const *,
+         int (*)(const void *, const void *));
 
 
-void   *
-tsearch (const void *,
-         void **,
-         int (*)(const void *, const void *));
+void  *
+  tsearch (const void *,
+           void **,
+           int (*)(const void *, const void *));
 
 #if defined(__cplusplus)
 };
diff --git a/src/testcurl/curl_version_check.c 
b/src/testcurl/curl_version_check.c
index dff143f8..d1134f42 100644
--- a/src/testcurl/curl_version_check.c
+++ b/src/testcurl/curl_version_check.c
@@ -39,11 +39,11 @@ parse_version_number (const char **s)
   char num[17];
 
   while (i < 16 && ((**s >= '0') & (**s <= '9')))
-    {
-      num[i] = **s;
-      (*s)++;
-      i++;
-    }
+  {
+    num[i] = **s;
+    (*s)++;
+    i++;
+  }
 
   num[i] = '\0';
 
@@ -53,7 +53,7 @@ parse_version_number (const char **s)
 const char *
 parse_version_string (const char *s, int *major, int *minor, int *micro)
 {
-  if (!s)
+  if (! s)
     return NULL;
   *major = parse_version_number (&s);
   if (*s != '.')
@@ -69,9 +69,9 @@ parse_version_string (const char *s, int *major, int *minor, 
int *micro)
 
 #ifdef HTTPS_SUPPORT
 int
-curl_uses_nss_ssl()
+curl_uses_nss_ssl ()
 {
-  return (strstr(curl_version(), " NSS/") != NULL) ? 0 : -1;
+  return (strstr (curl_version (), " NSS/") != NULL) ? 0 : -1;
 }
 #endif /* HTTPS_SUPPORT */
 
@@ -105,23 +105,25 @@ curl_check_version (const char *req_version)
     return -1;
   curl_ver++;
   /* Parse version numbers */
-  if ( (NULL == parse_version_string (req_version, &rq_major, &rq_minor, 
&rq_micro)) ||
-       (NULL == parse_version_string (curl_ver, &loc_major, &loc_minor, 
&loc_micro)) )
+  if ( (NULL == parse_version_string (req_version, &rq_major, &rq_minor,
+                                      &rq_micro)) ||
+       (NULL == parse_version_string (curl_ver, &loc_major, &loc_minor,
+                                      &loc_micro)) )
     return -1;
 
   /* Compare version numbers.  */
-  if ((loc_major > rq_major
-       || (loc_major == rq_major && loc_minor > rq_minor)
-       || (loc_major == rq_major && loc_minor == rq_minor
-           && loc_micro > rq_micro) || (loc_major == rq_major
-                                        && loc_minor == rq_minor
-                                        && loc_micro == rq_micro)) == 0)
-    {
-      fprintf (stderr,
-               "Error: running curl test depends on local libcurl version > 
%s\n",
-               req_version);
-      return -1;
-    }
+  if (((loc_major > rq_major)
+       || ((loc_major == rq_major)&&(loc_minor > rq_minor))
+       || ((loc_major == rq_major)&&(loc_minor == rq_minor)
+           &&(loc_micro > rq_micro)) || ((loc_major == rq_major)
+                                         &&(loc_minor == rq_minor)
+                                         &&(loc_micro == rq_micro) )) == 0)
+  {
+    fprintf (stderr,
+             "Error: running curl test depends on local libcurl version > 
%s\n",
+             req_version);
+    return -1;
+  }
 
   /*
    * enforce required gnutls/openssl version.
@@ -133,44 +135,46 @@ curl_check_version (const char *req_version)
     return -1;
   ssl_ver++;
   if (strncmp ("GnuTLS", ssl_ver, strlen ("GNUtls")) == 0)
-    {
-      ssl_ver = strchr (ssl_ver, '/');
-      req_ssl_ver = MHD_REQ_CURL_GNUTLS_VERSION;
-    }
+  {
+    ssl_ver = strchr (ssl_ver, '/');
+    req_ssl_ver = MHD_REQ_CURL_GNUTLS_VERSION;
+  }
   else if (strncmp ("OpenSSL", ssl_ver, strlen ("OpenSSL")) == 0)
-    {
-      ssl_ver = strchr (ssl_ver, '/');
-      req_ssl_ver = MHD_REQ_CURL_OPENSSL_VERSION;
-    }
+  {
+    ssl_ver = strchr (ssl_ver, '/');
+    req_ssl_ver = MHD_REQ_CURL_OPENSSL_VERSION;
+  }
   else if (strncmp ("NSS", ssl_ver, strlen ("NSS")) == 0)
-    {
-      ssl_ver = strchr (ssl_ver, '/');
-      req_ssl_ver = MHD_REQ_CURL_NSS_VERSION;
-    }
+  {
+    ssl_ver = strchr (ssl_ver, '/');
+    req_ssl_ver = MHD_REQ_CURL_NSS_VERSION;
+  }
   else
-    {
-      fprintf (stderr, "Error: unrecognized curl ssl library\n");
-      return -1;
-    }
+  {
+    fprintf (stderr, "Error: unrecognized curl ssl library\n");
+    return -1;
+  }
   if (ssl_ver == NULL)
     return -1;
   ssl_ver++;
-  if ( (NULL == parse_version_string (req_ssl_ver, &rq_major, &rq_minor, 
&rq_micro)) ||
-       (NULL == parse_version_string (ssl_ver, &loc_major, &loc_minor, 
&loc_micro)) )
+  if ( (NULL == parse_version_string (req_ssl_ver, &rq_major, &rq_minor,
+                                      &rq_micro)) ||
+       (NULL == parse_version_string (ssl_ver, &loc_major, &loc_minor,
+                                      &loc_micro)) )
     return -1;
 
-  if ((loc_major > rq_major
-       || (loc_major == rq_major && loc_minor > rq_minor)
-       || (loc_major == rq_major && loc_minor == rq_minor
-           && loc_micro > rq_micro) || (loc_major == rq_major
-                                        && loc_minor == rq_minor
-                                        && loc_micro == rq_micro)) == 0)
-    {
-      fprintf (stderr,
-               "Error: running curl test depends on local libcurl SSL version 
> %s\n",
-               req_ssl_ver);
-      return -1;
-    }
+  if (((loc_major > rq_major)
+       || ((loc_major == rq_major)&&(loc_minor > rq_minor))
+       || ((loc_major == rq_major)&&(loc_minor == rq_minor)
+           &&(loc_micro > rq_micro)) || ((loc_major == rq_major)
+                                         &&(loc_minor == rq_minor)
+                                         &&(loc_micro == rq_micro) )) == 0)
+  {
+    fprintf (stderr,
+             "Error: running curl test depends on local libcurl SSL version > 
%s\n",
+             req_ssl_ver);
+    return -1;
+  }
 #endif /* HTTPS_SUPPORT */
   return 0;
 }
diff --git a/src/testcurl/gauger.h b/src/testcurl/gauger.h
index 6698f5d5..d00839c1 100644
--- a/src/testcurl/gauger.h
+++ b/src/testcurl/gauger.h
@@ -17,64 +17,64 @@
 #include <stdio.h>
 #include <sys/wait.h>
 
-#define GAUGER(category, counter, value, unit)\
-{\
-    const char * __gauger_v[10];                       \
-    char __gauger_s[32];\
-    pid_t __gauger_p;\
-    if(!(__gauger_p=fork())){\
-      if(!fork()){ \
-            sprintf(__gauger_s,"%Lf", (long double) (value));\
-            __gauger_v[0] = "gauger";\
-            __gauger_v[1] = "-n";\
-            __gauger_v[2] = counter;   \
-            __gauger_v[3] = "-d";\
-            __gauger_v[4] = __gauger_s;\
-            __gauger_v[5] = "-u";\
-            __gauger_v[6] = unit;      \
-            __gauger_v[7] = "-c";\
-            __gauger_v[8] = category;  \
-            __gauger_v[9] = (char *)NULL;\
-            execvp("gauger", (char*const*) __gauger_v);        \
-            _exit(1);\
-        }else{\
-            _exit(0);\
-        }\
-    }else{\
-        waitpid(__gauger_p,NULL,0);\
-    }\
-}
+#define GAUGER(category, counter, value, unit) \
+  { \
+    const char *__gauger_v[10];      \
+    char __gauger_s[32]; \
+    pid_t __gauger_p; \
+    if (! (__gauger_p = fork ())) { \
+      if (! fork ()) { \
+        sprintf (__gauger_s,"%Lf", (long double) (value)); \
+        __gauger_v[0] = "gauger"; \
+        __gauger_v[1] = "-n"; \
+        __gauger_v[2] = counter;  \
+        __gauger_v[3] = "-d"; \
+        __gauger_v[4] = __gauger_s; \
+        __gauger_v[5] = "-u"; \
+        __gauger_v[6] = unit; \
+        __gauger_v[7] = "-c"; \
+        __gauger_v[8] = category; \
+        __gauger_v[9] = (char *) NULL; \
+        execvp ("gauger", (char*const*) __gauger_v); \
+        _exit (1); \
+      }else{ \
+        _exit (0); \
+      } \
+    }else{ \
+      waitpid (__gauger_p,NULL,0); \
+    } \
+  }
 
-#define GAUGER_ID(category, counter, value, unit, id)\
-{\
-    char* __gauger_v[12];\
-    char __gauger_s[32];\
-    pid_t __gauger_p;\
-    if(!(__gauger_p=fork())){\
-        if(!fork()){\
-            sprintf(__gauger_s,"%Lf", (long double) (value));\
-            __gauger_v[0] = "gauger";\
-            __gauger_v[1] = "-n";\
-            __gauger_v[2] = counter;\
-            __gauger_v[3] = "-d";\
-            __gauger_v[4] = __gauger_s;\
-            __gauger_v[5] = "-u";\
-            __gauger_v[6] = unit;\
-            __gauger_v[7] = "-i";\
-            __gauger_v[8] = id;\
-            __gauger_v[9] = "-c";\
-            __gauger_v[10] = category;\
-            __gauger_v[11] = (char *)NULL;\
-            execvp("gauger",__gauger_v);\
-            perror("gauger");\
-            _exit(1);\
-        }else{\
-            _exit(0);\
-        }\
-    }else{\
-        waitpid(__gauger_p,NULL,0);\
-    }\
-}
+#define GAUGER_ID(category, counter, value, unit, id) \
+  { \
+    char*__gauger_v[12]; \
+    char __gauger_s[32]; \
+    pid_t __gauger_p; \
+    if (! (__gauger_p = fork ())) { \
+      if (! fork ()) { \
+        sprintf (__gauger_s,"%Lf", (long double) (value)); \
+        __gauger_v[0] = "gauger"; \
+        __gauger_v[1] = "-n"; \
+        __gauger_v[2] = counter; \
+        __gauger_v[3] = "-d"; \
+        __gauger_v[4] = __gauger_s; \
+        __gauger_v[5] = "-u"; \
+        __gauger_v[6] = unit; \
+        __gauger_v[7] = "-i"; \
+        __gauger_v[8] = id; \
+        __gauger_v[9] = "-c"; \
+        __gauger_v[10] = category; \
+        __gauger_v[11] = (char *) NULL; \
+        execvp ("gauger",__gauger_v); \
+        perror ("gauger"); \
+        _exit (1); \
+      }else{ \
+        _exit (0); \
+      } \
+    }else{ \
+      waitpid (__gauger_p,NULL,0); \
+    } \
+  }
 
 #else
 
diff --git a/src/testcurl/https/test_empty_response.c 
b/src/testcurl/https/test_empty_response.c
index f53a70ec..41026896 100644
--- a/src/testcurl/https/test_empty_response.c
+++ b/src/testcurl/https/test_empty_response.c
@@ -49,11 +49,11 @@ ahc_echo (void *cls,
 {
   struct MHD_Response *response;
   int ret;
-  (void)cls;(void)url;(void)method;(void)version;               /* Unused. 
Silent compiler warning. */
-  (void)upload_data;(void)upload_data_size;(void)unused;        /* Unused. 
Silent compiler warning. */
+  (void) cls; (void) url; (void) method; (void) version;               /* 
Unused. Silent compiler warning. */
+  (void) upload_data; (void) upload_data_size; (void) unused;        /* 
Unused. Silent compiler warning. */
 
   response = MHD_create_response_from_buffer (0, NULL,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -88,31 +88,34 @@ testInternalSelectGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_TLS | 
MHD_USE_INTERNAL_POLLING_THREAD,
+  d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_TLS
+                        | MHD_USE_INTERNAL_POLLING_THREAD,
                         port, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
                         MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
-                       MHD_OPTION_END);
+                        MHD_OPTION_END);
   if (d == NULL)
     return 256;
 
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   char *aes256_sha = "AES256-SHA";
-  if (curl_uses_nss_ssl() == 0)
-    {
-      aes256_sha = "rsa_aes_256_sha";
-    }
+  if (curl_uses_nss_ssl () == 0)
+  {
+    aes256_sha = "rsa_aes_256_sha";
+  }
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "https://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   /* TLS options */
@@ -135,80 +138,83 @@ testInternalSelectGet ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 512;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
   mret = curl_multi_add_handle (multi, c);
   if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 2048;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 != maxposixs)
     {
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 != maxposixs)
-        {
-          if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-            {
+      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+      {
 #ifdef MHD_POSIX_SOCKETS
-              if (EINTR != errno)
-                abort ();
+        if (EINTR != errno)
+          abort ();
 #else
-              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-                abort ();
-              Sleep (1000);
+        if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                      ws.
+                                                                      fd_count)
+            ||(0 != es.fd_count) )
+          abort ();
+        Sleep (1000);
 #endif
-            }
-        }
-      else
-        (void)sleep (1);
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
+      }
     }
-  if (multi != NULL)
+    else
+      (void) sleep (1);
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != 0)
     return 8192;
@@ -220,16 +226,16 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
   if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
   if (0 != (errorCount = testInternalSelectGet ()))
     fprintf (stderr, "Failed test: %s, error: %u.\n", argv[0], errorCount);
   curl_global_cleanup ();
diff --git a/src/testcurl/https/test_https_get.c 
b/src/testcurl/https/test_https_get.c
index 61c25643..17248bf7 100644
--- a/src/testcurl/https/test_https_get.c
+++ b/src/testcurl/https/test_https_get.c
@@ -39,9 +39,9 @@ extern const char srv_signed_key_pem[];
 
 /* perform a HTTP GET request via SSL/TLS */
 static int
-test_secure_get (FILE * test_fd,
-                const char *cipher_suite,
-                int proto_version)
+test_secure_get (FILE *test_fd,
+                 const char *cipher_suite,
+                 int proto_version)
 {
   int ret;
   struct MHD_Daemon *d;
@@ -52,26 +52,29 @@ test_secure_get (FILE * test_fd,
   else
     port = 3041;
 
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
-                        MHD_USE_ERROR_LOG, port,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                        | MHD_USE_ERROR_LOG, port,
                         NULL, NULL, &http_ahc, NULL,
                         MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem,
                         MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem,
                         MHD_OPTION_END);
 
   if (d == NULL)
-    {
-      fprintf (stderr, MHD_E_SERVER_INIT);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_SERVER_INIT);
+    return -1;
+  }
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return -1; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return -1;
     }
+    port = (int) dinfo->port;
+  }
 
   ret = test_https_transfer (test_fd, port, cipher_suite, proto_version);
 
@@ -85,7 +88,7 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
   const char *aes256_sha_tlsv1   = "AES256-SHA";
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
@@ -93,19 +96,19 @@ main (int argc, char *const *argv)
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
   if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
-
-  if (curl_uses_nss_ssl() == 0)
-    {
-      aes256_sha_tlsv1 = "rsa_aes_256_sha";
-    }
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
+
+  if (curl_uses_nss_ssl () == 0)
+  {
+    aes256_sha_tlsv1 = "rsa_aes_256_sha";
+  }
 
   errorCount +=
     test_secure_get (NULL, aes256_sha_tlsv1, CURL_SSLVERSION_TLSv1);
diff --git a/src/testcurl/https/test_https_get_parallel.c 
b/src/testcurl/https/test_https_get_parallel.c
index 27c23173..e4040874 100644
--- a/src/testcurl/https/test_https_get_parallel.c
+++ b/src/testcurl/https/test_https_get_parallel.c
@@ -36,10 +36,10 @@
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 4
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 4
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 4
 #endif
 
@@ -83,8 +83,8 @@ test_single_client (void *cls, int port, const char 
*cipher_suite,
 {
   void *client_thread_ret;
   struct https_test_data client_args =
-    { NULL, port, cipher_suite, curl_proto_version };
-  (void)cls;    /* Unused. Silent compiler warning. */
+  { NULL, port, cipher_suite, curl_proto_version };
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   client_thread_ret = https_transfer_thread_adapter (&client_args);
   if (client_thread_ret != NULL)
@@ -101,7 +101,7 @@ test_single_client (void *cls, int port, const char 
*cipher_suite,
  * TODO : make client_count a parameter - numver of curl client threads to 
spawn
  */
 static int
-test_parallel_clients (void * cls, int port, const char *cipher_suite,
+test_parallel_clients (void *cls, int port, const char *cipher_suite,
                        int curl_proto_version)
 {
   int i;
@@ -109,26 +109,26 @@ test_parallel_clients (void * cls, int port, const char 
*cipher_suite,
   void *client_thread_ret;
   pthread_t client_arr[client_count];
   struct https_test_data client_args =
-    { NULL, port, cipher_suite, curl_proto_version };
-  (void)cls;    /* Unused. Silent compiler warning. */
+  { NULL, port, cipher_suite, curl_proto_version };
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   for (i = 0; i < client_count; ++i)
+  {
+    if (pthread_create (&client_arr[i], NULL,
+                        &https_transfer_thread_adapter, &client_args) != 0)
     {
-      if (pthread_create (&client_arr[i], NULL,
-                          &https_transfer_thread_adapter, &client_args) != 0)
-        {
-          fprintf (stderr, "Error: failed to spawn test client threads.\n");
-          return -1;
-        }
+      fprintf (stderr, "Error: failed to spawn test client threads.\n");
+      return -1;
     }
+  }
 
   /* check all client requests fulfilled correctly */
   for (i = 0; i < client_count; ++i)
-    {
-      if ((pthread_join (client_arr[i], &client_thread_ret) != 0) ||
-          (client_thread_ret != NULL))
-        return -1;
-    }
+  {
+    if ((pthread_join (client_arr[i], &client_thread_ret) != 0) ||
+        (client_thread_ret != NULL))
+      return -1;
+  }
 
   return 0;
 }
@@ -136,11 +136,11 @@ test_parallel_clients (void * cls, int port, const char 
*cipher_suite,
 
 int
 main (int argc, char *const *argv)
-{  
+{
   unsigned int errorCount = 0;
   const char *aes256_sha = "AES256-SHA";
   int port;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -150,21 +150,23 @@ main (int argc, char *const *argv)
   /* initialize random seed used by curl clients */
   unsigned int iseed = (unsigned int) time (NULL);
   srand (iseed);
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
 
   if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      return 77;
-    }
-  if (curl_uses_nss_ssl() == 0)
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    return 77;
+  }
+  if (curl_uses_nss_ssl () == 0)
     aes256_sha = "rsa_aes_256_sha";
 #ifdef EPOLL_SUPPORT
   errorCount +=
-    test_wrap ("single threaded daemon, single client, epoll", 
&test_single_client,
+    test_wrap ("single threaded daemon, single client, epoll",
+               &test_single_client,
                NULL, port,
-               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | 
MHD_USE_ERROR_LOG | MHD_USE_EPOLL,
+               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+               | MHD_USE_ERROR_LOG | MHD_USE_EPOLL,
                aes256_sha, CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
                srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
                srv_self_signed_cert_pem, MHD_OPTION_END);
@@ -172,7 +174,8 @@ main (int argc, char *const *argv)
   errorCount +=
     test_wrap ("single threaded daemon, single client", &test_single_client,
                NULL, port,
-               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | 
MHD_USE_ERROR_LOG,
+               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+               | MHD_USE_ERROR_LOG,
                aes256_sha, CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
                srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
                srv_self_signed_cert_pem, MHD_OPTION_END);
@@ -180,7 +183,8 @@ main (int argc, char *const *argv)
   errorCount +=
     test_wrap ("single threaded daemon, parallel clients, epoll",
                &test_parallel_clients, NULL, port,
-               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | 
MHD_USE_ERROR_LOG | MHD_USE_EPOLL,
+               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+               | MHD_USE_ERROR_LOG | MHD_USE_EPOLL,
                aes256_sha, CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
                srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
                srv_self_signed_cert_pem, MHD_OPTION_END);
@@ -188,7 +192,8 @@ main (int argc, char *const *argv)
   errorCount +=
     test_wrap ("single threaded daemon, parallel clients",
                &test_parallel_clients, NULL, port,
-               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | 
MHD_USE_ERROR_LOG,
+               MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+               | MHD_USE_ERROR_LOG,
                aes256_sha, CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
                srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
                srv_self_signed_cert_pem, MHD_OPTION_END);
diff --git a/src/testcurl/https/test_https_get_parallel_threads.c 
b/src/testcurl/https/test_https_get_parallel_threads.c
index c9fc8ffc..8ca976c2 100644
--- a/src/testcurl/https/test_https_get_parallel_threads.c
+++ b/src/testcurl/https/test_https_get_parallel_threads.c
@@ -38,10 +38,10 @@
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 4
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 4
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 4
 #endif
 
@@ -83,8 +83,8 @@ test_single_client (void *cls, int port, const char 
*cipher_suite,
 {
   void *client_thread_ret;
   struct https_test_data client_args =
-    { NULL, port, cipher_suite, curl_proto_version };
-  (void)cls;    /* Unused. Silent compiler warning. */
+  { NULL, port, cipher_suite, curl_proto_version };
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   client_thread_ret = https_transfer_thread_adapter (&client_args);
   if (client_thread_ret != NULL)
@@ -109,27 +109,27 @@ test_parallel_clients (void *cls, int port, const char 
*cipher_suite,
   void *client_thread_ret;
   pthread_t client_arr[client_count];
   struct https_test_data client_args =
-    { NULL, port, cipher_suite, curl_proto_version };
-  (void)cls;    /* Unused. Silent compiler warning. */
+  { NULL, port, cipher_suite, curl_proto_version };
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   for (i = 0; i < client_count; ++i)
+  {
+    if (pthread_create (&client_arr[i], NULL,
+                        &https_transfer_thread_adapter, &client_args) != 0)
     {
-      if (pthread_create (&client_arr[i], NULL,
-                          &https_transfer_thread_adapter, &client_args) != 0)
-        {
-          fprintf (stderr, "Error: failed to spawn test client threads.\n");
+      fprintf (stderr, "Error: failed to spawn test client threads.\n");
 
-          return -1;
-        }
+      return -1;
     }
+  }
 
   /* check all client requests fulfilled correctly */
   for (i = 0; i < client_count; ++i)
-    {
-      if ((pthread_join (client_arr[i], &client_thread_ret) != 0) ||
-          (client_thread_ret != NULL))
-        return -1;
-    }
+  {
+    if ((pthread_join (client_arr[i], &client_thread_ret) != 0) ||
+        (client_thread_ret != NULL))
+      return -1;
+  }
 
   return 0;
 }
@@ -141,7 +141,7 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *ssl_version;
   int port;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -157,32 +157,33 @@ main (int argc, char *const *argv)
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
   srand (iseed);
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
   ssl_version = curl_version_info (CURLVERSION_NOW)->ssl_version;
   if (NULL == ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
   if (0 != strncmp (ssl_version, "GnuTLS", 6))
-    {
-      fprintf (stderr, "This test can be run only with libcurl-gnutls.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
+  {
+    fprintf (stderr, "This test can be run only with libcurl-gnutls.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
 
   char *aes256_sha = "AES256-SHA";
-  if (curl_uses_nss_ssl() == 0)
-    {
-      aes256_sha = "rsa_aes_256_sha";
-    }
+  if (curl_uses_nss_ssl () == 0)
+  {
+    aes256_sha = "rsa_aes_256_sha";
+  }
 
   errorCount +=
     test_wrap ("multi threaded daemon, single client", &test_single_client,
                NULL, port,
-               MHD_USE_TLS | MHD_USE_ERROR_LOG | MHD_USE_THREAD_PER_CONNECTION 
| MHD_USE_INTERNAL_POLLING_THREAD,
+               MHD_USE_TLS | MHD_USE_ERROR_LOG | MHD_USE_THREAD_PER_CONNECTION
+               | MHD_USE_INTERNAL_POLLING_THREAD,
                aes256_sha, CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
                srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
                srv_self_signed_cert_pem, MHD_OPTION_END);
@@ -190,7 +191,8 @@ main (int argc, char *const *argv)
   errorCount +=
     test_wrap ("multi threaded daemon, parallel client",
                &test_parallel_clients, NULL, port,
-               MHD_USE_TLS | MHD_USE_ERROR_LOG | MHD_USE_THREAD_PER_CONNECTION 
| MHD_USE_INTERNAL_POLLING_THREAD,
+               MHD_USE_TLS | MHD_USE_ERROR_LOG | MHD_USE_THREAD_PER_CONNECTION
+               | MHD_USE_INTERNAL_POLLING_THREAD,
                aes256_sha, CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
                srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
                srv_self_signed_cert_pem, MHD_OPTION_END);
diff --git a/src/testcurl/https/test_https_get_select.c 
b/src/testcurl/https/test_https_get_select.c
index 94b4a051..ce74c1d7 100644
--- a/src/testcurl/https/test_https_get_select.c
+++ b/src/testcurl/https/test_https_get_select.c
@@ -52,19 +52,19 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -111,24 +111,26 @@ testExternalGet (int flags)
                         port, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
                         MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
-                       MHD_OPTION_END);
+                        MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
-  if (curl_uses_nss_ssl() == 0)
+  if (curl_uses_nss_ssl () == 0)
     aes256_sha = "rsa_aes_256_sha";
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "https://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   /* TLS options */
@@ -151,90 +153,93 @@ testExternalGet (int flags)
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 != maxposixs)
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 != maxposixs)
-        {
-          if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-            {
+      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+      {
 #ifdef MHD_POSIX_SOCKETS
-              if (EINTR != errno)
-                abort ();
+        if (EINTR != errno)
+          abort ();
 #else
-              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-                abort ();
-              Sleep (1000);
+        if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                      ws.
+                                                                      fd_count)
+            ||(0 != es.fd_count) )
+          abort ();
+        Sleep (1000);
 #endif
-            }
-        }
-      else
-        (void)sleep (1);
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
+      }
     }
-  if (multi != NULL)
+    else
+      (void) sleep (1);
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -248,17 +253,17 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   oneone = 0;
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
   if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
 
 #ifdef EPOLL_SUPPORT
   errorCount += testExternalGet (MHD_USE_EPOLL);
diff --git a/src/testcurl/https/test_https_multi_daemon.c 
b/src/testcurl/https/test_https_multi_daemon.c
index 130fa9df..de153ff6 100644
--- a/src/testcurl/https/test_https_multi_daemon.c
+++ b/src/testcurl/https/test_https_multi_daemon.c
@@ -43,70 +43,74 @@ extern const char srv_self_signed_cert_pem[];
  */
 static int
 test_concurent_daemon_pair (void *cls,
-                           const char *cipher_suite,
+                            const char *cipher_suite,
                             int proto_version)
 {
   int ret;
   struct MHD_Daemon *d1;
   struct MHD_Daemon *d2;
   int port1, port2;
-  (void)cls;    /* Unused. Silent compiler warning. */
+  (void) cls;    /* Unused. Silent compiler warning. */
 
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port1 = port2 = 0;
   else
-    {
-      port1 = 3050;
-      port2 = 3051;
-    }
-
-  d1 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
-                         MHD_USE_ERROR_LOG, port1,
+  {
+    port1 = 3050;
+    port2 = 3051;
+  }
+
+  d1 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                         | MHD_USE_ERROR_LOG, port1,
                          NULL, NULL, &http_ahc, NULL,
                          MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
                          MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
                          MHD_OPTION_END);
 
   if (d1 == NULL)
-    {
-      fprintf (stderr, MHD_E_SERVER_INIT);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_SERVER_INIT);
+    return -1;
+  }
   if (0 == port1)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d1, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d1, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d1); return -1; }
-      port1 = (int)dinfo->port;
+      MHD_stop_daemon (d1); return -1;
     }
+    port1 = (int) dinfo->port;
+  }
 
-  d2 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
-                         MHD_USE_ERROR_LOG, port2,
+  d2 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                         | MHD_USE_ERROR_LOG, port2,
                          NULL, NULL, &http_ahc, NULL,
                          MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
                          MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
                          MHD_OPTION_END);
 
   if (d2 == NULL)
+  {
+    MHD_stop_daemon (d1);
+    fprintf (stderr, MHD_E_SERVER_INIT);
+    return -1;
+  }
+  if (0 == port2)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d2, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
       MHD_stop_daemon (d1);
-      fprintf (stderr, MHD_E_SERVER_INIT);
+      MHD_stop_daemon (d2);
       return -1;
     }
-  if (0 == port2)
-    {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d2, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        {
-          MHD_stop_daemon (d1);
-          MHD_stop_daemon (d2);
-          return -1;
-        }
-      port2 = (int)dinfo->port;
-    }
+    port2 = (int) dinfo->port;
+  }
 
   ret =
     test_daemon_get (NULL, cipher_suite, proto_version, port1, 0);
@@ -128,7 +132,7 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   FILE *cert;
   const char *aes256_sha = "AES256-SHA";
-  (void)argc; (void)argv;       /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv;       /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
@@ -136,25 +140,25 @@ main (int argc, char *const *argv)
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
   if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
   if ((cert = setup_ca_cert ()) == NULL)
-    {
-      fprintf (stderr, MHD_E_TEST_FILE_CREAT);
-      curl_global_cleanup ();
-      return 99;
-    }
+  {
+    fprintf (stderr, MHD_E_TEST_FILE_CREAT);
+    curl_global_cleanup ();
+    return 99;
+  }
 
-  if (curl_uses_nss_ssl() == 0)
-    {
-      aes256_sha = "rsa_aes_256_sha";
-    }
+  if (curl_uses_nss_ssl () == 0)
+  {
+    aes256_sha = "rsa_aes_256_sha";
+  }
 
   errorCount +=
     test_concurent_daemon_pair (NULL, aes256_sha, CURL_SSLVERSION_TLSv1);
@@ -165,7 +169,7 @@ main (int argc, char *const *argv)
   fclose (cert);
   if (0 != remove (ca_cert_file_name))
     fprintf (stderr,
-            "Failed to remove `%s'\n",
-            ca_cert_file_name);
+             "Failed to remove `%s'\n",
+             ca_cert_file_name);
   return errorCount != 0 ? 1 : 0;
 }
diff --git a/src/testcurl/https/test_https_session_info.c 
b/src/testcurl/https/test_https_session_info.c
index 45f13981..b692af15 100644
--- a/src/testcurl/https/test_https_session_info.c
+++ b/src/testcurl/https/test_https_session_info.c
@@ -49,41 +49,41 @@ query_session_ahc (void *cls, struct MHD_Connection 
*connection,
 {
   struct MHD_Response *response;
   int ret;
-  (void)cls;(void)url;(void)method;(void)version;       /* Unused. Silent 
compiler warning. */
-  (void)upload_data;(void)upload_data_size;             /* Unused. Silent 
compiler warning. */
+  (void) cls; (void) url; (void) method; (void) version;       /* Unused. 
Silent compiler warning. */
+  (void) upload_data; (void) upload_data_size;             /* Unused. Silent 
compiler warning. */
 
   if (NULL == *ptr)
-    {
-      *ptr = (void*)&query_session_ahc;
-      return MHD_YES;
-    }
+  {
+    *ptr = (void*) &query_session_ahc;
+    return MHD_YES;
+  }
 
   if (GNUTLS_TLS1_1 !=
       (ret = MHD_get_connection_info
-       (connection,
-       MHD_CONNECTION_INFO_PROTOCOL)->protocol))
+               (connection,
+               MHD_CONNECTION_INFO_PROTOCOL)->protocol))
+  {
+    if (GNUTLS_TLS1_2 == ret)
+    {
+      /* as usual, TLS implementations sometimes don't
+         quite do what was asked, just mildly complain... */
+      fprintf (stderr,
+               "Warning: requested TLS 1.1, got TLS 1.2\n");
+    }
+    else
     {
-      if (GNUTLS_TLS1_2 == ret)
-      {
-        /* as usual, TLS implementations sometimes don't
-           quite do what was asked, just mildly complain... */
-        fprintf (stderr,
-                 "Warning: requested TLS 1.1, got TLS 1.2\n");
-      }
-      else
-      {
-        /* really different version... */
-        fprintf (stderr,
-                 "Error: requested protocol mismatch (wanted %d, got %d)\n",
-                 GNUTLS_TLS1_1,
-                 ret);
-        return -1;
-      }
+      /* really different version... */
+      fprintf (stderr,
+               "Error: requested protocol mismatch (wanted %d, got %d)\n",
+               GNUTLS_TLS1_1,
+               ret);
+      return -1;
     }
+  }
 
   response = MHD_create_response_from_buffer (strlen (EMPTY_PAGE),
-                                             (void *) EMPTY_PAGE,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) EMPTY_PAGE,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -114,37 +114,38 @@ test_query_session ()
   cbc.pos = 0;
 
   /* setup test */
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
-                        MHD_USE_ERROR_LOG, port,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                        | MHD_USE_ERROR_LOG, port,
                         NULL, NULL, &query_session_ahc, NULL,
-                       MHD_OPTION_HTTPS_PRIORITIES, "NORMAL:+ARCFOUR-128",
+                        MHD_OPTION_HTTPS_PRIORITIES, "NORMAL:+ARCFOUR-128",
                         MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
                         MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
                         MHD_OPTION_END);
 
   if (d == NULL)
-    {
-      free (cbc.buf);
-      return 2;
-    }
+  {
+    free (cbc.buf);
+    return 2;
+  }
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        {
-          MHD_stop_daemon (d);
-          free (cbc.buf);
-          return 32;
-        }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d);
+      free (cbc.buf);
+      return 32;
     }
+    port = (int) dinfo->port;
+  }
 
   const char *aes256_sha = "AES256-SHA";
-  if (curl_uses_nss_ssl() == 0)
-    {
-      aes256_sha = "rsa_aes_256_sha";
-    }
+  if (curl_uses_nss_ssl () == 0)
+  {
+    aes256_sha = "rsa_aes_256_sha";
+  }
 
   gen_test_file_url (url,
                      sizeof (url),
@@ -172,15 +173,15 @@ test_query_session ()
    * crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr, "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
+  {
+    fprintf (stderr, "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
 
-      MHD_stop_daemon (d);
-      curl_easy_cleanup (c);
-      free (cbc.buf);
-      return -1;
-    }
+    MHD_stop_daemon (d);
+    curl_easy_cleanup (c);
+    free (cbc.buf);
+    return -1;
+  }
 
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
@@ -195,7 +196,7 @@ main (int argc, char *const *argv)
 #if LIBCURL_VERSION_NUM >= 0x072200
   unsigned int errorCount = 0;
   const char *ssl_version;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
@@ -203,7 +204,7 @@ main (int argc, char *const *argv)
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
 
   ssl_version = curl_version_info (CURLVERSION_NOW)->ssl_version;
diff --git a/src/testcurl/https/test_https_sni.c 
b/src/testcurl/https/test_https_sni.c
index 8af1472b..16576656 100644
--- a/src/testcurl/https/test_https_sni.c
+++ b/src/testcurl/https/test_https_sni.c
@@ -60,9 +60,9 @@ static struct Hosts *hosts;
  * (This code is largely taken from GnuTLS).
  */
 static void
-load_keys(const char *hostname,
-          const char *CERT_FILE,
-          const char *KEY_FILE)
+load_keys (const char *hostname,
+           const char *CERT_FILE,
+           const char *KEY_FILE)
 {
   int ret;
   gnutls_datum_t data;
@@ -77,32 +77,32 @@ load_keys(const char *hostname,
 
   ret = gnutls_load_file (CERT_FILE, &data);
   if (ret < 0)
-    {
-      fprintf (stderr,
-               "*** Error loading certificate file %s.\n",
-               CERT_FILE);
-      exit (1);
-    }
+  {
+    fprintf (stderr,
+             "*** Error loading certificate file %s.\n",
+             CERT_FILE);
+    exit (1);
+  }
   ret =
     gnutls_pcert_import_x509_raw (&host->pcrt, &data, GNUTLS_X509_FMT_PEM,
                                   0);
   if (ret < 0)
-    {
-      fprintf (stderr,
-               "*** Error loading certificate file: %s\n",
-               gnutls_strerror (ret));
-      exit (1);
-    }
+  {
+    fprintf (stderr,
+             "*** Error loading certificate file: %s\n",
+             gnutls_strerror (ret));
+    exit (1);
+  }
   gnutls_free (data.data);
 
   ret = gnutls_load_file (KEY_FILE, &data);
   if (ret < 0)
-    {
-      fprintf (stderr,
-               "*** Error loading key file %s.\n",
-               KEY_FILE);
-      exit (1);
-    }
+  {
+    fprintf (stderr,
+             "*** Error loading key file %s.\n",
+             KEY_FILE);
+    exit (1);
+  }
 
   gnutls_privkey_init (&host->key);
   ret =
@@ -110,12 +110,12 @@ load_keys(const char *hostname,
                                     &data, GNUTLS_X509_FMT_PEM,
                                     NULL, 0);
   if (ret < 0)
-    {
-      fprintf (stderr,
-               "*** Error loading key file: %s\n",
-               gnutls_strerror (ret));
-      exit (1);
-    }
+  {
+    fprintf (stderr,
+             "*** Error loading key file: %s\n",
+             gnutls_strerror (ret));
+    exit (1);
+  }
   gnutls_free (data.data);
 }
 
@@ -133,19 +133,19 @@ load_keys(const char *hostname,
  */
 static int
 sni_callback (gnutls_session_t session,
-              const gnutls_datum_t* req_ca_dn,
+              const gnutls_datum_t*req_ca_dn,
               int nreqs,
-              const gnutls_pk_algorithm_t* pk_algos,
+              const gnutls_pk_algorithm_t*pk_algos,
               int pk_algos_length,
-              gnutls_pcert_st** pcert,
+              gnutls_pcert_st**pcert,
               unsigned int *pcert_length,
-              gnutls_privkey_t * pkey)
+              gnutls_privkey_t *pkey)
 {
   char name[256];
   size_t name_len;
   struct Hosts *host;
   unsigned int type;
-  (void)req_ca_dn;(void)nreqs;(void)pk_algos;(void)pk_algos_length;   /* 
Unused. Silent compiler warning. */
+  (void) req_ca_dn; (void) nreqs; (void) pk_algos; (void) pk_algos_length;   
/* Unused. Silent compiler warning. */
 
   name_len = sizeof (name);
   if (GNUTLS_E_SUCCESS !=
@@ -159,13 +159,13 @@ sni_callback (gnutls_session_t session,
     if (0 == strncmp (name, host->hostname, name_len))
       break;
   if (NULL == host)
-    {
-      fprintf (stderr,
-               "Need certificate for %.*s\n",
-               (int) name_len,
-               name);
-      return -1;
-    }
+  {
+    fprintf (stderr,
+             "Need certificate for %.*s\n",
+             (int) name_len,
+             name);
+    return -1;
+  }
 #if 0
   fprintf (stderr,
            "Returning certificate for %.*s\n",
@@ -192,10 +192,10 @@ do_get (const char *url, int port)
 
   len = strlen (test_data);
   if (NULL == (cbc.buf = malloc (sizeof (char) * len)))
-    {
-      fprintf (stderr, MHD_E_MEM);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_MEM);
+    return -1;
+  }
   cbc.size = len;
   cbc.pos = 0;
 
@@ -204,7 +204,7 @@ do_get (const char *url, int port)
   curl_easy_setopt (c, CURLOPT_VERBOSE, 1L);
 #endif
   curl_easy_setopt (c, CURLOPT_URL, url);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
   curl_easy_setopt (c, CURLOPT_TIMEOUT, 10L);
   curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 10L);
@@ -215,9 +215,9 @@ do_get (const char *url, int port)
   /* TODO merge into send_curl_req */
   curl_easy_setopt (c, CURLOPT_SSL_VERIFYPEER, 0L);
   curl_easy_setopt (c, CURLOPT_SSL_VERIFYHOST, 2L);
-  sprintf(buf, "host1:%d:127.0.0.1", port);
+  sprintf (buf, "host1:%d:127.0.0.1", port);
   dns_info = curl_slist_append (NULL, buf);
-  sprintf(buf, "host2:%d:127.0.0.1", port);
+  sprintf (buf, "host2:%d:127.0.0.1", port);
   dns_info = curl_slist_append (dns_info, buf);
   curl_easy_setopt (c, CURLOPT_RESOLVE, dns_info);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -227,23 +227,23 @@ do_get (const char *url, int port)
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr, "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      free (cbc.buf);
-      curl_slist_free_all (dns_info);
-      return errornum;
-    }
+  {
+    fprintf (stderr, "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    free (cbc.buf);
+    curl_slist_free_all (dns_info);
+    return errornum;
+  }
 
   curl_easy_cleanup (c);
   curl_slist_free_all (dns_info);
   if (memcmp (cbc.buf, test_data, len) != 0)
-    {
-      fprintf (stderr, "Error: local file & received file differ.\n");
-      free (cbc.buf);
-      return -1;
-    }
+  {
+    fprintf (stderr, "Error: local file & received file differ.\n");
+    free (cbc.buf);
+    return -1;
+  }
 
   free (cbc.buf);
   return 0;
@@ -256,7 +256,7 @@ main (int argc, char *const *argv)
   unsigned int error_count = 0;
   struct MHD_Daemon *d;
   int port;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -269,36 +269,40 @@ main (int argc, char *const *argv)
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
   if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
 
   load_keys ("host1", ABS_SRCDIR "/host1.crt", ABS_SRCDIR "/host1.key");
   load_keys ("host2", ABS_SRCDIR "/host2.crt", ABS_SRCDIR "/host2.key");
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                        | MHD_USE_ERROR_LOG,
                         port,
                         NULL, NULL,
                         &http_ahc, NULL,
                         MHD_OPTION_HTTPS_CERT_CALLBACK, &sni_callback,
                         MHD_OPTION_END);
   if (d == NULL)
-    {
-      fprintf (stderr, MHD_E_SERVER_INIT);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_SERVER_INIT);
+    return -1;
+  }
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return -1; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return -1;
     }
+    port = (int) dinfo->port;
+  }
   if (0 != do_get ("https://host1/";, port))
     error_count++;
   if (0 != do_get ("https://host2/";, port))
diff --git a/src/testcurl/https/test_https_time_out.c 
b/src/testcurl/https/test_https_time_out.c
index e46923eb..d2f4d92c 100644
--- a/src/testcurl/https/test_https_time_out.c
+++ b/src/testcurl/https/test_https_time_out.c
@@ -55,10 +55,10 @@ test_tls_session_time_out (gnutls_session_t session, int 
port)
 
   sd = socket (AF_INET, SOCK_STREAM, 0);
   if (sd == MHD_INVALID_SOCKET)
-    {
-      fprintf (stderr, "Failed to create socket: %s\n", strerror (errno));
-      return -1;
-    }
+  {
+    fprintf (stderr, "Failed to create socket: %s\n", strerror (errno));
+    return -1;
+  }
 
   memset (&sa, '\0', sizeof (struct sockaddr_in));
   sa.sin_family = AF_INET;
@@ -70,30 +70,30 @@ test_tls_session_time_out (gnutls_session_t session, int 
port)
   ret = connect (sd, (struct sockaddr *) &sa, sizeof (struct sockaddr_in));
 
   if (ret < 0)
-    {
-      fprintf (stderr, "Error: %s\n", MHD_E_FAILED_TO_CONNECT);
-      MHD_socket_close_chk_ (sd);
-      return -1;
-    }
+  {
+    fprintf (stderr, "Error: %s\n", MHD_E_FAILED_TO_CONNECT);
+    MHD_socket_close_chk_ (sd);
+    return -1;
+  }
 
   ret = gnutls_handshake (session);
   if (ret < 0)
-    {
-      fprintf (stderr, "Handshake failed\n");
-      MHD_socket_close_chk_ (sd);
-      return -1;
-    }
+  {
+    fprintf (stderr, "Handshake failed\n");
+    MHD_socket_close_chk_ (sd);
+    return -1;
+  }
 
-  (void)sleep (TIME_OUT + 1);
+  (void) sleep (TIME_OUT + 1);
 
   /* check that server has closed the connection */
   /* TODO better RST trigger */
   if (send (sd, "", 1, 0) == 0)
-    {
-      fprintf (stderr, "Connection failed to time-out\n");
-      MHD_socket_close_chk_ (sd);
-      return -1;
-    }
+  {
+    fprintf (stderr, "Connection failed to time-out\n");
+    MHD_socket_close_chk_ (sd);
+    return -1;
+  }
 
   MHD_socket_close_chk_ (sd);
   return 0;
@@ -110,7 +110,7 @@ main (int argc, char *const *argv)
   gnutls_datum_t cert;
   gnutls_certificate_credentials_t xcred;
   int port;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -126,8 +126,9 @@ main (int argc, char *const *argv)
   gnutls_global_init ();
   gnutls_global_set_log_level (11);
 
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
-                        MHD_USE_ERROR_LOG, port,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                        | MHD_USE_ERROR_LOG, port,
                         NULL, NULL, &http_dummy_ahc, NULL,
                         MHD_OPTION_CONNECTION_TIMEOUT, TIME_OUT,
                         MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
@@ -135,24 +136,26 @@ main (int argc, char *const *argv)
                         MHD_OPTION_END);
 
   if (NULL == d)
-    {
-      fprintf (stderr, MHD_E_SERVER_INIT);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_SERVER_INIT);
+    return -1;
+  }
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return -1; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return -1;
     }
+    port = (int) dinfo->port;
+  }
 
   if (0 != setup_session (&session, &key, &cert, &xcred))
-    {
-      fprintf (stderr, "failed to setup session\n");
-      return 1;
-    }
+  {
+    fprintf (stderr, "failed to setup session\n");
+    return 1;
+  }
   errorCount += test_tls_session_time_out (session, port);
   teardown_session (session, &key, &cert, xcred);
 
diff --git a/src/testcurl/https/test_tls_authentication.c 
b/src/testcurl/https/test_tls_authentication.c
index 2ed8f14c..51fb5331 100644
--- a/src/testcurl/https/test_tls_authentication.c
+++ b/src/testcurl/https/test_tls_authentication.c
@@ -41,38 +41,41 @@ extern const char srv_signed_key_pem[];
 
 /* perform a HTTP GET request via SSL/TLS */
 static int
-test_secure_get (void * cls, char *cipher_suite, int proto_version)
+test_secure_get (void *cls, char *cipher_suite, int proto_version)
 {
   int ret;
   struct MHD_Daemon *d;
   int port;
-  (void)cls;    /* Unused. Silent compiler warning. */
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
     port = 3070;
 
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
-                        MHD_USE_ERROR_LOG, port,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                        | MHD_USE_ERROR_LOG, port,
                         NULL, NULL, &http_ahc, NULL,
                         MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem,
                         MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem,
                         MHD_OPTION_END);
 
   if (d == NULL)
-    {
-      fprintf (stderr, MHD_E_SERVER_INIT);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_SERVER_INIT);
+    return -1;
+  }
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return -1; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return -1;
     }
+    port = (int) dinfo->port;
+  }
 
   ret = test_daemon_get (NULL, cipher_suite, proto_version, port, 0);
 
@@ -87,8 +90,8 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   char *aes256_sha = "AES256-SHA";
   FILE *crt;
-  (void)argc;
-  (void)argv;       /* Unused. Silent compiler warning. */
+  (void) argc;
+  (void) argv;       /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
@@ -96,26 +99,26 @@ main (int argc, char *const *argv)
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
   if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
-    {
-      fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
-      curl_global_cleanup ();
-      return 77;
-    }
+  {
+    fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+    curl_global_cleanup ();
+    return 77;
+  }
 
   if (NULL == (crt = setup_ca_cert ()))
-    {
-      fprintf (stderr, MHD_E_TEST_FILE_CREAT);
-      curl_global_cleanup ();
-      return 99;
-    }
+  {
+    fprintf (stderr, MHD_E_TEST_FILE_CREAT);
+    curl_global_cleanup ();
+    return 99;
+  }
   fclose (crt);
-  if (curl_uses_nss_ssl() == 0)
-    {
-      aes256_sha = "rsa_aes_256_sha";
-    }
+  if (curl_uses_nss_ssl () == 0)
+  {
+    aes256_sha = "rsa_aes_256_sha";
+  }
 
   errorCount +=
     test_secure_get (NULL, aes256_sha, CURL_SSLVERSION_TLSv1);
@@ -125,7 +128,7 @@ main (int argc, char *const *argv)
   curl_global_cleanup ();
   if (0 != remove (ca_cert_file_name))
     fprintf (stderr,
-            "Failed to remove `%s'\n",
-            ca_cert_file_name);
+             "Failed to remove `%s'\n",
+             ca_cert_file_name);
   return errorCount != 0 ? 1 : 0;
 }
diff --git a/src/testcurl/https/test_tls_extensions.c 
b/src/testcurl/https/test_tls_extensions.c
index 08cde939..f5095359 100644
--- a/src/testcurl/https/test_tls_extensions.c
+++ b/src/testcurl/https/test_tls_extensions.c
@@ -69,20 +69,20 @@ test_hello_extension (gnutls_session_t session, int port, 
extensions_t exten_t,
   sd = -1;
   memset (&cbc, 0, sizeof (struct CBC));
   if (NULL == (cbc.buf = malloc (sizeof (char) * 256)))
-    {
-      fprintf (stderr, MHD_E_MEM);
-      ret = -1;
-      goto cleanup;
-    }
+  {
+    fprintf (stderr, MHD_E_MEM);
+    ret = -1;
+    goto cleanup;
+  }
   cbc.size = 256;
 
   sd = socket (AF_INET, SOCK_STREAM, 0);
   if (sd == -1)
-    {
-      fprintf(stderr, "Failed to create socket: %s\n", strerror(errno));
-      free (cbc.buf);
-      return -1;
-    }
+  {
+    fprintf (stderr, "Failed to create socket: %s\n", strerror (errno));
+    free (cbc.buf);
+    return -1;
+  }
   memset (&sa, '\0', sizeof (struct sockaddr_in));
   sa.sin_family = AF_INET;
   sa.sin_port = htons (port);
@@ -101,10 +101,10 @@ test_hello_extension (gnutls_session_t session, int port, 
extensions_t exten_t,
 
   data = MHD_gnutls_malloc (datalen);
   if (data == NULL)
-      {
-        free (cbc.buf);
-        return -1;
-      }
+  {
+    free (cbc.buf);
+    return -1;
+  }
   hver = MHD_gtls_version_max (session);
   data[pos++] = MHD_gtls_version_get_major (hver);
   data[pos++] = MHD_gtls_version_get_minor (hver);
@@ -119,7 +119,8 @@ test_hello_extension (gnutls_session_t session, int port, 
extensions_t exten_t,
   /* generate session client random */
   memset (session->security_parameters.client_random, 0, TLS_RANDOM_SIZE);
   gnutls_write_uint32 (time (NULL), rnd);
-  if (GC_OK != MHD_gc_nonce ((char *) &rnd[4], TLS_RANDOM_SIZE - 4)) abort ();
+  if (GC_OK != MHD_gc_nonce ((char *) &rnd[4], TLS_RANDOM_SIZE - 4))
+    abort ();
   memcpy (session->security_parameters.client_random, rnd, TLS_RANDOM_SIZE);
   memcpy (&data[pos], rnd, TLS_RANDOM_SIZE);
   pos += TLS_RANDOM_SIZE;
@@ -148,37 +149,37 @@ test_hello_extension (gnutls_session_t session, int port, 
extensions_t exten_t,
   gnutls_write_uint16 (exten_data_len, &data[pos]);
   pos += 2;
   for (i = 0; i < ext_count; ++i)
-    {
-      /* write extension type */
-      gnutls_write_uint16 (exten_t, &data[pos]);
-      pos += 2;
-      gnutls_write_uint16 (ext_length, &data[pos]);
-      pos += 2;
-      /* we might want to generate random data here */
-      memset (&data[pos], 0, ext_length);
-      pos += ext_length;
-    }
+  {
+    /* write extension type */
+    gnutls_write_uint16 (exten_t, &data[pos]);
+    pos += 2;
+    gnutls_write_uint16 (ext_length, &data[pos]);
+    pos += 2;
+    /* we might want to generate random data here */
+    memset (&data[pos], 0, ext_length);
+    pos += ext_length;
+  }
 
   if (connect (sd, &sa, sizeof (struct sockaddr_in)) < 0)
-    {
-      fprintf (stderr, "%s\n", MHD_E_FAILED_TO_CONNECT);
-      ret = -1;
-      goto cleanup;
-    }
+  {
+    fprintf (stderr, "%s\n", MHD_E_FAILED_TO_CONNECT);
+    ret = -1;
+    goto cleanup;
+  }
 
   gnutls_transport_set_ptr (session, (MHD_gnutls_transport_ptr_t) (long) sd);
 
   if (gen_test_file_url (url,
                          sizeof (url),
                          port))
-    {
-      ret = -1;
-      goto cleanup;
-    }
+  {
+    ret = -1;
+    goto cleanup;
+  }
 
   /* this should crash the server */
   ret = gnutls_send_handshake (session, data, datalen,
-                              GNUTLS_HANDSHAKE_CLIENT_HELLO);
+                               GNUTLS_HANDSHAKE_CLIENT_HELLO);
 
   /* advance to STATE2 */
   session->internals.handshake_state = STATE2;
@@ -190,10 +191,10 @@ test_hello_extension (gnutls_session_t session, int port, 
extensions_t exten_t,
   /* make sure daemon is still functioning */
   if (CURLE_OK != send_curl_req (url, &cbc, "AES128-SHA",
                                  MHD_GNUTLS_PROTOCOL_TLS1_2))
-    {
-      ret = -1;
-      goto cleanup;
-    }
+  {
+    ret = -1;
+    goto cleanup;
+  }
 
 cleanup:
   if (-1 != sd)
@@ -233,34 +234,37 @@ main (int argc, char *const *argv)
   MHD_gtls_global_set_log_level (11);
 
   if ((test_fd = setup_test_file ()) == NULL)
-    {
-      fprintf (stderr, MHD_E_TEST_FILE_CREAT);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_TEST_FILE_CREAT);
+    return -1;
+  }
 
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
 
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
-                        MHD_USE_ERROR_LOG, port,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
+                        | MHD_USE_ERROR_LOG, port,
                         NULL, NULL, &http_ahc, NULL,
                         MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
                         MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
                         MHD_OPTION_END);
 
   if (d == NULL)
-    {
-      fprintf (stderr, "%s\n", MHD_E_SERVER_INIT);
-      return -1;
-    }
+  {
+    fprintf (stderr, "%s\n", MHD_E_SERVER_INIT);
+    return -1;
+  }
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return -1; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return -1;
     }
+    port = (int) dinfo->port;
+  }
 
   i = 0;
   setup_session (&session, &key, &cert, &xcred);
@@ -269,21 +273,21 @@ main (int argc, char *const *argv)
 #if 1
   i = 0;
   while (ext_arr[i] != -1)
-    {
-      setup_session (&session, &key, &cert, &xcred);
-      errorCount += test_hello_extension (session, port, ext_arr[i], 1, 16);
-      teardown_session (session, &key, &cert, xcred);
-
-      setup_session (&session, &key, &cert, &xcred);
-      errorCount += test_hello_extension (session, port, ext_arr[i], 3, 8);
-      teardown_session (session, &key, &cert, xcred);
-
-      /* this test specifically tests the issue raised in CVE-2008-1948 */
-      setup_session (&session, &key, &cert, &xcred);
-      errorCount += test_hello_extension (session, port, ext_arr[i], 6, 0);
-      teardown_session (session, &key, &cert, xcred);
-      i++;
-    }
+  {
+    setup_session (&session, &key, &cert, &xcred);
+    errorCount += test_hello_extension (session, port, ext_arr[i], 1, 16);
+    teardown_session (session, &key, &cert, xcred);
+
+    setup_session (&session, &key, &cert, &xcred);
+    errorCount += test_hello_extension (session, port, ext_arr[i], 3, 8);
+    teardown_session (session, &key, &cert, xcred);
+
+    /* this test specifically tests the issue raised in CVE-2008-1948 */
+    setup_session (&session, &key, &cert, &xcred);
+    errorCount += test_hello_extension (session, port, ext_arr[i], 6, 0);
+    teardown_session (session, &key, &cert, xcred);
+    i++;
+  }
 #endif
 
   print_test_result (errorCount, argv[0]);
diff --git a/src/testcurl/https/test_tls_options.c 
b/src/testcurl/https/test_tls_options.c
index 703ae92a..f94834b5 100644
--- a/src/testcurl/https/test_tls_options.c
+++ b/src/testcurl/https/test_tls_options.c
@@ -43,17 +43,17 @@ int curl_check_version (const char *req_version, ...);
  *
  */
 static int
-test_unmatching_ssl_version (void * cls, int port, const char *cipher_suite,
+test_unmatching_ssl_version (void *cls, int port, const char *cipher_suite,
                              int curl_req_ssl_version)
 {
   struct CBC cbc;
-  (void)cls;    /* Unused. Silent compiler warning. */
+  (void) cls;    /* Unused. Silent compiler warning. */
   if (NULL == (cbc.buf = malloc (sizeof (char) * 256)))
-    {
-      fprintf (stderr, "Error: failed to allocate: %s\n",
-               strerror (errno));
-      return -1;
-    }
+  {
+    fprintf (stderr, "Error: failed to allocate: %s\n",
+             strerror (errno));
+    return -1;
+  }
   cbc.size = 256;
   cbc.pos = 0;
 
@@ -61,21 +61,22 @@ test_unmatching_ssl_version (void * cls, int port, const 
char *cipher_suite,
   if (gen_test_file_url (url,
                          sizeof (url),
                          port))
-    {
-      free (cbc.buf);
-      fprintf (stderr,
-               "Internal error in gen_test_file_url\n");
-      return -1;
-    }
+  {
+    free (cbc.buf);
+    fprintf (stderr,
+             "Internal error in gen_test_file_url\n");
+    return -1;
+  }
 
   /* assert daemon *rejected* request */
   if (CURLE_OK ==
       send_curl_req (url, &cbc, cipher_suite, curl_req_ssl_version))
-    {
-      free (cbc.buf);
-      fprintf (stderr, "cURL failed to reject request despite SSL version 
mismatch!\n");
-      return -1;
-    }
+  {
+    free (cbc.buf);
+    fprintf (stderr,
+             "cURL failed to reject request despite SSL version mismatch!\n");
+    return -1;
+  }
 
   free (cbc.buf);
   return 0;
@@ -89,9 +90,10 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *ssl_version;
   int daemon_flags =
-    MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_TLS | MHD_USE_ERROR_LOG;
+    MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD
+    | MHD_USE_TLS | MHD_USE_ERROR_LOG;
   int port;
-  (void)argc; (void)argv;       /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv;       /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -105,10 +107,10 @@ main (int argc, char *const *argv)
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
- if (curl_check_version (MHD_REQ_CURL_VERSION))
-    {
-      return 77;
-    }
+  if (curl_check_version (MHD_REQ_CURL_VERSION))
+  {
+    return 77;
+  }
   ssl_version = curl_version_info (CURLVERSION_NOW)->ssl_version;
   if (NULL == ssl_version)
   {
@@ -121,46 +123,48 @@ main (int argc, char *const *argv)
     return 77;
   }
 
-  if (!testsuite_curl_global_init ())
+  if (! testsuite_curl_global_init ())
     return 99;
 
   const char *aes128_sha = "AES128-SHA";
   const char *aes256_sha = "AES256-SHA";
-  if (curl_uses_nss_ssl() == 0)
-    {
-      aes128_sha = "rsa_aes_128_sha";
-      aes256_sha = "rsa_aes_256_sha";
-    }
+  if (curl_uses_nss_ssl () == 0)
+  {
+    aes128_sha = "rsa_aes_128_sha";
+    aes256_sha = "rsa_aes_256_sha";
+  }
 
 
   if (0 !=
-    test_wrap ("TLS1.0-AES-SHA1",
-              &test_https_transfer, NULL, port, daemon_flags,
-              aes128_sha,
-              CURL_SSLVERSION_TLSv1,
-              MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
-              MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
-              MHD_OPTION_HTTPS_PRIORITIES, 
"NONE:+VERS-TLS1.0:+AES-128-CBC:+SHA1:+RSA:+COMP-NULL",
-              MHD_OPTION_END))
-    {
-      fprintf (stderr, "TLS1.0-AES-SHA1 test failed\n");
-      errorCount++;
-    }
+      test_wrap ("TLS1.0-AES-SHA1",
+                 &test_https_transfer, NULL, port, daemon_flags,
+                 aes128_sha,
+                 CURL_SSLVERSION_TLSv1,
+                 MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
+                 MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
+                 MHD_OPTION_HTTPS_PRIORITIES,
+                 "NONE:+VERS-TLS1.0:+AES-128-CBC:+SHA1:+RSA:+COMP-NULL",
+                 MHD_OPTION_END))
+  {
+    fprintf (stderr, "TLS1.0-AES-SHA1 test failed\n");
+    errorCount++;
+  }
   fprintf (stderr,
-          "The following handshake should fail (and print an error 
message)...\n");
+           "The following handshake should fail (and print an error 
message)...\n");
   if (0 !=
-    test_wrap ("TLS1.0 vs SSL3",
-              &test_unmatching_ssl_version, NULL, port, daemon_flags,
-              aes256_sha,
-              CURL_SSLVERSION_SSLv3,
-              MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
-              MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
-              MHD_OPTION_HTTPS_PRIORITIES, 
"NONE:+VERS-TLS1.0:+AES-256-CBC:+SHA1:+RSA:+COMP-NULL",
-              MHD_OPTION_END))
-    {
-      fprintf (stderr, "TLS1.0 vs SSL3 test failed\n");
-      errorCount++;
-    }
+      test_wrap ("TLS1.0 vs SSL3",
+                 &test_unmatching_ssl_version, NULL, port, daemon_flags,
+                 aes256_sha,
+                 CURL_SSLVERSION_SSLv3,
+                 MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
+                 MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
+                 MHD_OPTION_HTTPS_PRIORITIES,
+                 "NONE:+VERS-TLS1.0:+AES-256-CBC:+SHA1:+RSA:+COMP-NULL",
+                 MHD_OPTION_END))
+  {
+    fprintf (stderr, "TLS1.0 vs SSL3 test failed\n");
+    errorCount++;
+  }
   curl_global_cleanup ();
 
   return errorCount != 0 ? 1 : 0;
diff --git a/src/testcurl/https/tls_test_common.c 
b/src/testcurl/https/tls_test_common.c
index 367bed00..eb7cb14c 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -33,26 +33,26 @@ setup_ca_cert ()
   FILE *cert_fd;
 
   if (NULL == (cert_fd = fopen (ca_cert_file_name, "wb+")))
-    {
-      fprintf (stderr, "Error: failed to open `%s': %s\n",
-               ca_cert_file_name, strerror (errno));
-      return NULL;
-    }
+  {
+    fprintf (stderr, "Error: failed to open `%s': %s\n",
+             ca_cert_file_name, strerror (errno));
+    return NULL;
+  }
   if (fwrite (ca_cert_pem, sizeof (char), strlen (ca_cert_pem) + 1, cert_fd)
       != strlen (ca_cert_pem) + 1)
-    {
-      fprintf (stderr, "Error: failed to write `%s. %s'\n",
-               ca_cert_file_name, strerror (errno));
-      fclose (cert_fd);
-      return NULL;
-    }
+  {
+    fprintf (stderr, "Error: failed to write `%s. %s'\n",
+             ca_cert_file_name, strerror (errno));
+    fclose (cert_fd);
+    return NULL;
+  }
   if (fflush (cert_fd))
-    {
-      fprintf (stderr, "Error: failed to flush ca cert file stream. %s\n",
-               strerror (errno));
-      fclose (cert_fd);
-      return NULL;
-    }
+  {
+    fprintf (stderr, "Error: failed to flush ca cert file stream. %s\n",
+             strerror (errno));
+    fclose (cert_fd);
+    return NULL;
+  }
   return cert_fd;
 }
 
@@ -62,23 +62,23 @@ setup_ca_cert ()
  */
 int
 test_daemon_get (void *cls,
-                const char *cipher_suite, int proto_version,
-                int port,
-                int ver_peer)
+                 const char *cipher_suite, int proto_version,
+                 int port,
+                 int ver_peer)
 {
   CURL *c;
   struct CBC cbc;
   CURLcode errornum;
   char url[255];
   size_t len;
-  (void)cls;    /* Unused. Silent compiler warning. */
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   len = strlen (test_data);
   if (NULL == (cbc.buf = malloc (sizeof (char) * len)))
-    {
-      fprintf (stderr, MHD_E_MEM);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_MEM);
+    return -1;
+  }
   cbc.size = len;
   cbc.pos = 0;
 
@@ -115,22 +115,22 @@ test_daemon_get (void *cls,
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr, "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      free (cbc.buf);
-      return errornum;
-    }
+  {
+    fprintf (stderr, "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    free (cbc.buf);
+    return errornum;
+  }
 
   curl_easy_cleanup (c);
 
   if (memcmp (cbc.buf, test_data, len) != 0)
-    {
-      fprintf (stderr, "Error: local file & received file differ.\n");
-      free (cbc.buf);
-      return -1;
-    }
+  {
+    fprintf (stderr, "Error: local file & received file differ.\n");
+    free (cbc.buf);
+    return -1;
+  }
 
   free (cbc.buf);
   return 0;
@@ -141,7 +141,9 @@ void
 print_test_result (int test_outcome, char *test_name)
 {
   if (test_outcome != 0)
-    fprintf (stderr, "running test: %s [fail: %u]\n", test_name, (unsigned 
int)test_outcome);
+    fprintf (stderr, "running test: %s [fail: %u]\n", test_name, (unsigned
+                                                                  int)
+             test_outcome);
 #if 0
   else
     fprintf (stdout, "running test: %s [pass]\n", test_name);
@@ -171,21 +173,21 @@ http_ahc (void *cls, struct MHD_Connection *connection,
   static int aptr;
   struct MHD_Response *response;
   int ret;
-  (void)cls;(void)url;(void)version;            /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url; (void) version;            /* Unused. Silent 
compiler warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   *ptr = NULL;                  /* reset when done */
   response = MHD_create_response_from_buffer (strlen (test_data),
-                                             (void *) test_data,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) test_data,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -198,9 +200,9 @@ http_dummy_ahc (void *cls, struct MHD_Connection 
*connection,
                 const char *upload_data, size_t *upload_data_size,
                 void **ptr)
 {
-  (void)cls;(void)connection;(void)url;(void)method;(void)version;      /* 
Unused. Silent compiler warning. */
-  (void)upload_data;(void)upload_data_size;(void)ptr;                   /* 
Unused. Silent compiler warning. */
- return 0;
+  (void) cls; (void) connection; (void) url; (void) method; (void) version;    
  /* Unused. Silent compiler warning. */
+  (void) upload_data; (void) upload_data_size; (void) ptr;                   
/* Unused. Silent compiler warning. */
+  return 0;
 }
 
 /**
@@ -213,7 +215,7 @@ http_dummy_ahc (void *cls, struct MHD_Connection 
*connection,
  */
 /* TODO have test wrap consider a NULL cbc */
 int
-send_curl_req (char *url, struct CBC * cbc, const char *cipher_suite,
+send_curl_req (char *url, struct CBC *cbc, const char *cipher_suite,
                int proto_version)
 {
   CURL *c;
@@ -228,10 +230,10 @@ send_curl_req (char *url, struct CBC * cbc, const char 
*cipher_suite,
   curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 60L);
 
   if (cbc != NULL)
-    {
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_FILE, cbc);
-    }
+  {
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_FILE, cbc);
+  }
 
   /* TLS options */
   curl_easy_setopt (c, CURLOPT_SSLVERSION, proto_version);
@@ -248,12 +250,12 @@ send_curl_req (char *url, struct CBC * cbc, const char 
*cipher_suite,
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr, "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      return errornum;
-    }
+  {
+    fprintf (stderr, "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    return errornum;
+  }
   curl_easy_cleanup (c);
 
   return CURLE_OK;
@@ -286,27 +288,27 @@ gen_test_file_url (char *url,
   size_t i;
 #endif /* ! WINDOWS */
   if (NULL == (doc_path = malloc (doc_path_len)))
-    {
-      fprintf (stderr, MHD_E_MEM);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_MEM);
+    return -1;
+  }
   if (NULL == getcwd (doc_path, doc_path_len))
-    {
-      fprintf (stderr,
-               "Error: failed to get working directory. %s\n",
-               strerror (errno));
-      free (doc_path);
-      return -1;
-    }
+  {
+    fprintf (stderr,
+             "Error: failed to get working directory. %s\n",
+             strerror (errno));
+    free (doc_path);
+    return -1;
+  }
 #ifdef WINDOWS
   for (i = 0; i < doc_path_len; i++)
   {
     if (doc_path[i] == 0)
       break;
     if (doc_path[i] == '\\')
-      {
-        doc_path[i] = '/';
-      }
+    {
+      doc_path[i] = '/';
+    }
     if (doc_path[i] != ':')
       continue;
     if (i == 0)
@@ -322,7 +324,7 @@ gen_test_file_url (char *url,
                 "https://127.0.0.1";,
                 port,
                 doc_path,
-                "urlpath") >= (long long)url_len)
+                "urlpath") >= (long long) url_len)
     ret = -1;
 
   free (doc_path);
@@ -343,41 +345,41 @@ test_https_transfer (void *cls,
   int ret = 0;
   struct CBC cbc;
   char url[255];
-  (void)cls;    /* Unused. Silent compiler warning. */
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   len = strlen (test_data);
   if (NULL == (cbc.buf = malloc (sizeof (char) * len)))
-    {
-      fprintf (stderr, MHD_E_MEM);
-      return -1;
-    }
+  {
+    fprintf (stderr, MHD_E_MEM);
+    return -1;
+  }
   cbc.size = len;
   cbc.pos = 0;
 
   if (gen_test_file_url (url,
                          sizeof (url),
                          port))
-    {
-      ret = -1;
-      goto cleanup;
-    }
+  {
+    ret = -1;
+    goto cleanup;
+  }
 
   if (CURLE_OK !=
       send_curl_req (url, &cbc, cipher_suite, proto_version))
-    {
-      ret = -1;
-      goto cleanup;
-    }
+  {
+    ret = -1;
+    goto cleanup;
+  }
 
   /* compare test file & daemon responce */
   if ( (len != strlen (test_data)) ||
        (memcmp (cbc.buf,
-               test_data,
-               len) != 0) )
-    {
-      fprintf (stderr, "Error: local file & received file differ.\n");
-      ret = -1;
-    }
+                test_data,
+                len) != 0) )
+  {
+    fprintf (stderr, "Error: local file & received file differ.\n");
+    ret = -1;
+  }
 cleanup:
   free (cbc.buf);
   return ret;
@@ -392,28 +394,29 @@ cleanup:
  * @return port number on success or zero on failure
  */
 int
-setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list 
arg_list)
+setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list
+                arg_list)
 {
   *d = MHD_start_daemon_va (daemon_flags, port,
                             NULL, NULL, &http_ahc, NULL, arg_list);
 
   if (*d == NULL)
-    {
-      fprintf (stderr, MHD_E_SERVER_INIT);
-      return 0;
-    }
+  {
+    fprintf (stderr, MHD_E_SERVER_INIT);
+    return 0;
+  }
 
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (*d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (*d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        {
-          MHD_stop_daemon (*d);
-          return 0;
-        }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (*d);
+      return 0;
     }
+    port = (int) dinfo->port;
+  }
 
   return port;
 }
@@ -425,10 +428,10 @@ teardown_testcase (struct MHD_Daemon *d)
 }
 
 int
-setup_session (gnutls_session_t * session,
-               gnutls_datum_t * key,
-               gnutls_datum_t * cert,
-              gnutls_certificate_credentials_t * xcred)
+setup_session (gnutls_session_t *session,
+               gnutls_datum_t *key,
+               gnutls_datum_t *cert,
+               gnutls_certificate_credentials_t *xcred)
 {
   int ret;
   const char *err_pos;
@@ -437,42 +440,42 @@ setup_session (gnutls_session_t * session,
   key->size = strlen (srv_key_pem) + 1;
   key->data = malloc (key->size);
   if (NULL == key->data)
-     {
-       gnutls_certificate_free_credentials (*xcred);
-       return -1;
-     }
+  {
+    gnutls_certificate_free_credentials (*xcred);
+    return -1;
+  }
   memcpy (key->data, srv_key_pem, key->size);
   cert->size = strlen (srv_self_signed_cert_pem) + 1;
   cert->data = malloc (cert->size);
   if (NULL == cert->data)
-    {
-        gnutls_certificate_free_credentials (*xcred);
-       free (key->data);
-       return -1;
-    }
+  {
+    gnutls_certificate_free_credentials (*xcred);
+    free (key->data);
+    return -1;
+  }
   memcpy (cert->data, srv_self_signed_cert_pem, cert->size);
   gnutls_certificate_set_x509_key_mem (*xcred, cert, key,
-                                      GNUTLS_X509_FMT_PEM);
+                                       GNUTLS_X509_FMT_PEM);
   gnutls_init (session, GNUTLS_CLIENT);
   ret = gnutls_priority_set_direct (*session,
-                                   "NORMAL", &err_pos);
+                                    "NORMAL", &err_pos);
   if (ret < 0)
-    {
-       gnutls_deinit (*session);
-       gnutls_certificate_free_credentials (*xcred);
-       free (key->data);
-       return -1;
-    }
+  {
+    gnutls_deinit (*session);
+    gnutls_certificate_free_credentials (*xcred);
+    free (key->data);
+    return -1;
+  }
   gnutls_credentials_set (*session,
-                         GNUTLS_CRD_CERTIFICATE,
-                         *xcred);
+                          GNUTLS_CRD_CERTIFICATE,
+                          *xcred);
   return 0;
 }
 
 int
 teardown_session (gnutls_session_t session,
-                  gnutls_datum_t * key,
-                  gnutls_datum_t * cert,
+                  gnutls_datum_t *key,
+                  gnutls_datum_t *cert,
                   gnutls_certificate_credentials_t xcred)
 {
   free (key->data);
@@ -489,37 +492,37 @@ teardown_session (gnutls_session_t session,
 /* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) */
 int
 test_wrap (const char *test_name, int
-           (*test_function) (void * cls, int port, const char *cipher_suite,
-                             int proto_version), void * cls,
+           (*test_function)(void *cls, int port, const char *cipher_suite,
+                            int proto_version), void *cls,
            int port,
            int daemon_flags, const char *cipher_suite, int proto_version, ...)
 {
   int ret;
   va_list arg_list;
   struct MHD_Daemon *d;
-  (void)cls;    /* Unused. Silent compiler warning. */
+  (void) cls;    /* Unused. Silent compiler warning. */
 
   va_start (arg_list, proto_version);
   port = setup_testcase (&d, port, daemon_flags, arg_list);
   if (0 == port)
-    {
-      va_end (arg_list);
-      fprintf (stderr, "Failed to setup testcase %s\n", test_name);
-      return -1;
-    }
+  {
+    va_end (arg_list);
+    fprintf (stderr, "Failed to setup testcase %s\n", test_name);
+    return -1;
+  }
 #if 0
   fprintf (stdout, "running test: %s ", test_name);
 #endif
   ret = test_function (NULL, port, cipher_suite, proto_version);
 #if 0
   if (ret == 0)
-    {
-      fprintf (stdout, "[pass]\n");
-    }
+  {
+    fprintf (stdout, "[pass]\n");
+  }
   else
-    {
-      fprintf (stdout, "[fail]\n");
-    }
+  {
+    fprintf (stdout, "[fail]\n");
+  }
 #endif
   teardown_testcase (d);
   va_end (arg_list);
@@ -532,17 +535,19 @@ testsuite_curl_global_init (void)
 {
   CURLcode res;
 #if LIBCURL_VERSION_NUM >= 0x073800
-  if (CURLSSLSET_OK != curl_global_sslset(CURLSSLBACKEND_GNUTLS, NULL, NULL))
-    {
-      if (CURLSSLSET_TOO_LATE == curl_global_sslset(CURLSSLBACKEND_OPENSSL, 
NULL, NULL))
-        fprintf (stderr, "WARNING: libcurl was already initialised.\n");
-    }
+  if (CURLSSLSET_OK != curl_global_sslset (CURLSSLBACKEND_GNUTLS, NULL, NULL))
+  {
+    if (CURLSSLSET_TOO_LATE == curl_global_sslset (CURLSSLBACKEND_OPENSSL, 
NULL,
+                                                   NULL))
+      fprintf (stderr, "WARNING: libcurl was already initialised.\n");
+  }
 #endif /* LIBCURL_VERSION_NUM >= 0x07380 */
   res = curl_global_init (CURL_GLOBAL_ALL);
   if (CURLE_OK != res)
-    {
-      fprintf (stderr, "libcurl initialisation error: %s\n", 
curl_easy_strerror(res));
-      return 0;
-    }
+  {
+    fprintf (stderr, "libcurl initialisation error: %s\n", curl_easy_strerror (
+               res));
+    return 0;
+  }
   return 1;
 }
diff --git a/src/testcurl/https/tls_test_common.h 
b/src/testcurl/https/tls_test_common.h
index 490239ef..36f5ffa5 100644
--- a/src/testcurl/https/tls_test_common.h
+++ b/src/testcurl/https/tls_test_common.h
@@ -35,15 +35,18 @@
 #define test_data "Hello World\n"
 #define ca_cert_file_name "tmp_ca_cert.pem"
 
-#define EMPTY_PAGE "<html><head><title>Empty page</title></head><body>Empty 
page</body></html>"
-#define PAGE_NOT_FOUND "<html><head><title>File not 
found</title></head><body>File not found</body></html>"
+#define EMPTY_PAGE \
+  "<html><head><title>Empty page</title></head><body>Empty page</body></html>"
+#define PAGE_NOT_FOUND \
+  "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
 #define MHD_E_MEM "Error: memory error\n"
 #define MHD_E_SERVER_INIT "Error: failed to start server\n"
 #define MHD_E_TEST_FILE_CREAT "Error: failed to setup test file\n"
 #define MHD_E_CERT_FILE_CREAT "Error: failed to setup test certificate\n"
 #define MHD_E_KEY_FILE_CREAT "Error: failed to setup test certificate\n"
-#define MHD_E_FAILED_TO_CONNECT "Error: server connection could not be 
established\n"
+#define MHD_E_FAILED_TO_CONNECT \
+  "Error: server connection could not be established\n"
 
 /* TODO rm if unused */
 struct https_test_data
@@ -82,8 +85,8 @@ setup_ca_cert (void);
  * perform cURL request for file
  */
 int
-test_daemon_get (void * cls,
-                const char *cipher_suite, int proto_version,
+test_daemon_get (void *cls,
+                 const char *cipher_suite, int proto_version,
                  int port, int ver_peer);
 
 void
@@ -122,31 +125,33 @@ send_curl_req (char *url, struct CBC *cbc, const char 
*cipher_suite,
                int proto_version);
 
 int
-test_https_transfer (void *cls, int port, const char *cipher_suite, int 
proto_version);
+test_https_transfer (void *cls, int port, const char *cipher_suite, int
+                     proto_version);
 
 int
-setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list 
arg_list);
+setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list
+                arg_list);
 
 void
 teardown_testcase (struct MHD_Daemon *d);
 
 
 int
-setup_session (gnutls_session_t * session,
-               gnutls_datum_t * key,
-               gnutls_datum_t * cert,
-               gnutls_certificate_credentials_t * xcred);
+setup_session (gnutls_session_t *session,
+               gnutls_datum_t *key,
+               gnutls_datum_t *cert,
+               gnutls_certificate_credentials_t *xcred);
 
 int
 teardown_session (gnutls_session_t session,
-                  gnutls_datum_t * key,
-                  gnutls_datum_t * cert,
+                  gnutls_datum_t *key,
+                  gnutls_datum_t *cert,
                   gnutls_certificate_credentials_t xcred);
 
 int
 test_wrap (const char *test_name, int
-           (*test_function) (void * cls, int port, const char *cipher_suite,
-                             int proto_version), void * cls,
+           (*test_function)(void *cls, int port, const char *cipher_suite,
+                            int proto_version), void *cls,
            int port,
            int daemon_flags, const char *cipher_suite, int proto_version, ...);
 
diff --git a/src/testcurl/https/tls_test_keys.h 
b/src/testcurl/https/tls_test_keys.h
index b6e37eec..76f6f06f 100644
--- a/src/testcurl/https/tls_test_keys.h
+++ b/src/testcurl/https/tls_test_keys.h
@@ -24,150 +24,150 @@
 
 /* Certificate Authority key */
 const char ca_key_pem[] = "-----BEGIN RSA PRIVATE KEY-----\n"
-  "MIIEowIBAAKCAQEA0EdlP613rjFvEj93tGo9fzBoKWU3CW+AbbfcJ397C89MyZ9J\n"
-  "rlxyLGfa6qVX7CFVNmzgWWfcl2tHlw/fZmWtf/SFgrlkldvuGyY8H3n2HuMsWz/E\n"
-  "h7n5VgwBX8NsP4eZNmikepxpr1mYx25K8FjnsKjAR9jGUSV8UfZ7VLIY0x/yqe+3\n"
-  "32oqc4D/wJbV1AwwvC5Xf9rvHJwcZg57eqbDCL/4GDDk7d9Gark4XK6ZG+FnnxQn\n"
-  "4a4jIdf4FoPp9s0EieHrHwYzs/uBqmfCSF4wXiaO8bmEwtbAsVbZH74Le7ggUbEe\n"
-  "o+jan9XK0dE88AIImGzgoBnlic/Rr7J8OWA+iwIDAQABAoIBAEICZqXkUdpsw2F6\n"
-  "qPMOergNPO3lrKg6ZO8hBs6j2fj3tcPuzljK5sqJDboxNejZ9Zo+rmnXf3Oj5fgL\n"
-  "6UcYMYEsm4W/QRA3uEJ1fzeQnT7Ty9KNprlHaSzquCLEGlIWJSo3xu0vFlWjJUcL\n"
-  "fwemfaOhD/OVUeEU6s5FOngwy6pZUsOajs3fNRtwBGuuXjniKZZlpSf2Wqu3xpHZ\n"
-  "31OF1V0ycUCGPPFtpmUCtnZhS9L8QBTkNtfTIdXv6SfoBRFm0oXb0uL5HGft6yc7\n"
-  "eYRXIscllQciqG3ymJ/y9o0E3A0YsBVauQyi7OEk+Kg8uoYOBkZCIY69hoN2Znlk\n"
-  "OY5S5Z0CgYEA3j8pRAJzvc827KcX4vJf05HYD4aCyaI80fNmx1DgXfglTSGLQ361\n"
-  "6i05YW8WtIvgkma3wF+jJOckBCW/7iq8wAX7Kz75WKGRyyTEb0wSfjx0G8grxX4d\n"
-  "7sTIAAOnQj5WT6E/bkqxQZAYnVtIPxKtSlwts0H/bjPVYwSFchHK7t8CgYEA7+ks\n"
-  "C0EMjF8CDeCfvbOUGiiqAvU3G20LEC3WlJM3AU+J9Jzp6AMkgaIA8J5oNdsbFBn4\n"
-  "N12JPOO+7WRUk6Av8bsh4faE36ThnHohgAL8guRU7jIXvsFyO5yiY7/o/0lES0/V\n"
-  "6xkh/Epj4MReuCGkiD9ifCVAo+dhHskeE9qbYdUCgYA4yBpa7eV0UUTPIcHQkew5\n"
-  "ucFh9hPkQDcZzP4tXlR0rbmaAz/5dp4zvmoyopdCeZpezS+VTtn3y7Y/+QUYbILc\n"
-  "7KpHWkeKhX0iUbp+VQlEh12C25mTU62CG3SdzFEnc5XJsoDqRNsUzSP80B2dP8BW\n"
-  "h0aFzg7csRGLwtP1WOZoMQKBgQCrgsKd+Q8Dexh421DXyX3jhZalLrEKxlXWZy60\n"
-  "YNo98aLqYRNHbpe2pR6O5nARsGYXZMlyq0flY9um0sc0Epyz79g1NoufZrxzpUw1\n"
-  "u+zRlnKxJtaa5KjJvRzKuvPTLYnJXXXM8Na/Cl+E3F3qvQJm9QlvPyKLCmsAGz+J\n"
-  "agsTUQKBgC0wqqJ6b1tbrAD8AVeeAn/IiP1rxYpc3x2s6ikFO2FMHXHC9wgrRPOc\n"
-  "mkokV+DrUOv3I/7jG8wQA/FmBUPy562a1bObIKzg6CPXzrN68AmNnOIVU+H8fdxI\n"
-  "iGyfT8WNpcRmtN11v34qXHwOWGQhpyyk2yNa8VIBSpkShq/EseZ1\n"
-  "-----END RSA PRIVATE KEY-----\n";
+                          
"MIIEowIBAAKCAQEA0EdlP613rjFvEj93tGo9fzBoKWU3CW+AbbfcJ397C89MyZ9J\n"
+                          
"rlxyLGfa6qVX7CFVNmzgWWfcl2tHlw/fZmWtf/SFgrlkldvuGyY8H3n2HuMsWz/E\n"
+                          
"h7n5VgwBX8NsP4eZNmikepxpr1mYx25K8FjnsKjAR9jGUSV8UfZ7VLIY0x/yqe+3\n"
+                          
"32oqc4D/wJbV1AwwvC5Xf9rvHJwcZg57eqbDCL/4GDDk7d9Gark4XK6ZG+FnnxQn\n"
+                          
"4a4jIdf4FoPp9s0EieHrHwYzs/uBqmfCSF4wXiaO8bmEwtbAsVbZH74Le7ggUbEe\n"
+                          
"o+jan9XK0dE88AIImGzgoBnlic/Rr7J8OWA+iwIDAQABAoIBAEICZqXkUdpsw2F6\n"
+                          
"qPMOergNPO3lrKg6ZO8hBs6j2fj3tcPuzljK5sqJDboxNejZ9Zo+rmnXf3Oj5fgL\n"
+                          
"6UcYMYEsm4W/QRA3uEJ1fzeQnT7Ty9KNprlHaSzquCLEGlIWJSo3xu0vFlWjJUcL\n"
+                          
"fwemfaOhD/OVUeEU6s5FOngwy6pZUsOajs3fNRtwBGuuXjniKZZlpSf2Wqu3xpHZ\n"
+                          
"31OF1V0ycUCGPPFtpmUCtnZhS9L8QBTkNtfTIdXv6SfoBRFm0oXb0uL5HGft6yc7\n"
+                          
"eYRXIscllQciqG3ymJ/y9o0E3A0YsBVauQyi7OEk+Kg8uoYOBkZCIY69hoN2Znlk\n"
+                          
"OY5S5Z0CgYEA3j8pRAJzvc827KcX4vJf05HYD4aCyaI80fNmx1DgXfglTSGLQ361\n"
+                          
"6i05YW8WtIvgkma3wF+jJOckBCW/7iq8wAX7Kz75WKGRyyTEb0wSfjx0G8grxX4d\n"
+                          
"7sTIAAOnQj5WT6E/bkqxQZAYnVtIPxKtSlwts0H/bjPVYwSFchHK7t8CgYEA7+ks\n"
+                          
"C0EMjF8CDeCfvbOUGiiqAvU3G20LEC3WlJM3AU+J9Jzp6AMkgaIA8J5oNdsbFBn4\n"
+                          
"N12JPOO+7WRUk6Av8bsh4faE36ThnHohgAL8guRU7jIXvsFyO5yiY7/o/0lES0/V\n"
+                          
"6xkh/Epj4MReuCGkiD9ifCVAo+dhHskeE9qbYdUCgYA4yBpa7eV0UUTPIcHQkew5\n"
+                          
"ucFh9hPkQDcZzP4tXlR0rbmaAz/5dp4zvmoyopdCeZpezS+VTtn3y7Y/+QUYbILc\n"
+                          
"7KpHWkeKhX0iUbp+VQlEh12C25mTU62CG3SdzFEnc5XJsoDqRNsUzSP80B2dP8BW\n"
+                          
"h0aFzg7csRGLwtP1WOZoMQKBgQCrgsKd+Q8Dexh421DXyX3jhZalLrEKxlXWZy60\n"
+                          
"YNo98aLqYRNHbpe2pR6O5nARsGYXZMlyq0flY9um0sc0Epyz79g1NoufZrxzpUw1\n"
+                          
"u+zRlnKxJtaa5KjJvRzKuvPTLYnJXXXM8Na/Cl+E3F3qvQJm9QlvPyKLCmsAGz+J\n"
+                          
"agsTUQKBgC0wqqJ6b1tbrAD8AVeeAn/IiP1rxYpc3x2s6ikFO2FMHXHC9wgrRPOc\n"
+                          
"mkokV+DrUOv3I/7jG8wQA/FmBUPy562a1bObIKzg6CPXzrN68AmNnOIVU+H8fdxI\n"
+                          
"iGyfT8WNpcRmtN11v34qXHwOWGQhpyyk2yNa8VIBSpkShq/EseZ1\n"
+                          "-----END RSA PRIVATE KEY-----\n";
 
 /* Certificate Authority cert */
 const char ca_cert_pem[] = "-----BEGIN CERTIFICATE-----\n"
-  "MIIC6DCCAdKgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
-  "dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
-  "A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
-  "0EdlP613rjFvEj93tGo9fzBoKWU3CW+AbbfcJ397C89MyZ9JrlxyLGfa6qVX7CFV\n"
-  "NmzgWWfcl2tHlw/fZmWtf/SFgrlkldvuGyY8H3n2HuMsWz/Eh7n5VgwBX8NsP4eZ\n"
-  "Nmikepxpr1mYx25K8FjnsKjAR9jGUSV8UfZ7VLIY0x/yqe+332oqc4D/wJbV1Aww\n"
-  "vC5Xf9rvHJwcZg57eqbDCL/4GDDk7d9Gark4XK6ZG+FnnxQn4a4jIdf4FoPp9s0E\n"
-  "ieHrHwYzs/uBqmfCSF4wXiaO8bmEwtbAsVbZH74Le7ggUbEeo+jan9XK0dE88AII\n"
-  "mGzgoBnlic/Rr7J8OWA+iwIDAQABo0MwQTAPBgNVHRMBAf8EBTADAQH/MA8GA1Ud\n"
-  "DwEB/wQFAwMHBAAwHQYDVR0OBBYEFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsGCSqG\n"
-  "SIb3DQEBBQOCAQEAebD5m+vZkVXa8y+QZ5GtsiR9gpH+LKtdWBjk1kmfSgvQI/xA\n"
-  "aDCV/9BhdNGIBOTYGkln8urWd7g2Mj3TwKEAfNTUFpAsrBAlSSLTGYCSt72S2NsS\n"
-  "L/qUxmj1W6X95UHXCo49mSZx3LlaY3mz1L87gq/kK0XpzA3g2uF25jt84RvshsXy\n"
-  "clOc+eRrVETqFZqer96WB7kzFTv+qmROQKmW8X4a2A5r5Jl4vRwOz5/rEeB9Qs0K\n"
-  "rmK8+5HgvWd80WB8BtfFtZfoY/hHVM8nLD3ELVJrOKiTeIACunQFyT5lV0QkdmSA\n"
-  "CGInU7jzs8nu+s2avf6j+eVZUbVJ+dFMApTJgg==\n"
-  "-----END CERTIFICATE-----\n";
+                           
"MIIC6DCCAdKgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
+                           
"dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
+                           
"A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
+                           
"0EdlP613rjFvEj93tGo9fzBoKWU3CW+AbbfcJ397C89MyZ9JrlxyLGfa6qVX7CFV\n"
+                           
"NmzgWWfcl2tHlw/fZmWtf/SFgrlkldvuGyY8H3n2HuMsWz/Eh7n5VgwBX8NsP4eZ\n"
+                           
"Nmikepxpr1mYx25K8FjnsKjAR9jGUSV8UfZ7VLIY0x/yqe+332oqc4D/wJbV1Aww\n"
+                           
"vC5Xf9rvHJwcZg57eqbDCL/4GDDk7d9Gark4XK6ZG+FnnxQn4a4jIdf4FoPp9s0E\n"
+                           
"ieHrHwYzs/uBqmfCSF4wXiaO8bmEwtbAsVbZH74Le7ggUbEeo+jan9XK0dE88AII\n"
+                           
"mGzgoBnlic/Rr7J8OWA+iwIDAQABo0MwQTAPBgNVHRMBAf8EBTADAQH/MA8GA1Ud\n"
+                           
"DwEB/wQFAwMHBAAwHQYDVR0OBBYEFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsGCSqG\n"
+                           
"SIb3DQEBBQOCAQEAebD5m+vZkVXa8y+QZ5GtsiR9gpH+LKtdWBjk1kmfSgvQI/xA\n"
+                           
"aDCV/9BhdNGIBOTYGkln8urWd7g2Mj3TwKEAfNTUFpAsrBAlSSLTGYCSt72S2NsS\n"
+                           
"L/qUxmj1W6X95UHXCo49mSZx3LlaY3mz1L87gq/kK0XpzA3g2uF25jt84RvshsXy\n"
+                           
"clOc+eRrVETqFZqer96WB7kzFTv+qmROQKmW8X4a2A5r5Jl4vRwOz5/rEeB9Qs0K\n"
+                           
"rmK8+5HgvWd80WB8BtfFtZfoY/hHVM8nLD3ELVJrOKiTeIACunQFyT5lV0QkdmSA\n"
+                           "CGInU7jzs8nu+s2avf6j+eVZUbVJ+dFMApTJgg==\n"
+                           "-----END CERTIFICATE-----\n";
 
 /* test server CA signed certificates */
 const char srv_signed_cert_pem[] = "-----BEGIN CERTIFICATE-----\n"
-  "MIIDGzCCAgWgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
-  "dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
-  "A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
-  "vfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW+K03KwEku55QvnUn\n"
-  "dwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8ILq4sw32vo0fbMu5BZ\n"
-  "F49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ020Q5EAAEseD1YtWC\n"
-  "IpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6QYGGh1QmHRPAy3CB\n"
-  "II6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6xyoOl204xuekZOaG9\n"
-  "RUPId74Rtmwfi1TLbBzo2wIDAQABo3YwdDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
-  "MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFOFi4ilKOP1d\n"
-  "XHlWCMwmVKr7mgy8MB8GA1UdIwQYMBaAFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsG\n"
-  "CSqGSIb3DQEBBQOCAQEAHVWPxazupbOkG7Did+dY9z2z6RjTzYvurTtEKQgzM2Vz\n"
-  "GQBA+3pZ3c5mS97fPIs9hZXfnQeelMeZ2XP1a+9vp35bJjZBBhVH+pqxjCgiUflg\n"
-  "A3Zqy0XwwVCgQLE2HyaU3DLUD/aeIFK5gJaOSdNTXZLv43K8kl4cqDbMeRpVTbkt\n"
-  "YmG4AyEOYRNKGTqMEJXJoxD5E3rBUNrVI/XyTjYrulxbNPcMWEHKNeeqWpKDYTFo\n"
-  "Bb01PCthGXiq/4A2RLAFosadzRa8SBpoSjPPfZ0b2w4MJpReHqKbR5+T2t6hzml6\n"
-  "4ToyOKPDmamiTuN5KzLN3cw7DQlvWMvqSOChPLnA3Q==\n"
-  "-----END CERTIFICATE-----\n";
+                                   
"MIIDGzCCAgWgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
+                                   
"dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
+                                   
"A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
+                                   
"vfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW+K03KwEku55QvnUn\n"
+                                   
"dwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8ILq4sw32vo0fbMu5BZ\n"
+                                   
"F49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ020Q5EAAEseD1YtWC\n"
+                                   
"IpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6QYGGh1QmHRPAy3CB\n"
+                                   
"II6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6xyoOl204xuekZOaG9\n"
+                                   
"RUPId74Rtmwfi1TLbBzo2wIDAQABo3YwdDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
+                                   
"MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFOFi4ilKOP1d\n"
+                                   
"XHlWCMwmVKr7mgy8MB8GA1UdIwQYMBaAFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsG\n"
+                                   
"CSqGSIb3DQEBBQOCAQEAHVWPxazupbOkG7Did+dY9z2z6RjTzYvurTtEKQgzM2Vz\n"
+                                   
"GQBA+3pZ3c5mS97fPIs9hZXfnQeelMeZ2XP1a+9vp35bJjZBBhVH+pqxjCgiUflg\n"
+                                   
"A3Zqy0XwwVCgQLE2HyaU3DLUD/aeIFK5gJaOSdNTXZLv43K8kl4cqDbMeRpVTbkt\n"
+                                   
"YmG4AyEOYRNKGTqMEJXJoxD5E3rBUNrVI/XyTjYrulxbNPcMWEHKNeeqWpKDYTFo\n"
+                                   
"Bb01PCthGXiq/4A2RLAFosadzRa8SBpoSjPPfZ0b2w4MJpReHqKbR5+T2t6hzml6\n"
+                                   
"4ToyOKPDmamiTuN5KzLN3cw7DQlvWMvqSOChPLnA3Q==\n"
+                                   "-----END CERTIFICATE-----\n";
 
 /* test server key */
 const char srv_signed_key_pem[] = "-----BEGIN RSA PRIVATE KEY-----\n"
-  "MIIEowIBAAKCAQEAvfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW\n"
-  "+K03KwEku55QvnUndwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8IL\n"
-  "q4sw32vo0fbMu5BZF49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ0\n"
-  "20Q5EAAEseD1YtWCIpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6\n"
-  "QYGGh1QmHRPAy3CBII6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6x\n"
-  "yoOl204xuekZOaG9RUPId74Rtmwfi1TLbBzo2wIDAQABAoIBADu09WSICNq5cMe4\n"
-  "+NKCLlgAT1NiQpLls1gKRbDhKiHU9j8QWNvWWkJWrCya4QdUfLCfeddCMeiQmv3K\n"
-  "lJMvDs+5OjJSHFoOsGiuW2Ias7IjnIojaJalfBml6frhJ84G27IXmdz6gzOiTIer\n"
-  "DjeAgcwBaKH5WwIay2TxIaScl7AwHBauQkrLcyb4hTmZuQh6ArVIN6+pzoVuORXM\n"
-  "bpeNWl2l/HSN3VtUN6aCAKbN/X3o0GavCCMn5Fa85uJFsab4ss/uP+2PusU71+zP\n"
-  "sBm6p/2IbGvF5k3VPDA7X5YX61sukRjRBihY8xSnNYx1UcoOsX6AiPnbhifD8+xQ\n"
-  "Tlf8oJUCgYEA0BTfzqNpr9Wxw5/QXaSdw7S/0eP5a0C/nwURvmfSzuTD4equzbEN\n"
-  "d+dI/s2JMxrdj/I4uoAfUXRGaabevQIjFzC9uyE3LaOyR2zhuvAzX+vVcs6bSXeU\n"
-  "pKpCAcN+3Z3evMaX2f+z/nfSUAl2i4J2R+/LQAWJW4KwRky/m+cxpfUCgYEA6bN1\n"
-  "b73bMgM8wpNt6+fcmS+5n0iZihygQ2U2DEud8nZJL4Nrm1dwTnfZfJBnkGj6+0Q0\n"
-  "cOwj2KS0/wcEdJBP0jucU4v60VMhp75AQeHqidIde0bTViSRo3HWKXHBIFGYoU3T\n"
-  "LyPyKndbqsOObnsFXHn56Nwhr2HLf6nw4taGQY8CgYBoSW36FLCNbd6QGvLFXBGt\n"
-  "2lMhEM8az/K58kJ4WXSwOLtr6MD/WjNT2tkcy0puEJLm6BFCd6A6pLn9jaKou/92\n"
-  "SfltZjJPb3GUlp9zn5tAAeSSi7YMViBrfuFiHObij5LorefBXISLjuYbMwL03MgH\n"
-  "Ocl2JtA2ywMp2KFXs8GQWQKBgFyIVv5ogQrbZ0pvj31xr9HjqK6d01VxIi+tOmpB\n"
-  "4ocnOLEcaxX12BzprW55ytfOCVpF1jHD/imAhb3YrHXu0fwe6DXYXfZV4SSG2vB7\n"
-  "IB9z14KBN5qLHjNGFpMQXHSMek+b/ftTU0ZnPh9uEM5D3YqRLVd7GcdUhHvG8P8Q\n"
-  "C9aXAoGBAJtID6h8wOGMP0XYX5YYnhlC7dOLfk8UYrzlp3xhqVkzKthTQTj6wx9R\n"
-  "GtC4k7U1ki8oJsfcIlBNXd768fqDVWjYju5rzShMpo8OCTS6ipAblKjCxPPVhIpv\n"
-  "tWPlbSn1qj6wylstJ5/3Z+ZW5H4wIKp5jmLiioDhcP0L/Ex3Zx8O\n"
-  "-----END RSA PRIVATE KEY-----\n";
+                                  
"MIIEowIBAAKCAQEAvfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW\n"
+                                  
"+K03KwEku55QvnUndwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8IL\n"
+                                  
"q4sw32vo0fbMu5BZF49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ0\n"
+                                  
"20Q5EAAEseD1YtWCIpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6\n"
+                                  
"QYGGh1QmHRPAy3CBII6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6x\n"
+                                  
"yoOl204xuekZOaG9RUPId74Rtmwfi1TLbBzo2wIDAQABAoIBADu09WSICNq5cMe4\n"
+                                  
"+NKCLlgAT1NiQpLls1gKRbDhKiHU9j8QWNvWWkJWrCya4QdUfLCfeddCMeiQmv3K\n"
+                                  
"lJMvDs+5OjJSHFoOsGiuW2Ias7IjnIojaJalfBml6frhJ84G27IXmdz6gzOiTIer\n"
+                                  
"DjeAgcwBaKH5WwIay2TxIaScl7AwHBauQkrLcyb4hTmZuQh6ArVIN6+pzoVuORXM\n"
+                                  
"bpeNWl2l/HSN3VtUN6aCAKbN/X3o0GavCCMn5Fa85uJFsab4ss/uP+2PusU71+zP\n"
+                                  
"sBm6p/2IbGvF5k3VPDA7X5YX61sukRjRBihY8xSnNYx1UcoOsX6AiPnbhifD8+xQ\n"
+                                  
"Tlf8oJUCgYEA0BTfzqNpr9Wxw5/QXaSdw7S/0eP5a0C/nwURvmfSzuTD4equzbEN\n"
+                                  
"d+dI/s2JMxrdj/I4uoAfUXRGaabevQIjFzC9uyE3LaOyR2zhuvAzX+vVcs6bSXeU\n"
+                                  
"pKpCAcN+3Z3evMaX2f+z/nfSUAl2i4J2R+/LQAWJW4KwRky/m+cxpfUCgYEA6bN1\n"
+                                  
"b73bMgM8wpNt6+fcmS+5n0iZihygQ2U2DEud8nZJL4Nrm1dwTnfZfJBnkGj6+0Q0\n"
+                                  
"cOwj2KS0/wcEdJBP0jucU4v60VMhp75AQeHqidIde0bTViSRo3HWKXHBIFGYoU3T\n"
+                                  
"LyPyKndbqsOObnsFXHn56Nwhr2HLf6nw4taGQY8CgYBoSW36FLCNbd6QGvLFXBGt\n"
+                                  
"2lMhEM8az/K58kJ4WXSwOLtr6MD/WjNT2tkcy0puEJLm6BFCd6A6pLn9jaKou/92\n"
+                                  
"SfltZjJPb3GUlp9zn5tAAeSSi7YMViBrfuFiHObij5LorefBXISLjuYbMwL03MgH\n"
+                                  
"Ocl2JtA2ywMp2KFXs8GQWQKBgFyIVv5ogQrbZ0pvj31xr9HjqK6d01VxIi+tOmpB\n"
+                                  
"4ocnOLEcaxX12BzprW55ytfOCVpF1jHD/imAhb3YrHXu0fwe6DXYXfZV4SSG2vB7\n"
+                                  
"IB9z14KBN5qLHjNGFpMQXHSMek+b/ftTU0ZnPh9uEM5D3YqRLVd7GcdUhHvG8P8Q\n"
+                                  
"C9aXAoGBAJtID6h8wOGMP0XYX5YYnhlC7dOLfk8UYrzlp3xhqVkzKthTQTj6wx9R\n"
+                                  
"GtC4k7U1ki8oJsfcIlBNXd768fqDVWjYju5rzShMpo8OCTS6ipAblKjCxPPVhIpv\n"
+                                  
"tWPlbSn1qj6wylstJ5/3Z+ZW5H4wIKp5jmLiioDhcP0L/Ex3Zx8O\n"
+                                  "-----END RSA PRIVATE KEY-----\n";
 
 /* test server self signed certificates */
 const char srv_self_signed_cert_pem[] = "-----BEGIN CERTIFICATE-----\n"
-  "MIIC+jCCAeSgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
-  "dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
-  "A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
-  "tDEagv3p9OUhUL55jMucxjNK9N5cuozhcnrwDfBSU6oVrqm5kPqO1I7Cggzw68Y5\n"
-  "jhTcBi4FXmYOZppm1R3MhSJ5JSi/67Q7X4J5rnJLXYGN27qjMpnoGQ/2xmsNG/is\n"
-  "i+h/2vbtPU+WP9SEJnTfPLLpZ7KqCAk7FUUzKsuLx3/SOKtdkrWxPKwYTgnDEN6D\n"
-  "JL7tEzCnG5DFc4mQ7YW9PaRdC3rS1T8PvQ3jB2BUnohM0cFvKRuiU35tU7h7CPbL\n"
-  "4L66VglXoiwqmgcrwI2U968bD0+wRQ5c5bzNoshJOzN6CTMh1IhbklSh/Z6FA/e8\n"
-  "hj0yVo2tdllXuJGVs3PIEwIDAQABo1UwUzAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
-  "MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFDfU7pAv9LYn\n"
-  "n7jb4WHl4+Vgi2FnMAsGCSqGSIb3DQEBBQOCAQEAkaembPQMmv6OOjbIod8zTatr\n"
-  "x5Bwkwp3TOE1NRyy2OytzFIYRUkNrZYlcmrxcbNNycIK41CNVXbriFCF8gcmIq9y\n"
-  "vaKZn8Gcy+vGggv+1BP9IAPBGKRwSi0wmq9JoGE8hx+qqTpRSdfbM/cps/09hicO\n"
-  "0EIR7kWEbvnpMBcMKYOtYE9Gce7rdSMWVAsKc174xn8vW6TxCUvmWFv5DPg5HG1v\n"
-  "y1SUX73qafRo+W6FN4UC/DHfwRhF8RSKEnVbmgDVCs6GHdKBjU2qRgYyj6nWZqK1\n"
-  "XFUTWgia+Fl3D9vlsXaFcSZKA0Bq1eojl0B0AfeYAxTFwPWXscKvt/bXZfH8bg==\n"
-  "-----END CERTIFICATE-----\n";
+                                        
"MIIC+jCCAeSgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
+                                        
"dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n"
+                                        
"A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n"
+                                        
"tDEagv3p9OUhUL55jMucxjNK9N5cuozhcnrwDfBSU6oVrqm5kPqO1I7Cggzw68Y5\n"
+                                        
"jhTcBi4FXmYOZppm1R3MhSJ5JSi/67Q7X4J5rnJLXYGN27qjMpnoGQ/2xmsNG/is\n"
+                                        
"i+h/2vbtPU+WP9SEJnTfPLLpZ7KqCAk7FUUzKsuLx3/SOKtdkrWxPKwYTgnDEN6D\n"
+                                        
"JL7tEzCnG5DFc4mQ7YW9PaRdC3rS1T8PvQ3jB2BUnohM0cFvKRuiU35tU7h7CPbL\n"
+                                        
"4L66VglXoiwqmgcrwI2U968bD0+wRQ5c5bzNoshJOzN6CTMh1IhbklSh/Z6FA/e8\n"
+                                        
"hj0yVo2tdllXuJGVs3PIEwIDAQABo1UwUzAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n"
+                                        
"MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFDfU7pAv9LYn\n"
+                                        
"n7jb4WHl4+Vgi2FnMAsGCSqGSIb3DQEBBQOCAQEAkaembPQMmv6OOjbIod8zTatr\n"
+                                        
"x5Bwkwp3TOE1NRyy2OytzFIYRUkNrZYlcmrxcbNNycIK41CNVXbriFCF8gcmIq9y\n"
+                                        
"vaKZn8Gcy+vGggv+1BP9IAPBGKRwSi0wmq9JoGE8hx+qqTpRSdfbM/cps/09hicO\n"
+                                        
"0EIR7kWEbvnpMBcMKYOtYE9Gce7rdSMWVAsKc174xn8vW6TxCUvmWFv5DPg5HG1v\n"
+                                        
"y1SUX73qafRo+W6FN4UC/DHfwRhF8RSKEnVbmgDVCs6GHdKBjU2qRgYyj6nWZqK1\n"
+                                        
"XFUTWgia+Fl3D9vlsXaFcSZKA0Bq1eojl0B0AfeYAxTFwPWXscKvt/bXZfH8bg==\n"
+                                        "-----END CERTIFICATE-----\n";
 
 /* test server key */
 const char srv_key_pem[] = "-----BEGIN RSA PRIVATE KEY-----\n"
-  "MIIEpAIBAAKCAQEAtDEagv3p9OUhUL55jMucxjNK9N5cuozhcnrwDfBSU6oVrqm5\n"
-  "kPqO1I7Cggzw68Y5jhTcBi4FXmYOZppm1R3MhSJ5JSi/67Q7X4J5rnJLXYGN27qj\n"
-  "MpnoGQ/2xmsNG/isi+h/2vbtPU+WP9SEJnTfPLLpZ7KqCAk7FUUzKsuLx3/SOKtd\n"
-  "krWxPKwYTgnDEN6DJL7tEzCnG5DFc4mQ7YW9PaRdC3rS1T8PvQ3jB2BUnohM0cFv\n"
-  "KRuiU35tU7h7CPbL4L66VglXoiwqmgcrwI2U968bD0+wRQ5c5bzNoshJOzN6CTMh\n"
-  "1IhbklSh/Z6FA/e8hj0yVo2tdllXuJGVs3PIEwIDAQABAoIBAAEtcg+LFLGtoxjq\n"
-  "b+tFttBJfbRcfdG6ocYqBGmUXF+MgFs573DHX3sHNOQxlaNHtSgIclF1eYgNZFFt\n"
-  "VLIoBFTzfEQXoFosPUDoEuqVMeXLttmD7P2jwL780XJLZ4Xj6GY07npq1iGBcEZf\n"
-  "yCcdoyGkr9jgc5Auyis8DStGg/jfUBC4NBvF0GnuuNPAdYRPKUpKw9EatI+FdMjy\n"
-  "BuroD90fhdkK8EwMEVb9P17bdIc1MCIZFpUE9YHjVdK/oxCUhQ8KRfdbI4JU5Zh3\n"
-  "UtO6Jm2wFuP3VmeVpPvE/C2rxI70pyl6HMSiFGNc0rhJYCQ+yhohWj7nZ67H4vLx\n"
-  "plv5LxkCgYEAz7ewou8oFafDAMNoxaqKudvUg+lxXewdLDKaYBF5ACi9uAPCJ+v7\n"
-  "M5c/fvPFn/XHzo7xaXbtTAH3Z5xzBs+80OsvL+e1Ut4xR+ELRkybknh/s2wQeABk\n"
-  "Kb0vA59ukQGj12LV5phZMaVoXe6KJ7hZnN62d3K6m1wGE/k58i4pPLUCgYEA3hN8\n"
-  "G95zW7g0jVdSr+KUeVmephph9yh8Yb+3I3ojwOIv6d45TopGx8pFZlnBAMZf1ZQx\n"
-  "DIhzJNnaqZy/4w7RNaOGWnPA/5f+MIoHBiLGEEmfHC3lt087Yp9OuwDUHwpETYdV\n"
-  "o+KBCvVh60Et3bZUgF/1k/3YXxn8J5dsmJsjNqcCgYBLflyRa1BrRnTGMz9CEDCp\n"
-  "Si9b3h1Y4Hbd2GppHhCXMTd6yMrpDYhYANGQB3M9Juv+s88j4JhwNoq/uonH4Pqk\n"
-  "B8Y3qAQr4RuSH0WkwDUOsALhqBX4N1QwI1USAQEDbNAqeP5698X7GD3tXcQSmZrg\n"
-  "O8WfdjBCRNjkq4EW9xX/vQKBgQDONtmwJ0iHiu2BseyeVo/4fzfKlgUSNQ4K1rOA\n"
-  "xhIdMeu8Bxa/z7caHsGC4SVPSuYCtbE2Kh6BwapChcPJXCD45fgEViiJLuJiwEj1\n"
-  "caTpyvNsf1IoffJvCe9ZxtMyX549P8ZOgC3Dt0hN5CBrGLwu2Ox5l+YrqT10pi+5\n"
-  "JZX1UQKBgQCrcXrdkkDAc/a4+PxNRpJRLcU4fhv8/lr+UWItE8eUe7bd25bTQfQm\n"
-  "VpNKc/kAJ66PjIED6fy3ADhd2y4naT2a24uAgQ/M494J68qLnGh6K4JU/09uxR2v\n"
-  "1i2q/4FNLdFFk1XP4iNnTHRLZ+NYr2p5Y9RcvQfTjOauz8Ahav0lyg==\n"
-  "-----END RSA PRIVATE KEY-----\n";
+                           
"MIIEpAIBAAKCAQEAtDEagv3p9OUhUL55jMucxjNK9N5cuozhcnrwDfBSU6oVrqm5\n"
+                           
"kPqO1I7Cggzw68Y5jhTcBi4FXmYOZppm1R3MhSJ5JSi/67Q7X4J5rnJLXYGN27qj\n"
+                           
"MpnoGQ/2xmsNG/isi+h/2vbtPU+WP9SEJnTfPLLpZ7KqCAk7FUUzKsuLx3/SOKtd\n"
+                           
"krWxPKwYTgnDEN6DJL7tEzCnG5DFc4mQ7YW9PaRdC3rS1T8PvQ3jB2BUnohM0cFv\n"
+                           
"KRuiU35tU7h7CPbL4L66VglXoiwqmgcrwI2U968bD0+wRQ5c5bzNoshJOzN6CTMh\n"
+                           
"1IhbklSh/Z6FA/e8hj0yVo2tdllXuJGVs3PIEwIDAQABAoIBAAEtcg+LFLGtoxjq\n"
+                           
"b+tFttBJfbRcfdG6ocYqBGmUXF+MgFs573DHX3sHNOQxlaNHtSgIclF1eYgNZFFt\n"
+                           
"VLIoBFTzfEQXoFosPUDoEuqVMeXLttmD7P2jwL780XJLZ4Xj6GY07npq1iGBcEZf\n"
+                           
"yCcdoyGkr9jgc5Auyis8DStGg/jfUBC4NBvF0GnuuNPAdYRPKUpKw9EatI+FdMjy\n"
+                           
"BuroD90fhdkK8EwMEVb9P17bdIc1MCIZFpUE9YHjVdK/oxCUhQ8KRfdbI4JU5Zh3\n"
+                           
"UtO6Jm2wFuP3VmeVpPvE/C2rxI70pyl6HMSiFGNc0rhJYCQ+yhohWj7nZ67H4vLx\n"
+                           
"plv5LxkCgYEAz7ewou8oFafDAMNoxaqKudvUg+lxXewdLDKaYBF5ACi9uAPCJ+v7\n"
+                           
"M5c/fvPFn/XHzo7xaXbtTAH3Z5xzBs+80OsvL+e1Ut4xR+ELRkybknh/s2wQeABk\n"
+                           
"Kb0vA59ukQGj12LV5phZMaVoXe6KJ7hZnN62d3K6m1wGE/k58i4pPLUCgYEA3hN8\n"
+                           
"G95zW7g0jVdSr+KUeVmephph9yh8Yb+3I3ojwOIv6d45TopGx8pFZlnBAMZf1ZQx\n"
+                           
"DIhzJNnaqZy/4w7RNaOGWnPA/5f+MIoHBiLGEEmfHC3lt087Yp9OuwDUHwpETYdV\n"
+                           
"o+KBCvVh60Et3bZUgF/1k/3YXxn8J5dsmJsjNqcCgYBLflyRa1BrRnTGMz9CEDCp\n"
+                           
"Si9b3h1Y4Hbd2GppHhCXMTd6yMrpDYhYANGQB3M9Juv+s88j4JhwNoq/uonH4Pqk\n"
+                           
"B8Y3qAQr4RuSH0WkwDUOsALhqBX4N1QwI1USAQEDbNAqeP5698X7GD3tXcQSmZrg\n"
+                           
"O8WfdjBCRNjkq4EW9xX/vQKBgQDONtmwJ0iHiu2BseyeVo/4fzfKlgUSNQ4K1rOA\n"
+                           
"xhIdMeu8Bxa/z7caHsGC4SVPSuYCtbE2Kh6BwapChcPJXCD45fgEViiJLuJiwEj1\n"
+                           
"caTpyvNsf1IoffJvCe9ZxtMyX549P8ZOgC3Dt0hN5CBrGLwu2Ox5l+YrqT10pi+5\n"
+                           
"JZX1UQKBgQCrcXrdkkDAc/a4+PxNRpJRLcU4fhv8/lr+UWItE8eUe7bd25bTQfQm\n"
+                           
"VpNKc/kAJ66PjIED6fy3ADhd2y4naT2a24uAgQ/M494J68qLnGh6K4JU/09uxR2v\n"
+                           
"1i2q/4FNLdFFk1XP4iNnTHRLZ+NYr2p5Y9RcvQfTjOauz8Ahav0lyg==\n"
+                           "-----END RSA PRIVATE KEY-----\n";
 
 #endif
diff --git a/src/testcurl/mhd_has_in_name.h b/src/testcurl/mhd_has_in_name.h
index 50f32cca..aff15e15 100644
--- a/src/testcurl/mhd_has_in_name.h
+++ b/src/testcurl/mhd_has_in_name.h
@@ -39,27 +39,27 @@
  *         name.
  */
 static int
-has_in_name(const char *prog_name, const char *marker)
+has_in_name (const char *prog_name, const char *marker)
 {
   size_t name_pos;
   size_t pos;
 
-  if (!prog_name || !marker || !prog_name[0] || !marker[0])
+  if (! prog_name || ! marker || ! prog_name[0] || ! marker[0])
     return 0;
 
   pos = 0;
   name_pos = 0;
   while (prog_name[pos])
-    {
-      if ('/' == prog_name[pos])
-        name_pos = pos + 1;
+  {
+    if ('/' == prog_name[pos])
+      name_pos = pos + 1;
 #if defined(_WIN32) || defined(__CYGWIN__)
-      else if ('\\' == prog_name[pos])
-        name_pos = pos + 1;
+    else if ('\\' == prog_name[pos])
+      name_pos = pos + 1;
 #endif /* _WIN32 || __CYGWIN__ */
-      pos++;
-    }
+    pos++;
+  }
   if (name_pos == pos)
     return 0;
-  return strstr(prog_name + name_pos, marker) != (char*)0;
+  return strstr (prog_name + name_pos, marker) != (char*) 0;
 }
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index a0af70cd..112046d5 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -51,10 +51,10 @@
 #include <sys/socket.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -91,8 +91,8 @@ now ()
   struct timeval tv;
 
   gettimeofday (&tv, NULL);
-  return (((unsigned long long) tv.tv_sec * 1000LL) +
-         ((unsigned long long) tv.tv_usec / 1000LL));
+  return (((unsigned long long) tv.tv_sec * 1000LL)
+          + ((unsigned long long) tv.tv_usec / 1000LL));
 }
 
 
@@ -100,7 +100,7 @@ now ()
  * Start the timer.
  */
 static void
-start_timer()
+start_timer ()
 {
   start_time = now ();
 }
@@ -114,17 +114,17 @@ start_timer()
 static void
 stop (const char *desc)
 {
-  double rps = ((double) (ROUNDS * 1000)) / ((double) (now() - start_time));
+  double rps = ((double) (ROUNDS * 1000)) / ((double) (now () - start_time));
 
   fprintf (stderr,
-          "Sequential GETs using %s: %f %s\n",
-          desc,
-          rps,
-          "requests/s");
+           "Sequential GETs using %s: %f %s\n",
+           desc,
+           rps,
+           "requests/s");
   GAUGER (desc,
-         "Sequential GETs",
-         rps,
-         "requests/s");
+          "Sequential GETs",
+          rps,
+          "requests/s");
 }
 
 
@@ -138,8 +138,8 @@ struct CBC
 
 static size_t
 copyBuffer (void *ptr,
-           size_t size, size_t nmemb,
-           void *ctx)
+            size_t size, size_t nmemb,
+            void *ctx)
 {
   struct CBC *cbc = ctx;
 
@@ -162,16 +162,16 @@ ahc_echo (void *cls,
   static int ptr;
   const char *me = cls;
   int ret;
-  (void)url;(void)version;                      /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   if (ret == MHD_NO)
@@ -191,60 +191,64 @@ testInternalGet (int port, int poll_flag)
   unsigned int i;
   char url[64];
 
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
   cbc.buf = buf;
   cbc.size = 2048;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/hello_world";,
             port);
   start_timer ();
-  for (i=0;i<ROUNDS;i++)
+  for (i = 0; i<ROUNDS; i++)
+  {
+    cbc.pos = 0;
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    /* NOTE: use of CONNECTTIMEOUT without also
+ setting NOSIGNAL results in really weird
+ crashes on my system!*/
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    if (CURLE_OK != (errornum = curl_easy_perform (c)))
     {
-      cbc.pos = 0;
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      if (oneone)
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      /* NOTE: use of CONNECTTIMEOUT without also
-        setting NOSIGNAL results in really weird
-        crashes on my system!*/
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      if (CURLE_OK != (errornum = curl_easy_perform (c)))
-       {
-         fprintf (stderr,
-                  "curl_easy_perform failed: `%s'\n",
-                  curl_easy_strerror (errornum));
-         curl_easy_cleanup (c);
-         MHD_stop_daemon (d);
-         return 2;
-       }
+      fprintf (stderr,
+               "curl_easy_perform failed: `%s'\n",
+               curl_easy_strerror (errornum));
       curl_easy_cleanup (c);
+      MHD_stop_daemon (d);
+      return 2;
     }
+    curl_easy_cleanup (c);
+  }
   stop (poll_flag == MHD_USE_AUTO ? "internal thread with 'auto'" :
         poll_flag == MHD_USE_POLL ? "internal thread with poll()" :
-       poll_flag == MHD_USE_EPOLL ? "internal thread with epoll" : "internal 
thread with select()");
+        poll_flag == MHD_USE_EPOLL ? "internal thread with epoll" :
+        "internal thread with select()");
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 4;
@@ -265,61 +269,68 @@ testMultithreadedGet (int port, int poll_flag)
   unsigned int i;
   char url[64];
 
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
   cbc.buf = buf;
   cbc.size = 2048;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | poll_flag,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/hello_world";,
             port);
   start_timer ();
-  for (i=0;i<ROUNDS;i++)
+  for (i = 0; i<ROUNDS; i++)
+  {
+    cbc.pos = 0;
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+ setting NOSIGNAL results in really weird
+ crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    if (CURLE_OK != (errornum = curl_easy_perform (c)))
     {
-      cbc.pos = 0;
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      if (oneone)
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-        setting NOSIGNAL results in really weird
-        crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      if (CURLE_OK != (errornum = curl_easy_perform (c)))
-       {
-         fprintf (stderr,
-                  "curl_easy_perform failed: `%s'\n",
-                  curl_easy_strerror (errornum));
-         curl_easy_cleanup (c);
-         MHD_stop_daemon (d);
-         return 32;
-       }
+      fprintf (stderr,
+               "curl_easy_perform failed: `%s'\n",
+               curl_easy_strerror (errornum));
       curl_easy_cleanup (c);
+      MHD_stop_daemon (d);
+      return 32;
     }
-  stop ((poll_flag & MHD_USE_AUTO) ? "internal thread with 'auto' and thread 
per connection" :
-        (poll_flag & MHD_USE_POLL) ? "internal thread with poll() and thread 
per connection" :
-       (poll_flag & MHD_USE_EPOLL) ? "internal thread with epoll and thread 
per connection" :
-           "internal thread with select() and thread per connection");
+    curl_easy_cleanup (c);
+  }
+  stop ((poll_flag & MHD_USE_AUTO) ?
+        "internal thread with 'auto' and thread per connection" :
+        (poll_flag & MHD_USE_POLL) ?
+        "internal thread with poll() and thread per connection" :
+        (poll_flag & MHD_USE_EPOLL) ?
+        "internal thread with epoll and thread per connection" :
+        "internal thread with select() and thread per connection");
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 64;
@@ -339,61 +350,65 @@ testMultithreadedPoolGet (int port, int poll_flag)
   unsigned int i;
   char url[64];
 
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
   cbc.buf = buf;
   cbc.size = 2048;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/hello_world";,
             port);
   start_timer ();
-  for (i=0;i<ROUNDS;i++)
+  for (i = 0; i<ROUNDS; i++)
+  {
+    cbc.pos = 0;
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+ setting NOSIGNAL results in really weird
+ crashes on my system!*/
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    if (CURLE_OK != (errornum = curl_easy_perform (c)))
     {
-      cbc.pos = 0;
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      if (oneone)
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-        setting NOSIGNAL results in really weird
-        crashes on my system!*/
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      if (CURLE_OK != (errornum = curl_easy_perform (c)))
-       {
-         fprintf (stderr,
-                  "curl_easy_perform failed: `%s'\n",
-                  curl_easy_strerror (errornum));
-         curl_easy_cleanup (c);
-         MHD_stop_daemon (d);
-         return 32;
-       }
+      fprintf (stderr,
+               "curl_easy_perform failed: `%s'\n",
+               curl_easy_strerror (errornum));
       curl_easy_cleanup (c);
+      MHD_stop_daemon (d);
+      return 32;
     }
+    curl_easy_cleanup (c);
+  }
   stop (0 != (poll_flag & MHD_USE_AUTO) ? "internal thread pool with 'auto'" :
         0 != (poll_flag & MHD_USE_POLL) ? "internal thread pool with poll()" :
-       0 != (poll_flag & MHD_USE_EPOLL) ? "internal thread pool with epoll" : 
"internal thread pool with select()");
+        0 != (poll_flag & MHD_USE_EPOLL) ? "internal thread pool with epoll" :
+        "internal thread pool with select()");
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 64;
@@ -427,7 +442,7 @@ testExternalGet (int port)
   unsigned int i;
   char url[64];
 
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
   multi = NULL;
@@ -440,13 +455,15 @@ testExternalGet (int port)
   if (NULL == d)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/hello_world";,
@@ -454,116 +471,119 @@ testExternalGet (int port)
   start_timer ();
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  for (i = 0; i<ROUNDS; i++)
+  {
+    cbc.pos = 0;
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+ setting NOSIGNAL results in really weird
+ crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
     {
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 1024;
     }
-  for (i=0;i<ROUNDS;i++)
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
     {
-      cbc.pos = 0;
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      if (oneone)
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-       curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-        setting NOSIGNAL results in really weird
-        crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      mret = curl_multi_add_handle (multi, c);
+      maxsock = MHD_INVALID_SOCKET;
+      maxposixs = -1;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
       if (mret != CURLM_OK)
-       {
-         curl_multi_cleanup (multi);
-         curl_easy_cleanup (c);
-         MHD_stop_daemon (d);
-         return 1024;
-       }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-       {
-         maxsock = MHD_INVALID_SOCKET;
-         maxposixs = -1;
-         FD_ZERO (&rs);
-         FD_ZERO (&ws);
-         FD_ZERO (&es);
-         curl_multi_perform (multi, &running);
-         mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-         if (mret != CURLM_OK)
-           {
-             curl_multi_remove_handle (multi, c);
-             curl_multi_cleanup (multi);
-             curl_easy_cleanup (c);
-             MHD_stop_daemon (d);
-             return 2048;
-           }
-         if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-           {
-             curl_multi_remove_handle (multi, c);
-             curl_multi_cleanup (multi);
-             curl_easy_cleanup (c);
-             MHD_stop_daemon (d);
-             return 4096;
-           }
-         tv.tv_sec = 0;
-         tv.tv_usec = 1000;
-         if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-            {
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+      {
 #ifdef MHD_POSIX_SOCKETS
-              if (EINTR != errno)
-                abort ();
+        if (EINTR != errno)
+          abort ();
 #else
-              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-                abort ();
-              Sleep (1000);
+        if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                      ws.
+                                                                      fd_count)
+            ||(0 != es.fd_count) )
+          abort ();
+        Sleep (1000);
 #endif
-            }
-         curl_multi_perform (multi, &running);
-         if (running == 0)
-           {
-             msg = curl_multi_info_read (multi, &running);
-             if (msg == NULL)
-               break;
-             if (msg->msg == CURLMSG_DONE)
-               {
-                 if (msg->data.result != CURLE_OK)
-                   printf ("%s failed at %s:%d: `%s'\n",
-                           "curl_multi_perform",
-                           __FILE__,
-                           __LINE__, curl_easy_strerror (msg->data.result));
-                 curl_multi_remove_handle (multi, c);
-                 curl_easy_cleanup (c);
-                 c = NULL;
-               }
-           }
-         /* two possibilities here; as select sets are
-            tiny, this makes virtually no difference
-            in actual runtime right now, even though the
-            number of select calls is virtually cut in half
-            (and 'select' is the most expensive of our system
-            calls according to 'strace') */
-         if (0)
-           MHD_run (d);
-         else
-           MHD_run_from_select (d, &rs, &ws, &es);
-       }
-      if (NULL != c)
-       {
-         curl_multi_remove_handle (multi, c);
-         curl_easy_cleanup (c);
-         fprintf (stderr, "Timeout!?\n");
-       }
+      }
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        msg = curl_multi_info_read (multi, &running);
+        if (msg == NULL)
+          break;
+        if (msg->msg == CURLMSG_DONE)
+        {
+          if (msg->data.result != CURLE_OK)
+            printf ("%s failed at %s:%d: `%s'\n",
+                    "curl_multi_perform",
+                    __FILE__,
+                    __LINE__, curl_easy_strerror (msg->data.result));
+          curl_multi_remove_handle (multi, c);
+          curl_easy_cleanup (c);
+          c = NULL;
+        }
+      }
+      /* two possibilities here; as select sets are
+         tiny, this makes virtually no difference
+         in actual runtime right now, even though the
+         number of select calls is virtually cut in half
+         (and 'select' is the most expensive of our system
+         calls according to 'strace') */
+      if (0)
+        MHD_run (d);
+      else
+        MHD_run_from_select (d, &rs, &ws, &es);
     }
-  stop ("external select");
-  if (multi != NULL)
+    if (NULL != c)
     {
-      curl_multi_cleanup (multi);
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
+      fprintf (stderr, "Timeout!?\n");
     }
+  }
+  stop ("external select");
+  if (multi != NULL)
+  {
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -578,9 +598,9 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
   int port = 1130;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (oneone)
@@ -588,29 +608,29 @@ main (int argc, char *const *argv)
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   response = MHD_create_response_from_buffer (strlen ("/hello_world"),
-                                             "/hello_world",
-                                             MHD_RESPMEM_MUST_COPY);
+                                              "/hello_world",
+                                              MHD_RESPMEM_MUST_COPY);
   errorCount += testExternalGet (port++);
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalGet (port++, MHD_USE_AUTO);
+    errorCount += testMultithreadedGet (port++, MHD_USE_AUTO);
+    errorCount += testMultithreadedPoolGet (port++, MHD_USE_AUTO);
+    errorCount += testInternalGet (port++, 0);
+    errorCount += testMultithreadedGet (port++, 0);
+    errorCount += testMultithreadedPoolGet (port++, 0);
+    if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_POLL))
+    {
+      errorCount += testInternalGet (port++, MHD_USE_POLL);
+      errorCount += testMultithreadedGet (port++, MHD_USE_POLL);
+      errorCount += testMultithreadedPoolGet (port++, MHD_USE_POLL);
+    }
+    if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL))
     {
-      errorCount += testInternalGet (port++, MHD_USE_AUTO);
-      errorCount += testMultithreadedGet (port++, MHD_USE_AUTO);
-      errorCount += testMultithreadedPoolGet (port++, MHD_USE_AUTO);
-      errorCount += testInternalGet (port++, 0);
-      errorCount += testMultithreadedGet (port++, 0);
-      errorCount += testMultithreadedPoolGet (port++, 0);
-      if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
-       {
-         errorCount += testInternalGet(port++, MHD_USE_POLL);
-         errorCount += testMultithreadedGet(port++, MHD_USE_POLL);
-         errorCount += testMultithreadedPoolGet(port++, MHD_USE_POLL);
-       }
-      if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
-       {
-         errorCount += testInternalGet(port++, MHD_USE_EPOLL);
-         errorCount += testMultithreadedPoolGet(port++, MHD_USE_EPOLL);
-       }
+      errorCount += testInternalGet (port++, MHD_USE_EPOLL);
+      errorCount += testMultithreadedPoolGet (port++, MHD_USE_EPOLL);
     }
+  }
   MHD_destroy_response (response);
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/perf_get_concurrent.c 
b/src/testcurl/perf_get_concurrent.c
index 336a1d1e..b4cd6d8d 100644
--- a/src/testcurl/perf_get_concurrent.c
+++ b/src/testcurl/perf_get_concurrent.c
@@ -43,10 +43,10 @@
 #include "gauger.h"
 #include "mhd_has_in_name.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -98,8 +98,8 @@ now ()
   struct timeval tv;
 
   gettimeofday (&tv, NULL);
-  return (((unsigned long long) tv.tv_sec * 1000LL) +
-         ((unsigned long long) tv.tv_usec / 1000LL));
+  return (((unsigned long long) tv.tv_sec * 1000LL)
+          + ((unsigned long long) tv.tv_usec / 1000LL));
 }
 
 
@@ -107,7 +107,7 @@ now ()
  * Start the timer.
  */
 static void
-start_timer()
+start_timer ()
 {
   start_time = now ();
 }
@@ -121,26 +121,27 @@ start_timer()
 static void
 stop (const char *desc)
 {
-  double rps = ((double) (PAR * ROUNDS * 1000)) / ((double) (now() - 
start_time));
+  double rps = ((double) (PAR * ROUNDS * 1000)) / ((double) (now ()
+                                                             - start_time));
 
   fprintf (stderr,
-          "Parallel GETs using %s: %f %s\n",
-          desc,
-          rps,
-          "requests/s");
+           "Parallel GETs using %s: %f %s\n",
+           desc,
+           rps,
+           "requests/s");
   GAUGER (desc,
-         "Parallel GETs",
-         rps,
-         "requests/s");
+          "Parallel GETs",
+          rps,
+          "requests/s");
 }
 
 
 static size_t
 copyBuffer (void *ptr,
-           size_t size, size_t nmemb,
-           void *ctx)
+            size_t size, size_t nmemb,
+            void *ctx)
 {
-  (void)ptr;(void)ctx;          /* Unused. Silent compiler warning. */
+  (void) ptr; (void) ctx;          /* Unused. Silent compiler warning. */
   return size * nmemb;
 }
 
@@ -157,16 +158,16 @@ ahc_echo (void *cls,
   static int ptr;
   const char *me = cls;
   int ret;
-  (void)url;(void)version;                      /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   if (ret == MHD_NO)
@@ -181,7 +182,7 @@ thread_gets (void *param)
   CURL *c;
   CURLcode errornum;
   unsigned int i;
-  char * const url = (char*) param;
+  char *const url = (char*) param;
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, url);
@@ -198,17 +199,17 @@ thread_gets (void *param)
      setting NOSIGNAL results in really weird
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-  for (i=0;i<ROUNDS;i++)
+  for (i = 0; i<ROUNDS; i++)
+  {
+    if (CURLE_OK != (errornum = curl_easy_perform (c)))
     {
-      if (CURLE_OK != (errornum = curl_easy_perform (c)))
-        {
-          fprintf (stderr,
-                   "curl_easy_perform failed: `%s'\n",
-                   curl_easy_strerror (errornum));
-          curl_easy_cleanup (c);
-          return "curl error";
-        }
+      fprintf (stderr,
+               "curl_easy_perform failed: `%s'\n",
+               curl_easy_strerror (errornum));
+      curl_easy_cleanup (c);
+      return "curl error";
     }
+  }
   curl_easy_cleanup (c);
 
   return NULL;
@@ -216,34 +217,34 @@ thread_gets (void *param)
 
 
 static void *
-do_gets (void * param)
+do_gets (void *param)
 {
   int j;
   pthread_t par[PAR];
   char url[64];
-  int port = (int)(intptr_t)param;
+  int port = (int) (intptr_t) param;
   char *err = NULL;
 
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/hello_world";,
             port);
-  for (j=0;j<PAR;j++)
-    {
-      if (0 != pthread_create(&par[j], NULL, &thread_gets, (void*)url))
-        {
-          for (j--; j >= 0; j--)
-            pthread_join(par[j], NULL);
-          return "pthread_create error";
-        }
-    }
-  for (j=0;j<PAR;j++)
+  for (j = 0; j<PAR; j++)
+  {
+    if (0 != pthread_create (&par[j], NULL, &thread_gets, (void*) url))
     {
-      char *ret_val;
-      if (0 != pthread_join(par[j], (void**)&ret_val) ||
-          NULL != ret_val)
-        err = ret_val;
+      for (j--; j >= 0; j--)
+        pthread_join (par[j], NULL);
+      return "pthread_create error";
     }
+  }
+  for (j = 0; j<PAR; j++)
+  {
+    char *ret_val;
+    if ((0 != pthread_join (par[j], (void**) &ret_val)) ||
+        (NULL != ret_val) )
+      err = ret_val;
+  }
   signal_done = 1;
   return err;
 }
@@ -253,38 +254,45 @@ static int
 testInternalGet (int port, int poll_flag)
 {
   struct MHD_Daemon *d;
-  const char * const test_desc = ((poll_flag & MHD_USE_AUTO) ? "internal 
thread with 'auto'" :
-                                  (poll_flag & MHD_USE_POLL) ? "internal 
thread with poll()" :
-                                  (poll_flag & MHD_USE_EPOLL) ? "internal 
thread with epoll" : "internal thread with select()");
-  const char * ret_val;
-
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ?
+                                 "internal thread with 'auto'" :
+                                 (poll_flag & MHD_USE_POLL) ?
+                                 "internal thread with poll()" :
+                                 (poll_flag & MHD_USE_EPOLL) ?
+                                 "internal thread with epoll" :
+                                 "internal thread with select()");
+  const char *ret_val;
+
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
   signal_done = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   start_timer ();
-  ret_val = do_gets ((void*)(intptr_t)port);
-  if (!ret_val)
+  ret_val = do_gets ((void*) (intptr_t) port);
+  if (! ret_val)
     stop (test_desc);
   MHD_stop_daemon (d);
   if (ret_val)
-    {
-      fprintf (stderr,
-               "Error performing %s test: %s\n", test_desc, ret_val);
-      return 4;
-    }
+  {
+    fprintf (stderr,
+             "Error performing %s test: %s\n", test_desc, ret_val);
+    return 4;
+  }
   return 0;
 }
 
@@ -293,39 +301,49 @@ static int
 testMultithreadedGet (int port, int poll_flag)
 {
   struct MHD_Daemon *d;
-  const char * const test_desc = ((poll_flag & MHD_USE_AUTO) ? "internal 
thread with 'auto' and thread per connection" :
-                                  (poll_flag & MHD_USE_POLL) ? "internal 
thread with poll() and thread per connection" :
-                                  (poll_flag & MHD_USE_EPOLL) ? "internal 
thread with epoll and thread per connection"
-                                      : "internal thread with select() and 
thread per connection");
-  const char * ret_val;
-
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ?
+                                 "internal thread with 'auto' and thread per 
connection"
+                                 :
+                                 (poll_flag & MHD_USE_POLL) ?
+                                 "internal thread with poll() and thread per 
connection"
+                                 :
+                                 (poll_flag & MHD_USE_EPOLL) ?
+                                 "internal thread with epoll and thread per 
connection"
+                                 :
+                                 "internal thread with select() and thread per 
connection");
+  const char *ret_val;
+
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
   signal_done = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | poll_flag,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   start_timer ();
-  ret_val = do_gets ((void*)(intptr_t)port);
-  if (!ret_val)
+  ret_val = do_gets ((void*) (intptr_t) port);
+  if (! ret_val)
     stop (test_desc);
   MHD_stop_daemon (d);
   if (ret_val)
-    {
-      fprintf (stderr,
-               "Error performing %s test: %s\n", test_desc, ret_val);
-      return 4;
-    }
+  {
+    fprintf (stderr,
+             "Error performing %s test: %s\n", test_desc, ret_val);
+    return 4;
+  }
   return 0;
 }
 
@@ -334,39 +352,46 @@ static int
 testMultithreadedPoolGet (int port, int poll_flag)
 {
   struct MHD_Daemon *d;
-  const char * const test_desc = ((poll_flag & MHD_USE_AUTO) ? "internal 
thread pool with 'auto'" :
-                                  (poll_flag & MHD_USE_POLL) ? "internal 
thread pool with poll()" :
-                                  (poll_flag & MHD_USE_EPOLL) ? "internal 
thread poll with epoll" : "internal thread pool with select()");
-  const char * ret_val;
-
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ?
+                                 "internal thread pool with 'auto'" :
+                                 (poll_flag & MHD_USE_POLL) ?
+                                 "internal thread pool with poll()" :
+                                 (poll_flag & MHD_USE_EPOLL) ?
+                                 "internal thread poll with epoll" :
+                                 "internal thread pool with select()");
+  const char *ret_val;
+
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
-  signal_done = 0 ;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
poll_flag,
+  signal_done = 0;
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   start_timer ();
-  ret_val = do_gets ((void*)(intptr_t)port);
-  if (!ret_val)
+  ret_val = do_gets ((void*) (intptr_t) port);
+  if (! ret_val)
     stop (test_desc);
   MHD_stop_daemon (d);
   if (ret_val)
-    {
-      fprintf (stderr,
-               "Error performing %s test: %s\n", test_desc, ret_val);
-      return 4;
-    }
+  {
+    fprintf (stderr,
+             "Error performing %s test: %s\n", test_desc, ret_val);
+    return 4;
+  }
   return 0;
 }
 
@@ -386,7 +411,7 @@ testExternalGet (int port)
   char *ret_val;
   int ret = 0;
 
-  if (MHD_NO != MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT))
+  if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
 
   signal_done = 0;
@@ -395,66 +420,71 @@ testExternalGet (int port)
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   if (0 != pthread_create (&pid, NULL,
-                          &do_gets, (void*)(intptr_t)port))
-    {
-      MHD_stop_daemon(d);
-      return 512;
-    }
+                           &do_gets, (void*) (intptr_t) port))
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
   start_timer ();
 
   while (0 == signal_done)
+  {
+    max = 0;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+    {
+      MHD_stop_daemon (d);
+      return 4096;
+    }
+    tret = MHD_get_timeout (d, &tt);
+    if (MHD_YES != tret)
+      tt = 1;
+    tv.tv_sec = tt / 1000;
+    tv.tv_usec = 1000 * (tt % 1000);
+    if (-1 == select (max + 1, &rs, &ws, &es, &tv))
     {
-      max = 0;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-       {
-         MHD_stop_daemon (d);
-         return 4096;
-       }
-      tret = MHD_get_timeout (d, &tt);
-      if (MHD_YES != tret) tt = 1;
-      tv.tv_sec = tt / 1000;
-      tv.tv_usec = 1000 * (tt % 1000);
-      if (-1 == select (max + 1, &rs, &ws, &es, &tv))
-       {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR == errno)
-            continue;
-          fprintf (stderr,
-                   "select failed: %s\n",
-                   strerror (errno));
+      if (EINTR == errno)
+        continue;
+      fprintf (stderr,
+               "select failed: %s\n",
+               strerror (errno));
 #else
-          if (WSAEINVAL == WSAGetLastError() && 0 == rs.fd_count && 0 == 
ws.fd_count && 0 == es.fd_count)
-            {
-              Sleep (1000);
-              continue;
-            }
+      if ((WSAEINVAL == WSAGetLastError ()) &&(0 == rs.fd_count) &&(0 ==
+                                                                    
ws.fd_count)
+          &&(0 == es.fd_count) )
+      {
+        Sleep (1000);
+        continue;
+      }
 #endif
-         ret |= 1024;
-         break;
-       }
-      MHD_run_from_select(d, &rs, &ws, &es);
+      ret |= 1024;
+      break;
     }
+    MHD_run_from_select (d, &rs, &ws, &es);
+  }
 
   stop ("external select");
   MHD_stop_daemon (d);
-  if (0 != pthread_join(pid, (void**)&ret_val) ||
-      NULL != ret_val)
-    {
-      fprintf (stderr,
-               "%s\n", ret_val);
-      ret |= 8;
-    }
+  if ((0 != pthread_join (pid, (void**) &ret_val))||
+      (NULL != ret_val) )
+  {
+    fprintf (stderr,
+             "%s\n", ret_val);
+    ret |= 8;
+  }
   if (ret)
     fprintf (stderr, "Error performing test.\n");
   return 0;
@@ -466,9 +496,9 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
   int port = 1100;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (oneone)
@@ -476,8 +506,8 @@ main (int argc, char *const *argv)
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   response = MHD_create_response_from_buffer (strlen ("/hello_world"),
-                                             "/hello_world",
-                                             MHD_RESPMEM_MUST_COPY);
+                                              "/hello_world",
+                                              MHD_RESPMEM_MUST_COPY);
   errorCount += testInternalGet (port++, 0);
   errorCount += testMultithreadedGet (port++, 0);
   errorCount += testMultithreadedPoolGet (port++, 0);
@@ -485,17 +515,17 @@ main (int argc, char *const *argv)
   errorCount += testInternalGet (port++, MHD_USE_AUTO);
   errorCount += testMultithreadedGet (port++, MHD_USE_AUTO);
   errorCount += testMultithreadedPoolGet (port++, MHD_USE_AUTO);
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
-    {
-      errorCount += testInternalGet (port++, MHD_USE_POLL);
-      errorCount += testMultithreadedGet (port++, MHD_USE_POLL);
-      errorCount += testMultithreadedPoolGet (port++, MHD_USE_POLL);
-    }
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
-    {
-      errorCount += testInternalGet (port++, MHD_USE_EPOLL);
-      errorCount += testMultithreadedPoolGet (port++, MHD_USE_EPOLL);
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_POLL))
+  {
+    errorCount += testInternalGet (port++, MHD_USE_POLL);
+    errorCount += testMultithreadedGet (port++, MHD_USE_POLL);
+    errorCount += testMultithreadedPoolGet (port++, MHD_USE_POLL);
+  }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL))
+  {
+    errorCount += testInternalGet (port++, MHD_USE_EPOLL);
+    errorCount += testMultithreadedPoolGet (port++, MHD_USE_EPOLL);
+  }
   MHD_destroy_response (response);
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_callback.c b/src/testcurl/test_callback.c
index 5b1062fe..a0480932 100644
--- a/src/testcurl/test_callback.c
+++ b/src/testcurl/test_callback.c
@@ -35,56 +35,56 @@ struct callback_closure
 
 
 static ssize_t
-called_twice(void *cls, uint64_t pos, char *buf, size_t max)
+called_twice (void *cls, uint64_t pos, char *buf, size_t max)
 {
   struct callback_closure *cls2 = cls;
 
   (void) pos;    /* Unused. Silence compiler warning. */
   (void) max;
   if (cls2->called == 0)
-    {
-      memcpy(buf, "test", 5);
-      cls2->called = 1;
-      return strlen(buf);
-    }
+  {
+    memcpy (buf, "test", 5);
+    cls2->called = 1;
+    return strlen (buf);
+  }
   if (cls2->called == 1)
-    {
-      cls2->called = 2;
-      return MHD_CONTENT_READER_END_OF_STREAM;
-    }
-  fprintf(stderr,
-         "Handler called after returning END_OF_STREAM!\n");
+  {
+    cls2->called = 2;
+    return MHD_CONTENT_READER_END_OF_STREAM;
+  }
+  fprintf (stderr,
+           "Handler called after returning END_OF_STREAM!\n");
   return MHD_CONTENT_READER_END_WITH_ERROR;
 }
 
 
 static int
-callback(void *cls,
-         struct MHD_Connection *connection,
-         const char *url,
-        const char *method,
-         const char *version,
-         const char *upload_data,
-        size_t *upload_data_size,
-         void **con_cls)
+callback (void *cls,
+          struct MHD_Connection *connection,
+          const char *url,
+          const char *method,
+          const char *version,
+          const char *upload_data,
+          size_t *upload_data_size,
+          void **con_cls)
 {
-  struct callback_closure *cbc = calloc(1, sizeof(struct callback_closure));
+  struct callback_closure *cbc = calloc (1, sizeof(struct callback_closure));
   struct MHD_Response *r;
   int ret;
 
-  (void)cls;
-  (void)url;                          /* Unused. Silent compiler warning. */
-  (void)method;
-  (void)version;
-  (void)upload_data; /* Unused. Silent compiler warning. */
-  (void)upload_data_size;
-  (void)con_cls;         /* Unused. Silent compiler warning. */
+  (void) cls;
+  (void) url;                          /* Unused. Silent compiler warning. */
+  (void) method;
+  (void) version;
+  (void) upload_data; /* Unused. Silent compiler warning. */
+  (void) upload_data_size;
+  (void) con_cls;         /* Unused. Silent compiler warning. */
 
   if (NULL == cbc)
     return MHD_NO;
   r = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 1024,
-                                        &called_twice, cbc,
-                                        &free);
+                                         &called_twice, cbc,
+                                         &free);
   if (NULL == r)
   {
     free (cbc);
@@ -104,13 +104,13 @@ discard_buffer (void *ptr,
                 size_t nmemb,
                 void *ctx)
 {
-  (void)ptr;(void)ctx;  /* Unused. Silent compiler warning. */
+  (void) ptr; (void) ctx;  /* Unused. Silent compiler warning. */
   return size * nmemb;
 }
 
 
 int
-main(int argc, char **argv)
+main (int argc, char **argv)
 {
   struct MHD_Daemon *d;
   fd_set rs;
@@ -130,33 +130,35 @@ main(int argc, char **argv)
   struct timeval tv;
   int extra;
   int port;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
     port = 1140;
 
-  d = MHD_start_daemon(0,
-                      port,
-                      NULL,
-                      NULL,
-                      &callback,
-                      NULL,
-                      MHD_OPTION_END);
+  d = MHD_start_daemon (0,
+                        port,
+                        NULL,
+                        NULL,
+                        &callback,
+                        NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 32;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 48; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 48;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &discard_buffer);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
   curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
@@ -165,87 +167,89 @@ main(int argc, char **argv)
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   multi = curl_multi_init ();
   if (multi == NULL)
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 1;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1;
+  }
   mret = curl_multi_add_handle (multi, c);
   if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
+  extra = 10;
+  while ( (c != NULL) || (--extra > 0) )
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&ws);
+    FD_ZERO (&rs);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    if (NULL != multi)
+    {
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+      if (mret != CURLM_OK)
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 3;
+      }
+    }
+    if (MHD_YES !=
+        MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 2;
+      return 4;
     }
-  extra = 10;
-  while ( (c != NULL) || (--extra > 0) )
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+    {
+#ifdef MHD_POSIX_SOCKETS
+      if (EINTR != errno)
+        abort ();
+#else
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
+#endif
+    }
+    if (NULL != multi)
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO(&ws);
-      FD_ZERO(&rs);
-      FD_ZERO(&es);
       curl_multi_perform (multi, &running);
-      if (NULL != multi)
-       {
-         mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-         if (mret != CURLM_OK)
-           {
-             curl_multi_remove_handle (multi, c);
-             curl_multi_cleanup (multi);
-             curl_easy_cleanup (c);
-             MHD_stop_daemon (d);
-             return 3;
-           }
-       }
-      if (MHD_YES !=
-         MHD_get_fdset(d, &rs, &ws, &es, &maxsock))
-       {
+      if (running == 0)
+      {
+        msg = curl_multi_info_read (multi, &running);
+        if (msg == NULL)
+          break;
+        if (msg->msg == CURLMSG_DONE)
+        {
+          if (msg->data.result != CURLE_OK)
+            printf ("%s failed at %s:%d: `%s'\n",
+                    "curl_multi_perform",
+                    __FILE__,
+                    __LINE__, curl_easy_strerror (msg->data.result));
           curl_multi_remove_handle (multi, c);
           curl_multi_cleanup (multi);
           curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-         return 4;
-       }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
-#ifdef MHD_POSIX_SOCKETS
-              if (EINTR != errno)
-                abort ();
-#else
-              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-                abort ();
-              Sleep (1000);
-#endif
+          c = NULL;
+          multi = NULL;
         }
-      if (NULL != multi)
-       {
-         curl_multi_perform (multi, &running);
-         if (running == 0)
-           {
-             msg = curl_multi_info_read (multi, &running);
-             if (msg == NULL)
-               break;
-             if (msg->msg == CURLMSG_DONE)
-               {
-                 if (msg->data.result != CURLE_OK)
-                   printf ("%s failed at %s:%d: `%s'\n",
-                           "curl_multi_perform",
-                           __FILE__,
-                           __LINE__, curl_easy_strerror (msg->data.result));
-                 curl_multi_remove_handle (multi, c);
-                 curl_multi_cleanup (multi);
-                 curl_easy_cleanup (c);
-                 c = NULL;
-                 multi = NULL;
-               }
-           }
-       }
-      MHD_run(d);
+      }
     }
-  MHD_stop_daemon(d);
+    MHD_run (d);
+  }
+  MHD_stop_daemon (d);
   return 0;
 }
diff --git a/src/testcurl/test_concurrent_stop.c 
b/src/testcurl/test_concurrent_stop.c
index 71202add..02f4fffd 100644
--- a/src/testcurl/test_concurrent_stop.c
+++ b/src/testcurl/test_concurrent_stop.c
@@ -33,10 +33,10 @@
 #include <pthread.h>
 #include "gauger.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -81,50 +81,52 @@ thread_watchdog (void *param)
 
   seconds_passed = 0;
   while (watchdog_continue) /* Poor threads sync, but works for testing. */
+  {
+    if (0 == sleep (1))   /* Poor accuracy, but enough for testing. */
+      seconds_passed++;
+    if (timeout_val < seconds_passed)
     {
-      if (0 == sleep (1)) /* Poor accuracy, but enough for testing. */
-        seconds_passed++;
-      if (timeout_val < seconds_passed)
-        {
-          fprintf (stderr, "%s timeout expired.\n", watchdog_obj ? 
watchdog_obj : "Watchdog");
-          fflush (stderr);
-          _exit(16);
-        }
+      fprintf (stderr, "%s timeout expired.\n", watchdog_obj ? watchdog_obj :
+               "Watchdog");
+      fflush (stderr);
+      _exit (16);
     }
+  }
   return NULL;
 }
 
 pthread_t watchdog_tid;
 
 static void
-start_watchdog(int timeout, const char *obj_name)
+start_watchdog (int timeout, const char *obj_name)
 {
   watchdog_continue = 1;
   watchdog_obj = obj_name;
-  if (0 != pthread_create(&watchdog_tid, NULL, &thread_watchdog, 
(void*)(intptr_t)timeout))
-    {
-      fprintf(stderr, "Failed to start watchdog.\n");
-      _exit (99);
-    }
+  if (0 != pthread_create (&watchdog_tid, NULL, &thread_watchdog,
+                           (void*) (intptr_t) timeout))
+  {
+    fprintf (stderr, "Failed to start watchdog.\n");
+    _exit (99);
+  }
 }
 
 static void
-stop_watchdog(void)
+stop_watchdog (void)
 {
   watchdog_continue = 0;
   if (0 != pthread_join (watchdog_tid, NULL))
-    {
-      fprintf(stderr, "Failed to stop watchdog.\n");
-      _exit (99);
-    }
+  {
+    fprintf (stderr, "Failed to stop watchdog.\n");
+    _exit (99);
+  }
 }
 
 static size_t
 copyBuffer (void *ptr,
-           size_t size, size_t nmemb,
-           void *ctx)
+            size_t size, size_t nmemb,
+            void *ctx)
 {
-  (void)ptr;(void)ctx;  /* Unused. Silent compiler warning. */
+  (void) ptr; (void) ctx;  /* Unused. Silent compiler warning. */
   return size * nmemb;
 }
 
@@ -142,16 +144,16 @@ ahc_echo (void *cls,
   static int ptr;
   const char *me = cls;
   int ret;
-  (void)url;(void)version;                      /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
@@ -166,15 +168,15 @@ thread_gets (void *param)
 {
   CURL *c;
   CURLcode errornum;
-  char * const url = (char*) param;
+  char *const url = (char*) param;
 
   c = NULL;
   c = curl_easy_init ();
   if (NULL == c)
-    {
-      fprintf(stderr, "curl_easy_init failed.\n");
-      _exit(99);
-    }
+  {
+    fprintf (stderr, "curl_easy_init failed.\n");
+    _exit (99);
+  }
   curl_easy_setopt (c, CURLOPT_URL, url);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, NULL);
@@ -190,62 +192,62 @@ thread_gets (void *param)
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   while (continue_requesting)
+  {
+    errornum = curl_easy_perform (c);
+    if (CURLE_OK != errornum)
     {
-      errornum = curl_easy_perform (c);
-      if (CURLE_OK != errornum)
-        {
-          curl_easy_cleanup (c);
-          return NULL;
-        }
+      curl_easy_cleanup (c);
+      return NULL;
     }
+  }
   curl_easy_cleanup (c);
   return NULL;
 }
 
 static void *
-do_gets (void * param)
+do_gets (void *param)
 {
   int j;
   pthread_t par[PAR];
   char url[64];
-  int port = (int)(intptr_t)param;
+  int port = (int) (intptr_t) param;
 
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/hello_world";,
             port);
 
-  for (j=0;j<PAR;j++)
-    {
-      if (0 != pthread_create(&par[j], NULL, &thread_gets, (void*)url))
-        {
-          fprintf(stderr, "pthread_create failed.\n");
-          continue_requesting = 0;
-          for (j--; j >= 0; j--)
-            {
-              pthread_join(par[j], NULL);
-            }
-          _exit(99);
-        }
-    }
-  (void)sleep (1);
-  for (j=0;j<PAR;j++)
+  for (j = 0; j<PAR; j++)
+  {
+    if (0 != pthread_create (&par[j], NULL, &thread_gets, (void*) url))
     {
-      pthread_join(par[j], NULL);
+      fprintf (stderr, "pthread_create failed.\n");
+      continue_requesting = 0;
+      for (j--; j >= 0; j--)
+      {
+        pthread_join (par[j], NULL);
+      }
+      _exit (99);
     }
+  }
+  (void) sleep (1);
+  for (j = 0; j<PAR; j++)
+  {
+    pthread_join (par[j], NULL);
+  }
   return NULL;
 }
 
 
-pthread_t start_gets(int port)
+pthread_t start_gets (int port)
 {
   pthread_t tid;
   continue_requesting = 1;
-  if (0 != pthread_create(&tid, NULL, &do_gets, (void*)(intptr_t)port))
-    {
-      fprintf(stderr, "pthread_create failed.\n");
-      _exit(99);
-    }
+  if (0 != pthread_create (&tid, NULL, &do_gets, (void*) (intptr_t) port))
+  {
+    fprintf (stderr, "pthread_create failed.\n");
+    _exit (99);
+  }
   return tid;
 }
 
@@ -257,7 +259,9 @@ testMultithreadedGet (int port,
   struct MHD_Daemon *d;
   pthread_t p;
 
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | poll_flag,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port,
                         NULL, NULL,
                         &ahc_echo, "GET",
@@ -265,18 +269,20 @@ testMultithreadedGet (int port,
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   p = start_gets (port);
-  (void)sleep (1);
-  start_watchdog(10, "daemon_stop() in testMultithreadedGet");
+  (void) sleep (1);
+  start_watchdog (10, "daemon_stop() in testMultithreadedGet");
   MHD_stop_daemon (d);
-  stop_watchdog();
+  stop_watchdog ();
   continue_requesting = 0;
   pthread_join (p, NULL);
   return 0;
@@ -290,7 +296,8 @@ testMultithreadedPoolGet (int port,
   struct MHD_Daemon *d;
   pthread_t p;
 
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port,
                         NULL, NULL,
                         &ahc_echo, "GET",
@@ -299,18 +306,20 @@ testMultithreadedPoolGet (int port,
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   p = start_gets (port);
-  (void)sleep (1);
-  start_watchdog(10, "daemon_stop() in testMultithreadedPoolGet");
+  (void) sleep (1);
+  start_watchdog (10, "daemon_stop() in testMultithreadedPoolGet");
   MHD_stop_daemon (d);
-  stop_watchdog();
+  stop_watchdog ();
   continue_requesting = 0;
   pthread_join (p, NULL);
   return 0;
@@ -322,8 +331,8 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
   int port;
-  (void)argc;   /* Unused. Silent compiler warning. */
-  (void)argv;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
+  (void) argv;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -333,15 +342,16 @@ main (int argc, char *const *argv)
   /* Do reuse connection, otherwise all available local ports may exhausted. */
   oneone = 1;
 
-  if (0 != port && oneone)
+  if ((0 != port)&& oneone)
     port += 5;
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   response = MHD_create_response_from_buffer (strlen ("/hello_world"),
-                                             "/hello_world",
-                                             MHD_RESPMEM_MUST_COPY);
+                                              "/hello_world",
+                                              MHD_RESPMEM_MUST_COPY);
   errorCount += testMultithreadedGet (port, 0);
-  if (0 != port) port++;
+  if (0 != port)
+    port++;
   errorCount += testMultithreadedPoolGet (port, 0);
   MHD_destroy_response (response);
   if (errorCount != 0)
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c
index 35e9dc62..a3d14661 100644
--- a/src/testcurl/test_delete.c
+++ b/src/testcurl/test_delete.c
@@ -37,10 +37,10 @@
 #include <unistd.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -91,28 +91,28 @@ ahc_echo (void *cls,
   int *done = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)unused;   /* Unused. Silent compiler warning. */
+  (void) version; (void) unused;   /* Unused. Silent compiler warning. */
 
   if (0 != strcasecmp ("DELETE", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) == 0)
+  {
+    if (*upload_data_size != 8)
+      return MHD_YES;           /* not yet ready */
+    if (0 == memcmp (upload_data, "Hello123", 8))
     {
-      if (*upload_data_size != 8)
-        return MHD_YES;         /* not yet ready */
-      if (0 == memcmp (upload_data, "Hello123", 8))
-        {
-          *upload_data_size = 0;
-        }
-      else
-        {
-          printf ("Invalid upload data `%8s'!\n", upload_data);
-          return MHD_NO;
-        }
-      *done = 1;
-      return MHD_YES;
+      *upload_data_size = 0;
     }
+    else
+    {
+      printf ("Invalid upload data `%8s'!\n", upload_data);
+      return MHD_NO;
+    }
+    *done = 1;
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url), (void*) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -145,16 +145,18 @@ testInternalDelete ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -174,14 +176,14 @@ testInternalDelete ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -212,22 +214,25 @@ testMultithreadedDelete ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port,
                         NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -247,14 +252,14 @@ testMultithreadedDelete ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -292,16 +297,18 @@ testMultithreadedPoolDelete ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -321,14 +328,14 @@ testMultithreadedPoolDelete ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -381,16 +388,18 @@ testExternalDelete ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -413,86 +422,88 @@ testExternalDelete ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-              if (EINTR != errno)
-                abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-                abort ();
-              Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -507,19 +518,19 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalDelete ();
-      errorCount += testMultithreadedDelete ();
-      errorCount += testMultithreadedPoolDelete ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalDelete ();
+    errorCount += testMultithreadedDelete ();
+    errorCount += testMultithreadedPoolDelete ();
+  }
   errorCount += testExternalDelete ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c
index b0a39bf7..4de006b7 100644
--- a/src/testcurl/test_digestauth.c
+++ b/src/testcurl/test_digestauth.c
@@ -44,9 +44,11 @@
 #include <wincrypt.h>
 #endif
 
-#define PAGE "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
 
-#define DENIED "<html><head><title>libmicrohttpd 
demo</title></head><body>Access denied</body></html>"
+#define DENIED \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
denied</body></html>"
 
 #define MY_OPAQUE "11733b200778ce33060f31c9af70a870ba96ddd4"
 
@@ -89,48 +91,49 @@ ahc_echo (void *cls,
   const char *password = "testpass";
   const char *realm = "address@hidden";
   int ret;
-  (void)cls;(void)url;                          /* Unused. Silent compiler 
warning. */
-  (void)method;(void)version;(void)upload_data; /* Unused. Silent compiler 
warning. */
-  (void)upload_data_size;(void)unused;         /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url;                          /* Unused. Silent compiler 
warning. */
+  (void) method; (void) version; (void) upload_data; /* Unused. Silent 
compiler warning. */
+  (void) upload_data_size; (void) unused;         /* Unused. Silent compiler 
warning. */
 
   username = MHD_digest_auth_get_username (connection);
   if ( (username == NULL) ||
        (0 != strcmp (username, "testuser")) )
-    {
-      response = MHD_create_response_from_buffer (strlen (DENIED),
-                                                  DENIED,
-                                                  MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_auth_fail_response (connection,
-                                          realm,
-                                          MY_OPAQUE,
-                                          response,
-                                          MHD_NO);
-      MHD_destroy_response(response);
-      return ret;
-    }
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_auth_fail_response (connection,
+                                        realm,
+                                        MY_OPAQUE,
+                                        response,
+                                        MHD_NO);
+    MHD_destroy_response (response);
+    return ret;
+  }
   ret = MHD_digest_auth_check (connection,
                                realm,
-                              username,
+                               username,
                                password,
                                300);
   free (username);
   if ( (ret == MHD_INVALID_NONCE) ||
        (ret == MHD_NO) )
-    {
-      response = MHD_create_response_from_buffer (strlen (DENIED),
-                                                  DENIED,
-                                                  MHD_RESPMEM_PERSISTENT);
-      if (NULL == response)
-       return MHD_NO;
-      ret = MHD_queue_auth_fail_response (connection,
-                                          realm,
-                                          MY_OPAQUE,
-                                          response,
-                                          (MHD_INVALID_NONCE == ret) ? MHD_YES 
: MHD_NO);
-      MHD_destroy_response(response);
-      return ret;
-    }
-  response = MHD_create_response_from_buffer (strlen(PAGE),
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    if (NULL == response)
+      return MHD_NO;
+    ret = MHD_queue_auth_fail_response (connection,
+                                        realm,
+                                        MY_OPAQUE,
+                                        response,
+                                        (MHD_INVALID_NONCE == ret) ? MHD_YES :
+                                        MHD_NO);
+    MHD_destroy_response (response);
+    return ret;
+  }
+  response = MHD_create_response_from_buffer (strlen (PAGE),
                                               PAGE,
                                               MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection,
@@ -170,30 +173,30 @@ testDigestAuth ()
   fd = open ("/dev/urandom",
              O_RDONLY);
   if (-1 == fd)
+  {
+    fprintf (stderr,
+             "Failed to open `%s': %s\n",
+             "/dev/urandom",
+             strerror (errno));
+    return 1;
+  }
+  while (off < 8)
+  {
+    len = read (fd,
+                rnd,
+                8);
+    if (len == (size_t) -1)
     {
       fprintf (stderr,
-               "Failed to open `%s': %s\n",
+               "Failed to read `%s': %s\n",
                "/dev/urandom",
-               strerror(errno));
+               strerror (errno));
+      (void) close (fd);
       return 1;
     }
-  while (off < 8)
-    {
-      len = read (fd,
-                  rnd,
-                  8);
-      if (len == (size_t)-1)
-        {
-          fprintf (stderr,
-                   "Failed to read `%s': %s\n",
-                   "/dev/urandom",
-                   strerror(errno));
-          (void) close(fd);
-          return 1;
-        }
-      off += len;
-    }
-  (void) close(fd);
+    off += len;
+  }
+  (void) close (fd);
 #else
   {
     HCRYPTPROV cc;
@@ -211,7 +214,7 @@ testDigestAuth ()
                GetLastError ());
       return 1;
     }
-    b = CryptGenRandom (cc, 8, (BYTE*)rnd);
+    b = CryptGenRandom (cc, 8, (BYTE*) rnd);
     if (b == 0)
     {
       fprintf (stderr,
@@ -226,25 +229,25 @@ testDigestAuth ()
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL,
                         &ahc_echo, PAGE,
-                       MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof (rnd), rnd,
-                       MHD_OPTION_NONCE_NC_SIZE, 300,
-                       MHD_OPTION_END);
+                        MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof (rnd), rnd,
+                        MHD_OPTION_NONCE_NC_SIZE, 300,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
-    {
-      const union MHD_DaemonInfo *dinfo;
+  {
+    const union MHD_DaemonInfo *dinfo;
 
-      dinfo = MHD_get_daemon_info (d,
-                                   MHD_DAEMON_INFO_BIND_PORT);
-      if ( (NULL == dinfo) ||
-           (0 == dinfo->port) )
-        {
-          MHD_stop_daemon (d);
-          return 32;
-        }
-      port = (int)dinfo->port;
+    dinfo = MHD_get_daemon_info (d,
+                                 MHD_DAEMON_INFO_BIND_PORT);
+    if ( (NULL == dinfo) ||
+         (0 == dinfo->port) )
+    {
+      MHD_stop_daemon (d);
+      return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/bar%%20foo%%3Fkey%%3Dvalue";,
@@ -264,14 +267,14 @@ testDigestAuth ()
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (PAGE))
@@ -286,7 +289,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
@@ -296,7 +299,7 @@ main (int argc, char *const *argv)
 #endif
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-if (0 != curl_global_init (CURL_GLOBAL_WIN32))
+  if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   errorCount += testDigestAuth ();
   if (errorCount != 0)
diff --git a/src/testcurl/test_digestauth_sha256.c 
b/src/testcurl/test_digestauth_sha256.c
index c3430283..3482d14d 100644
--- a/src/testcurl/test_digestauth_sha256.c
+++ b/src/testcurl/test_digestauth_sha256.c
@@ -45,9 +45,11 @@
 #include <wincrypt.h>
 #endif
 
-#define PAGE "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
 
-#define DENIED "<html><head><title>libmicrohttpd 
demo</title></head><body>Access denied</body></html>"
+#define DENIED \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
denied</body></html>"
 
 #define MY_OPAQUE "11733b200778ce33060f31c9af70a870ba96ddd4"
 
@@ -90,26 +92,26 @@ ahc_echo (void *cls,
   const char *password = "testpass";
   const char *realm = "address@hidden";
   int ret;
-  (void)cls;(void)url;                          /* Unused. Silent compiler 
warning. */
-  (void)method;(void)version;(void)upload_data; /* Unused. Silent compiler 
warning. */
-  (void)upload_data_size;(void)unused;         /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url;                          /* Unused. Silent compiler 
warning. */
+  (void) method; (void) version; (void) upload_data; /* Unused. Silent 
compiler warning. */
+  (void) upload_data_size; (void) unused;         /* Unused. Silent compiler 
warning. */
 
   username = MHD_digest_auth_get_username (connection);
   if ( (username == NULL) ||
        (0 != strcmp (username, "testuser")) )
-    {
-      response = MHD_create_response_from_buffer (strlen (DENIED),
-                                                  DENIED,
-                                                  MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_auth_fail_response2 (connection,
-                                           realm,
-                                           MY_OPAQUE,
-                                           response,
-                                           MHD_NO,
-                                           MHD_DIGEST_ALG_SHA256);
-      MHD_destroy_response(response);
-      return ret;
-    }
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_auth_fail_response2 (connection,
+                                         realm,
+                                         MY_OPAQUE,
+                                         response,
+                                         MHD_NO,
+                                         MHD_DIGEST_ALG_SHA256);
+    MHD_destroy_response (response);
+    return ret;
+  }
   ret = MHD_digest_auth_check2 (connection,
                                 realm,
                                 username,
@@ -119,22 +121,23 @@ ahc_echo (void *cls,
   free (username);
   if ( (ret == MHD_INVALID_NONCE) ||
        (ret == MHD_NO) )
-    {
-      response = MHD_create_response_from_buffer (strlen (DENIED),
-                                                  DENIED,
-                                                  MHD_RESPMEM_PERSISTENT);
-      if (NULL == response)
-       return MHD_NO;
-      ret = MHD_queue_auth_fail_response2 (connection,
-                                           realm,
-                                           MY_OPAQUE,
-                                           response,
-                                           (MHD_INVALID_NONCE == ret) ? 
MHD_YES : MHD_NO,
-                                           MHD_DIGEST_ALG_SHA256);
-      MHD_destroy_response(response);
-      return ret;
-    }
-  response = MHD_create_response_from_buffer (strlen(PAGE),
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    if (NULL == response)
+      return MHD_NO;
+    ret = MHD_queue_auth_fail_response2 (connection,
+                                         realm,
+                                         MY_OPAQUE,
+                                         response,
+                                         (MHD_INVALID_NONCE == ret) ? MHD_YES :
+                                         MHD_NO,
+                                         MHD_DIGEST_ALG_SHA256);
+    MHD_destroy_response (response);
+    return ret;
+  }
+  response = MHD_create_response_from_buffer (strlen (PAGE),
                                               PAGE,
                                               MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection,
@@ -174,30 +177,30 @@ testDigestAuth ()
   fd = open ("/dev/urandom",
              O_RDONLY);
   if (-1 == fd)
+  {
+    fprintf (stderr,
+             "Failed to open `%s': %s\n",
+             "/dev/urandom",
+             strerror (errno));
+    return 1;
+  }
+  while (off < 8)
+  {
+    len = read (fd,
+                rnd,
+                8);
+    if (len == (size_t) -1)
     {
       fprintf (stderr,
-               "Failed to open `%s': %s\n",
+               "Failed to read `%s': %s\n",
                "/dev/urandom",
-               strerror(errno));
+               strerror (errno));
+      (void) close (fd);
       return 1;
     }
-  while (off < 8)
-    {
-      len = read (fd,
-                  rnd,
-                  8);
-      if (len == (size_t)-1)
-        {
-          fprintf (stderr,
-                   "Failed to read `%s': %s\n",
-                   "/dev/urandom",
-                   strerror(errno));
-          (void) close(fd);
-          return 1;
-        }
-      off += len;
-    }
-  (void) close(fd);
+    off += len;
+  }
+  (void) close (fd);
 #else
   {
     HCRYPTPROV cc;
@@ -215,7 +218,7 @@ testDigestAuth ()
                GetLastError ());
       return 1;
     }
-    b = CryptGenRandom (cc, 8, (BYTE*)rnd);
+    b = CryptGenRandom (cc, 8, (BYTE*) rnd);
     if (b == 0)
     {
       fprintf (stderr,
@@ -230,25 +233,25 @@ testDigestAuth ()
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL,
                         &ahc_echo, PAGE,
-                       MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof (rnd), rnd,
-                       MHD_OPTION_NONCE_NC_SIZE, 300,
-                       MHD_OPTION_END);
+                        MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof (rnd), rnd,
+                        MHD_OPTION_NONCE_NC_SIZE, 300,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
-    {
-      const union MHD_DaemonInfo *dinfo;
+  {
+    const union MHD_DaemonInfo *dinfo;
 
-      dinfo = MHD_get_daemon_info (d,
-                                   MHD_DAEMON_INFO_BIND_PORT);
-      if ( (NULL == dinfo) ||
-           (0 == dinfo->port) )
-        {
-          MHD_stop_daemon (d);
-          return 32;
-        }
-      port = (int)dinfo->port;
+    dinfo = MHD_get_daemon_info (d,
+                                 MHD_DAEMON_INFO_BIND_PORT);
+    if ( (NULL == dinfo) ||
+         (0 == dinfo->port) )
+    {
+      MHD_stop_daemon (d);
+      return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/bar%%20foo%%3Fkey%%3Dvalue";,
@@ -268,14 +271,14 @@ testDigestAuth ()
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (PAGE))
@@ -291,7 +294,7 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
   curl_version_info_data *d = curl_version_info (CURLVERSION_NOW);
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   /* curl added SHA256 support in 7.57 = 7.0x39 */
   if (d->version_num < 0x073900)
@@ -304,7 +307,7 @@ main (int argc, char *const *argv)
 #endif
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-if (0 != curl_global_init (CURL_GLOBAL_WIN32))
+  if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   errorCount += testDigestAuth ();
   if (errorCount != 0)
diff --git a/src/testcurl/test_digestauth_with_arguments.c 
b/src/testcurl/test_digestauth_with_arguments.c
index 3f2852c0..5bacdc76 100644
--- a/src/testcurl/test_digestauth_with_arguments.c
+++ b/src/testcurl/test_digestauth_with_arguments.c
@@ -43,9 +43,11 @@
 #include <wincrypt.h>
 #endif
 
-#define PAGE "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
+#define PAGE \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
granted</body></html>"
 
-#define DENIED "<html><head><title>libmicrohttpd 
demo</title></head><body>Access denied</body></html>"
+#define DENIED \
+  "<html><head><title>libmicrohttpd demo</title></head><body>Access 
denied</body></html>"
 
 #define MY_OPAQUE "11733b200778ce33060f31c9af70a870ba96ddd4"
 
@@ -82,48 +84,49 @@ ahc_echo (void *cls,
   const char *password = "testpass";
   const char *realm = "address@hidden";
   int ret;
-  (void)cls;(void)url;                          /* Unused. Silent compiler 
warning. */
-  (void)method;(void)version;(void)upload_data; /* Unused. Silent compiler 
warning. */
-  (void)upload_data_size;(void)unused;         /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url;                          /* Unused. Silent compiler 
warning. */
+  (void) method; (void) version; (void) upload_data; /* Unused. Silent 
compiler warning. */
+  (void) upload_data_size; (void) unused;         /* Unused. Silent compiler 
warning. */
 
-  username = MHD_digest_auth_get_username(connection);
+  username = MHD_digest_auth_get_username (connection);
   if ( (username == NULL) ||
        (0 != strcmp (username, "testuser")) )
-    {
-      response = MHD_create_response_from_buffer(strlen (DENIED),
-                                                DENIED,
-                                                MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_auth_fail_response(connection, realm,
-                                        MY_OPAQUE,
-                                        response,
-                                        MHD_NO);
-      MHD_destroy_response(response);
-      return ret;
-    }
-  ret = MHD_digest_auth_check(connection, realm,
-                             username,
-                             password,
-                             300);
-  free(username);
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_auth_fail_response (connection, realm,
+                                        MY_OPAQUE,
+                                        response,
+                                        MHD_NO);
+    MHD_destroy_response (response);
+    return ret;
+  }
+  ret = MHD_digest_auth_check (connection, realm,
+                               username,
+                               password,
+                               300);
+  free (username);
   if ( (ret == MHD_INVALID_NONCE) ||
        (ret == MHD_NO) )
-    {
-      response = MHD_create_response_from_buffer(strlen (DENIED),
-                                                DENIED,
-                                                MHD_RESPMEM_PERSISTENT);
-      if (NULL == response)
-       return MHD_NO;
-      ret = MHD_queue_auth_fail_response(connection, realm,
-                                        MY_OPAQUE,
-                                        response,
-                                        (ret == MHD_INVALID_NONCE) ? MHD_YES : 
MHD_NO);
-      MHD_destroy_response(response);
-      return ret;
-    }
-  response = MHD_create_response_from_buffer(strlen(PAGE), PAGE,
-                                            MHD_RESPMEM_PERSISTENT);
-  ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
-  MHD_destroy_response(response);
+  {
+    response = MHD_create_response_from_buffer (strlen (DENIED),
+                                                DENIED,
+                                                MHD_RESPMEM_PERSISTENT);
+    if (NULL == response)
+      return MHD_NO;
+    ret = MHD_queue_auth_fail_response (connection, realm,
+                                        MY_OPAQUE,
+                                        response,
+                                        (ret == MHD_INVALID_NONCE) ? MHD_YES :
+                                        MHD_NO);
+    MHD_destroy_response (response);
+    return ret;
+  }
+  response = MHD_create_response_from_buffer (strlen (PAGE), PAGE,
+                                              MHD_RESPMEM_PERSISTENT);
+  ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+  MHD_destroy_response (response);
   return ret;
 }
 
@@ -154,45 +157,46 @@ testDigestAuth ()
   cbc.size = 2048;
   cbc.pos = 0;
 #ifndef WINDOWS
-  fd = open("/dev/urandom", O_RDONLY);
+  fd = open ("/dev/urandom", O_RDONLY);
   if (-1 == fd)
-    {
-      fprintf(stderr, "Failed to open `%s': %s\n",
-              "/dev/urandom",
-              strerror(errno));
-      return 1;
-    }
+  {
+    fprintf (stderr, "Failed to open `%s': %s\n",
+             "/dev/urandom",
+             strerror (errno));
+    return 1;
+  }
   while (off < 8)
+  {
+    len = read (fd, rnd, 8);
+    if (len == (size_t) -1)
     {
-      len = read(fd, rnd, 8);
-      if (len == (size_t)-1)
-        {
-          fprintf(stderr,
-                  "Failed to read `%s': %s\n",
-                  "/dev/urandom",
-                  strerror(errno));
-          (void) close(fd);
-          return 1;
-        }
-      off += len;
+      fprintf (stderr,
+               "Failed to read `%s': %s\n",
+               "/dev/urandom",
+               strerror (errno));
+      (void) close (fd);
+      return 1;
     }
-  (void) close(fd);
+    off += len;
+  }
+  (void) close (fd);
 #else
   {
     HCRYPTPROV cc;
     BOOL b;
-    b = CryptAcquireContext (&cc, NULL, NULL, PROV_RSA_FULL, 
CRYPT_VERIFYCONTEXT);
+    b = CryptAcquireContext (&cc, NULL, NULL, PROV_RSA_FULL,
+                             CRYPT_VERIFYCONTEXT);
     if (b == 0)
     {
       fprintf (stderr, "Failed to acquire crypto provider context: %lu\n",
-          GetLastError ());
+               GetLastError ());
       return 1;
     }
-    b = CryptGenRandom (cc, 8, (BYTE*)rnd);
+    b = CryptGenRandom (cc, 8, (BYTE*) rnd);
     if (b == 0)
     {
       fprintf (stderr, "Failed to generate 8 random bytes: %lu\n",
-          GetLastError ());
+               GetLastError ());
     }
     CryptReleaseContext (cc, 0);
     if (b == 0)
@@ -201,19 +205,21 @@ testDigestAuth ()
 #endif
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, PAGE,
-                       MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof (rnd), rnd,
-                       MHD_OPTION_NONCE_NC_SIZE, 300,
-                       MHD_OPTION_END);
+                        MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof (rnd), rnd,
+                        MHD_OPTION_NONCE_NC_SIZE, 300,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/bar%%20foo%%3Fkey%%3Dvalue";,
@@ -233,14 +239,14 @@ testDigestAuth ()
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (PAGE))
@@ -255,7 +261,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index 567b0787..dee5a9c1 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -48,10 +48,10 @@
 #include <sys/socket.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -88,12 +88,12 @@ log_cb (void *cls,
   (void) con;
   if (0 != strcmp (uri,
                    EXPECTED_URI_PATH))
-    {
-      fprintf (stderr,
-               "Wrong URI: `%s'\n",
-               uri);
-      _exit (22);
-    }
+  {
+    fprintf (stderr,
+             "Wrong URI: `%s'\n",
+             uri);
+    _exit (22);
+  }
   return NULL;
 }
 
@@ -119,10 +119,10 @@ ahc_echo (void *cls,
   if (0 != strcasecmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   v = MHD_lookup_connection_value (connection,
                                    MHD_GET_ARGUMENT_KIND,
@@ -130,11 +130,11 @@ ahc_echo (void *cls,
   if ( (NULL == v) ||
        (0 != strcmp ("&",
                      v)) )
-    {
-      fprintf (stderr, "Found while looking for 'a=&': 'a=%s'\n",
-               NULL == v ? "NULL" : v);
-      _exit (17);
-    }
+  {
+    fprintf (stderr, "Found while looking for 'a=&': 'a=%s'\n",
+             NULL == v ? "NULL" : v);
+    _exit (17);
+  }
   v = NULL;
   if (MHD_YES != MHD_lookup_connection_value_n (connection,
                                                 MHD_GET_ARGUMENT_KIND,
@@ -142,30 +142,30 @@ ahc_echo (void *cls,
                                                 1,
                                                 &v,
                                                 NULL))
-    {
-      fprintf (stderr, "Not found 'b' GET argument.\n");
-      _exit (18);
-    }
+  {
+    fprintf (stderr, "Not found 'b' GET argument.\n");
+    _exit (18);
+  }
   if ( (NULL == v) ||
        (0 != strcmp ("c",
                      v)) )
-    {
-      fprintf (stderr, "Found while looking for 'b=c': 'b=%s'\n",
-               NULL == v ? "NULL" : v);
-      _exit (19);
-    }
+  {
+    fprintf (stderr, "Found while looking for 'b=c': 'b=%s'\n",
+             NULL == v ? "NULL" : v);
+    _exit (19);
+  }
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
                             response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
-    {
-      fprintf (stderr, "Failed to queue response.\n");
-      _exit (19);
-    }
+  {
+    fprintf (stderr, "Failed to queue response.\n");
+    _exit (19);
+  }
   return ret;
 }
 
@@ -181,16 +181,17 @@ testInternalGet (int poll_flag)
 
   if ( (0 == global_port) &&
        (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 
)
-    {
-      global_port = 1220;
-      if (oneone)
-        global_port += 20;
-    }
+  {
+    global_port = 1220;
+    if (oneone)
+      global_port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         global_port, NULL, NULL,
                         &ahc_echo, "GET",
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -198,16 +199,18 @@ testInternalGet (int poll_flag)
   if (d == NULL)
     return 1;
   if (0 == global_port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      global_port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    global_port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)global_port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) global_port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -222,14 +225,14 @@ testInternalGet (int poll_flag)
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -251,16 +254,18 @@ testMultithreadedGet (int poll_flag)
 
   if ( (0 == global_port) &&
        (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 
)
-    {
-      global_port = 1221;
-      if (oneone)
-        global_port += 20;
-    }
+  {
+    global_port = 1221;
+    if (oneone)
+      global_port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | poll_flag,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         global_port, NULL, NULL,
                         &ahc_echo, "GET",
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -268,16 +273,18 @@ testMultithreadedGet (int poll_flag)
   if (d == NULL)
     return 16;
   if (0 == global_port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      global_port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    global_port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)global_port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) global_port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -292,14 +299,14 @@ testMultithreadedGet (int poll_flag)
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -321,16 +328,17 @@ testMultithreadedPoolGet (int poll_flag)
 
   if ( (0 == global_port) &&
        (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 
)
-    {
-      global_port = 1222;
-      if (oneone)
-        global_port += 20;
-    }
+  {
+    global_port = 1222;
+    if (oneone)
+      global_port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         global_port, NULL, NULL,
                         &ahc_echo, "GET",
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
@@ -339,16 +347,18 @@ testMultithreadedPoolGet (int poll_flag)
   if (d == NULL)
     return 16;
   if (0 == global_port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      global_port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    global_port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)global_port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) global_port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -363,14 +373,14 @@ testMultithreadedPoolGet (int poll_flag)
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -394,7 +404,7 @@ testExternalGet ()
   fd_set ws;
   fd_set es;
   MHD_socket maxsock;
-  int maxposixs; 
+  int maxposixs;
   int running;
   struct CURLMsg *msg;
   time_t start;
@@ -402,11 +412,11 @@ testExternalGet ()
 
   if ( (0 == global_port) &&
        (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 
)
-    {
-      global_port = 1223;
-      if (oneone)
-        global_port += 20;
-    }
+  {
+    global_port = 1223;
+    if (oneone)
+      global_port += 20;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -420,16 +430,18 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == global_port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      global_port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    global_port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)global_port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) global_port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -447,90 +459,92 @@ testExternalGet ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
-    {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
 #ifdef MHD_POSIX_SOCKETS
-      if (maxsock > maxposixs)
-        maxposixs = maxsock;
+    if (maxsock > maxposixs)
+      maxposixs = maxsock;
 #endif /* MHD_POSIX_SOCKETS */
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+    {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            _exit (99);
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        _exit (99);
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -553,7 +567,7 @@ testUnknownPortGet (int poll_flag)
 
   struct sockaddr_in addr;
   socklen_t addr_len = sizeof(addr);
-  memset(&addr, 0, sizeof(addr));
+  memset (&addr, 0, sizeof(addr));
   addr.sin_family = AF_INET;
   addr.sin_port = 0;
   addr.sin_addr.s_addr = INADDR_ANY;
@@ -561,38 +575,41 @@ testUnknownPortGet (int poll_flag)
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         0, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_SOCK_ADDR, &addr,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                         MHD_OPTION_END);
   if (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
-    {
-      di = MHD_get_daemon_info (d, MHD_DAEMON_INFO_LISTEN_FD);
-      if (di == NULL)
-        return 65536;
-
-      if (0 != getsockname(di->listen_fd, (struct sockaddr *) &addr, 
&addr_len))
-        return 131072;
-
-      if (addr.sin_family != AF_INET)
-        return 26214;
-      port = (int)ntohs(addr.sin_port);
-    }
+  {
+    di = MHD_get_daemon_info (d, MHD_DAEMON_INFO_LISTEN_FD);
+    if (di == NULL)
+      return 65536;
+
+    if (0 != getsockname (di->listen_fd, (struct sockaddr *) &addr, &addr_len))
+      return 131072;
+
+    if (addr.sin_family != AF_INET)
+      return 26214;
+    port = (int) ntohs (addr.sin_port);
+  }
   else
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
-  snprintf(buf,
-           sizeof(buf),
-           "http://127.0.0.1:%d%s";,
-           port,
-           EXPECTED_URI_PATH);
+  snprintf (buf,
+            sizeof(buf),
+            "http://127.0.0.1:%d%s";,
+            port,
+            EXPECTED_URI_PATH);
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, buf);
@@ -610,14 +627,14 @@ testUnknownPortGet (int poll_flag)
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 524288;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 524288;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -631,115 +648,120 @@ testUnknownPortGet (int poll_flag)
 static int
 testStopRace (int poll_flag)
 {
-    struct sockaddr_in sin;
-    MHD_socket fd;
-    struct MHD_Daemon *d;
-
-    if ( (0 == global_port) &&
-         (MHD_NO == MHD_is_feature_supported 
(MHD_FEATURE_AUTODETECT_BIND_PORT)) )
-      {
-        global_port = 1224;
-        if (oneone)
-          global_port += 20;
-      }
-
-    d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag,
-                         global_port, NULL, NULL,
-                          &ahc_echo, "GET",
-                          MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
-                          MHD_OPTION_END);
-    if (d == NULL)
-       return 16;
-    if (0 == global_port)
-      {
-        const union MHD_DaemonInfo *dinfo;
-        dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-        if (NULL == dinfo || 0 == dinfo->port)
-          { MHD_stop_daemon (d); return 32; }
-        global_port = (int)dinfo->port;
-      }
+  struct sockaddr_in sin;
+  MHD_socket fd;
+  struct MHD_Daemon *d;
 
-    fd = socket (PF_INET, SOCK_STREAM, 0);
-    if (fd == MHD_INVALID_SOCKET)
+  if ( (0 == global_port) &&
+       (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 
)
+  {
+    global_port = 1224;
+    if (oneone)
+      global_port += 20;
+  }
+
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
+                        global_port, NULL, NULL,
+                        &ahc_echo, "GET",
+                        MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
+                        MHD_OPTION_END);
+  if (d == NULL)
+    return 16;
+  if (0 == global_port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-       fprintf(stderr, "socket error\n");
-       return 256;
+      MHD_stop_daemon (d); return 32;
     }
+    global_port = (int) dinfo->port;
+  }
 
-    memset(&sin, 0, sizeof(sin));
-    sin.sin_family = AF_INET;
-    sin.sin_port = htons(global_port);
-    sin.sin_addr.s_addr = htonl(0x7f000001);
+  fd = socket (PF_INET, SOCK_STREAM, 0);
+  if (fd == MHD_INVALID_SOCKET)
+  {
+    fprintf (stderr, "socket error\n");
+    return 256;
+  }
 
-    if (connect (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0)
-    {
-       fprintf(stderr, "connect error\n");
-       MHD_socket_close_chk_ (fd);
-       return 512;
-    }
+  memset (&sin, 0, sizeof(sin));
+  sin.sin_family = AF_INET;
+  sin.sin_port = htons (global_port);
+  sin.sin_addr.s_addr = htonl (0x7f000001);
 
-    /*  printf("Waiting\n"); */
-    /* Let the thread get going. */
-    usleep(500000);
+  if (connect (fd, (struct sockaddr *) (&sin), sizeof(sin)) < 0)
+  {
+    fprintf (stderr, "connect error\n");
+    MHD_socket_close_chk_ (fd);
+    return 512;
+  }
 
-    /* printf("Stopping daemon\n"); */
-    MHD_stop_daemon (d);
+  /*  printf("Waiting\n"); */
+  /* Let the thread get going. */
+  usleep (500000);
 
-    MHD_socket_close_chk_ (fd);
+  /* printf("Stopping daemon\n"); */
+  MHD_stop_daemon (d);
+
+  MHD_socket_close_chk_ (fd);
 
-    /* printf("good\n"); */
-    return 0;
+  /* printf("good\n"); */
+  return 0;
 }
 
 
 static int
 ahc_empty (void *cls,
-          struct MHD_Connection *connection,
-          const char *url,
-          const char *method,
-          const char *version,
-          const char *upload_data, size_t *upload_data_size,
-          void **unused)
+           struct MHD_Connection *connection,
+           const char *url,
+           const char *method,
+           const char *version,
+           const char *upload_data, size_t *upload_data_size,
+           void **unused)
 {
   static int ptr;
   struct MHD_Response *response;
   int ret;
-  (void)cls;(void)url;(void)url;(void)version;  /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url; (void) url; (void) version;  /* Unused. Silent 
compiler warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcasecmp ("GET", method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   response = MHD_create_response_from_buffer (0,
-                                             NULL,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              NULL,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
-    {
-      fprintf (stderr, "Failed to queue response.\n");
-      _exit (20);
-    }
+  {
+    fprintf (stderr, "Failed to queue response.\n");
+    _exit (20);
+  }
   return ret;
 }
 
 
 static int
-curlExcessFound(CURL *c, curl_infotype type, char *data, size_t size, void 
*cls)
+curlExcessFound (CURL *c, curl_infotype type, char *data, size_t size,
+                 void *cls)
 {
   static const char *excess_found = "Excess found";
   const size_t str_size = strlen (excess_found);
-  (void)c;      /* Unused. Silent compiler warning. */
+  (void) c;      /* Unused. Silent compiler warning. */
 
-  if (CURLINFO_TEXT == type
-      && size >= str_size
-      && 0 == strncmp(excess_found, data, str_size))
-    *(int *)cls = 1;
+  if ((CURLINFO_TEXT == type)
+      &&(size >= str_size)
+      &&(0 == strncmp (excess_found, data, str_size)))
+    *(int *) cls = 1;
   return 0;
 }
 
@@ -756,16 +778,17 @@ testEmptyGet (int poll_flag)
 
   if ( (0 == global_port) &&
        (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 
)
-    {
-      global_port = 1225;
-      if (oneone)
-        global_port += 20;
-    }
+  {
+    global_port = 1225;
+    if (oneone)
+      global_port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         global_port, NULL, NULL,
                         &ahc_empty, NULL,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -773,16 +796,18 @@ testEmptyGet (int poll_flag)
   if (d == NULL)
     return 4194304;
   if (0 == global_port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      global_port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    global_port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)global_port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) global_port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_DEBUGFUNCTION, &curlExcessFound);
@@ -800,14 +825,14 @@ testEmptyGet (int poll_flag)
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 8388608;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 8388608;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != 0)
@@ -825,7 +850,7 @@ main (int argc, char *const *argv)
   unsigned int test_result = 0;
   int verbose = 0;
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   verbose = has_param (argc, argv, "-v") || has_param (argc, argv, 
"--verbose");
@@ -838,115 +863,128 @@ main (int argc, char *const *argv)
   else if (verbose)
     printf ("PASSED: testExternalGet ().\n");
   errorCount += test_result;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      test_result += testInternalGet (0);
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    test_result += testInternalGet (0);
+    if (test_result)
+      fprintf (stderr, "FAILED: testInternalGet (0) - %u.\n", test_result);
+    else if (verbose)
+      printf ("PASSED: testInternalGet (0).\n");
+    errorCount += test_result;
+    test_result += testMultithreadedGet (0);
+    if (test_result)
+      fprintf (stderr, "FAILED: testMultithreadedGet (0) - %u.\n", 
test_result);
+    else if (verbose)
+      printf ("PASSED: testMultithreadedGet (0).\n");
+    errorCount += test_result;
+    test_result += testMultithreadedPoolGet (0);
+    if (test_result)
+      fprintf (stderr, "FAILED: testMultithreadedPoolGet (0) - %u.\n",
+               test_result);
+    else if (verbose)
+      printf ("PASSED: testMultithreadedPoolGet (0).\n");
+    errorCount += test_result;
+    test_result += testUnknownPortGet (0);
+    if (test_result)
+      fprintf (stderr, "FAILED: testUnknownPortGet (0) - %u.\n", test_result);
+    else if (verbose)
+      printf ("PASSED: testUnknownPortGet (0).\n");
+    errorCount += test_result;
+    test_result += testStopRace (0);
+    if (test_result)
+      fprintf (stderr, "FAILED: testStopRace (0) - %u.\n", test_result);
+    else if (verbose)
+      printf ("PASSED: testStopRace (0).\n");
+    errorCount += test_result;
+    test_result += testEmptyGet (0);
+    if (test_result)
+      fprintf (stderr, "FAILED: testEmptyGet (0) - %u.\n", test_result);
+    else if (verbose)
+      printf ("PASSED: testEmptyGet (0).\n");
+    errorCount += test_result;
+    if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_POLL))
+    {
+      test_result += testInternalGet (MHD_USE_POLL);
+      if (test_result)
+        fprintf (stderr, "FAILED: testInternalGet (MHD_USE_POLL) - %u.\n",
+                 test_result);
+      else if (verbose)
+        printf ("PASSED: testInternalGet (MHD_USE_POLL).\n");
+      errorCount += test_result;
+      test_result += testMultithreadedGet (MHD_USE_POLL);
+      if (test_result)
+        fprintf (stderr, "FAILED: testMultithreadedGet (MHD_USE_POLL) - %u.\n",
+                 test_result);
+      else if (verbose)
+        printf ("PASSED: testMultithreadedGet (MHD_USE_POLL).\n");
+      errorCount += test_result;
+      test_result += testMultithreadedPoolGet (MHD_USE_POLL);
       if (test_result)
-        fprintf (stderr, "FAILED: testInternalGet (0) - %u.\n", test_result);
+        fprintf (stderr,
+                 "FAILED: testMultithreadedPoolGet (MHD_USE_POLL) - %u.\n",
+                 test_result);
       else if (verbose)
-        printf ("PASSED: testInternalGet (0).\n");
+        printf ("PASSED: testMultithreadedPoolGet (MHD_USE_POLL).\n");
       errorCount += test_result;
-      test_result += testMultithreadedGet (0);
+      test_result += testUnknownPortGet (MHD_USE_POLL);
       if (test_result)
-        fprintf (stderr, "FAILED: testMultithreadedGet (0) - %u.\n", 
test_result);
+        fprintf (stderr, "FAILED: testUnknownPortGet (MHD_USE_POLL) - %u.\n",
+                 test_result);
       else if (verbose)
-        printf ("PASSED: testMultithreadedGet (0).\n");
+        printf ("PASSED: testUnknownPortGet (MHD_USE_POLL).\n");
       errorCount += test_result;
-      test_result += testMultithreadedPoolGet (0);
+      test_result += testStopRace (MHD_USE_POLL);
+      if (test_result)
+        fprintf (stderr, "FAILED: testStopRace (MHD_USE_POLL) - %u.\n",
+                 test_result);
+      else if (verbose)
+        printf ("PASSED: testStopRace (MHD_USE_POLL).\n");
+      errorCount += test_result;
+      test_result += testEmptyGet (MHD_USE_POLL);
+      if (test_result)
+        fprintf (stderr, "FAILED: testEmptyGet (MHD_USE_POLL) - %u.\n",
+                 test_result);
+      else if (verbose)
+        printf ("PASSED: testEmptyGet (MHD_USE_POLL).\n");
+      errorCount += test_result;
+    }
+    if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL))
+    {
+      test_result += testInternalGet (MHD_USE_EPOLL);
       if (test_result)
-        fprintf (stderr, "FAILED: testMultithreadedPoolGet (0) - %u.\n", 
test_result);
+        fprintf (stderr, "FAILED: testInternalGet (MHD_USE_EPOLL) - %u.\n",
+                 test_result);
       else if (verbose)
-        printf ("PASSED: testMultithreadedPoolGet (0).\n");
+        printf ("PASSED: testInternalGet (MHD_USE_EPOLL).\n");
       errorCount += test_result;
-      test_result += testUnknownPortGet (0);
+      test_result += testMultithreadedPoolGet (MHD_USE_EPOLL);
       if (test_result)
-        fprintf (stderr, "FAILED: testUnknownPortGet (0) - %u.\n", 
test_result);
+        fprintf (stderr,
+                 "FAILED: testMultithreadedPoolGet (MHD_USE_EPOLL) - %u.\n",
+                 test_result);
       else if (verbose)
-        printf ("PASSED: testUnknownPortGet (0).\n");
+        printf ("PASSED: testMultithreadedPoolGet (MHD_USE_EPOLL).\n");
       errorCount += test_result;
-      test_result += testStopRace (0);
+      test_result += testUnknownPortGet (MHD_USE_EPOLL);
       if (test_result)
-        fprintf (stderr, "FAILED: testStopRace (0) - %u.\n", test_result);
+        fprintf (stderr, "FAILED: testUnknownPortGet (MHD_USE_EPOLL) - %u.\n",
+                 test_result);
       else if (verbose)
-        printf ("PASSED: testStopRace (0).\n");
+        printf ("PASSED: testUnknownPortGet (MHD_USE_EPOLL).\n");
       errorCount += test_result;
-      test_result += testEmptyGet (0);
+      test_result += testEmptyGet (MHD_USE_EPOLL);
       if (test_result)
-        fprintf (stderr, "FAILED: testEmptyGet (0) - %u.\n", test_result);
+        fprintf (stderr, "FAILED: testEmptyGet (MHD_USE_EPOLL) - %u.\n",
+                 test_result);
       else if (verbose)
-        printf ("PASSED: testEmptyGet (0).\n");
+        printf ("PASSED: testEmptyGet (MHD_USE_EPOLL).\n");
       errorCount += test_result;
-      if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
-       {
-          test_result += testInternalGet(MHD_USE_POLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testInternalGet (MHD_USE_POLL) - %u.\n", 
test_result);
-          else if (verbose)
-            printf ("PASSED: testInternalGet (MHD_USE_POLL).\n");
-          errorCount += test_result;
-          test_result += testMultithreadedGet(MHD_USE_POLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testMultithreadedGet (MHD_USE_POLL) - 
%u.\n", test_result);
-          else if (verbose)
-            printf ("PASSED: testMultithreadedGet (MHD_USE_POLL).\n");
-          errorCount += test_result;
-          test_result += testMultithreadedPoolGet(MHD_USE_POLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testMultithreadedPoolGet (MHD_USE_POLL) 
- %u.\n", test_result);
-          else if (verbose)
-            printf ("PASSED: testMultithreadedPoolGet (MHD_USE_POLL).\n");
-          errorCount += test_result;
-          test_result += testUnknownPortGet(MHD_USE_POLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testUnknownPortGet (MHD_USE_POLL) - 
%u.\n", test_result);
-          else if (verbose)
-            printf ("PASSED: testUnknownPortGet (MHD_USE_POLL).\n");
-          errorCount += test_result;
-          test_result += testStopRace(MHD_USE_POLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testStopRace (MHD_USE_POLL) - %u.\n", 
test_result);
-          else if (verbose)
-            printf ("PASSED: testStopRace (MHD_USE_POLL).\n");
-          errorCount += test_result;
-          test_result += testEmptyGet(MHD_USE_POLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testEmptyGet (MHD_USE_POLL) - %u.\n", 
test_result);
-          else if (verbose)
-            printf ("PASSED: testEmptyGet (MHD_USE_POLL).\n");
-          errorCount += test_result;
-       }
-      if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
-       {
-          test_result += testInternalGet(MHD_USE_EPOLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testInternalGet (MHD_USE_EPOLL) - 
%u.\n", test_result);
-          else if (verbose)
-            printf ("PASSED: testInternalGet (MHD_USE_EPOLL).\n");
-          errorCount += test_result;
-          test_result += testMultithreadedPoolGet(MHD_USE_EPOLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testMultithreadedPoolGet (MHD_USE_EPOLL) 
- %u.\n", test_result);
-          else if (verbose)
-            printf ("PASSED: testMultithreadedPoolGet (MHD_USE_EPOLL).\n");
-          errorCount += test_result;
-          test_result += testUnknownPortGet(MHD_USE_EPOLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testUnknownPortGet (MHD_USE_EPOLL) - 
%u.\n", test_result);
-          else if (verbose)
-            printf ("PASSED: testUnknownPortGet (MHD_USE_EPOLL).\n");
-          errorCount += test_result;
-          test_result += testEmptyGet(MHD_USE_EPOLL);
-          if (test_result)
-            fprintf (stderr, "FAILED: testEmptyGet (MHD_USE_EPOLL) - %u.\n", 
test_result);
-          else if (verbose)
-            printf ("PASSED: testEmptyGet (MHD_USE_EPOLL).\n");
-          errorCount += test_result;
-       }
     }
+  }
   if (0 != errorCount)
     fprintf (stderr,
-            "Error (code: %u)\n",
-            errorCount);
+             "Error (code: %u)\n",
+             errorCount);
   else if (verbose)
     printf ("All tests passed.\n");
   curl_global_cleanup ();
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index c7be5c83..9916a902 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -40,10 +40,10 @@
 #include <unistd.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -120,19 +120,19 @@ ahc_echo (void *cls,
   struct MHD_Response **responseptr;
   int ret;
 
-  (void)url;
-  (void)version;                      /* Unused. Silent compiler warning. */
-  (void)upload_data;
-  (void)upload_data_size;     /* Unused. Silent compiler warning. */
+  (void) url;
+  (void) version;                      /* Unused. Silent compiler warning. */
+  (void) upload_data;
+  (void) upload_data_size;     /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   responseptr = malloc (sizeof (struct MHD_Response *));
   if (NULL == responseptr)
     return MHD_NO;
@@ -165,16 +165,16 @@ validate (struct CBC cbc, int ebase)
     return ebase;
 
   for (i = 0; i < 10; i++)
+  {
+    memset (buf, 'A' + i, 128);
+    if (0 != memcmp (buf, &cbc.buf[i * 128], 128))
     {
-      memset (buf, 'A' + i, 128);
-      if (0 != memcmp (buf, &cbc.buf[i * 128], 128))
-        {
-          fprintf (stderr,
-                   "Got  `%.*s'\nWant `%.*s'\n",
-                   128, buf, 128, &cbc.buf[i * 128]);
-          return ebase * 2;
-        }
+      fprintf (stderr,
+               "Got  `%.*s'\nWant `%.*s'\n",
+               128, buf, 128, &cbc.buf[i * 128]);
+      return ebase * 2;
     }
+  }
   return 0;
 }
 
@@ -201,16 +201,18 @@ testInternalGet ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -222,14 +224,14 @@ testInternalGet ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   return validate (cbc, 4);
@@ -253,21 +255,24 @@ testMultithreadedGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -279,14 +284,14 @@ testMultithreadedGet ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   return validate (cbc, 64);
@@ -316,16 +321,18 @@ testMultithreadedPoolGet ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -337,14 +344,14 @@ testMultithreadedPoolGet ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   return validate (cbc, 64);
@@ -388,16 +395,18 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -412,86 +421,88 @@ testExternalGet ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   return validate (cbc, 8192);
 }
@@ -502,16 +513,16 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalGet ();
-      errorCount += testMultithreadedGet ();
-      errorCount += testMultithreadedPoolGet ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalGet ();
+    errorCount += testMultithreadedGet ();
+    errorCount += testMultithreadedPoolGet ();
+  }
   errorCount += testExternalGet ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_get_response_cleanup.c 
b/src/testcurl/test_get_response_cleanup.c
index 66653a93..04fe3204 100644
--- a/src/testcurl/test_get_response_cleanup.c
+++ b/src/testcurl/test_get_response_cleanup.c
@@ -53,10 +53,10 @@
 
 #include "mhd_has_in_name.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -72,13 +72,13 @@ fork_curl (const char *url)
 {
   pid_t ret;
 
-  ret = fork();
+  ret = fork ();
   if (ret != 0)
     return ret;
   execlp ("curl", "curl", "-s", "-N", "-o", "/dev/null", "-GET", url, NULL);
   fprintf (stderr,
-          "Failed to exec curl: %s\n",
-          strerror (errno));
+           "Failed to exec curl: %s\n",
+           strerror (errno));
   _exit (-1);
 }
 
@@ -88,7 +88,7 @@ kill_curl (pid_t pid)
 {
   int status;
 
-  //fprintf (stderr, "Killing curl\n");
+  // fprintf (stderr, "Killing curl\n");
   kill (pid, SIGTERM);
   waitpid (pid, &status, 0);
 }
@@ -97,7 +97,7 @@ kill_curl (pid_t pid)
 static ssize_t
 push_callback (void *cls, uint64_t pos, char *buf, size_t max)
 {
-  (void)cls;(void)pos; /* Unused. Silent compiler warning. */
+  (void) cls; (void) pos;  /* Unused. Silent compiler warning. */
 
   if (max == 0)
     return 0;
@@ -111,7 +111,7 @@ push_free_callback (void *cls)
 {
   int *ok = cls;
 
-  //fprintf (stderr, "Cleanup callback called!\n");
+  // fprintf (stderr, "Cleanup callback called!\n");
   *ok = 0;
 }
 
@@ -129,23 +129,23 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)url;(void)version;                      /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  //fprintf (stderr, "In CB: %s!\n", method);
+  // fprintf (stderr, "In CB: %s!\n", method);
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
-                                               32 * 1024,
-                                               &push_callback,
-                                               &ok,
-                                               &push_free_callback);
+                                                32 * 1024,
+                                                &push_callback,
+                                                &ok,
+                                                &push_free_callback);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -165,11 +165,11 @@ testInternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1180;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1180;
+    if (oneone)
+      port += 10;
+  }
 
   ok = 1;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
@@ -177,21 +177,23 @@ testInternalGet ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/";,
             port);
   curl = fork_curl (url);
-  (void)sleep (1);
+  (void) sleep (1);
   kill_curl (curl);
-  (void)sleep (1);
+  (void) sleep (1);
   /* fprintf (stderr, "Stopping daemon!\n"); */
   MHD_stop_daemon (d);
   if (ok != 0)
@@ -211,47 +213,50 @@ testMultithreadedGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1181;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1181;
+    if (oneone)
+      port += 10;
+  }
 
   ok = 1;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, "GET",
-                       MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 2,
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 2,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/";,
             port);
-  //fprintf (stderr, "Forking cURL!\n");
+  // fprintf (stderr, "Forking cURL!\n");
   curl = fork_curl (url);
-  (void)sleep (1);
+  (void) sleep (1);
   kill_curl (curl);
-  (void)sleep (1);
+  (void) sleep (1);
   curl = fork_curl (url);
-  (void)sleep (1);
+  (void) sleep (1);
   if (ok != 0)
-    {
-      kill_curl (curl);
-      MHD_stop_daemon (d);
-      return 64;
-    }
+  {
+    kill_curl (curl);
+    MHD_stop_daemon (d);
+    return 64;
+  }
   kill_curl (curl);
-  (void)sleep (1);
-  //fprintf (stderr, "Stopping daemon!\n");
+  (void) sleep (1);
+  // fprintf (stderr, "Stopping daemon!\n");
   MHD_stop_daemon (d);
   if (ok != 0)
     return 32;
@@ -271,11 +276,11 @@ testMultithreadedPoolGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1182;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1182;
+    if (oneone)
+      port += 10;
+  }
 
   ok = 1;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
@@ -284,22 +289,24 @@ testMultithreadedPoolGet ()
   if (d == NULL)
     return 64;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/";,
             port);
   curl = fork_curl (url);
-  (void)sleep (1);
+  (void) sleep (1);
   kill_curl (curl);
-  (void)sleep (1);
-  //fprintf (stderr, "Stopping daemon!\n");
+  (void) sleep (1);
+  // fprintf (stderr, "Stopping daemon!\n");
   MHD_stop_daemon (d);
   if (ok != 0)
     return 128;
@@ -324,11 +331,11 @@ testExternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1183;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1183;
+    if (oneone)
+      port += 10;
+  }
 
   ok = 1;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
@@ -336,13 +343,15 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (url,
             sizeof (url),
             "http://127.0.0.1:%d/";,
@@ -351,47 +360,47 @@ testExternalGet ()
 
   start = time (NULL);
   while ((time (NULL) - start < 2))
+  {
+    max = 0;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+    {
+      MHD_stop_daemon (d);
+      return 4096;
+    }
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (max + 1, &rs, &ws, &es, &tv))
     {
-      max = 0;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-        {
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (max + 1, &rs, &ws, &es, &tv))
-        {
-          if (EINTR != errno)
-            abort ();
-        }
-      MHD_run (d);
+      if (EINTR != errno)
+        abort ();
     }
+    MHD_run (d);
+  }
   kill_curl (curl);
   start = time (NULL);
   while ((time (NULL) - start < 2))
+  {
+    max = 0;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+    {
+      MHD_stop_daemon (d);
+      return 4096;
+    }
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (max + 1, &rs, &ws, &es, &tv))
     {
-      max = 0;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-        {
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (max + 1, &rs, &ws, &es, &tv))
-        {
-          if (EINTR != errno)
-            abort ();
-        }
-      MHD_run (d);
+      if (EINTR != errno)
+        abort ();
     }
+    MHD_run (d);
+  }
   /* fprintf (stderr, "Stopping daemon!\n"); */
   MHD_stop_daemon (d);
   if (ok != 0)
@@ -404,28 +413,28 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
 #ifndef _WIN32
   /* Solaris has no way to disable SIGPIPE on socket disconnect. */
   if (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTOSUPPRESS_SIGPIPE))
-    {
-      struct sigaction act;
+  {
+    struct sigaction act;
 
-      act.sa_handler = SIG_IGN;
-      sigaction(SIGPIPE, &act, NULL);
-    }
+    act.sa_handler = SIG_IGN;
+    sigaction (SIGPIPE, &act, NULL);
+  }
 #endif /* _WIN32 */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalGet ();
-      errorCount += testMultithreadedGet ();
-      errorCount += testMultithreadedPoolGet ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalGet ();
+    errorCount += testMultithreadedGet ();
+    errorCount += testMultithreadedPoolGet ();
+  }
   errorCount += testExternalGet ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index 3e68647b..7651ff56 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -40,14 +40,15 @@
 #include <unistd.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
-#define TESTSTR "This is the content of the test file we are sending using 
sendfile (if available)"
+#define TESTSTR \
+  "This is the content of the test file we are sending using sendfile (if 
available)"
 
 static char *sourcefile;
 
@@ -88,25 +89,25 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   int ret;
   int fd;
-  (void)url;(void)version;                      /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   fd = open (sourcefile, O_RDONLY);
   if (fd == -1)
-    {
-      fprintf (stderr, "Failed to open `%s': %s\n",
-              sourcefile,
-              strerror (errno));
-      exit (1);
-    }
+  {
+    fprintf (stderr, "Failed to open `%s': %s\n",
+             sourcefile,
+             strerror (errno));
+    exit (1);
+  }
   response = MHD_create_response_from_fd (strlen (TESTSTR), fd);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
@@ -129,11 +130,11 @@ testInternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1200;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1200;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -143,16 +144,18 @@ testInternalGet ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -167,14 +170,14 @@ testInternalGet ()
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (TESTSTR))
@@ -198,30 +201,33 @@ testMultithreadedGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1201;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1201;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -236,14 +242,14 @@ testMultithreadedGet ()
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (TESTSTR))
@@ -267,11 +273,11 @@ testMultithreadedPoolGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1202;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1202;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -282,16 +288,18 @@ testMultithreadedPoolGet ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -306,14 +314,14 @@ testMultithreadedPoolGet ()
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (TESTSTR))
@@ -351,11 +359,11 @@ testExternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1203;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1203;
+    if (oneone)
+      port += 10;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -366,16 +374,18 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -393,86 +403,88 @@ testExternalGet ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (TESTSTR))
     return 8192;
@@ -495,7 +507,7 @@ testUnknownPortGet ()
 
   struct sockaddr_in addr;
   socklen_t addr_len = sizeof(addr);
-  memset(&addr, 0, sizeof(addr));
+  memset (&addr, 0, sizeof(addr));
   addr.sin_family = AF_INET;
   addr.sin_port = 0;
   addr.sin_addr.s_addr = INADDR_ANY;
@@ -511,29 +523,31 @@ testUnknownPortGet ()
     return 32768;
 
   if (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
-    {
-      di = MHD_get_daemon_info (d, MHD_DAEMON_INFO_LISTEN_FD);
-      if (di == NULL)
-        return 65536;
-
-      if (0 != getsockname(di->listen_fd, (struct sockaddr *) &addr, 
&addr_len))
-        return 131072;
-
-      if (addr.sin_family != AF_INET)
-        return 26214;
-      port = (int)ntohs(addr.sin_port);
-    }
+  {
+    di = MHD_get_daemon_info (d, MHD_DAEMON_INFO_LISTEN_FD);
+    if (di == NULL)
+      return 65536;
+
+    if (0 != getsockname (di->listen_fd, (struct sockaddr *) &addr, &addr_len))
+      return 131072;
+
+    if (addr.sin_family != AF_INET)
+      return 26214;
+    port = (int) ntohs (addr.sin_port);
+  }
   else
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
-  snprintf(buf, sizeof(buf), "http://127.0.0.1:%d/";,
-           port);
+  snprintf (buf, sizeof(buf), "http://127.0.0.1:%d/";,
+            port);
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, buf);
@@ -551,14 +565,14 @@ testUnknownPortGet ()
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 524288;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 524288;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen (TESTSTR))
@@ -575,9 +589,9 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *tmp;
   FILE *f;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
 
@@ -594,24 +608,24 @@ main (int argc, char *const *argv)
             oneone ? "11" : "");
   f = fopen (sourcefile, "w");
   if (NULL == f)
-    {
-      fprintf (stderr, "failed to write test file\n");
-      free (sourcefile);
-      return 1;
-    }
+  {
+    fprintf (stderr, "failed to write test file\n");
+    free (sourcefile);
+    return 1;
+  }
   if (1 !=
       fwrite (TESTSTR, strlen (TESTSTR), 1, f))
     abort ();
   fclose (f);
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalGet ();
-      errorCount += testMultithreadedGet ();
-      errorCount += testMultithreadedPoolGet ();
-      errorCount += testUnknownPortGet ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalGet ();
+    errorCount += testMultithreadedGet ();
+    errorCount += testMultithreadedPoolGet ();
+    errorCount += testUnknownPortGet ();
+  }
   errorCount += testExternalGet ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_iplimit.c b/src/testcurl/test_iplimit.c
index 35ae6645..82d2923f 100644
--- a/src/testcurl/test_iplimit.c
+++ b/src/testcurl/test_iplimit.c
@@ -45,10 +45,10 @@
 #include <windows.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -86,19 +86,19 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -119,14 +119,14 @@ testMultithreadedGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1260;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1260;
+    if (oneone)
+      port += 5;
+  }
 
   /* Test only valid for HTTP/1.1 (uses persistent connections) */
-  if (!oneone)
+  if (! oneone)
     return 0;
 
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
@@ -137,83 +137,85 @@ testMultithreadedGet ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
   for (k = 0; k < 3; ++k)
+  {
+    struct CBC cbc[3];
+    CURL *cenv[3];
+    int i;
+
+    success = 0;
+    failure = 0;
+    for (i = 0; i < 3; ++i)
+    {
+      CURL *c;
+      CURLcode errornum;
+
+      cenv[i] = c = curl_easy_init ();
+      cbc[i].buf = buf;
+      cbc[i].size = 2048;
+      cbc[i].pos = 0;
+
+      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
+      curl_easy_setopt (c, CURLOPT_PORT, (long) port);
+      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc[i]);
+      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+      curl_easy_setopt (c, CURLOPT_FORBID_REUSE, 0L);
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+      /* NOTE: use of CONNECTTIMEOUT without also
+       *   setting NOSIGNAL results in really weird
+       *   crashes on my system! */
+      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+
+      errornum = curl_easy_perform (c);
+      if (CURLE_OK == errornum)
+        success++;
+      else
+        failure++;
+    }
+
+    /* Cleanup the environments */
+    for (i = 0; i < 3; ++i)
+      curl_easy_cleanup (cenv[i]);
+    if ( (2 != success) ||
+         (1 != failure) )
     {
-      struct CBC cbc[3];
-      CURL *cenv[3];
-      int i;
-
-      success = 0;
-      failure = 0;
-      for (i = 0; i < 3; ++i)
-        {
-          CURL *c;
-          CURLcode errornum;
-
-          cenv[i] = c = curl_easy_init ();
-          cbc[i].buf = buf;
-          cbc[i].size = 2048;
-          cbc[i].pos = 0;
-
-          curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-          curl_easy_setopt (c, CURLOPT_PORT, (long)port);
-          curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-          curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc[i]);
-          curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-          curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-          curl_easy_setopt (c, CURLOPT_FORBID_REUSE, 0L);
-          curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-          curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-          /* NOTE: use of CONNECTTIMEOUT without also
-           *   setting NOSIGNAL results in really weird
-           *   crashes on my system! */
-          curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-
-          errornum = curl_easy_perform (c);
-          if (CURLE_OK == errornum)
-            success++;
-          else
-            failure++;
-        }
-
-      /* Cleanup the environments */
-      for (i = 0; i < 3; ++i)
-        curl_easy_cleanup (cenv[i]);
-      if ( (2 != success) ||
-           (1 != failure) )
+      fprintf (stderr,
+               "Unexpected number of success (%u) or failure (%u)\n",
+               success,
+               failure);
+      MHD_stop_daemon (d);
+      return 32;
+    }
+
+    (void) sleep (2);
+
+    for (i = 0; i < 2; ++i)
+    {
+      if (cbc[i].pos != strlen ("/hello_world"))
       {
-        fprintf (stderr,
-                 "Unexpected number of success (%u) or failure (%u)\n",
-                 success,
-                 failure);
         MHD_stop_daemon (d);
-        return 32;
+        return 64;
+      }
+      if (0 != strncmp ("/hello_world", cbc[i].buf, strlen ("/hello_world")))
+      {
+        MHD_stop_daemon (d);
+        return 128;
       }
-
-      (void)sleep(2);
-
-      for (i = 0; i < 2; ++i)
-        {
-          if (cbc[i].pos != strlen ("/hello_world"))
-            {
-              MHD_stop_daemon (d);
-              return 64;
-            }
-          if (0 != strncmp ("/hello_world", cbc[i].buf, strlen 
("/hello_world")))
-            {
-              MHD_stop_daemon (d);
-              return 128;
-            }
-        }
     }
+  }
   MHD_stop_daemon (d);
   return 0;
 }
@@ -228,14 +230,14 @@ testMultithreadedPoolGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1261;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1261;
+    if (oneone)
+      port += 5;
+  }
 
   /* Test only valid for HTTP/1.1 (uses persistent connections) */
-  if (!oneone)
+  if (! oneone)
     return 0;
 
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
@@ -246,90 +248,92 @@ testMultithreadedPoolGet ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
   for (k = 0; k < 3; ++k)
+  {
+    struct CBC cbc[3];
+    CURL *cenv[3];
+    int i;
+
+    for (i = 0; i < 3; ++i)
     {
-      struct CBC cbc[3];
-      CURL *cenv[3];
-      int i;
-
-      for (i = 0; i < 3; ++i)
-        {
-          CURL *c;
-          CURLcode errornum;
-
-          cenv[i] = c = curl_easy_init ();
-          cbc[i].buf = buf;
-          cbc[i].size = 2048;
-          cbc[i].pos = 0;
-
-          curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-          curl_easy_setopt (c, CURLOPT_PORT, (long)port);
-          curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-          curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc[i]);
-          curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-          curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-          curl_easy_setopt (c, CURLOPT_FORBID_REUSE, 0L);
-          curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-          curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-          /* NOTE: use of CONNECTTIMEOUT without also
-           *   setting NOSIGNAL results in really weird
-           *   crashes on my system! */
-          curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-
-          errornum = curl_easy_perform (c);
-          if ( ( (CURLE_OK != errornum) && (i <  2) ) ||
-              ( (CURLE_OK == errornum) && (i == 2) ) )
-            {
-              int j;
-
-              /* First 2 should succeed */
-              if (i < 2)
-                fprintf (stderr,
-                         "curl_easy_perform failed: `%s'\n",
-                         curl_easy_strerror (errornum));
-
-              /* Last request should have failed */
-              else
-                fprintf (stderr,
-                         "No error on IP address over limit\n");
-
-              for (j = 0; j < i; ++j)
-                curl_easy_cleanup (cenv[j]);
-              MHD_stop_daemon (d);
-              return 32;
-            }
-        }
-
-      /* Cleanup the environments */
-      for (i = 0; i < 3; ++i)
-        curl_easy_cleanup (cenv[i]);
-
-      (void)sleep(2);
-
-      for (i = 0; i < 2; ++i)
-        {
-          if (cbc[i].pos != strlen ("/hello_world"))
-            {
-              MHD_stop_daemon (d);
-              return 64;
-            }
-          if (0 != strncmp ("/hello_world", cbc[i].buf, strlen 
("/hello_world")))
-            {
-              MHD_stop_daemon (d);
-              return 128;
-            }
-        }
+      CURL *c;
+      CURLcode errornum;
+
+      cenv[i] = c = curl_easy_init ();
+      cbc[i].buf = buf;
+      cbc[i].size = 2048;
+      cbc[i].pos = 0;
+
+      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
+      curl_easy_setopt (c, CURLOPT_PORT, (long) port);
+      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc[i]);
+      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+      curl_easy_setopt (c, CURLOPT_FORBID_REUSE, 0L);
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+      /* NOTE: use of CONNECTTIMEOUT without also
+       *   setting NOSIGNAL results in really weird
+       *   crashes on my system! */
+      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+
+      errornum = curl_easy_perform (c);
+      if ( ( (CURLE_OK != errornum) && (i <  2) ) ||
+           ( (CURLE_OK == errornum) && (i == 2) ) )
+      {
+        int j;
+
+        /* First 2 should succeed */
+        if (i < 2)
+          fprintf (stderr,
+                   "curl_easy_perform failed: `%s'\n",
+                   curl_easy_strerror (errornum));
+
+        /* Last request should have failed */
+        else
+          fprintf (stderr,
+                   "No error on IP address over limit\n");
+
+        for (j = 0; j < i; ++j)
+          curl_easy_cleanup (cenv[j]);
+        MHD_stop_daemon (d);
+        return 32;
+      }
+    }
+
+    /* Cleanup the environments */
+    for (i = 0; i < 3; ++i)
+      curl_easy_cleanup (cenv[i]);
 
+    (void) sleep (2);
 
+    for (i = 0; i < 2; ++i)
+    {
+      if (cbc[i].pos != strlen ("/hello_world"))
+      {
+        MHD_stop_daemon (d);
+        return 64;
+      }
+      if (0 != strncmp ("/hello_world", cbc[i].buf, strlen ("/hello_world")))
+      {
+        MHD_stop_daemon (d);
+        return 128;
+      }
     }
+
+
+  }
   MHD_stop_daemon (d);
   return 0;
 }
@@ -338,9 +342,9 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
index 4495cfd6..0b7256ae 100644
--- a/src/testcurl/test_large_put.c
+++ b/src/testcurl/test_large_put.c
@@ -38,10 +38,10 @@
 
 #include "test_helpers.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -61,34 +61,35 @@ struct CBC
 };
 
 char*
-alloc_init(size_t buf_size)
+alloc_init (size_t buf_size)
 {
-  static const char template[] = 
"ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz";
+  static const char template[] =
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz";
   static const size_t templ_size = sizeof(template) / sizeof(char) - 1;
   char *buf;
   char *fill_ptr;
   size_t to_fill;
 
-  buf = malloc(buf_size);
+  buf = malloc (buf_size);
   if (NULL == buf)
     return NULL;
 
   fill_ptr = buf;
   to_fill = buf_size;
   while (to_fill > 0)
-    {
-      const size_t to_copy = to_fill > templ_size ? templ_size : to_fill;
-      memcpy (fill_ptr, template, to_copy);
-      fill_ptr += to_copy;
-      to_fill -= to_copy;
-    }
+  {
+    const size_t to_copy = to_fill > templ_size ? templ_size : to_fill;
+    memcpy (fill_ptr, template, to_copy);
+    fill_ptr += to_copy;
+    to_fill -= to_copy;
+  }
   return buf;
 }
 
 static size_t
 putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
 {
-  size_t *pos = (size_t *)ptr;
+  size_t *pos = (size_t *) ptr;
   size_t wrt;
 
   wrt = size * nmemb;
@@ -127,46 +128,46 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   int ret;
   static size_t processed;
-  (void)version;        /* Unused. Silent compiler warning. */
+  (void) version;        /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("PUT", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) == 0)
+  {
+    size_t *pproc;
+    if (NULL == *pparam)
+    {
+      processed = 0;
+      *pparam = &processed;     /* Safe as long as only one parallel request 
served. */
+    }
+    pproc = (size_t*) *pparam;
+
+    if (0 == *upload_data_size)
+      return MHD_YES;   /* No data to process. */
+
+    if (*pproc + *upload_data_size > PUT_SIZE)
+    {
+      fprintf (stderr, "Incoming data larger than expected.\n");
+      return MHD_NO;
+    }
+    if ( (! incr_read) && (*upload_data_size != PUT_SIZE) )
+      return MHD_YES;   /* Wait until whole request is received. */
+
+    if (0 != memcmp (upload_data, put_buffer + (*pproc), *upload_data_size))
     {
-      size_t *pproc;
-      if (NULL == *pparam)
-        {
-          processed = 0;
-          *pparam = &processed; /* Safe as long as only one parallel request 
served. */
-        }
-      pproc = (size_t*) *pparam;
-
-      if (0 == *upload_data_size)
-        return MHD_YES; /* No data to process. */
-
-      if (*pproc + *upload_data_size > PUT_SIZE)
-        {
-          fprintf (stderr, "Incoming data larger than expected.\n");
-          return MHD_NO;
-        }
-      if ( (!incr_read) && (*upload_data_size != PUT_SIZE) )
-        return MHD_YES; /* Wait until whole request is received. */
-
-      if (0 != memcmp(upload_data, put_buffer + (*pproc), *upload_data_size))
-        {
-          fprintf (stderr, "Incoming data does not match sent data.\n");
-          return MHD_NO;
-        }
-      *pproc += *upload_data_size;
-      *upload_data_size = 0; /* Current block of data is fully processed. */
-
-      if (PUT_SIZE == *pproc)
-        *done = 1; /* Whole request is processed. */
-      return MHD_YES;
+      fprintf (stderr, "Incoming data does not match sent data.\n");
+      return MHD_NO;
     }
+    *pproc += *upload_data_size;
+    *upload_data_size = 0;   /* Current block of data is fully processed. */
+
+    if (PUT_SIZE == *pproc)
+      *done = 1;   /* Whole request is processed. */
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -188,35 +189,39 @@ testPutInternalThread (unsigned int add_flag)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1270;
-      if (oneone)
-        port += 10;
-      if (incr_read)
-        port += 20;
-    }
+  {
+    port = 1270;
+    if (oneone)
+      port += 10;
+    if (incr_read)
+      port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
add_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | add_flag,
                         port,
                         NULL, NULL, &ahc_echo, &done_flag,
-                       MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read 
? 1024 : (PUT_SIZE * 4 / 3)),
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+                        (size_t) (incr_read ? 1024 : (PUT_SIZE * 4 / 3)),
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -235,14 +240,14 @@ testPutInternalThread (unsigned int add_flag)
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -267,36 +272,40 @@ testPutThreadPerConn (unsigned int add_flag)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1271;
-      if (oneone)
-        port += 10;
-      if (incr_read)
-        port += 20;
-    }
+  {
+    port = 1271;
+    if (oneone)
+      port += 10;
+    if (incr_read)
+      port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD |
-                          MHD_USE_ERROR_LOG | add_flag,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD
+                        | MHD_USE_ERROR_LOG | add_flag,
                         port,
                         NULL, NULL, &ahc_echo, &done_flag,
-                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read 
? 1024 : (PUT_SIZE * 4)),
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+                        (size_t) (incr_read ? 1024 : (PUT_SIZE * 4)),
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -315,21 +324,21 @@ testPutThreadPerConn (unsigned int add_flag)
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
-    {
-      fprintf (stderr, "Got invalid response `%.*s'\n", (int)cbc.pos, cbc.buf);
-      return 64;
-    }
+  {
+    fprintf (stderr, "Got invalid response `%.*s'\n", (int) cbc.pos, cbc.buf);
+    return 64;
+  }
   if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
     return 128;
   return 0;
@@ -350,36 +359,40 @@ testPutThreadPool (unsigned int add_flag)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1272;
-      if (oneone)
-        port += 10;
-      if (incr_read)
-        port += 20;
-    }
+  {
+    port = 1272;
+    if (oneone)
+      port += 10;
+    if (incr_read)
+      port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
add_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | add_flag,
                         port,
                         NULL, NULL, &ahc_echo, &done_flag,
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
-                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read 
? 1024 : (PUT_SIZE * 4)),
-                       MHD_OPTION_END);
+                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+                        (size_t) (incr_read ? 1024 : (PUT_SIZE * 4)),
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -398,21 +411,21 @@ testPutThreadPool (unsigned int add_flag)
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
-    {
-      fprintf (stderr, "Got invalid response `%.*s'\n", (int)cbc.pos, cbc.buf);
-      return 64;
-    }
+  {
+    fprintf (stderr, "Got invalid response `%.*s'\n", (int) cbc.pos, cbc.buf);
+    return 64;
+  }
   if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
     return 128;
   return 0;
@@ -447,13 +460,13 @@ testPutExternal (void)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1273;
-      if (oneone)
-        port += 10;
-      if (incr_read)
-        port += 20;
-    }
+  {
+    port = 1273;
+    if (oneone)
+      port += 10;
+    if (incr_read)
+      port += 20;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -462,21 +475,24 @@ testPutExternal (void)
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         port,
                         NULL, NULL, &ahc_echo, &done_flag,
-                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read 
? 1024 : (PUT_SIZE * 4)),
+                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+                        (size_t) (incr_read ? 1024 : (PUT_SIZE * 4)),
                         MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -498,92 +514,94 @@ testPutExternal (void)
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
-    {
-      fprintf (stderr, "Got invalid response `%.*s'\n", (int)cbc.pos, cbc.buf);
-      return 8192;
-    }
+  {
+    fprintf (stderr, "Got invalid response `%.*s'\n", (int) cbc.pos, cbc.buf);
+    return 8192;
+  }
   if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
     return 16384;
   return 0;
@@ -597,59 +615,67 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   unsigned int lastErr;
 
-  oneone = has_in_name(argv[0], "11");
-  incr_read = has_in_name(argv[0], "_inc");
-  verbose = has_param(argc, argv, "-v");
+  oneone = has_in_name (argv[0], "11");
+  incr_read = has_in_name (argv[0], "_inc");
+  verbose = has_param (argc, argv, "-v");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 99;
   put_buffer = alloc_init (PUT_SIZE);
   if (NULL == put_buffer)
     return 99;
   lastErr = testPutExternal ();
-  if (verbose && 0 != lastErr)
+  if (verbose &&(0 != lastErr))
     fprintf (stderr, "Error during testing with external select().\n");
   errorCount += lastErr;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    lastErr = testPutInternalThread (0);
+    if (verbose &&(0 != lastErr) )
+      fprintf (stderr,
+               "Error during testing with internal thread with select().\n");
+    errorCount += lastErr;
+    lastErr = testPutThreadPerConn (0);
+    if (verbose &&(0 != lastErr) )
+      fprintf (stderr,
+               "Error during testing with internal thread per connection with 
select().\n");
+    errorCount += lastErr;
+    lastErr = testPutThreadPool (0);
+    if (verbose &&(0 != lastErr) )
+      fprintf (stderr,
+               "Error during testing with thread pool per connection with 
select().\n");
+    errorCount += lastErr;
+    if (MHD_is_feature_supported (MHD_FEATURE_POLL))
     {
-      lastErr = testPutInternalThread (0);
-      if (verbose && 0 != lastErr)
-       fprintf (stderr, "Error during testing with internal thread with 
select().\n");
+      lastErr = testPutInternalThread (MHD_USE_POLL);
+      if (verbose &&(0 != lastErr) )
+        fprintf (stderr,
+                 "Error during testing with internal thread with poll().\n");
       errorCount += lastErr;
-      lastErr = testPutThreadPerConn (0);
-      if (verbose && 0 != lastErr)
-       fprintf (stderr, "Error during testing with internal thread per 
connection with select().\n");
+      lastErr = testPutThreadPerConn (MHD_USE_POLL);
+      if (verbose &&(0 != lastErr) )
+        fprintf (stderr,
+                 "Error during testing with internal thread per connection 
with poll().\n");
+      errorCount += lastErr;
+      lastErr = testPutThreadPool (MHD_USE_POLL);
+      if (verbose &&(0 != lastErr) )
+        fprintf (stderr,
+                 "Error during testing with thread pool per connection with 
poll().\n");
+      errorCount += lastErr;
+    }
+    if (MHD_is_feature_supported (MHD_FEATURE_EPOLL))
+    {
+      lastErr = testPutInternalThread (MHD_USE_EPOLL);
+      if (verbose &&(0 != lastErr) )
+        fprintf (stderr,
+                 "Error during testing with internal thread with epoll.\n");
       errorCount += lastErr;
-      lastErr = testPutThreadPool (0);
-      if (verbose && 0 != lastErr)
-       fprintf (stderr, "Error during testing with thread pool per connection 
with select().\n");
+      lastErr = testPutThreadPool (MHD_USE_EPOLL);
+      if (verbose &&(0 != lastErr) )
+        fprintf (stderr,
+                 "Error during testing with thread pool per connection with 
epoll.\n");
       errorCount += lastErr;
-      if (MHD_is_feature_supported(MHD_FEATURE_POLL))
-       {
-         lastErr = testPutInternalThread (MHD_USE_POLL);
-         if (verbose && 0 != lastErr)
-           fprintf (stderr, "Error during testing with internal thread with 
poll().\n");
-         errorCount += lastErr;
-         lastErr = testPutThreadPerConn (MHD_USE_POLL);
-         if (verbose && 0 != lastErr)
-           fprintf (stderr, "Error during testing with internal thread per 
connection with poll().\n");
-         errorCount += lastErr;
-         lastErr = testPutThreadPool (MHD_USE_POLL);
-         if (verbose && 0 != lastErr)
-           fprintf (stderr, "Error during testing with thread pool per 
connection with poll().\n");
-         errorCount += lastErr;
-       }
-      if (MHD_is_feature_supported(MHD_FEATURE_EPOLL))
-       {
-         lastErr = testPutInternalThread (MHD_USE_EPOLL);
-         if (verbose && 0 != lastErr)
-           fprintf (stderr, "Error during testing with internal thread with 
epoll.\n");
-         errorCount += lastErr;
-         lastErr = testPutThreadPool (MHD_USE_EPOLL);
-         if (verbose && 0 != lastErr)
-           fprintf (stderr, "Error during testing with thread pool per 
connection with epoll.\n");
-         errorCount += lastErr;
-       }
     }
+  }
   free (put_buffer);
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c
index dc76a136..01d62d11 100644
--- a/src/testcurl/test_long_header.c
+++ b/src/testcurl/test_long_header.c
@@ -42,14 +42,14 @@
  * half of this value, so the actual value does not have
  * to be big at all...
  */
-#define VERY_LONG (1024*8)
+#define VERY_LONG (1024 * 8)
 
 static int oneone;
 
 static int
 apc_all (void *cls, const struct sockaddr *addr, socklen_t addrlen)
 {
-  (void)cls;(void)addr;(void)addrlen;   /* Unused. Silent compiler warning. */
+  (void) cls; (void) addr; (void) addrlen;   /* Unused. Silent compiler 
warning. */
   return MHD_YES;
 }
 
@@ -63,7 +63,7 @@ struct CBC
 static size_t
 copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
 {
-  (void)ptr;(void)ctx;  /* Unused. Silent compiler warning. */
+  (void) ptr; (void) ctx;  /* Unused. Silent compiler warning. */
   return size * nmemb;
 }
 
@@ -79,14 +79,14 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)upload_data;      /* Unused. Silent compiler warning. */
-  (void)upload_data_size;(void)unused;  /* Unused. Silent compiler warning. */
+  (void) version; (void) upload_data;      /* Unused. Silent compiler warning. 
*/
+  (void) upload_data_size; (void) unused;  /* Unused. Silent compiler warning. 
*/
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -107,44 +107,47 @@ testLongUrlGet (size_t buff_size)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1330 + buff_size % 20;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1330 + buff_size % 20;
+    if (oneone)
+      port += 5;
+  }
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        port,
-                        &apc_all,
-                        NULL,
-                        &ahc_echo,
-                        "GET",
-                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
-                        (size_t) buff_size, MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    port,
+    &apc_all,
+    NULL,
+    &ahc_echo,
+    "GET",
+    MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+    (size_t) buff_size, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   url = malloc (VERY_LONG);
   if (url == NULL)
-    {
-       MHD_stop_daemon (d);
-       return 1;
-    }
+  {
+    MHD_stop_daemon (d);
+    return 1;
+  }
   memset (url, 'a', VERY_LONG);
   url[VERY_LONG - 1] = '\0';
   memcpy (url, "http://127.0.0.1/";, strlen ("http://127.0.0.1/";));
   curl_easy_setopt (c, CURLOPT_URL, url);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -159,19 +162,19 @@ testLongUrlGet (size_t buff_size)
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK == curl_easy_perform (c))
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      free (url);
-      return 2;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    free (url);
+    return 2;
+  }
   if (CURLE_OK != curl_easy_getinfo (c, CURLINFO_RESPONSE_CODE, &code))
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      free (url);
-      return 4;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    free (url);
+    return 4;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   free (url);
@@ -196,40 +199,43 @@ testLongHeaderGet (size_t buff_size)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1331 + buff_size % 20;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1331 + buff_size % 20;
+    if (oneone)
+      port += 5;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        port,
-                        &apc_all,
-                        NULL,
-                        &ahc_echo,
-                        "GET",
-                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
-                        (size_t) buff_size, MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    port,
+    &apc_all,
+    NULL,
+    &ahc_echo,
+    "GET",
+    MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+    (size_t) buff_size, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   url = malloc (VERY_LONG);
   if (url == NULL)
-     {
-       MHD_stop_daemon (d);
-       return 16;
-     }
+  {
+    MHD_stop_daemon (d);
+    return 16;
+  }
   memset (url, 'a', VERY_LONG);
   url[VERY_LONG - 1] = '\0';
   url[VERY_LONG / 2] = ':';
@@ -238,7 +244,7 @@ testLongHeaderGet (size_t buff_size)
 
   curl_easy_setopt (c, CURLOPT_HTTPHEADER, header);
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -253,21 +259,21 @@ testLongHeaderGet (size_t buff_size)
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK == curl_easy_perform (c))
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      curl_slist_free_all (header);
-      free (url);
-      return 32;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    curl_slist_free_all (header);
+    free (url);
+    return 32;
+  }
   if (CURLE_OK != curl_easy_getinfo (c, CURLINFO_RESPONSE_CODE, &code))
-    {
-      curl_slist_free_all (header);
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      free (url);
-      return 64;
-    }
+  {
+    curl_slist_free_all (header);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    free (url);
+    return 64;
+  }
   curl_slist_free_all (header);
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
@@ -281,9 +287,9 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
diff --git a/src/testcurl/test_parse_cookies.c 
b/src/testcurl/test_parse_cookies.c
index c09846d8..da33ea3f 100644
--- a/src/testcurl/test_parse_cookies.c
+++ b/src/testcurl/test_parse_cookies.c
@@ -1,4 +1,3 @@
-
 /*
      This file is part of libmicrohttpd
      Copyright (C) 2007 Christian Grothoff
@@ -73,15 +72,15 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   int ret;
   const char *hdr;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
 
   hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name1");
@@ -97,8 +96,8 @@ ahc_echo (void *cls,
   if ((hdr == NULL) || (0 != strcmp (hdr, "var4 with spaces")))
     abort ();
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_PERSISTENT);
+                                              (void *) url,
+                                              MHD_RESPMEM_PERSISTENT);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -133,11 +132,11 @@ testExternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1340;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1340;
+    if (oneone)
+      port += 5;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -148,16 +147,18 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -180,86 +181,88 @@ testExternalGet ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -273,9 +276,9 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c
index 03452a2f..b665139a 100644
--- a/src/testcurl/test_post.c
+++ b/src/testcurl/test_post.c
@@ -45,10 +45,10 @@
 
 #include "mhd_has_in_name.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -66,12 +66,12 @@ struct CBC
 
 static void
 completed_cb (void *cls,
-             struct MHD_Connection *connection,
-             void **con_cls,
-             enum MHD_RequestTerminationCode toe)
+              struct MHD_Connection *connection,
+              void **con_cls,
+              enum MHD_RequestTerminationCode toe)
 {
   struct MHD_PostProcessor *pp = *con_cls;
-  (void)cls;(void)connection;(void)toe; /* Unused. Silent compiler warning. */
+  (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler 
warning. */
 
   if (NULL != pp)
     MHD_destroy_post_processor (pp);
@@ -107,8 +107,8 @@ post_iterator (void *cls,
                const char *value, uint64_t off, size_t size)
 {
   int *eok = cls;
-  (void)kind;(void)filename;(void)content_type; /* Unused. Silent compiler 
warning. */
-  (void)transfer_encoding;(void)off;            /* Unused. Silent compiler 
warning. */
+  (void) kind; (void) filename; (void) content_type; /* Unused. Silent 
compiler warning. */
+  (void) transfer_encoding; (void) off;            /* Unused. Silent compiler 
warning. */
 
   if ((0 == strcasecmp (key, "name")) &&
       (size == strlen ("daniel")) && (0 == strncmp (value, "daniel", size)))
@@ -133,32 +133,32 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   struct MHD_PostProcessor *pp;
   int ret;
-  (void)cls;(void)version;      /* Unused. Silent compiler warning. */
+  (void) cls; (void) version;      /* Unused. Silent compiler warning. */
 
   if (0 != strcasecmp ("POST", method))
-    {
-      printf ("METHOD: %s\n", method);
-      return MHD_NO;            /* unexpected method */
-    }
+  {
+    printf ("METHOD: %s\n", method);
+    return MHD_NO;              /* unexpected method */
+  }
   pp = *unused;
   if (pp == NULL)
-    {
-      eok = 0;
-      pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
-      *unused = pp;
-    }
+  {
+    eok = 0;
+    pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
+    *unused = pp;
+  }
   MHD_post_process (pp, upload_data, *upload_data_size);
   if ((eok == 3) && (0 == *upload_data_size))
-    {
-      response = MHD_create_response_from_buffer (strlen (url),
-                                                 (void *) url,
-                                                 MHD_RESPMEM_MUST_COPY);
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-      MHD_destroy_response (response);
-      MHD_destroy_post_processor (pp);
-      *unused = NULL;
-      return ret;
-    }
+  {
+    response = MHD_create_response_from_buffer (strlen (url),
+                                                (void *) url,
+                                                MHD_RESPMEM_MUST_COPY);
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+    MHD_destroy_post_processor (pp);
+    *unused = NULL;
+    return ret;
+  }
   *upload_data_size = 0;
   return MHD_YES;
 }
@@ -177,32 +177,34 @@ testInternalPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1370;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1370;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
@@ -220,14 +222,14 @@ testInternalPost ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -250,32 +252,35 @@ testMultithreadedPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1371;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1371;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
@@ -293,14 +298,14 @@ testMultithreadedPost ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -323,11 +328,11 @@ testMultithreadedPoolPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1372;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1372;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -335,21 +340,23 @@ testMultithreadedPoolPost ()
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
@@ -367,14 +374,14 @@ testMultithreadedPoolPost ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -411,11 +418,11 @@ testExternalPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1373;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1373;
+    if (oneone)
+      port += 10;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -423,21 +430,23 @@ testExternalPost ()
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
@@ -458,85 +467,88 @@ testExternalPost ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -548,43 +560,43 @@ testExternalPost ()
 
 static int
 ahc_cancel (void *cls,
-           struct MHD_Connection *connection,
-           const char *url,
-           const char *method,
-           const char *version,
-           const char *upload_data, size_t *upload_data_size,
-           void **unused)
+            struct MHD_Connection *connection,
+            const char *url,
+            const char *method,
+            const char *version,
+            const char *upload_data, size_t *upload_data_size,
+            void **unused)
 {
   struct MHD_Response *response;
   int ret;
-  (void)cls;(void)url;(void)version;            /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url; (void) version;            /* Unused. Silent 
compiler warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcasecmp ("POST", method))
-    {
-      fprintf (stderr,
-              "Unexpected method `%s'\n", method);
-      return MHD_NO;
-    }
+  {
+    fprintf (stderr,
+             "Unexpected method `%s'\n", method);
+    return MHD_NO;
+  }
 
   if (*unused == NULL)
-    {
-      *unused = "wibble";
-      /* We don't want the body. Send a 500. */
-      response = MHD_create_response_from_buffer (0, NULL,
-                                                 MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_response(connection, 500, response);
-      if (ret != MHD_YES)
-       fprintf(stderr, "Failed to queue response\n");
-      MHD_destroy_response(response);
-      return ret;
-    }
+  {
+    *unused = "wibble";
+    /* We don't want the body. Send a 500. */
+    response = MHD_create_response_from_buffer (0, NULL,
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_response (connection, 500, response);
+    if (ret != MHD_YES)
+      fprintf (stderr, "Failed to queue response\n");
+    MHD_destroy_response (response);
+    return ret;
+  }
   else
-    {
-      fprintf(stderr,
-             "In ahc_cancel again. This should not happen.\n");
-      return MHD_NO;
-    }
+  {
+    fprintf (stderr,
+             "In ahc_cancel again. This should not happen.\n");
+    return MHD_NO;
+  }
 }
 
 struct CRBC
@@ -596,7 +608,7 @@ struct CRBC
 
 
 static size_t
-readBuffer(void *p, size_t size, size_t nmemb, void *opaque)
+readBuffer (void *p, size_t size, size_t nmemb, void *opaque)
 {
   struct CRBC *data = opaque;
   size_t required = size * nmemb;
@@ -605,18 +617,18 @@ readBuffer(void *p, size_t size, size_t nmemb, void 
*opaque)
   if (required > left)
     required = left;
 
-  memcpy(p, data->buffer + data->pos, required);
+  memcpy (p, data->buffer + data->pos, required);
   data->pos += required;
 
-  return required/size;
+  return required / size;
 }
 
 
 static size_t
-slowReadBuffer(void *p, size_t size, size_t nmemb, void *opaque)
+slowReadBuffer (void *p, size_t size, size_t nmemb, void *opaque)
 {
-  (void)sleep(1);
-  return readBuffer(p, size, nmemb, opaque);
+  (void) sleep (1);
+  return readBuffer (p, size, nmemb, opaque);
 }
 
 
@@ -628,7 +640,7 @@ slowReadBuffer(void *p, size_t size, size_t nmemb, void 
*opaque)
 
 
 static int
-testMultithreadedPostCancelPart(int flags)
+testMultithreadedPostCancelPart (int flags)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -645,44 +657,48 @@ testMultithreadedPostCancelPart(int flags)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1374;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1374;
+    if (oneone)
+      port += 10;
+  }
 
   /* Don't test features that aren't available with HTTP/1.0 in
    * HTTP/1.0 mode. */
-  if (!oneone && (flags & (FLAG_EXPECT_CONTINUE | FLAG_CHUNKED)))
+  if (! oneone && (flags & (FLAG_EXPECT_CONTINUE | FLAG_CHUNKED)))
     return 0;
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_cancel, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_END);
   if (d == NULL)
     return 32768;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
   crbc.buffer = "Test content";
-  crbc.size = strlen(crbc.buffer);
+  crbc.size = strlen (crbc.buffer);
   crbc.pos = 0;
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-  curl_easy_setopt (c, CURLOPT_READFUNCTION, (flags & FLAG_SLOW_READ) ? 
&slowReadBuffer : &readBuffer);
+  curl_easy_setopt (c, CURLOPT_READFUNCTION, (flags & FLAG_SLOW_READ) ?
+                    &slowReadBuffer : &readBuffer);
   curl_easy_setopt (c, CURLOPT_READDATA, &crbc);
   curl_easy_setopt (c, CURLOPT_POSTFIELDS, NULL);
   curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, crbc.size);
@@ -700,68 +716,72 @@ testMultithreadedPostCancelPart(int flags)
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
 
   if (flags & FLAG_CHUNKED)
-      headers = curl_slist_append(headers, "Transfer-Encoding: chunked");
-  if (!(flags & FLAG_FORM_DATA))
-  headers = curl_slist_append(headers, "Content-Type: 
application/octet-stream");
+    headers = curl_slist_append (headers, "Transfer-Encoding: chunked");
+  if (! (flags & FLAG_FORM_DATA))
+    headers = curl_slist_append (headers,
+                                 "Content-Type: application/octet-stream");
   if (flags & FLAG_EXPECT_CONTINUE)
-      headers = curl_slist_append(headers, "Expect: 100-Continue");
-  curl_easy_setopt(c, CURLOPT_HTTPHEADER, headers);
+    headers = curl_slist_append (headers, "Expect: 100-Continue");
+  curl_easy_setopt (c, CURLOPT_HTTPHEADER, headers);
 
   if (CURLE_HTTP_RETURNED_ERROR != (errornum = curl_easy_perform (c)))
-    {
+  {
 #ifdef _WIN32
-      curl_version_info_data *curlverd = curl_version_info(CURLVERSION_NOW);
-      if (0 != (flags & FLAG_SLOW_READ) && CURLE_RECV_ERROR == errornum &&
-          (curlverd == NULL || curlverd->ares_num < 0x073100) )
-        { /* libcurl up to version 7.49.0 didn't have workaround for WinSock 
bug */
-          fprintf (stderr, "Ignored curl_easy_perform expected failure on W32 
with \"slow read\".\n");
-          result = 0;
-        }
-      else
+    curl_version_info_data *curlverd = curl_version_info (CURLVERSION_NOW);
+    if ((0 != (flags & FLAG_SLOW_READ)) &&(CURLE_RECV_ERROR == errornum) &&
+        ((curlverd == NULL) ||(curlverd->ares_num < 0x073100) ) )
+    {     /* libcurl up to version 7.49.0 didn't have workaround for WinSock 
bug */
+      fprintf (stderr,
+               "Ignored curl_easy_perform expected failure on W32 with \"slow 
read\".\n");
+      result = 0;
+    }
+    else
 #else  /* ! _WIN32 */
-      if(1)
+    if (1)
 #endif /* ! _WIN32 */
-        {
-          fprintf (stderr,
-                   "flibbet curl_easy_perform didn't fail as expected: `%s' 
%d\n",
-                   curl_easy_strerror (errornum), errornum);
-          result = 65536;
-        }
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      curl_slist_free_all(headers);
-      return result;
-    }
-
-  if (CURLE_OK != (cc = curl_easy_getinfo(c, CURLINFO_RESPONSE_CODE, 
&response_code)))
     {
-      fprintf(stderr, "curl_easy_getinfo failed: '%s'\n", 
curl_easy_strerror(errornum));
+      fprintf (stderr,
+               "flibbet curl_easy_perform didn't fail as expected: `%s' %d\n",
+               curl_easy_strerror (errornum), errornum);
       result = 65536;
     }
-
-  if (!result && (response_code != 500))
-    {
-      fprintf(stderr, "Unexpected response code: %ld\n", response_code);
-      result = 131072;
-    }
-
-  if (!result && (cbc.pos != 0))
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    curl_slist_free_all (headers);
+    return result;
+  }
+
+  if (CURLE_OK != (cc = curl_easy_getinfo (c, CURLINFO_RESPONSE_CODE,
+                                           &response_code)))
+  {
+    fprintf (stderr, "curl_easy_getinfo failed: '%s'\n", curl_easy_strerror (
+               errornum));
+    result = 65536;
+  }
+
+  if (! result && (response_code != 500))
+  {
+    fprintf (stderr, "Unexpected response code: %ld\n", response_code);
+    result = 131072;
+  }
+
+  if (! result && (cbc.pos != 0))
     result = 262144;
 
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
-  curl_slist_free_all(headers);
+  curl_slist_free_all (headers);
   return result;
 }
 
 
 static int
-testMultithreadedPostCancel()
+testMultithreadedPostCancel ()
 {
   int result = 0;
   int flags;
-  for(flags = 0; flags < FLAG_COUNT; ++flags)
-    result |= testMultithreadedPostCancelPart(flags);
+  for (flags = 0; flags < FLAG_COUNT; ++flags)
+    result |= testMultithreadedPostCancelPart (flags);
   return result;
 }
 
@@ -770,20 +790,20 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testMultithreadedPostCancel ();
-      errorCount += testInternalPost ();
-      errorCount += testMultithreadedPost ();
-      errorCount += testMultithreadedPoolPost ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testMultithreadedPostCancel ();
+    errorCount += testInternalPost ();
+    errorCount += testMultithreadedPost ();
+    errorCount += testMultithreadedPoolPost ();
+  }
   errorCount += testExternalPost ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index 6da54a95..558228a2 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -38,14 +38,15 @@
 #include <unistd.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
-#define POST_DATA "<?xml version='1.0' 
?>\n<xml>\n<data-id>1</data-id>\n</xml>\n"
+#define POST_DATA \
+  "<?xml version='1.0' ?>\n<xml>\n<data-id>1</data-id>\n</xml>\n"
 
 #define LOOPCOUNT 1000
 
@@ -82,25 +83,25 @@ ahc_echo (void *cls,
   static int marker;
   struct MHD_Response *response;
   int ret;
-  (void)cls;(void)url;(void)version;            /* Unused. Silent compiler 
warning. */
-  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url; (void) version;            /* Unused. Silent 
compiler warning. */
+  (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcmp ("POST", method))
-    {
-      printf ("METHOD: %s\n", method);
-      return MHD_NO;            /* unexpected method */
-    }
+  {
+    printf ("METHOD: %s\n", method);
+    return MHD_NO;              /* unexpected method */
+  }
   if ((*mptr != NULL) && (0 == *upload_data_size))
-    {
-      if (*mptr != &marker)
-        abort ();
-      response = MHD_create_response_from_buffer (2, "OK",
-                                                 MHD_RESPMEM_PERSISTENT);
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-      MHD_destroy_response (response);
-      *mptr = NULL;
-      return ret;
-    }
+  {
+    if (*mptr != &marker)
+      abort ();
+    response = MHD_create_response_from_buffer (2, "OK",
+                                                MHD_RESPMEM_PERSISTENT);
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+    *mptr = NULL;
+    return ret;
+  }
   if (strlen (POST_DATA) != *upload_data_size)
     return MHD_YES;
   *upload_data_size = 0;
@@ -124,11 +125,11 @@ testInternalPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1350;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1350;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -137,58 +138,60 @@ testInternalPost ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   for (i = 0; i < LOOPCOUNT; i++)
+  {
+    if (99 == i % 100)
+      fprintf (stderr, ".");
+    c = curl_easy_init ();
+    cbc.pos = 0;
+    buf[0] = '\0';
+    snprintf (url,
+              sizeof (url),
+              "http://127.0.0.1:%d/hw%d";,
+              port,
+              i);
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
+    curl_easy_setopt (c, CURLOPT_POST, 1L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    if (CURLE_OK != (errornum = curl_easy_perform (c)))
     {
-      if (99 == i % 100)
-        fprintf (stderr, ".");
-      c = curl_easy_init ();
-      cbc.pos = 0;
-      buf[0] = '\0';
-      snprintf (url,
-                sizeof (url),
-                "http://127.0.0.1:%d/hw%d";,
-                port,
-                i);
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
-      curl_easy_setopt (c, CURLOPT_POST, 1L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      if (CURLE_OK != (errornum = curl_easy_perform (c)))
-        {
-          fprintf (stderr,
-                   "curl_easy_perform failed: `%s'\n",
-                   curl_easy_strerror (errornum));
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2;
-        }
+      fprintf (stderr,
+               "curl_easy_perform failed: `%s'\n",
+               curl_easy_strerror (errornum));
       curl_easy_cleanup (c);
-      if ((buf[0] != 'O') || (buf[1] != 'K'))
-        {
-          MHD_stop_daemon (d);
-          return 4;
-        }
+      MHD_stop_daemon (d);
+      return 2;
+    }
+    curl_easy_cleanup (c);
+    if ((buf[0] != 'O') || (buf[1] != 'K'))
+    {
+      MHD_stop_daemon (d);
+      return 4;
     }
+  }
   MHD_stop_daemon (d);
   if (LOOPCOUNT >= 99)
     fprintf (stderr, "\n");
@@ -210,73 +213,76 @@ testMultithreadedPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1351;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1351;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL,
                         &ahc_echo, NULL,
                         MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   for (i = 0; i < LOOPCOUNT; i++)
+  {
+    if (99 == i % 100)
+      fprintf (stderr, ".");
+    c = curl_easy_init ();
+    cbc.pos = 0;
+    buf[0] = '\0';
+    snprintf (url,
+              sizeof (url),
+              "http://127.0.0.1:%d/hw%d";,
+              port,
+              i);
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
+    curl_easy_setopt (c, CURLOPT_POST, 1L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    if (CURLE_OK != (errornum = curl_easy_perform (c)))
     {
-      if (99 == i % 100)
-        fprintf (stderr, ".");
-      c = curl_easy_init ();
-      cbc.pos = 0;
-      buf[0] = '\0';
-      snprintf (url,
-                sizeof (url),
-                "http://127.0.0.1:%d/hw%d";,
-                port,
-                i);
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
-      curl_easy_setopt (c, CURLOPT_POST, 1L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      if (CURLE_OK != (errornum = curl_easy_perform (c)))
-        {
-          fprintf (stderr,
-                   "curl_easy_perform failed: `%s'\n",
-                   curl_easy_strerror (errornum));
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 32;
-        }
+      fprintf (stderr,
+               "curl_easy_perform failed: `%s'\n",
+               curl_easy_strerror (errornum));
       curl_easy_cleanup (c);
-      if ((buf[0] != 'O') || (buf[1] != 'K'))
-        {
-          MHD_stop_daemon (d);
-          return 64;
-        }
+      MHD_stop_daemon (d);
+      return 32;
+    }
+    curl_easy_cleanup (c);
+    if ((buf[0] != 'O') || (buf[1] != 'K'))
+    {
+      MHD_stop_daemon (d);
+      return 64;
     }
+  }
   MHD_stop_daemon (d);
   if (LOOPCOUNT >= 99)
     fprintf (stderr, "\n");
@@ -298,11 +304,11 @@ testMultithreadedPoolPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1352;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1352;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -312,58 +318,60 @@ testMultithreadedPoolPost ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   for (i = 0; i < LOOPCOUNT; i++)
+  {
+    if (99 == i % 100)
+      fprintf (stderr, ".");
+    c = curl_easy_init ();
+    cbc.pos = 0;
+    buf[0] = '\0';
+    snprintf (url,
+              sizeof (url),
+              "http://127.0.0.1:%d/hw%d";,
+              port,
+              i);
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
+    curl_easy_setopt (c, CURLOPT_POST, 1L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    if (CURLE_OK != (errornum = curl_easy_perform (c)))
     {
-      if (99 == i % 100)
-        fprintf (stderr, ".");
-      c = curl_easy_init ();
-      cbc.pos = 0;
-      buf[0] = '\0';
-      snprintf (url,
-                sizeof (url),
-                "http://127.0.0.1:%d/hw%d";,
-                port,
-                i);
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
-      curl_easy_setopt (c, CURLOPT_POST, 1L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      if (CURLE_OK != (errornum = curl_easy_perform (c)))
-        {
-          fprintf (stderr,
-                   "curl_easy_perform failed: `%s'\n",
-                   curl_easy_strerror (errornum));
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 32;
-        }
+      fprintf (stderr,
+               "curl_easy_perform failed: `%s'\n",
+               curl_easy_strerror (errornum));
       curl_easy_cleanup (c);
-      if ((buf[0] != 'O') || (buf[1] != 'K'))
-        {
-          MHD_stop_daemon (d);
-          return 64;
-        }
+      MHD_stop_daemon (d);
+      return 32;
+    }
+    curl_easy_cleanup (c);
+    if ((buf[0] != 'O') || (buf[1] != 'K'))
+    {
+      MHD_stop_daemon (d);
+      return 64;
     }
+  }
   MHD_stop_daemon (d);
   if (LOOPCOUNT >= 99)
     fprintf (stderr, "\n");
@@ -401,11 +409,11 @@ testExternalPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1353;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1353;
+    if (oneone)
+      port += 10;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -416,134 +424,138 @@ testExternalPost ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  for (i = 0; i < LOOPCOUNT; i++)
+  {
+    if (99 == i % 100)
+      fprintf (stderr, ".");
+    c = curl_easy_init ();
+    cbc.pos = 0;
+    buf[0] = '\0';
+    snprintf (url,
+              sizeof (url),
+              "http://127.0.0.1:%d/hw%d";,
+              port,
+              i);
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
+    curl_easy_setopt (c, CURLOPT_POST, 1L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
     {
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 1024;
     }
-  for (i = 0; i < LOOPCOUNT; i++)
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (multi != NULL))
     {
-      if (99 == i % 100)
-       fprintf (stderr, ".");
-      c = curl_easy_init ();
-      cbc.pos = 0;
-      buf[0] = '\0';
-      snprintf (url,
-                sizeof (url),
-                "http://127.0.0.1:%d/hw%d";,
-                port,
-                i);
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
-      curl_easy_setopt (c, CURLOPT_POST, 1L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      mret = curl_multi_add_handle (multi, c);
+      maxsock = MHD_INVALID_SOCKET;
+      maxposixs = -1;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      while (CURLM_CALL_MULTI_PERFORM ==
+             curl_multi_perform (multi, &running))
+        ;
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
       if (mret != CURLM_OK)
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      if (MHD_NO == MHD_get_timeout (d, &timeout))
+        timeout = 100;          /* 100ms == INFTY -- CURL bug... */
+      if ((CURLM_OK == curl_multi_timeout (multi, &ctimeout)) &&
+          (ctimeout < (long long) timeout) && (ctimeout >= 0))
+        timeout = ctimeout;
+      if ( (c == NULL) || (running == 0) )
+        timeout = 0; /* terminate quickly... */
+      tv.tv_sec = timeout / 1000;
+      tv.tv_usec = (timeout % 1000) * 1000;
+      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+      {
+        if (EINTR == errno)
+          continue;
+        fprintf (stderr,
+                 "select failed: %s\n",
+                 strerror (errno));
+        break;
+      }
+      while (CURLM_CALL_MULTI_PERFORM ==
+             curl_multi_perform (multi, &running))
+        ;
+      if (running == 0)
+      {
+        msg = curl_multi_info_read (multi, &running);
+        if (msg == NULL)
+          break;
+        if (msg->msg == CURLMSG_DONE)
         {
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (multi != NULL))
-        {
-          maxsock = MHD_INVALID_SOCKET;
-          maxposixs = -1;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          while (CURLM_CALL_MULTI_PERFORM ==
-                 curl_multi_perform (multi, &running));
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          if (MHD_NO == MHD_get_timeout (d, &timeout))
-            timeout = 100;      /* 100ms == INFTY -- CURL bug... */
-          if ((CURLM_OK == curl_multi_timeout (multi, &ctimeout)) &&
-              (ctimeout < (long long)timeout) && (ctimeout >= 0))
-            timeout = ctimeout;
-         if ( (c == NULL) || (running == 0) )
-           timeout = 0; /* terminate quickly... */
-          tv.tv_sec = timeout / 1000;
-          tv.tv_usec = (timeout % 1000) * 1000;
-          if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-           {
-             if (EINTR == errno)
-               continue;
-             fprintf (stderr,
-                      "select failed: %s\n",
-                      strerror (errno));
-             break;
-           }
-          while (CURLM_CALL_MULTI_PERFORM ==
-                 curl_multi_perform (multi, &running));
-          if (running == 0)
-            {
-              msg = curl_multi_info_read (multi, &running);
-              if (msg == NULL)
-                break;
-              if (msg->msg == CURLMSG_DONE)
-                {
-                  if (msg->data.result != CURLE_OK)
-                    printf ("%s failed at %s:%d: `%s'\n",
-                            "curl_multi_perform",
-                            __FILE__,
-                            __LINE__, curl_easy_strerror (msg->data.result));
-                  curl_multi_remove_handle (multi, c);
-                  curl_easy_cleanup (c);
-                  c = NULL;
-                }
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
+          if (msg->data.result != CURLE_OK)
+            printf ("%s failed at %s:%d: `%s'\n",
+                    "curl_multi_perform",
+                    __FILE__,
+                    __LINE__, curl_easy_strerror (msg->data.result));
           curl_multi_remove_handle (multi, c);
           curl_easy_cleanup (c);
+          c = NULL;
         }
-      if ((buf[0] != 'O') || (buf[1] != 'K'))
-        {
-          curl_multi_cleanup (multi);
-          MHD_stop_daemon (d);
-          return 8192;
-        }
+      }
+      MHD_run (d);
     }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
+    }
+    if ((buf[0] != 'O') || (buf[1] != 'K'))
+    {
+      curl_multi_cleanup (multi);
+      MHD_stop_daemon (d);
+      return 8192;
+    }
+  }
   curl_multi_cleanup (multi);
   MHD_stop_daemon (d);
   if (LOOPCOUNT >= 99)
@@ -569,8 +581,8 @@ now ()
   struct timeval tv;
 
   gettimeofday (&tv, NULL);
-  return (((unsigned long long) tv.tv_sec * 1000LL) +
-         ((unsigned long long) tv.tv_usec / 1000LL));
+  return (((unsigned long long) tv.tv_sec * 1000LL)
+          + ((unsigned long long) tv.tv_usec / 1000LL));
 }
 
 
@@ -578,56 +590,64 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      start_time = now();
-      errorCount += testInternalPost ();
-      fprintf (stderr,
-              oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: 
Sequential POSTs (http/1.0) %f/s\n",
-              "internal select",
-              (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0));
-      GAUGER ("internal select",
-             oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs 
(http/1.0)",
-             (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0),
-             "requests/s");
-      start_time = now();
-      errorCount += testMultithreadedPost ();
-      fprintf (stderr,
-              oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: 
Sequential POSTs (http/1.0) %f/s\n",
-              "multithreaded post",
-              (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0));
-      GAUGER ("Multithreaded select",
-             oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs 
(http/1.0)",
-             (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0),
-             "requests/s");
-      start_time = now();
-      errorCount += testMultithreadedPoolPost ();
-      fprintf (stderr,
-              oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: 
Sequential POSTs (http/1.0) %f/s\n",
-              "thread with pool",
-              (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0));
-      GAUGER ("thread with pool",
-             oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs 
(http/1.0)",
-             (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0),
-             "requests/s");
-    }
-  start_time = now();
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    start_time = now ();
+    errorCount += testInternalPost ();
+    fprintf (stderr,
+             oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" :
+             "%s: Sequential POSTs (http/1.0) %f/s\n",
+             "internal select",
+             (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
+    GAUGER ("internal select",
+            oneone ? "Sequential POSTs (http/1.1)" :
+            "Sequential POSTs (http/1.0)",
+            (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
+            "requests/s");
+    start_time = now ();
+    errorCount += testMultithreadedPost ();
+    fprintf (stderr,
+             oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" :
+             "%s: Sequential POSTs (http/1.0) %f/s\n",
+             "multithreaded post",
+             (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
+    GAUGER ("Multithreaded select",
+            oneone ? "Sequential POSTs (http/1.1)" :
+            "Sequential POSTs (http/1.0)",
+            (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
+            "requests/s");
+    start_time = now ();
+    errorCount += testMultithreadedPoolPost ();
+    fprintf (stderr,
+             oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" :
+             "%s: Sequential POSTs (http/1.0) %f/s\n",
+             "thread with pool",
+             (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
+    GAUGER ("thread with pool",
+            oneone ? "Sequential POSTs (http/1.1)" :
+            "Sequential POSTs (http/1.0)",
+            (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
+            "requests/s");
+  }
+  start_time = now ();
   errorCount += testExternalPost ();
   fprintf (stderr,
-          oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: Sequential 
POSTs (http/1.0) %f/s\n",
-          "external select",
-          (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0));
+           oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" :
+           "%s: Sequential POSTs (http/1.0) %f/s\n",
+           "external select",
+           (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
   GAUGER ("external select",
-         oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs 
(http/1.0)",
-         (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0),
-         "requests/s");
+          oneone ? "Sequential POSTs (http/1.1)" :
+          "Sequential POSTs (http/1.0)",
+          (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
+          "requests/s");
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
   curl_global_cleanup ();
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c
index 723bde0f..c4fbd5d5 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -43,10 +43,10 @@
 
 #include "mhd_has_in_name.h"
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -62,12 +62,12 @@ struct CBC
 
 static void
 completed_cb (void *cls,
-             struct MHD_Connection *connection,
-             void **con_cls,
-             enum MHD_RequestTerminationCode toe)
+              struct MHD_Connection *connection,
+              void **con_cls,
+              enum MHD_RequestTerminationCode toe)
 {
   struct MHD_PostProcessor *pp = *con_cls;
-  (void)cls;(void)connection;(void)toe;            /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) connection; (void) toe;            /* Unused. Silent 
compiler warning. */
 
   if (NULL != pp)
     MHD_destroy_post_processor (pp);
@@ -103,8 +103,8 @@ post_iterator (void *cls,
                const char *value, uint64_t off, size_t size)
 {
   int *eok = cls;
-  (void)kind;(void)filename;(void)content_type; /* Unused. Silent compiler 
warning. */
-  (void)transfer_encoding;(void)off;            /* Unused. Silent compiler 
warning. */
+  (void) kind; (void) filename; (void) content_type; /* Unused. Silent 
compiler warning. */
+  (void) transfer_encoding; (void) off;            /* Unused. Silent compiler 
warning. */
 
 #if 0
   fprintf (stderr, "PI sees %s-%.*s\n", key, size, value);
@@ -132,34 +132,34 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   struct MHD_PostProcessor *pp;
   int ret;
-  (void)cls;(void)version;      /* Unused. Silent compiler warning. */
+  (void) cls; (void) version;      /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("POST", method))
-    {
-      printf ("METHOD: %s\n", method);
-      return MHD_NO;            /* unexpected method */
-    }
+  {
+    printf ("METHOD: %s\n", method);
+    return MHD_NO;              /* unexpected method */
+  }
   pp = *unused;
   if (pp == NULL)
-    {
-      eok = 0;
-      pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
-      if (pp == NULL)
-        abort ();
-      *unused = pp;
-    }
+  {
+    eok = 0;
+    pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
+    if (pp == NULL)
+      abort ();
+    *unused = pp;
+  }
   MHD_post_process (pp, upload_data, *upload_data_size);
   if ((eok == 3) && (0 == *upload_data_size))
-    {
-      response = MHD_create_response_from_buffer (strlen (url),
-                                                 (void *) url,
-                                                 MHD_RESPMEM_MUST_COPY);
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-      MHD_destroy_response (response);
-      MHD_destroy_post_processor (pp);
-      *unused = NULL;
-      return ret;
-    }
+  {
+    response = MHD_create_response_from_buffer (strlen (url),
+                                                (void *) url,
+                                                MHD_RESPMEM_MUST_COPY);
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+    MHD_destroy_post_processor (pp);
+    *unused = NULL;
+    return ret;
+  }
   *upload_data_size = 0;
   return MHD_YES;
 }
@@ -192,32 +192,34 @@ testInternalPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1390;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1390;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   pd = make_form ();
@@ -234,15 +236,15 @@ testInternalPost ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      curl_formfree (pd);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    curl_formfree (pd);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   curl_formfree (pd);
   MHD_stop_daemon (d);
@@ -267,32 +269,35 @@ testMultithreadedPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1390;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1390;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   pd = make_form ();
@@ -309,15 +314,15 @@ testMultithreadedPost ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      curl_formfree (pd);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    curl_formfree (pd);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   curl_formfree (pd);
   MHD_stop_daemon (d);
@@ -342,11 +347,11 @@ testMultithreadedPoolPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1391;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1391;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -354,21 +359,23 @@ testMultithreadedPoolPost ()
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   pd = make_form ();
@@ -385,15 +392,15 @@ testMultithreadedPoolPost ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      curl_formfree (pd);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    curl_formfree (pd);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   curl_formfree (pd);
   MHD_stop_daemon (d);
@@ -432,11 +439,11 @@ testExternalPost ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1392;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1392;
+    if (oneone)
+      port += 10;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -444,21 +451,23 @@ testExternalPost ()
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   pd = make_form ();
@@ -478,91 +487,93 @@ testExternalPost ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    curl_formfree (pd);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_formfree (pd);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
-      curl_formfree (pd);
       MHD_stop_daemon (d);
-      return 512;
+      curl_formfree (pd);
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
-      curl_formfree (pd);
       curl_easy_cleanup (c);
+      curl_formfree (pd);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          curl_formfree (pd);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          curl_formfree (pd);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__,
-                        curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__,
+                  curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   curl_formfree (pd);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -577,7 +588,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
@@ -587,17 +598,17 @@ main (int argc, char *const *argv)
 #endif
 #endif
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPost ();
-      errorCount += testMultithreadedPost ();
-      errorCount += testMultithreadedPoolPost ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPost ();
+    errorCount += testMultithreadedPost ();
+    errorCount += testMultithreadedPoolPost ();
+  }
   errorCount += testExternalPost ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_process_arguments.c 
b/src/testcurl/test_process_arguments.c
index 0817836d..3094a97f 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -74,15 +74,15 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   int ret;
   const char *hdr;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   hdr = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "k");
   if ((hdr == NULL) || (0 != strcmp (hdr, "v x")))
@@ -96,12 +96,12 @@ ahc_echo (void *cls,
   if ((hdr == NULL) || (0 != strcmp (hdr, "\240bar")))
     abort ();
   if (3 != MHD_get_connection_values (connection,
-                                     MHD_GET_ARGUMENT_KIND,
-                                     NULL, NULL))
+                                      MHD_GET_ARGUMENT_KIND,
+                                      NULL, NULL))
     abort ();
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -137,11 +137,11 @@ testExternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1410;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1410;
+    if (oneone)
+      port += 5;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -152,17 +152,19 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL,
                     
"http://127.0.0.1/hello+world?k=v+x&hash=%23foo&space=%A0bar";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -180,86 +182,88 @@ testExternalGet ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello+world"))
     return 8192;
@@ -273,9 +277,9 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
diff --git a/src/testcurl/test_process_headers.c 
b/src/testcurl/test_process_headers.c
index a1237c78..a2d7485b 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -1,4 +1,3 @@
-
 /*
      This file is part of libmicrohttpd
      Copyright (C) 2007 Christian Grothoff
@@ -38,10 +37,10 @@
 #include <unistd.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -70,11 +69,12 @@ static int
 kv_cb (void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
 {
   if ((0 == strcmp (key, MHD_HTTP_HEADER_HOST)) &&
-      (0 == strncmp (value, "127.0.0.1", strlen("127.0.0.1"))) && (kind == 
MHD_HEADER_KIND))
-    {
-      *((int *) cls) = 1;
-      return MHD_NO;
-    }
+      (0 == strncmp (value, "127.0.0.1", strlen ("127.0.0.1"))) && (kind ==
+                                                                    
MHD_HEADER_KIND))
+  {
+    *((int *) cls) = 1;
+    return MHD_NO;
+  }
   return MHD_YES;
 }
 
@@ -92,15 +92,15 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   int ret;
   const char *hdr;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   ret = 0;
   MHD_get_connection_values (connection, MHD_HEADER_KIND, &kv_cb, &ret);
@@ -115,7 +115,7 @@ ahc_echo (void *cls,
     abort ();
   hdr = MHD_lookup_connection_value (connection,
                                      MHD_HEADER_KIND, MHD_HTTP_HEADER_HOST);
-  if ((hdr == NULL) || (0 != strncmp (hdr, "127.0.0.1", strlen("127.0.0.1"))))
+  if ((hdr == NULL) || (0 != strncmp (hdr, "127.0.0.1", strlen ("127.0.0.1"))))
     abort ();
   MHD_set_connection_value (connection,
                             MHD_HEADER_KIND, "FakeHeader", "NowPresent");
@@ -125,8 +125,8 @@ ahc_echo (void *cls,
     abort ();
 
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   if (NULL == response)
     abort ();
   MHD_add_response_header (response, "MyHeader", "MyValue");
@@ -162,11 +162,11 @@ testInternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1420;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1420;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -176,16 +176,18 @@ testInternalGet ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -200,14 +202,14 @@ testInternalGet ()
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -230,30 +232,33 @@ testMultithreadedGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1421;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1421;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -268,14 +273,14 @@ testMultithreadedGet ()
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -298,11 +303,11 @@ testMultithreadedPoolGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1422;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1422;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -313,16 +318,18 @@ testMultithreadedPoolGet ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -337,14 +344,14 @@ testMultithreadedPoolGet ()
      crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -381,11 +388,11 @@ testExternalGet ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1423;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1423;
+    if (oneone)
+      port += 10;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -396,16 +403,18 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -423,86 +432,88 @@ testExternalGet ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -517,17 +528,17 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalGet ();
-      errorCount += testMultithreadedGet ();
-      errorCount += testMultithreadedPoolGet ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalGet ();
+    errorCount += testMultithreadedGet ();
+    errorCount += testMultithreadedPoolGet ();
+  }
   errorCount += testExternalGet ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index fd56e2b2..df399268 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -37,10 +37,10 @@
 #include <unistd.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -91,28 +91,28 @@ ahc_echo (void *cls,
   int *done = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)unused;   /* Unused. Silent compiler warning. */
+  (void) version; (void) unused;   /* Unused. Silent compiler warning. */
 
   if (0 != strcasecmp ("PUT", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) == 0)
+  {
+    if (*upload_data_size != 8)
+      return MHD_YES;           /* not yet ready */
+    if (0 == memcmp (upload_data, "Hello123", 8))
     {
-      if (*upload_data_size != 8)
-        return MHD_YES;         /* not yet ready */
-      if (0 == memcmp (upload_data, "Hello123", 8))
-        {
-          *upload_data_size = 0;
-        }
-      else
-        {
-          printf ("Invalid upload data `%8s'!\n", upload_data);
-          return MHD_NO;
-        }
-      *done = 1;
-      return MHD_YES;
+      *upload_data_size = 0;
     }
+    else
+    {
+      printf ("Invalid upload data `%8s'!\n", upload_data);
+      return MHD_NO;
+    }
+    *done = 1;
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url), (void*) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -134,11 +134,11 @@ testInternalPut ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1450;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1450;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -149,16 +149,18 @@ testInternalPut ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -177,14 +179,14 @@ testInternalPut ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -209,31 +211,34 @@ testMultithreadedPut ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1451;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1451;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port,
                         NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -252,14 +257,14 @@ testMultithreadedPut ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -285,11 +290,11 @@ testMultithreadedPoolPut ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1452;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1452;
+    if (oneone)
+      port += 10;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -301,16 +306,18 @@ testMultithreadedPoolPut ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -329,14 +336,14 @@ testMultithreadedPoolPut ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -373,11 +380,11 @@ testExternalPut ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1453;
-      if (oneone)
-        port += 10;
-    }
+  {
+    port = 1453;
+    if (oneone)
+      port += 10;
+  }
 
   multi = NULL;
   cbc.buf = buf;
@@ -389,17 +396,19 @@ testExternalPut ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
-curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
+  curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
   curl_easy_setopt (c, CURLOPT_READDATA, &pos);
@@ -420,90 +429,92 @@ curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
-    {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
 #ifdef MHD_POSIX_SOCKETS
-      if (maxsock > maxposixs)
-        maxposixs = maxsock;
+    if (maxsock > maxposixs)
+      maxposixs = maxsock;
 #endif /* MHD_POSIX_SOCKETS */
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+    {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            _exit (99);
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        _exit (99);
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__, curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__, curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -518,19 +529,19 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPut ();
-      errorCount += testMultithreadedPut ();
-      errorCount += testMultithreadedPoolPut ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPut ();
+    errorCount += testMultithreadedPut ();
+    errorCount += testMultithreadedPoolPut ();
+  }
   errorCount += testExternalPut ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_put_chunked.c b/src/testcurl/test_put_chunked.c
index 9f875a40..6374f4a7 100644
--- a/src/testcurl/test_put_chunked.c
+++ b/src/testcurl/test_put_chunked.c
@@ -37,10 +37,10 @@
 #include <unistd.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -92,38 +92,38 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   int ret;
   int have;
-  (void)version;(void)unused;   /* Unused. Silent compiler warning. */
+  (void) version; (void) unused;   /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("PUT", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) < 8)
+  {
+    have = *upload_data_size;
+    if (have + *done > 8)
     {
-      have = *upload_data_size;
-      if (have + *done > 8)
-        {
-          printf ("Invalid upload data `%8s'!\n", upload_data);
-          return MHD_NO;
-        }
-      if (0 == have)
-        return MHD_YES;
-      if (0 == memcmp (upload_data, &"Hello123"[*done], have))
-        {
-          *done += have;
-          *upload_data_size = 0;
-        }
-      else
-        {
-          printf ("Invalid upload data `%8s'!\n", upload_data);
-          return MHD_NO;
-        }
-#if 0
-      fprintf (stderr, "Not ready for response: %u/%u\n", *done, 8);
-#endif
+      printf ("Invalid upload data `%8s'!\n", upload_data);
+      return MHD_NO;
+    }
+    if (0 == have)
       return MHD_YES;
+    if (0 == memcmp (upload_data, &"Hello123"[*done], have))
+    {
+      *done += have;
+      *upload_data_size = 0;
+    }
+    else
+    {
+      printf ("Invalid upload data `%8s'!\n", upload_data);
+      return MHD_NO;
     }
+#if 0
+    fprintf (stderr, "Not ready for response: %u/%u\n", *done, 8);
+#endif
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -156,16 +156,18 @@ testInternalPut ()
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -184,14 +186,14 @@ testInternalPut ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -221,22 +223,25 @@ testMultithreadedPut ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port,
                         NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -255,14 +260,14 @@ testMultithreadedPut ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -300,16 +305,18 @@ testMultithreadedPoolPut ()
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -328,14 +335,14 @@ testMultithreadedPoolPut ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -388,16 +395,18 @@ testExternalPut ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -419,87 +428,89 @@ testExternalPut ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  mret = curl_multi_add_handle (multi, c);
+  if (mret != CURLM_OK)
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
+  start = time (NULL);
+  while ((time (NULL) - start < 5) && (multi != NULL))
+  {
+    maxsock = MHD_INVALID_SOCKET;
+    maxposixs = -1;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    curl_multi_perform (multi, &running);
+    mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+    if (mret != CURLM_OK)
     {
+      curl_multi_remove_handle (multi, c);
+      curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 512;
+      return 2048;
     }
-  mret = curl_multi_add_handle (multi, c);
-  if (mret != CURLM_OK)
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
     {
+      curl_multi_remove_handle (multi, c);
       curl_multi_cleanup (multi);
       curl_easy_cleanup (c);
       MHD_stop_daemon (d);
-      return 1024;
+      return 4096;
     }
-  start = time (NULL);
-  while ((time (NULL) - start < 5) && (multi != NULL))
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
     {
-      maxsock = MHD_INVALID_SOCKET;
-      maxposixs = -1;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      curl_multi_perform (multi, &running);
-      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-      if (mret != CURLM_OK)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 2048;
-        }
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          MHD_stop_daemon (d);
-          return 4096;
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      curl_multi_perform (multi, &running);
-      if (running == 0)
-        {
-          msg = curl_multi_info_read (multi, &running);
-          if (msg == NULL)
-            break;
-          if (msg->msg == CURLMSG_DONE)
-            {
-              if (msg->data.result != CURLE_OK)
-                printf ("%s failed at %s:%d: `%s'\n",
-                        "curl_multi_perform",
-                        __FILE__,
-                        __LINE__,
-                        curl_easy_strerror (msg->data.result));
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              c = NULL;
-              multi = NULL;
-            }
-        }
-      MHD_run (d);
     }
-  if (multi != NULL)
+    curl_multi_perform (multi, &running);
+    if (running == 0)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      msg = curl_multi_info_read (multi, &running);
+      if (msg == NULL)
+        break;
+      if (msg->msg == CURLMSG_DONE)
+      {
+        if (msg->data.result != CURLE_OK)
+          printf ("%s failed at %s:%d: `%s'\n",
+                  "curl_multi_perform",
+                  __FILE__,
+                  __LINE__,
+                  curl_easy_strerror (msg->data.result));
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        c = NULL;
+        multi = NULL;
+      }
     }
+    MHD_run (d);
+  }
+  if (multi != NULL)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
     return 8192;
@@ -514,16 +525,16 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPut ();
-      errorCount += testMultithreadedPut ();
-      errorCount += testMultithreadedPoolPut ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPut ();
+    errorCount += testMultithreadedPut ();
+    errorCount += testMultithreadedPoolPut ();
+  }
   errorCount += testExternalPut ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c
index 69b07618..c42880ce 100644
--- a/src/testcurl/test_quiesce.c
+++ b/src/testcurl/test_quiesce.c
@@ -40,10 +40,10 @@
 #include <sys/socket.h>
 #endif
 
-#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#if defined(CPU_COUNT) && (CPU_COUNT + 0) < 2
 #undef CPU_COUNT
 #endif
-#if !defined(CPU_COUNT)
+#if ! defined(CPU_COUNT)
 #define CPU_COUNT 2
 #endif
 
@@ -83,19 +83,19 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   response = MHD_create_response_from_buffer (strlen (url),
-                                     (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -106,16 +106,16 @@ ahc_echo (void *cls,
 
 static void
 request_completed (void *cls, struct MHD_Connection *connection,
-                  void **con_cls, enum MHD_RequestTerminationCode code)
+                   void **con_cls, enum MHD_RequestTerminationCode code)
 {
-  (void)connection;(void)con_cls;(void)code;    /* Unused. Silent compiler 
warning. */
-  int *done = (int *)cls;
+  (void) connection; (void) con_cls; (void) code;    /* Unused. Silent 
compiler warning. */
+  int *done = (int *) cls;
   *done = 1;
 }
 
 
 static void *
-ServeOneRequest(void *param)
+ServeOneRequest (void *param)
 {
   struct MHD_Daemon *d;
   fd_set rs;
@@ -138,38 +138,40 @@ ServeOneRequest(void *param)
 
   start = time (NULL);
   while ((time (NULL) - start < 5) && done == 0)
+  {
+    max = 0;
+    FD_ZERO (&rs);
+    FD_ZERO (&ws);
+    FD_ZERO (&es);
+    if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+    {
+      MHD_stop_daemon (d);
+      MHD_socket_close_chk_ (fd);
+      return "MHD_get_fdset() failed";
+    }
+    tv.tv_sec = 0;
+    tv.tv_usec = 1000;
+    if (-1 == MHD_SYS_select_ (max + 1, &rs, &ws, &es, &tv))
     {
-      max = 0;
-      FD_ZERO (&rs);
-      FD_ZERO (&ws);
-      FD_ZERO (&es);
-      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-        {
-          MHD_stop_daemon (d);
-          MHD_socket_close_chk_(fd);
-          return "MHD_get_fdset() failed";
-        }
-      tv.tv_sec = 0;
-      tv.tv_usec = 1000;
-      if (-1 == MHD_SYS_select_ (max + 1, &rs, &ws, &es, &tv))
-        {
 #ifdef MHD_POSIX_SOCKETS
-          if (EINTR != errno)
-            abort ();
+      if (EINTR != errno)
+        abort ();
 #else
-          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-            abort ();
-          Sleep (1000);
+      if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                    
ws.fd_count)
+          ||(0 != es.fd_count) )
+        abort ();
+      Sleep (1000);
 #endif
-        }
-      MHD_run (d);
     }
+    MHD_run (d);
+  }
   fd = MHD_quiesce_daemon (d);
   if (MHD_INVALID_SOCKET == fd)
-    {
-      MHD_stop_daemon (d);
-      return "MHD_quiesce_daemon() failed in ServeOneRequest()";
-    }
+  {
+    MHD_stop_daemon (d);
+    return "MHD_quiesce_daemon() failed in ServeOneRequest()";
+  }
   MHD_stop_daemon (d);
   return done ? NULL : "Requests was not served by ServeOneRequest()";
 }
@@ -182,7 +184,7 @@ setupCURL (void *cbc)
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -218,44 +220,51 @@ testGet (int type, int pool_count, int poll_flag)
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  if (pool_count > 0) {
+  if (pool_count > 0)
+  {
     d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag,
                           port, NULL, NULL, &ahc_echo, "GET",
-                          MHD_OPTION_THREAD_POOL_SIZE, pool_count, 
MHD_OPTION_END);
+                          MHD_OPTION_THREAD_POOL_SIZE, pool_count,
+                          MHD_OPTION_END);
 
-  } else {
+  }
+  else {
     d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag,
                           port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   }
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
-  c = setupCURL(&cbc);
+  c = setupCURL (&cbc);
 
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
 
-  if (cbc.pos != strlen ("/hello_world")) {
+  if (cbc.pos != strlen ("/hello_world"))
+  {
     curl_easy_cleanup (c);
     MHD_stop_daemon (d);
     return 4;
   }
-  if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) {
+  if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
+  {
     curl_easy_cleanup (c);
     MHD_stop_daemon (d);
     return 8;
@@ -263,78 +272,79 @@ testGet (int type, int pool_count, int poll_flag)
 
   fd = MHD_quiesce_daemon (d);
   if (MHD_INVALID_SOCKET == fd)
-    {
-      fprintf (stderr,
-               "MHD_quiesce_daemon failed.\n");
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
-  if (0 != pthread_create(&thrd, NULL, &ServeOneRequest, (void*)(intptr_t) fd))
-    {
-      fprintf (stderr, "pthread_create failed\n");
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 16;
-    }
+  {
+    fprintf (stderr,
+             "MHD_quiesce_daemon failed.\n");
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
+  if (0 != pthread_create (&thrd, NULL, &ServeOneRequest,
+                           (void*) (intptr_t) fd))
+  {
+    fprintf (stderr, "pthread_create failed\n");
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 16;
+  }
 
   cbc.pos = 0;
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
 
-  if (0 != pthread_join(thrd, (void**)&thrdRet))
-    {
-      fprintf (stderr, "pthread_join failed\n");
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 16;
-    }
+  if (0 != pthread_join (thrd, (void**) &thrdRet))
+  {
+    fprintf (stderr, "pthread_join failed\n");
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 16;
+  }
   if (NULL != thrdRet)
-    {
-      fprintf (stderr, "ServeOneRequest() error: %s\n", thrdRet);
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 16;
-    }
+  {
+    fprintf (stderr, "ServeOneRequest() error: %s\n", thrdRet);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 16;
+  }
 
   if (cbc.pos != strlen ("/hello_world"))
-    {
-      fprintf(stderr, "%s\n", cbc.buf);
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      MHD_socket_close_chk_(fd);
-      return 4;
-    }
+  {
+    fprintf (stderr, "%s\n", cbc.buf);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    MHD_socket_close_chk_ (fd);
+    return 4;
+  }
   if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
-    {
-      fprintf(stderr, "%s\n", cbc.buf);
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      MHD_socket_close_chk_(fd);
-      return 8;
-    }
+  {
+    fprintf (stderr, "%s\n", cbc.buf);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    MHD_socket_close_chk_ (fd);
+    return 8;
+  }
 
   /* at this point, the forked server quit, and the new
    * server has quiesced, so new requests should fail
    */
   if (CURLE_OK == (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr, "curl_easy_perform should fail\n");
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      MHD_socket_close_chk_(fd);
-      return 2;
-    }
+  {
+    fprintf (stderr, "curl_easy_perform should fail\n");
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    MHD_socket_close_chk_ (fd);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
-  MHD_socket_close_chk_(fd);
+  MHD_socket_close_chk_ (fd);
 
   return 0;
 }
@@ -382,136 +392,141 @@ testExternalGet ()
   if (d == NULL)
     return 256;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
-  c = setupCURL(&cbc);
+    port = (int) dinfo->port;
+  }
+  c = setupCURL (&cbc);
 
   multi = curl_multi_init ();
   if (multi == NULL)
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 512;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 512;
+  }
   mret = curl_multi_add_handle (multi, c);
   if (mret != CURLM_OK)
-    {
-      curl_multi_cleanup (multi);
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 1024;
-    }
+  {
+    curl_multi_cleanup (multi);
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 1024;
+  }
 
   for (i = 0; i < 2; i++)
+  {
+    start = time (NULL);
+    while ( (time (NULL) - start < 5) &&
+            (NULL != multi) )
     {
-      start = time (NULL);
-      while ( (time (NULL) - start < 5) &&
-              (NULL != multi) )
-        {
-          maxsock = MHD_INVALID_SOCKET;
-          maxposixs = -1;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
-            {
+      maxsock = MHD_INVALID_SOCKET;
+      maxposixs = -1;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
+      if (mret != CURLM_OK)
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+      {
 #ifdef MHD_POSIX_SOCKETS
-              if (EINTR != errno)
-                abort ();
+        if (EINTR != errno)
+          abort ();
 #else
-              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
-                abort ();
-              Sleep (1000);
+        if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
+                                                                      ws.
+                                                                      fd_count)
+            ||(0 != es.fd_count) )
+          abort ();
+        Sleep (1000);
 #endif
-            }
-          curl_multi_perform (multi, &running);
-          if (0 == running)
-            {
-              msg = curl_multi_info_read (multi, &running);
-              if (NULL == msg)
-                break;
-              if (msg->msg == CURLMSG_DONE)
-                {
-                  if (i == 0 && msg->data.result != CURLE_OK)
-                    printf ("%s failed at %s:%d: `%s'\n",
-                            "curl_multi_perform",
-                            __FILE__,
-                            __LINE__,
-                            curl_easy_strerror (msg->data.result));
-                  else if ( (i == 1) &&
-                            (msg->data.result == CURLE_OK) )
-                    printf ("%s should have failed at %s:%d\n",
-                            "curl_multi_perform",
-                            __FILE__,
-                            __LINE__);
-                  curl_multi_remove_handle (multi, c);
-                  curl_multi_cleanup (multi);
-                  curl_easy_cleanup (c);
-                  c = NULL;
-                  multi = NULL;
-                }
-            }
-          MHD_run (d);
-        }
-
-      if (0 == i)
+      }
+      curl_multi_perform (multi, &running);
+      if (0 == running)
+      {
+        msg = curl_multi_info_read (multi, &running);
+        if (NULL == msg)
+          break;
+        if (msg->msg == CURLMSG_DONE)
         {
-          /* quiesce the daemon on the 1st iteration, so the 2nd should fail */
-          fd = MHD_quiesce_daemon(d);
-          if (MHD_INVALID_SOCKET == fd)
-            {
-              fprintf (stderr,
-                       "MHD_quiesce_daemon failed.\n");
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              MHD_stop_daemon (d);
-              return 2;
-            }
-          c = setupCURL (&cbc);
-          multi = curl_multi_init ();
-          mret = curl_multi_add_handle (multi, c);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              MHD_stop_daemon (d);
-              return 32768;
-            }
+          if ((i == 0) &&(msg->data.result != CURLE_OK) )
+            printf ("%s failed at %s:%d: `%s'\n",
+                    "curl_multi_perform",
+                    __FILE__,
+                    __LINE__,
+                    curl_easy_strerror (msg->data.result));
+          else if ( (i == 1) &&
+                    (msg->data.result == CURLE_OK) )
+            printf ("%s should have failed at %s:%d\n",
+                    "curl_multi_perform",
+                    __FILE__,
+                    __LINE__);
+          curl_multi_remove_handle (multi, c);
+          curl_multi_cleanup (multi);
+          curl_easy_cleanup (c);
+          c = NULL;
+          multi = NULL;
         }
+      }
+      MHD_run (d);
     }
-  if (NULL != multi)
+
+    if (0 == i)
     {
-      curl_multi_remove_handle (multi, c);
-      curl_easy_cleanup (c);
-      curl_multi_cleanup (multi);
+      /* quiesce the daemon on the 1st iteration, so the 2nd should fail */
+      fd = MHD_quiesce_daemon (d);
+      if (MHD_INVALID_SOCKET == fd)
+      {
+        fprintf (stderr,
+                 "MHD_quiesce_daemon failed.\n");
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 2;
+      }
+      c = setupCURL (&cbc);
+      multi = curl_multi_init ();
+      mret = curl_multi_add_handle (multi, c);
+      if (mret != CURLM_OK)
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        MHD_stop_daemon (d);
+        return 32768;
+      }
     }
+  }
+  if (NULL != multi)
+  {
+    curl_multi_remove_handle (multi, c);
+    curl_easy_cleanup (c);
+    curl_multi_cleanup (multi);
+  }
   MHD_stop_daemon (d);
   MHD_socket_close_chk_ (fd);
   if (cbc.pos != strlen ("/hello_world"))
@@ -526,32 +541,37 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   errorCount += testExternalGet ();
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
+    errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION
+                           | MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
+    errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, 0);
+    if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_POLL))
     {
-      errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
-      errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
-      errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, 0);
-      if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
-       {
-         errorCount += testGet(MHD_USE_INTERNAL_POLLING_THREAD, 0, 
MHD_USE_POLL);
-         errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_POLL);
-         errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, 
MHD_USE_POLL);
-       }
-      if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
-       {
-         errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, 
MHD_USE_EPOLL);
-         errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, 
MHD_USE_EPOLL);
-       }
+      errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_POLL);
+      errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION
+                             | MHD_USE_INTERNAL_POLLING_THREAD, 0,
+                             MHD_USE_POLL);
+      errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT,
+                             MHD_USE_POLL);
     }
+    if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL))
+    {
+      errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, 
MHD_USE_EPOLL);
+      errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT,
+                             MHD_USE_EPOLL);
+    }
+  }
   if (0 != errorCount)
     fprintf (stderr,
-            "Error (code: %u)\n",
-            errorCount);
+             "Error (code: %u)\n",
+             errorCount);
   curl_global_cleanup ();
   return errorCount != 0;       /* 0 == pass */
 }
diff --git a/src/testcurl/test_quiesce_stream.c 
b/src/testcurl/test_quiesce_stream.c
index bccb5890..821f1102 100644
--- a/src/testcurl/test_quiesce_stream.c
+++ b/src/testcurl/test_quiesce_stream.c
@@ -35,7 +35,7 @@
 #include <unistd.h>
 #elif defined(_WIN32)
 #include <windows.h>
-#define sleep(s) (Sleep((s)*1000), 0)
+#define sleep(s) (Sleep ((s) * 1000), 0)
 #endif /* _WIN32 */
 
 
@@ -48,8 +48,8 @@ http_PanicCallback (void *cls,
                     unsigned int line,
                     const char *reason)
 {
-  (void)cls;    /* Unused. Silent compiler warning. */
-  fprintf( stderr,
+  (void) cls;    /* Unused. Silent compiler warning. */
+  fprintf (stderr,
            "PANIC: exit process: %s at %s:%u\n",
            reason,
            file,
@@ -81,11 +81,11 @@ suspend_connection (struct MHD_Connection *connection)
                                &resume_connection,
                                connection);
   if (0 != status)
-    {
-      fprintf (stderr,
-               "Could not create thead\n");
-      exit( EXIT_FAILURE );
-    }
+  {
+    fprintf (stderr,
+             "Could not create thead\n");
+    exit (EXIT_FAILURE);
+  }
   pthread_detach (thread_id);
 }
 
@@ -103,17 +103,18 @@ http_ContentReaderCallback (void *cls,
                             char *buf,
                             size_t max)
 {
-  static const char alphabet[] = 
"\nABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+  static const char alphabet[] =
+    "\nABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
   struct ContentReaderUserdata *userdata = cls;
-  (void)pos;(void)max;  /* Unused. Silent compiler warning. */
+  (void) pos; (void) max;  /* Unused. Silent compiler warning. */
 
-  if( userdata->bytes_written >= 1024)
-    {
-      fprintf( stderr,
-               "finish: %d\n",
-               request_counter);
-      return MHD_CONTENT_READER_END_OF_STREAM;
-    }
+  if ( userdata->bytes_written >= 1024)
+  {
+    fprintf (stderr,
+             "finish: %d\n",
+             request_counter);
+    return MHD_CONTENT_READER_END_OF_STREAM;
+  }
   userdata->bytes_written++;
   buf[0] = alphabet[userdata->bytes_written % (sizeof(alphabet) - 1)];
   suspend_connection (userdata->connection);
@@ -139,21 +140,22 @@ http_AccessHandlerCallback (void *cls,
                             const char *version,
                             const char *upload_data,
                             size_t *upload_data_size,
-                            void **con_cls )
+                            void **con_cls)
 {
   int ret;
-  (void)cls;(void)url;                          /* Unused. Silent compiler 
warning. */
-  (void)method;(void)version;(void)upload_data; /* Unused. Silent compiler 
warning. */
-  (void)upload_data_size;                       /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url;                          /* Unused. Silent compiler 
warning. */
+  (void) method; (void) version; (void) upload_data; /* Unused. Silent 
compiler warning. */
+  (void) upload_data_size;                       /* Unused. Silent compiler 
warning. */
 
   /* Never respond on first call */
   if (NULL == *con_cls)
   {
     fprintf (stderr,
              "start: %d\n",
-              ++request_counter);
+             ++request_counter);
 
-    struct ContentReaderUserdata *userdata = malloc (sizeof(struct 
ContentReaderUserdata));
+    struct ContentReaderUserdata *userdata = malloc (sizeof(struct
+                                                            
ContentReaderUserdata));
 
     if (NULL == userdata)
       return MHD_NO;
@@ -181,7 +183,7 @@ http_AccessHandlerCallback (void *cls,
 
 
 int
-main(void)
+main (void)
 {
   int port;
   char command_line[1024];
@@ -198,9 +200,9 @@ main(void)
   /* Flags */
   unsigned int daemon_flags
     = MHD_USE_INTERNAL_POLLING_THREAD
-    | MHD_USE_AUTO
-    | MHD_ALLOW_SUSPEND_RESUME
-    | MHD_USE_ITC;
+      | MHD_USE_AUTO
+      | MHD_ALLOW_SUSPEND_RESUME
+      | MHD_USE_ITC;
 
   /* Create daemon */
   struct MHD_Daemon *daemon = MHD_start_daemon (daemon_flags,
@@ -213,33 +215,35 @@ main(void)
   if (NULL == daemon)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (daemon, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (daemon, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (daemon); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (daemon); return 32;
     }
+    port = (int) dinfo->port;
+  }
   snprintf (command_line,
             sizeof (command_line),
             "curl -s http://127.0.0.1:%d";,
             port);
 
   if (0 != system (command_line))
-    {
-      MHD_stop_daemon (daemon);
-      return 1;
-    }
+  {
+    MHD_stop_daemon (daemon);
+    return 1;
+  }
   /* wait for a request */
   while (0 == request_counter)
-    (void)sleep (1);
+    (void) sleep (1);
 
   fprintf (stderr,
            "quiesce\n");
   MHD_quiesce_daemon (daemon);
 
   /* wait a second */
-  (void)sleep (1);
+  (void) sleep (1);
 
   fprintf (stderr,
            "stopping daemon\n");
diff --git a/src/testcurl/test_termination.c b/src/testcurl/test_termination.c
index 5be74303..cd99e0af 100644
--- a/src/testcurl/test_termination.c
+++ b/src/testcurl/test_termination.c
@@ -53,29 +53,29 @@ connection_handler (void *cls,
                     const char *url,
                     const char *method,
                     const char *version,
-                    const char *upload_data, size_t * upload_data_size,
+                    const char *upload_data, size_t *upload_data_size,
                     void **ptr)
 {
   static int i;
-  (void)cls;(void)url;                          /* Unused. Silent compiler 
warning. */
-  (void)method;(void)version;(void)upload_data; /* Unused. Silent compiler 
warning. */
-  (void)upload_data_size;                       /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) url;                          /* Unused. Silent compiler 
warning. */
+  (void) method; (void) version; (void) upload_data; /* Unused. Silent 
compiler warning. */
+  (void) upload_data_size;                       /* Unused. Silent compiler 
warning. */
 
   if (*ptr == NULL)
-    {
-      *ptr = &i;
-      return MHD_YES;
-    }
+  {
+    *ptr = &i;
+    return MHD_YES;
+  }
 
   if (*upload_data_size != 0)
-    {
-      (*upload_data_size) = 0;
-      return MHD_YES;
-    }
+  {
+    (*upload_data_size) = 0;
+    return MHD_YES;
+  }
 
   struct MHD_Response *response =
     MHD_create_response_from_buffer (strlen ("Response"), "Response",
-                                    MHD_RESPMEM_PERSISTENT);
+                                     MHD_RESPMEM_PERSISTENT);
   int ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
 
@@ -85,7 +85,7 @@ connection_handler (void *cls,
 static size_t
 write_data (void *ptr, size_t size, size_t nmemb, void *stream)
 {
-  (void)ptr;(void)stream;       /* Unused. Silent compiler warning. */
+  (void) ptr; (void) stream;       /* Unused. Silent compiler warning. */
   return size * nmemb;
 }
 
@@ -103,24 +103,28 @@ main (void)
     port = 1490;
 
 
-  daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                             | MHD_USE_INTERNAL_POLLING_THREAD
+                             | MHD_USE_ERROR_LOG,
                              port,
                              NULL,
                              NULL, connection_handler, NULL, MHD_OPTION_END);
 
   if (daemon == NULL)
-    {
-      fprintf (stderr, "Daemon cannot be started!");
-      exit (1);
-    }
+  {
+    fprintf (stderr, "Daemon cannot be started!");
+    exit (1);
+  }
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (daemon, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (daemon, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (daemon); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (daemon); return 32;
     }
+    port = (int) dinfo->port;
+  }
 
   curl = curl_easy_init ();
   /* curl_easy_setopt(curl, CURLOPT_POST, 1L); */
@@ -133,12 +137,12 @@ main (void)
 
   CURLcode success = curl_easy_perform (curl);
   if (success != 0)
-    {
-      fprintf (stderr, "CURL Error");
-      exit (1);
-    }
+  {
+    fprintf (stderr, "CURL Error");
+    exit (1);
+  }
   /* CPU used to go crazy here */
-  (void)sleep (1);
+  (void) sleep (1);
 
   curl_easy_cleanup (curl);
   MHD_stop_daemon (daemon);
diff --git a/src/testcurl/test_timeout.c b/src/testcurl/test_timeout.c
index d87bb368..a17b0fb8 100644
--- a/src/testcurl/test_timeout.c
+++ b/src/testcurl/test_timeout.c
@@ -51,37 +51,37 @@ struct CBC
 };
 
 
-static void 
+static void
 termination_cb (void *cls,
-               struct MHD_Connection *connection,
-               void **con_cls,
-               enum MHD_RequestTerminationCode toe)
+                struct MHD_Connection *connection,
+                void **con_cls,
+                enum MHD_RequestTerminationCode toe)
 {
   int *test = cls;
-  (void)connection;(void)con_cls;       /* Unused. Silent compiler warning. */
+  (void) connection; (void) con_cls;       /* Unused. Silent compiler warning. 
*/
 
   switch (toe)
+  {
+  case MHD_REQUEST_TERMINATED_COMPLETED_OK:
+    if (test == &withoutTimeout)
     {
-    case MHD_REQUEST_TERMINATED_COMPLETED_OK :
-      if (test == &withoutTimeout)
-       {
-         withoutTimeout = 0;
-       }
-      break;
-    case MHD_REQUEST_TERMINATED_WITH_ERROR :
-    case MHD_REQUEST_TERMINATED_READ_ERROR :
-      break;
-    case MHD_REQUEST_TERMINATED_TIMEOUT_REACHED :
-      if (test == &withTimeout)
-       {
-         withTimeout = 0;
-       }
-      break;
-    case MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
-      break;
-    case MHD_REQUEST_TERMINATED_CLIENT_ABORT:
-      break;
+      withoutTimeout = 0;
     }
+    break;
+  case MHD_REQUEST_TERMINATED_WITH_ERROR:
+  case MHD_REQUEST_TERMINATED_READ_ERROR:
+    break;
+  case MHD_REQUEST_TERMINATED_TIMEOUT_REACHED:
+    if (test == &withTimeout)
+    {
+      withTimeout = 0;
+    }
+    break;
+  case MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
+    break;
+  case MHD_REQUEST_TERMINATED_CLIENT_ABORT:
+    break;
+  }
 }
 
 
@@ -93,7 +93,7 @@ putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
 
   wrt = size * nmemb;
   if (wrt > 8 - (*pos))
-       wrt = 8 - (*pos);
+    wrt = 8 - (*pos);
   memcpy (stream, &("Hello123"[*pos]), wrt);
   (*pos) += wrt;
   return wrt;
@@ -103,7 +103,7 @@ putBuffer (void *stream, size_t size, size_t nmemb, void 
*ptr)
 static size_t
 putBuffer_fail (void *stream, size_t size, size_t nmemb, void *ptr)
 {
-  (void)stream;(void)size;(void)nmemb;(void)ptr;        /* Unused. Silent 
compiler warning. */
+  (void) stream; (void) size; (void) nmemb; (void) ptr;        /* Unused. 
Silent compiler warning. */
   return 0;
 }
 
@@ -133,29 +133,29 @@ ahc_echo (void *cls,
   int *done = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)unused;   /* Unused. Silent compiler warning. */
+  (void) version; (void) unused;   /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("PUT", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) == 0)
+  {
+    if (*upload_data_size != 8)
+      return MHD_YES;           /* not yet ready */
+    if (0 == memcmp (upload_data, "Hello123", 8))
+    {
+      *upload_data_size = 0;
+    }
+    else
     {
-      if (*upload_data_size != 8)
-        return MHD_YES;         /* not yet ready */
-      if (0 == memcmp (upload_data, "Hello123", 8))
-        {
-          *upload_data_size = 0;
-        }
-      else
-        {
-          printf ("Invalid upload data `%8s'!\n", upload_data);
-          return MHD_NO;
-        }
-      *done = 1;
-      return MHD_YES;
+      printf ("Invalid upload data `%8s'!\n", upload_data);
+      return MHD_NO;
     }
+    *done = 1;
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url, 
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -177,11 +177,11 @@ testWithoutTimeout ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1500;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1500;
+    if (oneone)
+      port += 5;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -190,21 +190,24 @@ testWithoutTimeout ()
                         port,
                         NULL, NULL, &ahc_echo, &done_flag,
                         MHD_OPTION_CONNECTION_TIMEOUT, 2,
-                        MHD_OPTION_NOTIFY_COMPLETED, &termination_cb, 
&withTimeout,
+                        MHD_OPTION_NOTIFY_COMPLETED, &termination_cb,
+                        &withTimeout,
                         MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
@@ -223,11 +226,11 @@ testWithoutTimeout ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -251,11 +254,11 @@ testWithTimeout ()
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1501;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1501;
+    if (oneone)
+      port += 5;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
@@ -264,21 +267,24 @@ testWithTimeout ()
                         port,
                         NULL, NULL, &ahc_echo, &done_flag,
                         MHD_OPTION_CONNECTION_TIMEOUT, 2,
-                        MHD_OPTION_NOTIFY_COMPLETED, &termination_cb, 
&withoutTimeout,
+                        MHD_OPTION_NOTIFY_COMPLETED, &termination_cb,
+                        &withoutTimeout,
                         MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer_fail);
@@ -297,16 +303,16 @@ testWithTimeout ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      if (errornum == CURLE_GOT_NOTHING)
-         /* mhd had the timeout */
-         return 0;
-      else
-         /* curl had the timeout first */
-         return 32;
-    }
+  {
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    if (errornum == CURLE_GOT_NOTHING)
+      /* mhd had the timeout */
+      return 0;
+    else
+      /* curl had the timeout first */
+      return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   return 64;
@@ -317,9 +323,9 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
@@ -327,9 +333,9 @@ main (int argc, char *const *argv)
   errorCount += testWithoutTimeout ();
   errorCount += testWithTimeout ();
   if (errorCount != 0)
-    fprintf (stderr, 
-            "Error during test execution (code: %u)\n",
-            errorCount);
+    fprintf (stderr,
+             "Error during test execution (code: %u)\n",
+             errorCount);
   curl_global_cleanup ();
   if ((withTimeout == 0) && (withoutTimeout == 0))
     return 0;
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c
index d7c133ae..f1bab3d1 100644
--- a/src/testcurl/test_urlparse.c
+++ b/src/testcurl/test_urlparse.c
@@ -68,13 +68,13 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
   return size * nmemb;
 }
 
-static int 
+static int
 test_values (void *cls,
-            enum MHD_ValueKind kind,
-            const char *key,
-            const char *value)
+             enum MHD_ValueKind kind,
+             const char *key,
+             const char *value)
 {
-  (void)cls;(void)kind;         /* Unused. Silent compiler warning. */
+  (void) cls; (void) kind;         /* Unused. Silent compiler warning. */
   if ( (0 == strcmp (key, "a")) &&
        (0 == strcmp (value, "b")) )
     matches += 1;
@@ -100,23 +100,23 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   MHD_get_connection_values (connection,
-                            MHD_GET_ARGUMENT_KIND,
-                            &test_values,
-                            NULL);
+                             MHD_GET_ARGUMENT_KIND,
+                             &test_values,
+                             NULL);
   *unused = NULL;
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -138,30 +138,33 @@ testInternalGet (int poll_flag)
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
-    {
-      port = 1510;
-      if (oneone)
-        port += 5;
-    }
+  {
+    port = 1510;
+    if (oneone)
+      port += 5;
+  }
 
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG  | 
poll_flag,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
+                        | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
+  {
+    const union MHD_DaemonInfo *dinfo;
+    dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+    if ((NULL == dinfo) ||(0 == dinfo->port) )
     {
-      const union MHD_DaemonInfo *dinfo;
-      dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-      if (NULL == dinfo || 0 == dinfo->port)
-        { MHD_stop_daemon (d); return 32; }
-      port = (int)dinfo->port;
+      MHD_stop_daemon (d); return 32;
     }
+    port = (int) dinfo->port;
+  }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world?a=b&c=&d";);
-  curl_easy_setopt (c, CURLOPT_PORT, (long)port);
+  curl_easy_setopt (c, CURLOPT_PORT, (long) port);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
   curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
   curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
@@ -176,14 +179,14 @@ testInternalGet (int poll_flag)
      crashes on my system!*/
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 2;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 2;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -200,9 +203,9 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
-  if (NULL == argv || 0 == argv[0])
+  if ((NULL == argv)||(0 == argv[0]))
     return 99;
   oneone = has_in_name (argv[0], "11");
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
diff --git a/src/testzzuf/socat.c b/src/testzzuf/socat.c
index 72089a6d..07cbf464 100644
--- a/src/testzzuf/socat.c
+++ b/src/testzzuf/socat.c
@@ -67,27 +67,27 @@ zzuf_socat_start ()
   };
   zzuf_pid = fork ();
   if (zzuf_pid == -1)
-    {
-      fprintf (stderr, "fork failed: %s\n", strerror (errno));
-      exit (1);
-    }
+  {
+    fprintf (stderr, "fork failed: %s\n", strerror (errno));
+    exit (1);
+  }
   if (zzuf_pid != 0)
+  {
+    (void) sleep (1);                 /* allow zzuf and socat to start */
+    status = 0;
+    if (0 < waitpid (zzuf_pid, &status, WNOHANG))
     {
-      (void)sleep (1);                /* allow zzuf and socat to start */
-      status = 0;
-      if (0 < waitpid (zzuf_pid, &status, WNOHANG))
-        {
-          if (WIFEXITED (status))
-            fprintf (stderr,
-                     "zzuf died with status code %d!\n",
-                     WEXITSTATUS (status));
-          if (WIFSIGNALED (status))
-            fprintf (stderr,
-                     "zzuf died from signal %d!\n", WTERMSIG (status));
-          exit (1);
-        }
-      return;
+      if (WIFEXITED (status))
+        fprintf (stderr,
+                 "zzuf died with status code %d!\n",
+                 WEXITSTATUS (status));
+      if (WIFSIGNALED (status))
+        fprintf (stderr,
+                 "zzuf died from signal %d!\n", WTERMSIG (status));
+      exit (1);
     }
+    return;
+  }
   setpgid (0, 0);
   execvp ("zzuf", args);
   fprintf (stderr, "execution of `zzuf' failed: %s\n", strerror (errno));
@@ -100,13 +100,13 @@ zzuf_socat_stop ()
 {
   int status;
   if (zzuf_pid != 0)
-    {
-      if (0 != killpg (zzuf_pid, SIGINT))
-        fprintf (stderr, "Failed to killpg: %s\n", strerror (errno));
-      kill (zzuf_pid, SIGINT);
-      waitpid (zzuf_pid, &status, 0);
-      (void)sleep (1);                /* allow socat to also die in peace */
-    }
+  {
+    if (0 != killpg (zzuf_pid, SIGINT))
+      fprintf (stderr, "Failed to killpg: %s\n", strerror (errno));
+    kill (zzuf_pid, SIGINT);
+    waitpid (zzuf_pid, &status, 0);
+    (void) sleep (1);                 /* allow socat to also die in peace */
+  }
 }
 
 /* end of socat.c */
diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c
index 08954226..cfa70b13 100644
--- a/src/testzzuf/test_get.c
+++ b/src/testzzuf/test_get.c
@@ -72,19 +72,19 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
+  (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *unused)
-    {
-      *unused = &ptr;
-      return MHD_YES;
-    }
+  {
+    *unused = &ptr;
+    return MHD_YES;
+  }
   *unused = NULL;
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -105,32 +105,33 @@ testInternalGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -149,32 +150,33 @@ testMultithreadedGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD /* | 
MHD_USE_ERROR_LOG */,
                         11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 16;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -204,90 +206,90 @@ testExternalGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */,
                         11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 256;
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  zzuf_socat_start ();
+  for (i = 0; i < LOOP_COUNT; i++)
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
     {
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
+      zzuf_socat_stop ();
       MHD_stop_daemon (d);
-      return 512;
+      return 1024;
     }
-  zzuf_socat_start ();
-  for (i = 0; i < LOOP_COUNT; i++)
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
     {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      mret = curl_multi_add_handle (multi, c);
+      max = 0;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
-        {
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          zzuf_socat_stop ();
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-        {
-          max = 0;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          select (max + 1, &rs, &ws, &es, &tv);
-          curl_multi_perform (multi, &running);
-          if (running == 0)
-            {
-              curl_multi_info_read (multi, &running);
-              curl_multi_remove_handle (multi, c);
-              curl_easy_cleanup (c);
-              c = NULL;
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_easy_cleanup (c);
-        }
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      select (max + 1, &rs, &ws, &es, &tv);
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        curl_multi_info_read (multi, &running);
+        curl_multi_remove_handle (multi, c);
+        curl_easy_cleanup (c);
+        c = NULL;
+      }
+      MHD_run (d);
     }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
+    }
+  }
   fprintf (stderr, "\n");
   curl_multi_cleanup (multi);
   zzuf_socat_stop ();
@@ -300,17 +302,17 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   oneone = (NULL != strrchr (argv[0], (int) '/')) ?
-    (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
+           (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalGet ();
-      errorCount += testMultithreadedGet ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalGet ();
+    errorCount += testMultithreadedGet ();
+  }
   errorCount += testExternalGet ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c
index 2a16202b..facad587 100644
--- a/src/testzzuf/test_get_chunked.c
+++ b/src/testzzuf/test_get_chunked.c
@@ -67,10 +67,10 @@ crc (void *cls, uint64_t pos, char *buf, size_t max)
   struct MHD_Response **responseptr = cls;
 
   if (pos == 128 * 10)
-    {
-      MHD_add_response_header (*responseptr, "Footer", "working");
-      return MHD_CONTENT_READER_END_OF_STREAM;
-    }
+  {
+    MHD_add_response_header (*responseptr, "Footer", "working");
+    return MHD_CONTENT_READER_END_OF_STREAM;
+  }
   if (max < 128)
     abort ();                   /* should not happen in this testcase... */
   memset (buf, 'A' + (pos / 128), 128);
@@ -108,11 +108,11 @@ ahc_echo (void *cls,
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *ptr)
-    {
-      /* do never respond on first call */
-      *ptr = &aptr;
-      return MHD_YES;
-    }
+  {
+    /* do never respond on first call */
+    *ptr = &aptr;
+    return MHD_YES;
+  }
   responseptr = malloc (sizeof (struct MHD_Response *));
   if (NULL == responseptr)
     return MHD_NO;
@@ -144,29 +144,30 @@ testInternalGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -185,29 +186,30 @@ testMultithreadedGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD /* | 
MHD_USE_ERROR_LOG */,
                         11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 16;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -237,87 +239,87 @@ testExternalGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */,
                         11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   if (d == NULL)
     return 256;
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  zzuf_socat_start ();
+  for (i = 0; i < LOOP_COUNT; i++)
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
     {
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
+      zzuf_socat_stop ();
       MHD_stop_daemon (d);
-      return 512;
+      return 1024;
     }
-  zzuf_socat_start ();
-  for (i = 0; i < LOOP_COUNT; i++)
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
     {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      mret = curl_multi_add_handle (multi, c);
+      max = 0;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
-        {
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          zzuf_socat_stop ();
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-        {
-          max = 0;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          select (max + 1, &rs, &ws, &es, &tv);
-          curl_multi_perform (multi, &running);
-          if (running == 0)
-            {
-              curl_multi_info_read (multi, &running);
-              curl_multi_remove_handle (multi, c);
-              curl_easy_cleanup (c);
-              c = NULL;
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_easy_cleanup (c);
-        }
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      select (max + 1, &rs, &ws, &es, &tv);
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        curl_multi_info_read (multi, &running);
+        curl_multi_remove_handle (multi, c);
+        curl_easy_cleanup (c);
+        c = NULL;
+      }
+      MHD_run (d);
     }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
+    }
+  }
   fprintf (stderr, "\n");
   curl_multi_cleanup (multi);
   zzuf_socat_stop ();
@@ -331,15 +333,15 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalGet ();
-      errorCount += testMultithreadedGet ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalGet ();
+    errorCount += testMultithreadedGet ();
+  }
   errorCount += testExternalGet ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c
index 12a396bb..5ffaf272 100644
--- a/src/testzzuf/test_long_header.c
+++ b/src/testzzuf/test_long_header.c
@@ -43,14 +43,14 @@
  * half of this value, so the actual value does not have
  * to be big at all...
  */
-#define VERY_LONG (1024*10)
+#define VERY_LONG (1024 * 10)
 
 static int oneone;
 
 static int
 apc_all (void *cls, const struct sockaddr *addr, socklen_t addrlen)
 {
-  (void)cls;(void)addr;(void)addrlen;   /* Unused. Silent compiler warning. */
+  (void) cls; (void) addr; (void) addrlen;   /* Unused. Silent compiler 
warning. */
   return MHD_YES;
 }
 
@@ -64,7 +64,7 @@ struct CBC
 static size_t
 copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
 {
-  (void)ptr;(void)ctx;  /* Unused. Silent compiler warning. */
+  (void) ptr; (void) ctx;  /* Unused. Silent compiler warning. */
   return size * nmemb;
 }
 
@@ -80,14 +80,14 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)upload_data;      /* Unused. Silent compiler warning. */
-  (void)upload_data_size;(void)unused;  /* Unused. Silent compiler warning. */
+  (void) version; (void) upload_data;      /* Unused. Silent compiler warning. 
*/
+  (void) upload_data_size; (void) unused;  /* Unused. Silent compiler warning. 
*/
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -107,46 +107,47 @@ testLongUrlGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080,
-                        &apc_all,
-                        NULL,
-                        &ahc_echo,
-                        "GET",
-                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
-                        (size_t) (VERY_LONG / 2), MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080,
+    &apc_all,
+    NULL,
+    &ahc_echo,
+    "GET",
+    MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+    (size_t) (VERY_LONG / 2), MHD_OPTION_END);
 
   if (d == NULL)
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-
-      c = curl_easy_init ();
-      url = malloc (VERY_LONG);
-      memset (url, 'a', VERY_LONG);
-      url[VERY_LONG - 1] = '\0';
-      memcpy (url, "http://127.0.0.1:11081/";,
-              strlen ("http://127.0.0.1:11081/";));
-      curl_easy_setopt (c, CURLOPT_URL, url);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-      free (url);
-    }
+  {
+    fprintf (stderr, ".");
+
+    c = curl_easy_init ();
+    url = malloc (VERY_LONG);
+    memset (url, 'a', VERY_LONG);
+    url[VERY_LONG - 1] = '\0';
+    memcpy (url, "http://127.0.0.1:11081/";,
+            strlen ("http://127.0.0.1:11081/";));
+    curl_easy_setopt (c, CURLOPT_URL, url);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+    free (url);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
 
@@ -169,49 +170,50 @@ testLongHeaderGet ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080,
-                        &apc_all,
-                        NULL,
-                        &ahc_echo,
-                        "GET",
-                        MHD_OPTION_CONNECTION_MEMORY_LIMIT,
-                        (size_t) (VERY_LONG / 2), MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080,
+    &apc_all,
+    NULL,
+    &ahc_echo,
+    "GET",
+    MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+    (size_t) (VERY_LONG / 2), MHD_OPTION_END);
   if (d == NULL)
     return 16;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      url = malloc (VERY_LONG);
-      memset (url, 'a', VERY_LONG);
-      url[VERY_LONG - 1] = '\0';
-      url[VERY_LONG / 2] = ':';
-      url[VERY_LONG / 2 + 1] = ' ';
-      header = curl_slist_append (header, url);
-
-      curl_easy_setopt (c, CURLOPT_HTTPHEADER, header);
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_slist_free_all (header);
-      header = NULL;
-      curl_easy_cleanup (c);
-      free (url);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    url = malloc (VERY_LONG);
+    memset (url, 'a', VERY_LONG);
+    url[VERY_LONG - 1] = '\0';
+    url[VERY_LONG / 2] = ':';
+    url[VERY_LONG / 2 + 1] = ' ';
+    header = curl_slist_append (header, url);
+
+    curl_easy_setopt (c, CURLOPT_HTTPHEADER, header);
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_slist_free_all (header);
+    header = NULL;
+    curl_easy_cleanup (c);
+    free (url);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
 
diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c
index 03b8e5a8..90da5e02 100644
--- a/src/testzzuf/test_post.c
+++ b/src/testzzuf/test_post.c
@@ -53,12 +53,12 @@ struct CBC
 
 static void
 completed_cb (void *cls,
-             struct MHD_Connection *connection,
-             void **con_cls,
-             enum MHD_RequestTerminationCode toe)
+              struct MHD_Connection *connection,
+              void **con_cls,
+              enum MHD_RequestTerminationCode toe)
 {
   struct MHD_PostProcessor *pp = *con_cls;
-  (void)cls;(void)connection;(void)toe; /* Unused. Silent compiler warning. */
+  (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler 
warning. */
 
   if (NULL != pp)
     MHD_destroy_post_processor (pp);
@@ -94,8 +94,8 @@ post_iterator (void *cls,
                const char *value, uint64_t off, size_t size)
 {
   int *eok = cls;
-  (void)kind;(void)filename;(void)content_type; /* Unused. Silent compiler 
warning. */
-  (void)transfer_encoding;(void)off;            /* Unused. Silent compiler 
warning. */
+  (void) kind; (void) filename; (void) content_type; /* Unused. Silent 
compiler warning. */
+  (void) transfer_encoding; (void) off;            /* Unused. Silent compiler 
warning. */
 
   if ((0 == strcmp (key, "name")) &&
       (size == strlen ("daniel")) && (0 == strncmp (value, "daniel", size)))
@@ -119,31 +119,31 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   struct MHD_PostProcessor *pp;
   int ret;
-  (void)cls;(void)version;      /* Unused. Silent compiler warning. */
+  (void) cls; (void) version;      /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("POST", method))
-    {
-      return MHD_NO;            /* unexpected method */
-    }
+  {
+    return MHD_NO;              /* unexpected method */
+  }
   pp = *unused;
   if (pp == NULL)
-    {
-      eok = 0;
-      pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
-      *unused = pp;
-    }
+  {
+    eok = 0;
+    pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
+    *unused = pp;
+  }
   MHD_post_process (pp, upload_data, *upload_data_size);
   if ((eok == 3) && (0 == *upload_data_size))
-    {
-      response = MHD_create_response_from_buffer (strlen (url),
-                                                 (void *) url,
-                                                 MHD_RESPMEM_MUST_COPY);
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-      MHD_destroy_response (response);
-      MHD_destroy_post_processor (pp);
-      *unused = NULL;
-      return ret;
-    }
+  {
+    response = MHD_create_response_from_buffer (strlen (url),
+                                                (void *) url,
+                                                MHD_RESPMEM_MUST_COPY);
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+    MHD_destroy_post_processor (pp);
+    *unused = NULL;
+    return ret;
+  }
   *upload_data_size = 0;
   return MHD_YES;
 }
@@ -161,38 +161,39 @@ testInternalPost ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080, NULL, NULL, &ahc_echo, NULL, 
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,       
                
-                       MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080, NULL, NULL, &ahc_echo, NULL,
+    MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+    MHD_OPTION_END);
   if (d == NULL)
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
-      curl_easy_setopt (c, CURLOPT_POST, 1L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
+    curl_easy_setopt (c, CURLOPT_POST, 1L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -212,39 +213,40 @@ testMultithreadedPost ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */ ,
-                        11080, NULL, NULL, &ahc_echo, NULL, 
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD /* | 
MHD_USE_ERROR_LOG */,
+                        11080, NULL, NULL, &ahc_echo, NULL,
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
 
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
-      curl_easy_setopt (c, CURLOPT_POST, 1L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
+    curl_easy_setopt (c, CURLOPT_POST, 1L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
 
@@ -275,101 +277,101 @@ testExternalPost ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */ ,
-                        1082, NULL, NULL, &ahc_echo, NULL, 
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */,
+                        1082, NULL, NULL, &ahc_echo, NULL,
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 256;
   multi = curl_multi_init ();
   if (multi == NULL)
-    {
-      MHD_stop_daemon (d);
-      return 512;
-    }
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
 
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
+  {
+    fprintf (stderr, ".");
+
+
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:1082/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
+    curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
+    curl_easy_setopt (c, CURLOPT_POST, 1L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+
+
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
     {
-      fprintf (stderr, ".");
-
-
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:1082/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
-      curl_easy_setopt (c, CURLOPT_POSTFIELDSIZE, strlen (POST_DATA));
-      curl_easy_setopt (c, CURLOPT_POST, 1L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-
-
-      mret = curl_multi_add_handle (multi, c);
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
+      zzuf_socat_stop ();
+      MHD_stop_daemon (d);
+      return 1024;
+    }
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
+    {
+      max = 0;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
-        {
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          zzuf_socat_stop ();
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-        {
-          max = 0;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          select (max + 1, &rs, &ws, &es, &tv);
-          curl_multi_perform (multi, &running);
-          if (running == 0)
-            {
-              curl_multi_info_read (multi, &running);
-              curl_multi_remove_handle (multi, c);
-              curl_easy_cleanup (c);
-              c = NULL;
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_easy_cleanup (c);
-        }
-
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      select (max + 1, &rs, &ws, &es, &tv);
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        curl_multi_info_read (multi, &running);
+        curl_multi_remove_handle (multi, c);
+        curl_easy_cleanup (c);
+        c = NULL;
+      }
+      MHD_run (d);
     }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
+    }
+
+  }
   fprintf (stderr, "\n");
   curl_multi_cleanup (multi);
   zzuf_socat_stop ();
@@ -383,17 +385,17 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   oneone = (NULL != strrchr (argv[0], (int) '/')) ?
-    (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
+           (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPost ();
-      errorCount += testMultithreadedPost ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPost ();
+    errorCount += testMultithreadedPost ();
+  }
   errorCount += testExternalPost ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c
index cbe55b5d..d7c2fad3 100644
--- a/src/testzzuf/test_post_form.c
+++ b/src/testzzuf/test_post_form.c
@@ -51,12 +51,12 @@ struct CBC
 
 static void
 completed_cb (void *cls,
-             struct MHD_Connection *connection,
-             void **con_cls,
-             enum MHD_RequestTerminationCode toe)
+              struct MHD_Connection *connection,
+              void **con_cls,
+              enum MHD_RequestTerminationCode toe)
 {
   struct MHD_PostProcessor *pp = *con_cls;
-  (void)cls;(void)connection;(void)toe;            /* Unused. Silent compiler 
warning. */
+  (void) cls; (void) connection; (void) toe;            /* Unused. Silent 
compiler warning. */
 
   if (NULL != pp)
     MHD_destroy_post_processor (pp);
@@ -91,8 +91,8 @@ post_iterator (void *cls,
                const char *value, uint64_t off, size_t size)
 {
   int *eok = cls;
-  (void)kind;(void)filename;(void)content_type; /* Unused. Silent compiler 
warning. */
-  (void)transfer_encoding;(void)off;            /* Unused. Silent compiler 
warning. */
+  (void) kind; (void) filename; (void) content_type; /* Unused. Silent 
compiler warning. */
+  (void) transfer_encoding; (void) off;            /* Unused. Silent compiler 
warning. */
 
   if (key == NULL)
     return MHD_YES;
@@ -122,33 +122,33 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   struct MHD_PostProcessor *pp;
   int ret;
-  (void)cls;(void)version;      /* Unused. Silent compiler warning. */
+  (void) cls; (void) version;      /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("POST", method))
-    {
-      return MHD_NO;            /* unexpected method */
-    }
+  {
+    return MHD_NO;              /* unexpected method */
+  }
   pp = *unused;
   if (pp == NULL)
-    {
-      eok = 0;
-      pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
-      if (pp == NULL)
-        return MHD_NO;
-      *unused = pp;
-    }
+  {
+    eok = 0;
+    pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
+    if (pp == NULL)
+      return MHD_NO;
+    *unused = pp;
+  }
   MHD_post_process (pp, upload_data, *upload_data_size);
   if ((eok == 3) && (0 == *upload_data_size))
-    {
-      response = MHD_create_response_from_buffer (strlen (url),
-                                                 (void *) url,
-                                                 MHD_RESPMEM_MUST_COPY);
-      ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
-      MHD_destroy_response (response);
-      MHD_destroy_post_processor (pp);
-      *unused = NULL;
-      return ret;
-    }
+  {
+    response = MHD_create_response_from_buffer (strlen (url),
+                                                (void *) url,
+                                                MHD_RESPMEM_MUST_COPY);
+    ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+    MHD_destroy_response (response);
+    MHD_destroy_post_processor (pp);
+    *unused = NULL;
+    return ret;
+  }
   *upload_data_size = 0;
   return MHD_YES;
 }
@@ -180,37 +180,38 @@ testInternalPost ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080, NULL, NULL, &ahc_echo, NULL,
+    MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+    MHD_OPTION_END);
   if (d == NULL)
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      pd = make_form ();
-      curl_easy_setopt (c, CURLOPT_HTTPPOST, pd);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-      curl_formfree (pd);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    pd = make_form ();
+    curl_easy_setopt (c, CURLOPT_HTTPPOST, pd);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+    curl_formfree (pd);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -231,37 +232,38 @@ testMultithreadedPost ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD /* | 
MHD_USE_ERROR_LOG */,
                         11080, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 16;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      pd = make_form ();
-      curl_easy_setopt (c, CURLOPT_HTTPPOST, pd);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-      curl_formfree (pd);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    pd = make_form ();
+    curl_easy_setopt (c, CURLOPT_HTTPPOST, pd);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+    curl_formfree (pd);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -292,100 +294,100 @@ testExternalPost ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */,
                         1082, NULL, NULL, &ahc_echo, NULL,
-                       MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
-                       MHD_OPTION_END);
+                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
+                        MHD_OPTION_END);
   if (d == NULL)
     return 256;
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  zzuf_socat_start ();
+  for (i = 0; i < LOOP_COUNT; i++)
+  {
+    fprintf (stderr, ".");
+
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:1082/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    pd = make_form ();
+    curl_easy_setopt (c, CURLOPT_HTTPPOST, pd);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 15L);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
     {
+      curl_multi_cleanup (multi);
+      curl_formfree (pd);
+      curl_easy_cleanup (c);
+      zzuf_socat_stop ();
       MHD_stop_daemon (d);
-      return 512;
+      return 1024;
     }
-  zzuf_socat_start ();
-  for (i = 0; i < LOOP_COUNT; i++)
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
     {
-      fprintf (stderr, ".");
-
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:1082/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      pd = make_form ();
-      curl_easy_setopt (c, CURLOPT_HTTPPOST, pd);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 15L);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-
-      mret = curl_multi_add_handle (multi, c);
+      max = 0;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
-        {
-          curl_multi_cleanup (multi);
-          curl_formfree (pd);
-          curl_easy_cleanup (c);
-          zzuf_socat_stop ();
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-        {
-          max = 0;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              curl_formfree (pd);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              curl_formfree (pd);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          select (max + 1, &rs, &ws, &es, &tv);
-          curl_multi_perform (multi, &running);
-          if (running == 0)
-            {
-              curl_multi_info_read (multi, &running);
-              curl_multi_remove_handle (multi, c);
-              curl_easy_cleanup (c);
-              c = NULL;
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_easy_cleanup (c);
-        }
-      curl_formfree (pd);
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        curl_formfree (pd);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        curl_formfree (pd);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      select (max + 1, &rs, &ws, &es, &tv);
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        curl_multi_info_read (multi, &running);
+        curl_multi_remove_handle (multi, c);
+        curl_easy_cleanup (c);
+        c = NULL;
+      }
+      MHD_run (d);
     }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
+    }
+    curl_formfree (pd);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   curl_multi_cleanup (multi);
@@ -399,17 +401,17 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   oneone = (NULL != strrchr (argv[0], (int) '/')) ?
-    (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
+           (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPost ();
-      errorCount += testMultithreadedPost ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPost ();
+    errorCount += testMultithreadedPost ();
+  }
   errorCount += testExternalPost ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c
index 5a237ddd..605f4804 100644
--- a/src/testzzuf/test_put.c
+++ b/src/testzzuf/test_put.c
@@ -86,29 +86,29 @@ ahc_echo (void *cls,
   int *done = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)unused;   /* Unused. Silent compiler warning. */
+  (void) version; (void) unused;   /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("PUT", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) == 0)
+  {
+    if (*upload_data_size != 8)
+      return MHD_YES;           /* not yet ready */
+    if (0 == memcmp (upload_data, "Hello123", 8))
     {
-      if (*upload_data_size != 8)
-        return MHD_YES;         /* not yet ready */
-      if (0 == memcmp (upload_data, "Hello123", 8))
-        {
-          *upload_data_size = 0;
-        }
-      else
-        {
-          printf ("Invalid upload data `%8s'!\n", upload_data);
-          return MHD_NO;
-        }
-      *done = 1;
-      return MHD_YES;
+      *upload_data_size = 0;
     }
+    else
+    {
+      printf ("Invalid upload data `%8s'!\n", upload_data);
+      return MHD_NO;
+    }
+    *done = 1;
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -129,37 +129,38 @@ testInternalPut ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080,
-                        NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080,
+    NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -180,37 +181,38 @@ testMultithreadedPut ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD /* | 
MHD_USE_ERROR_LOG */,
                         11080,
                         NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -242,99 +244,99 @@ testExternalPut ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_ERROR_LOG */,
                         11080,
                         NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   multi = curl_multi_init ();
   if (multi == NULL)
-    {
-      MHD_stop_daemon (d);
-      return 512;
-    }
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
+  {
+    fprintf (stderr, ".");
 
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
 
 
 
-      mret = curl_multi_add_handle (multi, c);
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
+    {
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
+      zzuf_socat_stop ();
+      MHD_stop_daemon (d);
+      return 1024;
+    }
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
+    {
+      max = 0;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
-        {
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          zzuf_socat_stop ();
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-        {
-          max = 0;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          select (max + 1, &rs, &ws, &es, &tv);
-          curl_multi_perform (multi, &running);
-          if (running == 0)
-            {
-              curl_multi_info_read (multi, &running);
-              curl_multi_remove_handle (multi, c);
-              curl_easy_cleanup (c);
-              c = NULL;
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_easy_cleanup (c);
-        }
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      select (max + 1, &rs, &ws, &es, &tv);
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        curl_multi_info_read (multi, &running);
+        curl_multi_remove_handle (multi, c);
+        curl_easy_cleanup (c);
+        c = NULL;
+      }
+      MHD_run (d);
+    }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
     }
+  }
   fprintf (stderr, "\n");
   curl_multi_cleanup (multi);
   zzuf_socat_stop ();
@@ -347,17 +349,17 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;   /* Unused. Silent compiler warning. */
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   oneone = (NULL != strrchr (argv[0], (int) '/')) ?
-    (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
+           (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPut ();
-      errorCount += testMultithreadedPut ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPut ();
+    errorCount += testMultithreadedPut ();
+  }
   errorCount += testExternalPut ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c
index d016d84e..f66e1ff9 100644
--- a/src/testzzuf/test_put_chunked.c
+++ b/src/testzzuf/test_put_chunked.c
@@ -87,34 +87,34 @@ ahc_echo (void *cls,
   struct MHD_Response *response;
   int ret;
   int have;
-  (void)version;(void)unused;   /* Unused. Silent compiler warning. */
+  (void) version; (void) unused;   /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("PUT", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) < 8)
+  {
+    have = *upload_data_size;
+    if (have + *done > 8)
     {
-      have = *upload_data_size;
-      if (have + *done > 8)
-        {
-          return MHD_NO;
-        }
-      if (0 == memcmp (upload_data, &"Hello123"[*done], have))
-        {
-          *done += have;
-          *upload_data_size = 0;
-        }
-      else
-        {
-          return MHD_NO;
-        }
+      return MHD_NO;
+    }
+    if (0 == memcmp (upload_data, &"Hello123"[*done], have))
+    {
+      *done += have;
+      *upload_data_size = 0;
+    }
+    else
+    {
+      return MHD_NO;
+    }
 #if 0
-      fprintf (stderr, "Not ready for response: %u/%u\n", *done, 8);
+    fprintf (stderr, "Not ready for response: %u/%u\n", *done, 8);
 #endif
-      return MHD_YES;
-    }
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url,
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -142,30 +142,30 @@ testInternalPut ()
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11080/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      /* by not giving the file size, we force chunking! */
-      /*
-         curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
-       */
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11080/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    /* by not giving the file size, we force chunking! */
+    /*
+       curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
+     */
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -186,7 +186,8 @@ testMultithreadedPut ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         11081,
                         NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
@@ -211,14 +212,14 @@ testMultithreadedPut ()
    *   crashes on my system! */
   curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
-    {
-      fprintf (stderr,
-               "curl_easy_perform failed: `%s'\n",
-               curl_easy_strerror (errornum));
-      curl_easy_cleanup (c);
-      MHD_stop_daemon (d);
-      return 32;
-    }
+  {
+    fprintf (stderr,
+             "curl_easy_perform failed: `%s'\n",
+             curl_easy_strerror (errornum));
+    curl_easy_cleanup (c);
+    MHD_stop_daemon (d);
+    return 32;
+  }
   curl_easy_cleanup (c);
   MHD_stop_daemon (d);
   if (cbc.pos != strlen ("/hello_world"))
@@ -262,90 +263,90 @@ testExternalPut ()
 
   multi = curl_multi_init ();
   if (multi == NULL)
-    {
-      MHD_stop_daemon (d);
-      return 512;
-    }
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11082/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      /* by not giving the file size, we force chunking! */
-      /*
-         curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
-       */
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+  {
+    fprintf (stderr, ".");
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11082/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    /* by not giving the file size, we force chunking! */
+    /*
+       curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
+     */
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
 
 
-      mret = curl_multi_add_handle (multi, c);
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
+    {
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
+      zzuf_socat_stop ();
+      MHD_stop_daemon (d);
+      return 1024;
+    }
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
+    {
+      max = 0;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
-        {
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          zzuf_socat_stop ();
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-        {
-          max = 0;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          select (max + 1, &rs, &ws, &es, &tv);
-          curl_multi_perform (multi, &running);
-          if (running == 0)
-            {
-              curl_multi_info_read (multi, &running);
-              curl_multi_remove_handle (multi, c);
-              curl_easy_cleanup (c);
-              c = NULL;
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_easy_cleanup (c);
-        }
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      select (max + 1, &rs, &ws, &es, &tv);
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        curl_multi_info_read (multi, &running);
+        curl_multi_remove_handle (multi, c);
+        curl_easy_cleanup (c);
+        c = NULL;
+      }
+      MHD_run (d);
+    }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
     }
+  }
   fprintf (stderr, "\n");
   curl_multi_cleanup (multi);
   zzuf_socat_stop ();
@@ -359,15 +360,15 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+  (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPut ();
-      errorCount += testMultithreadedPut ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPut ();
+    errorCount += testMultithreadedPut ();
+  }
   errorCount += testExternalPut ();
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c
index 815ce77d..1186f583 100644
--- a/src/testzzuf/test_put_large.c
+++ b/src/testzzuf/test_put_large.c
@@ -94,35 +94,35 @@ ahc_echo (void *cls,
   int *done = cls;
   struct MHD_Response *response;
   int ret;
-  (void)version;(void)unused;  /* Unused. Silent compiler warning. */
+  (void) version; (void) unused; /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("PUT", method))
     return MHD_NO;              /* unexpected method */
   if ((*done) == 0)
+  {
+    if (*upload_data_size != PUT_SIZE)
     {
-      if (*upload_data_size != PUT_SIZE)
-        {
 #if 0
-          fprintf (stderr,
-                   "Waiting for more data (%u/%u)...\n",
-                   *upload_data_size, PUT_SIZE);
+      fprintf (stderr,
+               "Waiting for more data (%u/%u)...\n",
+               *upload_data_size, PUT_SIZE);
 #endif
-          return MHD_YES;       /* not yet ready */
-        }
-      if (0 == memcmp (upload_data, put_buffer, PUT_SIZE))
-        {
-          *upload_data_size = 0;
-        }
-      else
-        {
-          return MHD_NO;
-        }
-      *done = 1;
-      return MHD_YES;
+      return MHD_YES;           /* not yet ready */
     }
+    if (0 == memcmp (upload_data, put_buffer, PUT_SIZE))
+    {
+      *upload_data_size = 0;
+    }
+    else
+    {
+      return MHD_NO;
+    }
+    *done = 1;
+    return MHD_YES;
+  }
   response = MHD_create_response_from_buffer (strlen (url),
-                                             (void *) url, 
-                                             MHD_RESPMEM_MUST_COPY);
+                                              (void *) url,
+                                              MHD_RESPMEM_MUST_COPY);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -143,38 +143,39 @@ testInternalPut ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG 
*/ ,
-                        11080,
-                        NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
+  d = MHD_start_daemon (
+    MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
+    11080,
+    NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      curl_easy_setopt (c, CURLOPT_INFILESIZE, (long) PUT_SIZE);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    curl_easy_setopt (c, CURLOPT_INFILESIZE, (long) PUT_SIZE);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -195,38 +196,39 @@ testMultithreadedPut ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */ ,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
+                        | MHD_USE_INTERNAL_POLLING_THREAD /* | 
MHD_USE_ERROR_LOG */,
                         11080,
                         NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   zzuf_socat_start ();
   for (i = 0; i < LOOP_COUNT; i++)
-    {
-      fprintf (stderr, ".");
-
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      curl_easy_setopt (c, CURLOPT_INFILESIZE, (long) PUT_SIZE);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-      curl_easy_perform (c);
-      curl_easy_cleanup (c);
-    }
+  {
+    fprintf (stderr, ".");
+
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    curl_easy_setopt (c, CURLOPT_INFILESIZE, (long) PUT_SIZE);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_perform (c);
+    curl_easy_cleanup (c);
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   MHD_stop_daemon (d);
@@ -267,92 +269,92 @@ testExternalPut ()
     return 256;
   multi = curl_multi_init ();
   if (multi == NULL)
+  {
+    MHD_stop_daemon (d);
+    return 512;
+  }
+  zzuf_socat_start ();
+  for (i = 0; i < LOOP_COUNT; i++)
+  {
+    fprintf (stderr, ".");
+
+    c = curl_easy_init ();
+    curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
+    curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
+    curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
+    curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
+    curl_easy_setopt (c, CURLOPT_READDATA, &pos);
+    curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
+    curl_easy_setopt (c, CURLOPT_INFILESIZE, (long) PUT_SIZE);
+    curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+    curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
+    if (oneone)
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+    else
+      curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+    curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
+    /* NOTE: use of CONNECTTIMEOUT without also
+     *   setting NOSIGNAL results in really weird
+     *   crashes on my system! */
+    curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
+
+
+
+    mret = curl_multi_add_handle (multi, c);
+    if (mret != CURLM_OK)
     {
+      curl_multi_cleanup (multi);
+      curl_easy_cleanup (c);
+      zzuf_socat_stop ();
       MHD_stop_daemon (d);
-      return 512;
+      return 1024;
     }
-  zzuf_socat_start ();
-  for (i = 0; i < LOOP_COUNT; i++)
+    start = time (NULL);
+    while ((time (NULL) - start < 5) && (c != NULL))
     {
-      fprintf (stderr, ".");
-
-      c = curl_easy_init ();
-      curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world";);
-      curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
-      curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
-      curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);
-      curl_easy_setopt (c, CURLOPT_READDATA, &pos);
-      curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
-      curl_easy_setopt (c, CURLOPT_INFILESIZE, (long) PUT_SIZE);
-      curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
-      curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
-      if (oneone)
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-      else
-        curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-      curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT_MS, CURL_TIMEOUT);
-      /* NOTE: use of CONNECTTIMEOUT without also
-       *   setting NOSIGNAL results in really weird
-       *   crashes on my system! */
-      curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
-
-
-
-      mret = curl_multi_add_handle (multi, c);
+      max = 0;
+      FD_ZERO (&rs);
+      FD_ZERO (&ws);
+      FD_ZERO (&es);
+      curl_multi_perform (multi, &running);
+      mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
-        {
-          curl_multi_cleanup (multi);
-          curl_easy_cleanup (c);
-          zzuf_socat_stop ();
-          MHD_stop_daemon (d);
-          return 1024;
-        }
-      start = time (NULL);
-      while ((time (NULL) - start < 5) && (c != NULL))
-        {
-          max = 0;
-          FD_ZERO (&rs);
-          FD_ZERO (&ws);
-          FD_ZERO (&es);
-          curl_multi_perform (multi, &running);
-          mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
-          if (mret != CURLM_OK)
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 2048;
-            }
-          if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
-            {
-              curl_multi_remove_handle (multi, c);
-              curl_multi_cleanup (multi);
-              curl_easy_cleanup (c);
-              zzuf_socat_stop ();
-              MHD_stop_daemon (d);
-              return 4096;
-            }
-          tv.tv_sec = 0;
-          tv.tv_usec = 1000;
-          select (max + 1, &rs, &ws, &es, &tv);
-          curl_multi_perform (multi, &running);
-          if (running == 0)
-            {
-              curl_multi_info_read (multi, &running);
-              curl_multi_remove_handle (multi, c);
-              curl_easy_cleanup (c);
-              c = NULL;
-            }
-          MHD_run (d);
-        }
-      if (c != NULL)
-        {
-          curl_multi_remove_handle (multi, c);
-          curl_easy_cleanup (c);
-        }
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 2048;
+      }
+      if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+      {
+        curl_multi_remove_handle (multi, c);
+        curl_multi_cleanup (multi);
+        curl_easy_cleanup (c);
+        zzuf_socat_stop ();
+        MHD_stop_daemon (d);
+        return 4096;
+      }
+      tv.tv_sec = 0;
+      tv.tv_usec = 1000;
+      select (max + 1, &rs, &ws, &es, &tv);
+      curl_multi_perform (multi, &running);
+      if (running == 0)
+      {
+        curl_multi_info_read (multi, &running);
+        curl_multi_remove_handle (multi, c);
+        curl_easy_cleanup (c);
+        c = NULL;
+      }
+      MHD_run (d);
     }
+    if (c != NULL)
+    {
+      curl_multi_remove_handle (multi, c);
+      curl_easy_cleanup (c);
+    }
+  }
   fprintf (stderr, "\n");
   zzuf_socat_stop ();
   curl_multi_cleanup (multi);
@@ -365,19 +367,19 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void)argc;  /* Unused. Silent compiler warning. */
+  (void) argc; /* Unused. Silent compiler warning. */
 
   oneone = (NULL != strrchr (argv[0], (int) '/')) ?
-    (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
+           (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   put_buffer = malloc (PUT_SIZE);
   memset (put_buffer, 1, PUT_SIZE);
-  if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
-    {
-      errorCount += testInternalPut ();
-      errorCount += testMultithreadedPut ();
-    }
+  if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
+  {
+    errorCount += testInternalPut ();
+    errorCount += testMultithreadedPut ();
+  }
   errorCount += testExternalPut ();
   free (put_buffer);
   if (errorCount != 0)

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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