gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (4153c1cd -> 96ff40d7)


From: gnunet
Subject: [libmicrohttpd] branch master updated (4153c1cd -> 96ff40d7)
Date: Sat, 01 Oct 2022 14:16:00 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 4153c1cd mhd_str: minor refactoring for compact code
     new 6933158a muted some compiler warnings for clang
     new 13e217f5 Added workarounds for clang with W32 and MinGW incorrect 
headers
     new 4adc14c9 Some readability improvements
     new 3f98c609 Removed "gauger" server usage from the testsuite
     new b34d7a3e microhttpd/tests: muted compiler warnings
     new 53207f93 testcurl: Muted some compiler warnings, minor refactoring
     new 81733d43 testcurl: fixed functions declarations
     new 023e1dba testcurl: fixed used types and related warnings
     new 96ff40d7 test_add_conn: added reasonable limits

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


Summary of changes:
 configure.ac                                  |  36 ++-
 doc/examples/websocket.c                      |   3 +-
 src/examples/http_chunked_compression.c       |   7 +-
 src/examples/post_example.c                   |   4 +-
 src/examples/websocket_chatserver_example.c   |  20 +-
 src/examples/websocket_threaded_example.c     |  15 +-
 src/include/microhttpd.h                      |   8 +-
 src/microhttpd/connection.c                   |  80 +++---
 src/microhttpd/connection_https.c             |   6 +-
 src/microhttpd/daemon.c                       | 227 ++++++++--------
 src/microhttpd/mhd_str.c                      |   2 +-
 src/microhttpd/postprocessor.c                |  15 +-
 src/microhttpd/test_client_put_stop.c         |  10 +-
 src/microhttpd/test_postprocessor.c           |   5 +-
 src/microhttpd/test_set_panic.c               |   4 +-
 src/microhttpd/test_sha1.c                    |  12 +-
 src/microhttpd/test_sha512_256.c              |   6 +-
 src/microhttpd/test_str.c                     | 367 +++++++++++++-------------
 src/microhttpd/test_upgrade.c                 |  12 +-
 src/microhttpd/test_upgrade_large.c           |  12 +-
 src/testcurl/Makefile.am                      |   6 +-
 src/testcurl/gauger.h                         |  86 ------
 src/testcurl/https/tls_test_common.c          |   4 +-
 src/testcurl/perf_get.c                       |  74 +++---
 src/testcurl/perf_get_concurrent.c            |  78 +++---
 src/testcurl/test_add_conn.c                  | 114 ++++----
 src/testcurl/test_basicauth.c                 |   5 +-
 src/testcurl/test_callback.c                  |   6 +-
 src/testcurl/test_concurrent_stop.c           |  50 ++--
 src/testcurl/test_delete.c                    |  48 ++--
 src/testcurl/test_digestauth.c                |   9 +-
 src/testcurl/test_digestauth2.c               |   8 +-
 src/testcurl/test_digestauth_concurrent.c     |   3 +-
 src/testcurl/test_digestauth_emu_ext.c        |   6 +-
 src/testcurl/test_digestauth_sha256.c         |  10 +-
 src/testcurl/test_digestauth_with_arguments.c |   6 +-
 src/testcurl/test_get.c                       |  85 +++---
 src/testcurl/test_get_chunked.c               |  63 ++---
 src/testcurl/test_get_close_keep_alive.c      |  62 ++---
 src/testcurl/test_get_empty.c                 |  62 ++---
 src/testcurl/test_get_iovec.c                 | 131 +++++----
 src/testcurl/test_get_response_cleanup.c      |  61 +++--
 src/testcurl/test_get_sendfile.c              |  60 ++---
 src/testcurl/test_get_wait.c                  |  27 +-
 src/testcurl/test_head.c                      |   4 +-
 src/testcurl/test_iplimit.c                   |  29 +-
 src/testcurl/test_large_put.c                 |  32 +--
 src/testcurl/test_long_header.c               |  59 ++---
 src/testcurl/test_parse_cookies.c             |   4 +-
 src/testcurl/test_patch.c                     |  50 ++--
 src/testcurl/test_post.c                      |  62 ++---
 src/testcurl/test_post_loop.c                 |  91 +++----
 src/testcurl/test_postform.c                  |  39 ++-
 src/testcurl/test_process_arguments.c         |  19 +-
 src/testcurl/test_process_headers.c           |  49 ++--
 src/testcurl/test_put.c                       |  48 ++--
 src/testcurl/test_put_chunked.c               |  61 +++--
 src/testcurl/test_quiesce.c                   |  45 ++--
 src/testcurl/test_quiesce_stream.c            |  14 +-
 src/testcurl/test_termination.c               |   8 +-
 src/testcurl/test_timeout.c                   |  31 ++-
 src/testcurl/test_toolarge.c                  |  83 +++---
 src/testcurl/test_tricky.c                    |  51 ++--
 src/testcurl/test_urlparse.c                  |  21 +-
 src/testzzuf/test_get.c                       |  12 +-
 src/testzzuf/test_get_chunked.c               |  12 +-
 src/testzzuf/test_long_header.c               |  40 +--
 src/testzzuf/test_post.c                      |  16 +-
 src/testzzuf/test_post_form.c                 |  16 +-
 src/testzzuf/test_put.c                       |  14 +-
 src/testzzuf/test_put_chunked.c               |   6 +-
 src/testzzuf/test_put_large.c                 |  14 +-
 72 files changed, 1380 insertions(+), 1465 deletions(-)
 delete mode 100644 src/testcurl/gauger.h

diff --git a/configure.ac b/configure.ac
index 6a13f469..4f9b3f45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -325,7 +325,7 @@ AS_CASE([${enable_build_type}],[debug|debugger],
     MHD_CHECK_ADD_CC_CFLAGS([-Wextra -Wdouble-promotion], [CFLAGS_ac])
     MHD_FIND_ADD_CC_CFLAG_IFELSE(
       [
-        # clang produce warning when string pointer is used as a formar for 
v*printf() function
+        # clang produce warning when string pointer is used as a format 
specifier for v*printf() function
         
AS_VAR_IF([mhd_cv_cc_clang_based],["yes"],[MHD_CHECK_ADD_CC_CFLAG([-Wno-format-nonliteral],
 [CFLAGS_ac])])
       ],[],
       [CFLAGS_ac], [-Wformat=2], [-Wformat]
@@ -359,7 +359,39 @@ AS_CASE([${enable_build_type}],[debug|debugger],
     MHD_CHECK_ADD_CC_CFLAGS([-Wmissing-noreturn 
-Wmissing-variable-declarations -Wnested-anon-types], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wnewline-eof -Wover-aligned -Wredundant-parens], 
[CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wshift-sign-overflow -Wtautological-compare 
-Wunaligned-access], [CFLAGS_ac])
-    MHD_CHECK_ADD_CC_CFLAGS([-Wunused -Wused-but-marked-unused 
-Wzero-as-null-pointer-constant -Wzero-length-array], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wunused -Wzero-as-null-pointer-constant 
-Wzero-length-array], [CFLAGS_ac])
+    MHD_CHECK_CC_CFLAG([-Wused-but-marked-unused],[CFLAGS_ac],
+      [
+        AC_CACHE_CHECK([whether $[]CC -Wused-but-marked-unused works with 
system headers],
+          [mhd_cv_wused_but_marked_unused_sys_header],
+          [
+            SAVE_ac_c_werror_flag="$ac_c_werror_flag"
+            ac_c_werror_flag="yes"
+            CFLAGS="${CFLAGS_ac} -Wused-but-marked-unused ${user_CFLAGS}"
+            AC_COMPILE_IFELSE(
+              [
+                AC_LANG_SOURCE([[
+#include <stdio.h>
+
+int main(void)
+{
+  char buf[16];
+  return (int) snprintf(buf, 16, "test");
+}
+                  ]]
+                )
+              ],
+              [mhd_cv_wused_but_marked_unused_sys_header="yes"],
+              [mhd_cv_wused_but_marked_unused_sys_header="no"]
+            )
+            ac_c_werror_flag="$SAVE_ac_c_werror_flag"
+          ]
+        )
+        AS_VAR_IF([mhd_cv_wused_but_marked_unused_sys_header],["yes"],
+          [MHD_APPEND_FLAG_TO_VAR([CFLAGS_ac],[-Wused-but-marked-unused])]
+        )
+      ]
+    )
     #
     # Removed flags:
     #
diff --git a/doc/examples/websocket.c b/doc/examples/websocket.c
index ea29af62..1d25fe5c 100644
--- a/doc/examples/websocket.c
+++ b/doc/examples/websocket.c
@@ -411,8 +411,7 @@ access_handler (void *cls,
   {
     struct MHD_Response *response;
     response =
-      MHD_create_response_from_buffer_static (strlen (
-                                                PAGE_NOT_FOUND),
+      MHD_create_response_from_buffer_static (strlen (PAGE_NOT_FOUND),
                                               PAGE_NOT_FOUND);
     ret = MHD_queue_response (connection,
                               MHD_HTTP_NOT_FOUND,
diff --git a/src/examples/http_chunked_compression.c 
b/src/examples/http_chunked_compression.c
index aa7bd2e5..6c52f60a 100644
--- a/src/examples/http_chunked_compression.c
+++ b/src/examples/http_chunked_compression.c
@@ -88,7 +88,7 @@ compress_buf (z_stream *strm, const void *src, size_t 
src_size, size_t *offset,
     {
       strm->avail_out = CHUNK;
       strm->next_out = tmp;
-      ret = deflate (strm, flush);
+      ret = (Z_OK == deflate (strm, flush)) ? MHD_YES : MHD_NO;
       have = CHUNK - strm->avail_out;
       *dest_size += have;
       tmp_dest = realloc (*dest, *dest_size);
@@ -104,7 +104,7 @@ compress_buf (z_stream *strm, const void *src, size_t 
src_size, size_t *offset,
     while (0 == strm->avail_out);
   }
   while (flush != Z_SYNC_FLUSH);
-  return (Z_OK == ret) ? MHD_YES : MHD_NO;
+  return ret;
 }
 
 
@@ -183,8 +183,7 @@ ahc_echo (void *cls, struct MHD_Connection *con, const char 
*url, const
   holder->file = fopen (__FILE__, "rb");
   if (NULL == holder->file)
     goto file_error;
-  ret = deflateInit (&holder->stream, Z_BEST_COMPRESSION);
-  if (ret != Z_OK)
+  if (Z_OK != deflateInit (&holder->stream, Z_BEST_COMPRESSION))
     goto stream_error;
   holder->buf = malloc (CHUNK);
   if (NULL == holder->buf)
diff --git a/src/examples/post_example.c b/src/examples/post_example.c
index 6b10afc0..f49b49ff 100644
--- a/src/examples/post_example.c
+++ b/src/examples/post_example.c
@@ -373,8 +373,8 @@ fill_v1_v2_form (const void *cls,
   size_t slen;
   (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;
diff --git a/src/examples/websocket_chatserver_example.c 
b/src/examples/websocket_chatserver_example.c
index cd5940db..f01ada43 100644
--- a/src/examples/websocket_chatserver_example.c
+++ b/src/examples/websocket_chatserver_example.c
@@ -966,12 +966,9 @@ chat_adduser (struct ConnectedUser *cu)
 
   /* add the new user to the list */
   size_t user_count_ = user_count + 1;
-  struct ConnectedUser **users_ = (struct ConnectedUser **) realloc (users,
-                                                                     
user_count_
-                                                                     * sizeof (
-                                                                       struct
-                                                                       
ConnectedUser
-                                                                       *));
+  struct ConnectedUser **users_ =
+    (struct ConnectedUser **) realloc (users, user_count_
+                                       * sizeof (struct ConnectedUser *));
   if (NULL == users_)
   {
     /* realloc failed */
@@ -1546,8 +1543,8 @@ connecteduser_parse_received_websocket_stream (struct 
ConnectedUser *cu,
               snprintf (result_text + 5, 235, "%d", (int) cu->user_id);
               strcat (result_text,
                       "|");
-              snprintf (result_text + strlen (result_text), 240 - strlen (
-                          result_text), "%d", (int) ping);
+              snprintf (result_text + strlen (result_text), 240
+                        - strlen (result_text), "%d", (int) ping);
               chat_addmessage (0,
                                0,
                                result_text,
@@ -2256,9 +2253,10 @@ access_handler (void *cls,
     {
       /* return error page */
       struct MHD_Response *response;
-      response = MHD_create_response_from_buffer_static (strlen (
-                                                           
PAGE_INVALID_WEBSOCKET_REQUEST),
-                                                         
PAGE_INVALID_WEBSOCKET_REQUEST);
+      response =
+        MHD_create_response_from_buffer_static ( \
+          strlen (PAGE_INVALID_WEBSOCKET_REQUEST),
+          PAGE_INVALID_WEBSOCKET_REQUEST);
       ret = MHD_queue_response (connection,
                                 MHD_HTTP_BAD_REQUEST,
                                 response);
diff --git a/src/examples/websocket_threaded_example.c 
b/src/examples/websocket_threaded_example.c
index e1580548..e73b1414 100644
--- a/src/examples/websocket_threaded_example.c
+++ b/src/examples/websocket_threaded_example.c
@@ -861,18 +861,19 @@ ahc_cb (void *cls, struct MHD_Connection *con, const char 
*url,
   {
     return send_bad_request (con);
   }
-  ws_version_header = MHD_lookup_connection_value (
-    con, MHD_HEADER_KIND, MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION);
+  ws_version_header =
+    MHD_lookup_connection_value (con, MHD_HEADER_KIND,
+                                 MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION);
   if ((NULL == ws_version_header)
       || (0 != strcmp (ws_version_header, WS_SEC_WEBSOCKET_VERSION)))
   {
     return send_upgrade_required (con);
   }
-  ret = MHD_lookup_connection_value_n (
-    con, MHD_HEADER_KIND,
-    MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY,
-    strlen (MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY),
-    &ws_key_header, &key_size);
+  ret = MHD_lookup_connection_value_n (con, MHD_HEADER_KIND,
+                                       MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY,
+                                       strlen (
+                                         MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY),
+                                       &ws_key_header, &key_size);
   if ((MHD_NO == ret) || (key_size != WS_KEY_LEN))
   {
     return send_bad_request (con);
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 5e744b69..41c5d2ce 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -3700,8 +3700,8 @@ 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_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,
@@ -3974,8 +3974,8 @@ 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_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,
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index f187da59..30260402 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -766,13 +766,14 @@ need_100_continue (struct MHD_Connection *connection)
   const char *expect;
 
   return (MHD_IS_HTTP_VER_1_1_COMPAT (connection->rq.http_ver) &&
-          (MHD_NO != MHD_lookup_connection_value_n (connection,
-                                                    MHD_HEADER_KIND,
-                                                    MHD_HTTP_HEADER_EXPECT,
-                                                    MHD_STATICSTR_LEN_ (
-                                                      MHD_HTTP_HEADER_EXPECT),
-                                                    &expect,
-                                                    NULL)) &&
+          (MHD_NO !=
+           MHD_lookup_connection_value_n (connection,
+                                          MHD_HEADER_KIND,
+                                          MHD_HTTP_HEADER_EXPECT,
+                                          MHD_STATICSTR_LEN_ (
+                                            MHD_HTTP_HEADER_EXPECT),
+                                          &expect,
+                                          NULL)) &&
           (MHD_str_equal_caseless_ (expect,
                                     "100-continue")) );
 }
@@ -1085,8 +1086,8 @@ try_ready_normal_body (struct MHD_Connection *connection)
                              MHD_REQUEST_TERMINATED_COMPLETED_OK);
     else
       CONNECTION_CLOSE_ERROR (connection,
-                              _ (
-                                "Closing connection (application reported 
error generating data)."));
+                              _ ("Closing connection (application reported " \
+                                 "error generating data)."));
     return MHD_NO;
   }
   response->data_start = connection->rp.rsp_write_position;
@@ -1225,8 +1226,8 @@ try_ready_chunked_body (struct MHD_Connection *connection,
     MHD_mutex_unlock_chk_ (&response->mutex);
 #endif
     CONNECTION_CLOSE_ERROR (connection,
-                            _ (
-                              "Closing connection (application error 
generating response)."));
+                            _ ("Closing connection (application error " \
+                               "generating response)."));
     return MHD_NO;
   }
   if (MHD_CONTENT_READER_END_OF_STREAM == ret)
@@ -3100,13 +3101,14 @@ parse_cookie_header (struct MHD_Connection *connection)
   bool strict_parsing;
   size_t i;
 
-  if (MHD_NO == MHD_lookup_connection_value_n (connection,
-                                               MHD_HEADER_KIND,
-                                               MHD_HTTP_HEADER_COOKIE,
-                                               MHD_STATICSTR_LEN_ (
-                                                 MHD_HTTP_HEADER_COOKIE),
-                                               &hdr,
-                                               &hdr_len))
+  if (MHD_NO ==
+      MHD_lookup_connection_value_n (connection,
+                                     MHD_HEADER_KIND,
+                                     MHD_HTTP_HEADER_COOKIE,
+                                     MHD_STATICSTR_LEN_ (
+                                       MHD_HTTP_HEADER_COOKIE),
+                                     &hdr,
+                                     &hdr_len))
     return MHD_PARSE_COOKIE_OK;
   if (0 == hdr_len)
     return MHD_PARSE_COOKIE_OK;
@@ -3414,8 +3416,8 @@ call_connection_handler (struct MHD_Connection 
*connection)
   {
     /* serious internal error, close connection */
     CONNECTION_CLOSE_ERROR (connection,
-                            _ (
-                              "Application reported internal error, closing 
connection."));
+                            _ ("Application reported internal error, " \
+                               "closing connection."));
     return;
   }
 }
@@ -3939,13 +3941,14 @@ parse_connection_headers (struct MHD_Connection 
*connection)
   }
 
   connection->rq.remaining_upload_size = 0;
-  if (MHD_NO != MHD_lookup_connection_value_n (connection,
-                                               MHD_HEADER_KIND,
-                                               
MHD_HTTP_HEADER_TRANSFER_ENCODING,
-                                               MHD_STATICSTR_LEN_ (
-                                                 
MHD_HTTP_HEADER_TRANSFER_ENCODING),
-                                               &enc,
-                                               NULL))
+  if (MHD_NO !=
+      MHD_lookup_connection_value_n (connection,
+                                     MHD_HEADER_KIND,
+                                     MHD_HTTP_HEADER_TRANSFER_ENCODING,
+                                     MHD_STATICSTR_LEN_ (
+                                       MHD_HTTP_HEADER_TRANSFER_ENCODING),
+                                     &enc,
+                                     NULL))
   {
     connection->rq.remaining_upload_size = MHD_SIZE_UNKNOWN;
     if (MHD_str_equal_caseless_ (enc,
@@ -3954,13 +3957,14 @@ parse_connection_headers (struct MHD_Connection 
*connection)
   }
   else
   {
-    if (MHD_NO != MHD_lookup_connection_value_n (connection,
-                                                 MHD_HEADER_KIND,
-                                                 
MHD_HTTP_HEADER_CONTENT_LENGTH,
-                                                 MHD_STATICSTR_LEN_ (
-                                                   
MHD_HTTP_HEADER_CONTENT_LENGTH),
-                                                 &clen,
-                                                 &val_len))
+    if (MHD_NO !=
+        MHD_lookup_connection_value_n (connection,
+                                       MHD_HEADER_KIND,
+                                       MHD_HTTP_HEADER_CONTENT_LENGTH,
+                                       MHD_STATICSTR_LEN_ (
+                                         MHD_HTTP_HEADER_CONTENT_LENGTH),
+                                       &clen,
+                                       &val_len))
     {
       size_t num_digits;
 
@@ -4679,8 +4683,8 @@ cleanup_connection (struct MHD_Connection *connection)
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ (
-                  "Failed to signal end of connection via inter-thread 
communication channel.\n"));
+                _ ("Failed to signal end of connection via inter-thread " \
+                   "communication channel.\n"));
 #endif
     }
   }
@@ -5189,8 +5193,8 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
       {
         /* oops - close! */
         CONNECTION_CLOSE_ERROR (connection,
-                                _ (
-                                  "Closing connection (failed to create 
response footer)."));
+                                _ ("Closing connection (failed to create " \
+                                   "response footer)."));
         continue;
       }
       mhd_assert (connection->write_buffer_send_offset < \
diff --git a/src/microhttpd/connection_https.c 
b/src/microhttpd/connection_https.c
index 0d691706..5421d5b2 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -111,9 +111,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;
 }
 
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 29ce1ccc..6f7bfb58 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -815,20 +815,20 @@ urh_from_fdset (struct MHD_UpgradeResponseHandle *urh,
 
   if (MHD_INVALID_SOCKET != conn_sckt)
   {
-    if (FD_ISSET (conn_sckt, rs))
+    if (FD_ISSET (conn_sckt, (fd_set *) _MHD_DROP_CONST (rs)))
       urh->app.celi |= MHD_EPOLL_STATE_READ_READY;
-    if (FD_ISSET (conn_sckt, ws))
+    if (FD_ISSET (conn_sckt, (fd_set *) _MHD_DROP_CONST (ws)))
       urh->app.celi |= MHD_EPOLL_STATE_WRITE_READY;
-    if (FD_ISSET (conn_sckt, es))
+    if (FD_ISSET (conn_sckt, (fd_set *) _MHD_DROP_CONST (es)))
       urh->app.celi |= MHD_EPOLL_STATE_ERROR;
   }
   if ((MHD_INVALID_SOCKET != mhd_sckt))
   {
-    if (FD_ISSET (mhd_sckt, rs))
+    if (FD_ISSET (mhd_sckt, (fd_set *) _MHD_DROP_CONST (rs)))
       urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY;
-    if (FD_ISSET (mhd_sckt, ws))
+    if (FD_ISSET (mhd_sckt, (fd_set *) _MHD_DROP_CONST (ws)))
       urh->mhd.celi |= MHD_EPOLL_STATE_WRITE_READY;
-    if (FD_ISSET (mhd_sckt, es))
+    if (FD_ISSET (mhd_sckt, (fd_set *) _MHD_DROP_CONST (es)))
       urh->mhd.celi |= MHD_EPOLL_STATE_ERROR;
   }
 }
@@ -1337,8 +1337,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
     if (! urh->was_closed)
     {
       MHD_DLOG (daemon,
-                _ (
-                  "Initiated daemon shutdown while \"upgraded\" connection was 
not closed.\n"));
+                _ ("Initiated daemon shutdown while \"upgraded\" " \
+                   "connection was not closed.\n"));
     }
 #endif
     urh->was_closed = true;
@@ -1352,9 +1352,9 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ ("Failed to forward to application "
-                   "%" PRIu64 \
-                   " bytes of data received from remote side: application shut 
down socket.\n"),
+                _ ("Failed to forward to application %" PRIu64 \
+                   " bytes of data received from remote side: " \
+                   "application shut down socket.\n"),
                 (uint64_t) urh->in_buffer_used);
 #endif
 
@@ -1519,10 +1519,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
            * persistent / unrecoverable error. */
 #ifdef HAVE_MESSAGES
           MHD_DLOG (daemon,
-                    _ (
-                      "Failed to forward to remote client "
-                      "%" PRIu64 \
-                      " bytes of data received from application: %s\n"),
+                    _ ("Failed to forward to remote client %" PRIu64 \
+                       " bytes of data received from application: %s\n"),
                     (uint64_t) urh->out_buffer_used,
                     gnutls_strerror ((int) res));
 #endif
@@ -1589,10 +1587,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
            * persistent / unrecoverable error. */
 #ifdef HAVE_MESSAGES
           MHD_DLOG (daemon,
-                    _ (
-                      "Failed to forward to application "
-                      "%" PRIu64 \
-                      " bytes of data received from remote side: %s\n"),
+                    _ ("Failed to forward to application %" PRIu64 \
+                       " bytes of data received from remote side: %s\n"),
                     (uint64_t) urh->in_buffer_used,
                     MHD_socket_strerr_ (err));
 #endif
@@ -1645,10 +1641,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
 #ifdef HAVE_MESSAGES
     if (0 < urh->out_buffer_used)
       MHD_DLOG (daemon,
-                _ (
-                  "Failed to forward to remote client "
-                  "%" PRIu64 \
-                  " bytes of data received from application: daemon shut 
down.\n"),
+                _ ("Failed to forward to remote client %" PRIu64 \
+                   " bytes of data received from application: daemon shut 
down.\n"),
                 (uint64_t) urh->out_buffer_used);
 #endif
     /* Discard any data unsent to remote. */
@@ -2254,8 +2248,8 @@ exit:
   {
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-              _ (
-                "Failed to signal thread termination via inter-thread 
communication channel.\n"));
+              _ ("Failed to signal thread termination via inter-thread " \
+                 "communication channel.\n"));
 #endif
   }
   return (MHD_THRD_RTRN_TYPE_) 0;
@@ -2361,8 +2355,8 @@ psk_gnutls_adapter (gnutls_session_t session,
   {
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-              _ (
-                "PSK authentication failed: gnutls_malloc failed to allocate 
memory.\n"));
+              _ ("PSK authentication failed: gnutls_malloc failed to " \
+                 "allocate memory.\n"));
 #endif
     free (app_psk);
     return -1;
@@ -2446,8 +2440,8 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
     /* above connection limit - reject */
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-              _ (
-                "Server reached connection limit. Closing inbound 
connection.\n"));
+              _ ("Server reached connection limit. " \
+                 "Closing inbound connection.\n"));
 #endif
     MHD_socket_close_chk_ (client_socket);
 #if defined(ENFILE) && (ENFILE + 0 != 0)
@@ -2640,8 +2634,8 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
     default:
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ (
-                  "Failed to setup TLS credentials: unknown credential type 
%d.\n"),
+                _ ("Failed to setup TLS credentials: " \
+                   "unknown credential type %d.\n"),
                 daemon->cred_type);
 #endif
       gnutls_deinit (connection->tls_session);
@@ -3212,15 +3206,15 @@ MHD_suspend_connection (struct MHD_Connection 
*connection)
 #endif /* MHD_USE_THREADS */
 
   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.\n"));
+              _ ("Error: connection scheduled for \"upgrade\" cannot " \
+                 "be suspended.\n"));
 #endif /* HAVE_MESSAGES */
     return;
   }
@@ -3252,8 +3246,8 @@ MHD_resume_connection (struct MHD_Connection *connection)
 #endif /* MHD_USE_THREADS */
 
   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
@@ -3267,8 +3261,8 @@ MHD_resume_connection (struct MHD_Connection *connection)
   {
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-              _ (
-                "Failed to signal resume via inter-thread communication 
channel.\n"));
+              _ ("Failed to signal resume via inter-thread " \
+                 "communication channel.\n"));
 #endif
   }
 }
@@ -3445,8 +3439,8 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ (
-                  "Failed to signal resume of connection via inter-thread 
communication channel.\n"));
+                _ ("Failed to signal resume of connection via " \
+                   "inter-thread communication channel.\n"));
 #endif
     }
   }
@@ -3559,8 +3553,7 @@ MHD_add_connection (struct MHD_Daemon *daemon,
   {
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-              _ (
-                "Failed to suppress SIGPIPE on new client socket: %s\n"),
+              _ ("Failed to suppress SIGPIPE on new client socket: %s\n"),
               MHD_socket_last_strerr_ ());
 #else  /* ! HAVE_MESSAGES */
     (void) 0; /* Mute compiler warning */
@@ -3911,8 +3904,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
                             EPOLL_CTL_DEL,
                             pos->socket_fd,
                             NULL))
-          MHD_PANIC (_ (
-                       "Failed to remove FD from epoll set.\n"));
+          MHD_PANIC (_ ("Failed to remove FD from epoll set.\n"));
         pos->epoll_state &=
           ~((enum MHD_EpollState)
             MHD_EPOLL_STATE_IN_EPOLL_SET);
@@ -4299,7 +4291,7 @@ internal_run_from_select (struct MHD_Daemon *daemon,
      will trigger select again and will be processed */
   if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
        (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
-                  read_fd_set)) )
+                  (fd_set *) _MHD_DROP_CONST (read_fd_set))) )
     MHD_itc_clear_ (daemon->itc);
 
   /* Process externally added connection if any */
@@ -4310,7 +4302,7 @@ internal_run_from_select (struct MHD_Daemon *daemon,
   if ( (MHD_INVALID_SOCKET != (ds = daemon->listen_fd)) &&
        (! daemon->was_quiesced) &&
        (FD_ISSET (ds,
-                  read_fd_set)) )
+                  (fd_set *) _MHD_DROP_CONST (read_fd_set))) )
     (void) MHD_accept_connection (daemon);
 
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
@@ -4325,11 +4317,11 @@ internal_run_from_select (struct MHD_Daemon *daemon,
         continue;
       call_handlers (pos,
                      FD_ISSET (ds,
-                               read_fd_set),
+                               (fd_set *) _MHD_DROP_CONST (read_fd_set)),
                      FD_ISSET (ds,
-                               write_fd_set),
+                               (fd_set *) _MHD_DROP_CONST (write_fd_set)),
                      FD_ISSET (ds,
-                               except_fd_set));
+                               (fd_set *) _MHD_DROP_CONST (except_fd_set)));
     }
   }
 
@@ -5794,8 +5786,8 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
   {
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-              _ (
-                "Using MHD_quiesce_daemon in this mode requires 
MHD_USE_ITC.\n"));
+              _ ("Using MHD_quiesce_daemon in this mode " \
+                 "requires MHD_USE_ITC.\n"));
 #endif
     return MHD_INVALID_SOCKET;
   }
@@ -5822,8 +5814,8 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
       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.\n"));
+          MHD_PANIC (_ ("Failed to signal quiesce via inter-thread " \
+                        "communication channel.\n"));
       }
     }
 #endif
@@ -5845,8 +5837,8 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
 #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.\n"));
+    MHD_PANIC (_ ("failed to signal quiesce via inter-thread " \
+                  "communication channel.\n"));
   return ret;
 }
 
@@ -6007,18 +5999,16 @@ parse_options_va (struct MHD_Daemon *daemon,
       {
 #ifdef HAVE_MESSAGES
         MHD_DLOG (daemon,
-                  _ (
-                    "Warning: Zero size, specified for thread pool size, is 
ignored. "
-                    "Thread pool is not used.\n"));
+                  _ ("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"));
+                  _ ("Warning: \"1\", specified for thread pool size, " \
+                     "is ignored. Thread pool is not used.\n"));
 #endif
         daemon->worker_pool_size = 0;
       }
@@ -6069,8 +6059,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif
       break;
@@ -6082,8 +6072,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif
       break;
@@ -6095,8 +6085,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif
       break;
@@ -6108,8 +6098,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif
       break;
@@ -6160,8 +6150,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif
       break;
@@ -6190,8 +6180,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif
       break;
@@ -6199,8 +6189,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #if GNUTLS_VERSION_MAJOR < 3
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ (
-                  "MHD_OPTION_HTTPS_CERT_CALLBACK requires building MHD with 
GnuTLS >= 3.0.\n"));
+                _ ("MHD_OPTION_HTTPS_CERT_CALLBACK requires building " \
+                   "MHD with GnuTLS >= 3.0.\n"));
 #endif
       return MHD_NO;
 #else
@@ -6211,8 +6201,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif /*  HAVE_MESSAGES */
       break;
@@ -6221,8 +6211,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #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"));
+                _ ("MHD_OPTION_HTTPS_CERT_CALLBACK2 requires building " \
+                   "MHD with GnuTLS >= 3.6.3.\n"));
 #endif
       return MHD_NO;
 #else
@@ -6233,8 +6223,8 @@ parse_options_va (struct MHD_Daemon *daemon,
 #ifdef HAVE_MESSAGES
       else
         MHD_DLOG (daemon,
-                  _ (
-                    "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not 
set.\n"),
+                  _ ("MHD HTTPS option %d passed to MHD but " \
+                     "MHD_USE_TLS not set.\n"),
                   opt);
 #endif /* HAVE_MESSAGES */
       break;
@@ -6491,8 +6481,8 @@ parse_options_va (struct MHD_Daemon *daemon,
       break;
 #else
       MHD_DLOG (daemon,
-                _ (
-                  "MHD HTTPS option %d passed to MHD compiled without GNUtls 
>= 3.\n"),
+                _ ("MHD HTTPS option %d passed to MHD compiled " \
+                   "without GNUtls >= 3.\n"),
                 opt);
       return MHD_NO;
 #endif
@@ -6875,10 +6865,11 @@ MHD_start_daemon_va (unsigned int flags,
        (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD)) )
   {
     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"));
+              _ ("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
 
@@ -6919,8 +6910,8 @@ MHD_start_daemon_va (unsigned int flags,
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ (
-                  "file descriptor for inter-thread communication channel 
exceeds maximum value.\n"));
+                _ ("file descriptor for inter-thread communication " \
+                   "channel exceeds maximum value.\n"));
 #endif
       MHD_itc_destroy_chk_ (daemon->itc);
 #ifdef HTTPS_SUPPORT
@@ -7013,8 +7004,8 @@ MHD_start_daemon_va (unsigned int flags,
   {
 #ifdef HAVE_MESSAGES
     MHD_DLOG (daemon,
-              _ (
-                "MHD thread polling only works with 
MHD_USE_INTERNAL_POLLING_THREAD.\n"));
+              _ ("MHD thread polling only works with " \
+                 "MHD_USE_INTERNAL_POLLING_THREAD.\n"));
 #endif
     goto free_and_fail;
   }
@@ -7111,8 +7102,8 @@ MHD_start_daemon_va (unsigned int flags,
          on this platform we cannot; fail hard */
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ (
-                  "Cannot allow listening address reuse: SO_REUSEPORT not 
defined.\n"));
+                _ ("Cannot allow listening address reuse: " \
+                   "SO_REUSEPORT not defined.\n"));
 #endif
       goto free_and_fail;
 #endif /* !MHD_WINSOCK_SOCKETS && !SO_REUSEPORT */
@@ -7147,8 +7138,8 @@ MHD_start_daemon_va (unsigned int flags,
 #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"));
+                _ ("Cannot disallow listening address reuse: " \
+                   "SO_EXCLUSIVEADDRUSE not defined.\n"));
 #endif
       goto free_and_fail;
 #endif /* MHD_WINSOCK_SOCKETS */
@@ -7299,8 +7290,8 @@ MHD_start_daemon_va (unsigned int flags,
       /* 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"));
+                _ ("Failed to get listen port number " \
+                   "(`struct sockaddr_storage` too small!?).\n"));
 #endif /* HAVE_MESSAGES */
     }
 #ifndef __linux__
@@ -7404,8 +7395,8 @@ MHD_start_daemon_va (unsigned int flags,
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-                _ (
-                  "Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL 
is not supported.\n"));
+                _ ("Combining MHD_USE_THREAD_PER_CONNECTION and " \
+                   "MHD_USE_EPOLL is not supported.\n"));
 #endif
       goto free_and_fail;
     }
@@ -7569,8 +7560,8 @@ MHD_start_daemon_va (unsigned int flags,
           {
 #ifdef HAVE_MESSAGES
             MHD_DLOG (daemon,
-                      _ (
-                        "Failed to create worker inter-thread communication 
channel: %s\n"),
+                      _ ("Failed to create worker inter-thread " \
+                         "communication channel: %s\n"),
                       MHD_itc_last_strerror_ () );
 #endif
             MHD_mutex_destroy_chk_ (&d->new_connections_mutex);
@@ -7583,8 +7574,8 @@ MHD_start_daemon_va (unsigned int flags,
           {
 #ifdef HAVE_MESSAGES
             MHD_DLOG (daemon,
-                      _ (
-                        "File descriptor for worker inter-thread communication 
channel exceeds maximum value.\n"));
+                      _ ("File descriptor for worker inter-thread " \
+                         "communication channel exceeds maximum value.\n"));
 #endif
             MHD_itc_destroy_chk_ (d->itc);
             MHD_mutex_destroy_chk_ (&d->new_connections_mutex);
@@ -7855,8 +7846,8 @@ close_all_connections (struct MHD_Daemon *daemon)
     while (NULL != susp)
     {
       if (NULL == susp->urh)     /* "Upgraded" connection? */
-        MHD_PANIC (_ (
-                     "MHD_stop_daemon() called while we have suspended 
connections.\n"));
+        MHD_PANIC (_ ("MHD_stop_daemon() called while we have " \
+                      "suspended connections.\n"));
 #ifdef HTTPS_SUPPORT
       else if (used_tls &&
                used_thr_p_c &&
@@ -7869,8 +7860,8 @@ close_all_connections (struct MHD_Daemon *daemon)
 #ifdef HAVE_MESSAGES
         if (! susp->urh->was_closed)
           MHD_DLOG (daemon,
-                    _ (
-                      "Initiated daemon shutdown while \"upgraded\" connection 
was not closed.\n"));
+                    _ ("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
@@ -7888,8 +7879,8 @@ close_all_connections (struct MHD_Daemon *daemon)
   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"));
 #if defined(UPGRADE_SUPPORT) && defined(HTTPS_SUPPORT)
 #ifdef MHD_USE_THREADS
   if (upg_allowed && used_tls && used_thr_p_c)
@@ -7927,8 +7918,8 @@ close_all_connections (struct MHD_Daemon *daemon)
     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.\n"));
+      MHD_PANIC (_ ("Failed to signal shutdown via inter-thread " \
+                    "communication channel.\n"));
 #endif
   }
 
@@ -8025,8 +8016,8 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
       {
         if (! MHD_itc_activate_ (daemon->worker_pool[i].itc,
                                  "e"))
-          MHD_PANIC (_ (
-                       "Failed to signal shutdown via inter-thread 
communication channel.\n"));
+          MHD_PANIC (_ ("Failed to signal shutdown via inter-thread " \
+                        "communication channel.\n"));
       }
       else
         mhd_assert (MHD_INVALID_SOCKET != fd);
@@ -8063,8 +8054,8 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
       {
         if (! MHD_itc_activate_ (daemon->itc,
                                  "e"))
-          MHD_PANIC (_ (
-                       "Failed to signal shutdown via inter-thread 
communication channel.\n"));
+          MHD_PANIC (_ ("Failed to signal shutdown via inter-thread " \
+                        "communication channel.\n"));
       }
       else
       {
@@ -8573,8 +8564,8 @@ MHD_init (void)
   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_GCRYPT */
   gnutls_global_init ();
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 9c1c5172..22ae36a9 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -1428,7 +1428,7 @@ MHD_hex_to_bin (const char *hex,
     const int l = toxdigitvalue (hex[r++]);
     if ((0 > h) || (0 > l))
       return 0;
-    out[w++] = ( (((uint8_t) ((unsigned int) h)) << 4)
+    out[w++] = ( ((uint8_t) (((uint8_t) ((unsigned int) h)) << 4))
                  | ((uint8_t) ((unsigned int) l)) );
   }
   mhd_assert (len == r);
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index a9738906..99074215 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -54,13 +54,14 @@ MHD_create_post_processor (struct MHD_Connection 
*connection,
        (NULL == iter))
     MHD_PANIC (_ ("libmicrohttpd API violation.\n"));
   encoding = NULL;
-  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),
-                                               &encoding,
-                                               NULL))
+  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),
+                                     &encoding,
+                                     NULL))
     return NULL;
   mhd_assert (NULL != encoding);
   boundary = NULL;
diff --git a/src/microhttpd/test_client_put_stop.c 
b/src/microhttpd/test_client_put_stop.c
index c26ff78a..b4167870 100644
--- a/src/microhttpd/test_client_put_stop.c
+++ b/src/microhttpd/test_client_put_stop.c
@@ -623,8 +623,8 @@ _MHD_dumbClient_create (uint16_t port, const char *method, 
const char *url,
       int prn_size;
       memcpy (send_buf + clnt->req_size, MHD_HTTP_HEADER_CONTENT_LENGTH ": ",
               MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": "));
-      clnt->req_size += MHD_STATICSTR_LEN_ (
-        MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
+      clnt->req_size +=
+        MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
       prn_size = snprintf (send_buf + clnt->req_size,
                            (buf_alloc_size - clnt->req_size),
                            "%u", (unsigned int) req_body_size);
@@ -2011,7 +2011,7 @@ static int
 testInternalGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
   struct term_notif_cb_param *term_result;
@@ -2027,7 +2027,7 @@ static int
 testMultithreadedGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
   struct term_notif_cb_param *term_result;
@@ -2042,7 +2042,7 @@ static int
 testMultithreadedPoolGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
   struct term_notif_cb_param *term_result;
diff --git a/src/microhttpd/test_postprocessor.c 
b/src/microhttpd/test_postprocessor.c
index ac1e704c..f7a88f11 100644
--- a/src/microhttpd/test_postprocessor.c
+++ b/src/microhttpd/test_postprocessor.c
@@ -394,8 +394,9 @@ test_multipart_garbage (void)
     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.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);
diff --git a/src/microhttpd/test_set_panic.c b/src/microhttpd/test_set_panic.c
index a2d889c1..ac803a26 100644
--- a/src/microhttpd/test_set_panic.c
+++ b/src/microhttpd/test_set_panic.c
@@ -530,8 +530,8 @@ _MHD_dumbClient_create (uint16_t port, const char *method, 
const char *url,
       memcpy (send_buf + clnt->req_size,
               MHD_HTTP_HEADER_CONTENT_LENGTH ": ",
               MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": "));
-      clnt->req_size += MHD_STATICSTR_LEN_ (
-        MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
+      clnt->req_size +=
+        MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
       prn_size = snprintf (send_buf + clnt->req_size,
                            (buf_alloc_size - clnt->req_size),
                            "%u", (unsigned int) req_body_size);
diff --git a/src/microhttpd/test_sha1.c b/src/microhttpd/test_sha1.c
index 4426a3c7..c90f8918 100644
--- a/src/microhttpd/test_sha1.c
+++ b/src/microhttpd/test_sha1.c
@@ -249,9 +249,9 @@ check_result (const char *test_name,
   {
     char calc_str[SHA1_DIGEST_STRING_SIZE];
     bin2hex (calculated, SHA1_DIGEST_SIZE, calc_str);
-    printf (
-      "PASSED: %s check %u: calculated digest %s matches expected digest.\n",
-      test_name, check_num, calc_str);
+    printf ("PASSED: %s check %u: calculated digest %s matches " \
+            "expected digest.\n",
+            test_name, check_num, calc_str);
     fflush (stdout);
   }
   return failed ? 1 : 0;
@@ -275,7 +275,7 @@ test1_str (void)
     uint8_t digest[SHA1_DIGEST_SIZE];
 
     MHD_SHA1_init (&ctx);
-    MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str,
+    MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str,
                      data_units1[i].str_l.len);
     MHD_SHA1_finish (&ctx, digest);
     num_failed += check_result (__FUNCTION__, i, digest,
@@ -321,8 +321,8 @@ test2_str (void)
     size_t part_s = data_units1[i].str_l.len / 4;
 
     MHD_SHA1_init (&ctx);
-    MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, part_s);
-    MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str + part_s,
+    MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str, part_s);
+    MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str + part_s,
                      data_units1[i].str_l.len - part_s);
     MHD_SHA1_finish (&ctx, digest);
     num_failed += check_result (__FUNCTION__, i, digest,
diff --git a/src/microhttpd/test_sha512_256.c b/src/microhttpd/test_sha512_256.c
index 81a505c0..192cb1fb 100644
--- a/src/microhttpd/test_sha512_256.c
+++ b/src/microhttpd/test_sha512_256.c
@@ -427,9 +427,9 @@ check_result (const char *test_name,
   {
     char calc_str[SHA512_256_DIGEST_SIZE * 2 + 1];
     bin2hex (calculated, SHA512_256_DIGEST_SIZE, calc_str);
-    printf (
-      "PASSED: %s check %u: calculated digest %s matches expected digest.\n",
-      test_name, check_num, calc_str);
+    printf ("PASSED: %s check %u: calculated digest %s matches " \
+            "expected digest.\n",
+            test_name, check_num, calc_str);
     fflush (stdout);
   }
   return failed ? 1 : 0;
diff --git a/src/microhttpd/test_str.c b/src/microhttpd/test_str.c
index 35e31319..650510a1 100644
--- a/src/microhttpd/test_str.c
+++ b/src/microhttpd/test_str.c
@@ -312,22 +312,22 @@ 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 ("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 ("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 */
@@ -445,21 +445,21 @@ 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 ("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 ("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 */
@@ -644,11 +644,12 @@ check_eq_strings_n (void)
         }
       }
       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);
+        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;
@@ -1174,14 +1175,14 @@ check_str_to_uint64_valid (void)
                  "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,
+                 " 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);
+        printf ("PASSED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 ") == %" \
+                PRIuPTR "\n",
+                n_prnt (t->str.str), rv, rs);
     }
   }
   return t_failed;
@@ -1245,9 +1246,9 @@ check_str_to_uint64_all_chars (void)
         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));
+        printf ("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (test_str));
       }
     }
   }
@@ -1304,9 +1305,9 @@ check_str_to_uint64_overflow (void)
         }
       }
       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));
+        printf ("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (t->str));
     }
   }
   return t_failed;
@@ -1362,9 +1363,9 @@ check_str_to_uint64_no_val (void)
         }
       }
       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));
+        printf ("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (t->str));
     }
   }
   return t_failed;
@@ -1431,12 +1432,11 @@ check_str_to_uint64_n_valid (void)
         }
       }
       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),
-          (uintptr_t) t->num_of_digt,
-          (uintptr_t) t->str.len + 1, rv, rs);
+        printf ("PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%"
+                PRIuPTR ", ->%" PRIu64 ")" " == %" PRIuPTR "\n",
+                n_prnt (t->str.str),
+                (uintptr_t) t->num_of_digt,
+                (uintptr_t) t->str.len + 1, rv, rs);
     }
   }
   return t_failed;
@@ -1510,9 +1510,9 @@ check_str_to_uint64_n_all_chars (void)
         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));
+        printf ("PASSED: MHD_str_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (test_str));
       }
     }
   }
@@ -1577,12 +1577,11 @@ check_str_to_uint64_n_overflow (void)
         }
       }
       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);
+        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;
@@ -1646,11 +1645,10 @@ check_str_to_uint64_n_no_val (void)
         }
       }
       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);
+        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;
@@ -1715,15 +1713,14 @@ check_strx_to_uint32_valid (void)
                  "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,
+                 " 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);
+        printf ("PASSED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64 ") == %"
+                PRIuPTR "\n",
+                n_prnt (t->str.str), (uint64_t) rv, rs);
     }
   }
   return t_failed;
@@ -1792,9 +1789,9 @@ check_strx_to_uint32_all_chars (void)
         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));
+        printf ("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (test_str));
       }
     }
   }
@@ -1869,9 +1866,9 @@ check_strx_to_uint32_overflow (void)
         }
       }
       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));
+        printf ("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (str));
     }
   }
   return t_failed;
@@ -1928,9 +1925,9 @@ check_strx_to_uint32_no_val (void)
         }
       }
       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));
+        printf ("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (t->str));
     }
   }
   return t_failed;
@@ -2086,9 +2083,9 @@ check_strx_to_uint32_n_all_chars (void)
         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));
+        printf ("PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..5, &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (test_str));
       }
     }
   }
@@ -2186,12 +2183,11 @@ check_strx_to_uint32_n_overflow (void)
         }
       }
       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);
+        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;
@@ -2256,11 +2252,10 @@ check_strx_to_uint32_n_no_val (void)
         }
       }
       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);
+        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;
@@ -2326,10 +2321,9 @@ check_strx_to_uint64_valid (void)
                  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);
+        printf ("PASSED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64 ") == %"
+                PRIuPTR "\n",
+                n_prnt (t->str.str), rv, rs);
     }
   }
   return t_failed;
@@ -2397,9 +2391,9 @@ check_strx_to_uint64_all_chars (void)
         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));
+        printf ("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (test_str));
       }
     }
   }
@@ -2456,9 +2450,9 @@ check_strx_to_uint64_overflow (void)
         }
       }
       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));
+        printf ("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (t->str));
     }
   }
   return t_failed;
@@ -2514,9 +2508,9 @@ check_strx_to_uint64_no_val (void)
         }
       }
       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));
+        printf ("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (t->str));
     }
   }
   return t_failed;
@@ -2583,13 +2577,12 @@ check_strx_to_uint64_n_valid (void)
         }
       }
       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),
-          (uintptr_t) t->num_of_digt,
-          (uintptr_t) t->str.len + 1, rv, rs);
+        printf ("PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
+                ", ->0x%"
+                PRIX64 ")"
+                " == %" PRIuPTR "\n", n_prnt (t->str.str),
+                (uintptr_t) t->num_of_digt,
+                (uintptr_t) t->str.len + 1, rv, rs);
     }
   }
   return t_failed;
@@ -2668,9 +2661,9 @@ check_strx_to_uint64_n_all_chars (void)
         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));
+        printf ("PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, "
+                "value of ret_val is unmodified\n",
+                n_prnt (test_str));
       }
     }
   }
@@ -2736,12 +2729,11 @@ check_strx_to_uint64_n_overflow (void)
         }
       }
       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);
+        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;
@@ -2806,11 +2798,10 @@ check_strx_to_uint64_n_no_val (void)
         }
       }
       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);
+        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;
@@ -2847,8 +2838,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2858,8 +2849,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2869,8 +2860,8 @@ run_str_to_X_tests (void)
              "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,
@@ -2878,8 +2869,8 @@ run_str_to_X_tests (void)
              (unsigned long) 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 ();
   if (res != 0)
@@ -2889,8 +2880,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2900,8 +2891,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2911,8 +2902,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2922,8 +2913,8 @@ run_str_to_X_tests (void)
              "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,
@@ -2931,8 +2922,8 @@ run_str_to_X_tests (void)
              (unsigned long) 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 ();
   if (res != 0)
@@ -2942,8 +2933,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2953,8 +2944,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2964,8 +2955,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -2975,8 +2966,8 @@ run_str_to_X_tests (void)
              "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,
@@ -2984,8 +2975,8 @@ run_str_to_X_tests (void)
              (unsigned long) 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 ();
   if (res != 0)
@@ -2995,8 +2986,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3006,8 +2997,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3017,8 +3008,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3028,8 +3019,8 @@ run_str_to_X_tests (void)
              "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,
@@ -3037,8 +3028,8 @@ run_str_to_X_tests (void)
              (unsigned long) 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 ();
   if (res != 0)
@@ -3048,8 +3039,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3059,8 +3050,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3070,8 +3061,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3081,8 +3072,8 @@ run_str_to_X_tests (void)
              "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,
@@ -3090,8 +3081,8 @@ run_str_to_X_tests (void)
              (unsigned long) 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 ();
   if (res != 0)
@@ -3101,8 +3092,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3112,8 +3103,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3123,8 +3114,8 @@ run_str_to_X_tests (void)
              "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 ();
   if (res != 0)
@@ -3134,8 +3125,8 @@ run_str_to_X_tests (void)
              "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,
@@ -3143,8 +3134,8 @@ run_str_to_X_tests (void)
              (unsigned long) 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 ||
@@ -4454,8 +4445,8 @@ run_str_from_X_tests (void)
     failures += str_from_uint16;
   }
   else if (verbose > 1)
-    printf (
-      "PASSED: testcase check_str_from_uint16() successfully passed.\n\n");
+    printf ("PASSED: testcase check_str_from_uint16() successfully "
+            "passed.\n\n");
 
   str_from_uint64 = check_str_from_uint64 ();
   if (str_from_uint64 != 0)
@@ -4465,8 +4456,8 @@ run_str_from_X_tests (void)
     failures += str_from_uint64;
   }
   else if (verbose > 1)
-    printf (
-      "PASSED: testcase check_str_from_uint16() successfully passed.\n\n");
+    printf ("PASSED: testcase check_str_from_uint16() successfully "
+            "passed.\n\n");
   strx_from_uint32 = check_strx_from_uint32 ();
   if (strx_from_uint32 != 0)
   {
@@ -4475,8 +4466,8 @@ run_str_from_X_tests (void)
     failures += strx_from_uint32;
   }
   else if (verbose > 1)
-    printf (
-      "PASSED: testcase check_strx_from_uint32() successfully passed.\n\n");
+    printf ("PASSED: testcase check_strx_from_uint32() successfully "
+            "passed.\n\n");
 
   str_from_uint8_pad = check_str_from_uint8_pad ();
   if (str_from_uint8_pad != 0)
@@ -4486,8 +4477,8 @@ run_str_from_X_tests (void)
     failures += str_from_uint8_pad;
   }
   else if (verbose > 1)
-    printf (
-      "PASSED: testcase check_str_from_uint8_pad() successfully passed.\n\n");
+    printf ("PASSED: testcase check_str_from_uint8_pad() successfully "
+            "passed.\n\n");
 
   if (failures)
   {
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index 5836db6b..fb4bdadf 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -353,8 +353,8 @@ wr_create_tls_sckt (void)
     {
       if (GNUTLS_E_SUCCESS == gnutls_set_default_priority (s->tls_s))
       {
-        if (GNUTLS_E_SUCCESS == gnutls_certificate_allocate_credentials (
-              &(s->tls_crd)))
+        if (GNUTLS_E_SUCCESS ==
+            gnutls_certificate_allocate_credentials (&(s->tls_crd)))
         {
           if (GNUTLS_E_SUCCESS == gnutls_credentials_set (s->tls_s,
                                                           
GNUTLS_CRD_CERTIFICATE,
@@ -1196,8 +1196,12 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
                               &to64);
     if (1000 < to64)
       to64 = 1000;
-    tv.tv_sec = to64 / 1000;
-    tv.tv_usec = 1000 * (to64 % 1000);
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+    tv.tv_sec = (time_t) (to64 / 1000);
+#else  /* Native W32 */
+    tv.tv_sec = (long) (to64 / 1000);
+#endif /* Native W32 */
+    tv.tv_usec = (int) (1000 * (to64 % 1000));
     ret = select (ep + 1,
                   &rs,
                   NULL,
diff --git a/src/microhttpd/test_upgrade_large.c 
b/src/microhttpd/test_upgrade_large.c
index 6f2331fa..2374574e 100644
--- a/src/microhttpd/test_upgrade_large.c
+++ b/src/microhttpd/test_upgrade_large.c
@@ -519,8 +519,8 @@ wr_create_tls_sckt (void)
     {
       if (GNUTLS_E_SUCCESS == gnutls_set_default_priority (s->tls_s))
       {
-        if (GNUTLS_E_SUCCESS == gnutls_certificate_allocate_credentials (
-              &(s->tls_crd)))
+        if (GNUTLS_E_SUCCESS ==
+            gnutls_certificate_allocate_credentials (&(s->tls_crd)))
         {
           if (GNUTLS_E_SUCCESS == gnutls_credentials_set (s->tls_s,
                                                           
GNUTLS_CRD_CERTIFICATE,
@@ -1382,8 +1382,12 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
                               &to64);
     if (1000 < to64)
       to64 = 1000;
-    tv.tv_sec = to64 / 1000;
-    tv.tv_usec = 1000 * (to64 % 1000);
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+    tv.tv_sec = (time_t) (to64 / 1000);
+#else  /* Native W32 */
+    tv.tv_sec = (long) (to64 / 1000);
+#endif /* Native W32 */
+    tv.tv_usec = (int) (1000 * (to64 % 1000));
     ret = select (ep + 1,
                   &rs,
                   NULL,
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index cd6dcd21..13f9fed7 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -259,11 +259,11 @@ test_callback_SOURCES = \
 
 perf_get_SOURCES = \
   perf_get.c \
-  gauger.h mhd_has_in_name.h
+  mhd_has_in_name.h
 
 perf_get_concurrent_SOURCES = \
   perf_get_concurrent.c \
-  gauger.h mhd_has_in_name.h
+  mhd_has_in_name.h
 perf_get_concurrent_CFLAGS = \
   $(AM_CFLAGS) $(PTHREAD_CFLAGS)
 perf_get_concurrent_LDADD = \
@@ -271,7 +271,7 @@ perf_get_concurrent_LDADD = \
 
 perf_get_concurrent11_SOURCES = \
   perf_get_concurrent.c \
-  gauger.h mhd_has_in_name.h
+  mhd_has_in_name.h
 perf_get_concurrent11_CFLAGS = \
   $(AM_CFLAGS) $(PTHREAD_CFLAGS)
 perf_get_concurrent11_LDADD = \
diff --git a/src/testcurl/gauger.h b/src/testcurl/gauger.h
deleted file mode 100644
index d00839c1..00000000
--- a/src/testcurl/gauger.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/** ---------------------------------------------------------------------------
- * This software is in the public domain, furnished "as is", without technical
- * support, and with no warranty, express or implied, as to its usefulness for
- * any purpose.
- *
- * gauger.h
- * Interface for C programs to log remotely to a gauger server
- *
- * Author: Bartlomiej Polot
- * -------------------------------------------------------------------------*/
-#ifndef __GAUGER_H__
-#define __GAUGER_H__
-
-#ifndef WINDOWS
-
-#include <unistd.h>
-#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_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
-
-#define GAUGER_ID(category, counter, value, unit, id) {}
-#define GAUGER(category, counter, value, unit) {}
-
-#endif /* WINDOWS */
-
-#endif
diff --git a/src/testcurl/https/tls_test_common.c 
b/src/testcurl/https/tls_test_common.c
index f3c561fe..e23f1c4e 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -711,8 +711,8 @@ testsuite_curl_global_init (void)
   res = curl_global_init (CURL_GLOBAL_ALL);
   if (CURLE_OK != res)
   {
-    fprintf (stderr, "libcurl initialisation error: %s\n", curl_easy_strerror (
-               res));
+    fprintf (stderr, "libcurl initialisation error: %s\n",
+             curl_easy_strerror (res));
     return 0;
   }
   return 1;
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index 3ee1c388..bcd5a21c 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -45,7 +45,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include "gauger.h"
 #include "mhd_has_in_name.h"
 
 #ifndef WINDOWS
@@ -96,7 +95,7 @@ static unsigned long long start_time;
  * @return current time in ms
  */
 static unsigned long long
-now ()
+now (void)
 {
   struct timeval tv;
 
@@ -110,7 +109,7 @@ now ()
  * Start the timer.
  */
 static void
-start_timer ()
+start_timer (void)
 {
   start_time = now ();
 }
@@ -131,10 +130,6 @@ stop (const char *desc)
            desc,
            rps,
            "requests/s");
-  GAUGER (desc,
-          "Sequential GETs",
-          rps,
-          "requests/s");
 }
 
 
@@ -171,12 +166,12 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   enum MHD_Result ret;
+  (void) cls;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
   (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -191,8 +186,8 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalGet (int port, int poll_flag)
+static unsigned int
+testInternalGet (uint16_t port, uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -208,8 +203,8 @@ testInternalGet (int port, int poll_flag)
   cbc.buf = buf;
   cbc.size = 2048;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -220,12 +215,12 @@ testInternalGet (int port, int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/hello_world";,
-            port);
+            "http://127.0.0.1:%u/hello_world";,
+            (unsigned int) port);
   start_timer ();
   for (i = 0; i < ROUNDS; i++)
   {
@@ -269,8 +264,8 @@ testInternalGet (int port, int poll_flag)
 }
 
 
-static int
-testMultithreadedGet (int port, int poll_flag)
+static unsigned int
+testMultithreadedGet (uint16_t port, uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -287,8 +282,8 @@ testMultithreadedGet (int port, int poll_flag)
   cbc.size = 2048;
   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);
+                        | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
@@ -299,12 +294,12 @@ testMultithreadedGet (int port, int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/hello_world";,
-            port);
+            "http://127.0.0.1:%u/hello_world";,
+            (unsigned int) port);
   start_timer ();
   for (i = 0; i < ROUNDS; i++)
   {
@@ -351,8 +346,8 @@ testMultithreadedGet (int port, int poll_flag)
 }
 
 
-static int
-testMultithreadedPoolGet (int port, int poll_flag)
+static unsigned int
+testMultithreadedPoolGet (uint16_t port, uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -368,8 +363,8 @@ testMultithreadedPoolGet (int port, int poll_flag)
   cbc.buf = buf;
   cbc.size = 2048;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -382,12 +377,12 @@ testMultithreadedPoolGet (int port, int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/hello_world";,
-            port);
+            "http://127.0.0.1:%u/hello_world";,
+            (unsigned int) port);
   start_timer ();
   for (i = 0; i < ROUNDS; i++)
   {
@@ -431,8 +426,8 @@ testMultithreadedPoolGet (int port, int poll_flag)
 }
 
 
-static int
-testExternalGet (int port)
+static unsigned int
+testExternalGet (uint16_t port)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -464,7 +459,7 @@ testExternalGet (int port)
   cbc.size = 2048;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         port, NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_END);
   if (NULL == d)
     return 256;
@@ -476,12 +471,12 @@ testExternalGet (int port)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/hello_world";,
-            port);
+            "http://127.0.0.1:%u/hello_world";,
+            (unsigned int) port);
   start_timer ();
   multi = curl_multi_init ();
   if (multi == NULL)
@@ -633,7 +628,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  int port = 1130;
+  uint16_t port = 1130;
   (void) argc;   /* Unused. Silent compiler warning. */
 
   if ((NULL == argv) || (0 == argv[0]))
@@ -643,9 +638,8 @@ main (int argc, char *const *argv)
     port += 15;
   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);
+  response = MHD_create_response_from_buffer_copy (strlen ("/hello_world"),
+                                                   "/hello_world");
   errorCount += testExternalGet (port++);
   if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
   {
diff --git a/src/testcurl/perf_get_concurrent.c 
b/src/testcurl/perf_get_concurrent.c
index 80f66eea..d1d396ae 100644
--- a/src/testcurl/perf_get_concurrent.c
+++ b/src/testcurl/perf_get_concurrent.c
@@ -42,7 +42,6 @@
 #include <string.h>
 #include <time.h>
 #include <pthread.h>
-#include "gauger.h"
 #include "mhd_has_in_name.h"
 
 #if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
@@ -99,7 +98,7 @@ static volatile int signal_done;
  * @return current time in ms
  */
 static unsigned long long
-now ()
+now (void)
 {
   struct timeval tv;
 
@@ -113,7 +112,7 @@ now ()
  * Start the timer.
  */
 static void
-start_timer ()
+start_timer (void)
 {
   start_time = now ();
 }
@@ -135,10 +134,6 @@ stop (const char *desc)
            desc,
            rps,
            "requests/s");
-  GAUGER (desc,
-          "Parallel GETs",
-          rps,
-          "requests/s");
 }
 
 
@@ -162,12 +157,12 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   enum MHD_Result ret;
+  (void) cls;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
   (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -189,6 +184,7 @@ thread_gets (void *param)
   CURLcode errornum;
   unsigned int i;
   char *const url = (char *) param;
+  static char curl_err_marker[] = "curl error";
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, url);
@@ -213,7 +209,7 @@ thread_gets (void *param)
                "curl_easy_perform failed: `%s'\n",
                curl_easy_strerror (errornum));
       curl_easy_cleanup (c);
-      return "curl error";
+      return curl_err_marker;
     }
   }
   curl_easy_cleanup (c);
@@ -228,20 +224,21 @@ do_gets (void *param)
   int j;
   pthread_t par[PAR];
   char url[64];
-  int port = (int) (intptr_t) param;
+  uint16_t port = (uint16_t) (intptr_t) param;
   char *err = NULL;
+  static char pthr_err_marker[] = "pthread_create error";
 
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/hello_world";,
-            port);
+            "http://127.0.0.1:%u/hello_world";,
+            (unsigned int) 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";
+      return pthr_err_marker;
     }
   }
   for (j = 0; j < PAR; j++)
@@ -256,8 +253,8 @@ do_gets (void *param)
 }
 
 
-static int
-testInternalGet (int port, int poll_flag)
+static unsigned int
+testInternalGet (uint16_t port, uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ?
@@ -274,8 +271,8 @@ testInternalGet (int port, int 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_END);
+                        | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -286,7 +283,7 @@ testInternalGet (int port, int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   start_timer ();
   ret_val = do_gets ((void *) (intptr_t) port);
@@ -303,8 +300,8 @@ testInternalGet (int port, int poll_flag)
 }
 
 
-static int
-testMultithreadedGet (int port, int poll_flag)
+static unsigned int
+testMultithreadedGet (uint16_t port, uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ?
@@ -325,8 +322,8 @@ testMultithreadedGet (int port, int poll_flag)
   signal_done = 0;
   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);
+                        | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
@@ -337,7 +334,7 @@ testMultithreadedGet (int port, int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   start_timer ();
   ret_val = do_gets ((void *) (intptr_t) port);
@@ -354,8 +351,8 @@ testMultithreadedGet (int port, int poll_flag)
 }
 
 
-static int
-testMultithreadedPoolGet (int port, int poll_flag)
+static unsigned int
+testMultithreadedPoolGet (uint16_t port, uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ?
@@ -372,8 +369,8 @@ testMultithreadedPoolGet (int port, int 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",
+                        | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -386,7 +383,7 @@ testMultithreadedPoolGet (int port, int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   start_timer ();
   ret_val = do_gets ((void *) (intptr_t) port);
@@ -403,8 +400,8 @@ testMultithreadedPoolGet (int port, int poll_flag)
 }
 
 
-static int
-testExternalGet (int port)
+static unsigned int
+testExternalGet (uint16_t port)
 {
   struct MHD_Daemon *d;
   pthread_t pid;
@@ -423,7 +420,7 @@ testExternalGet (int port)
 
   signal_done = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
@@ -434,7 +431,7 @@ testExternalGet (int port)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   if (0 != pthread_create (&pid, NULL,
                            &do_gets, (void *) (intptr_t) port))
@@ -458,8 +455,12 @@ testExternalGet (int port)
     tret = MHD_get_timeout64 (d, &tt64);
     if (MHD_YES != tret)
       tt64 = 1;
-    tv.tv_sec = tt64 / 1000;
-    tv.tv_usec = 1000 * (tt64 % 1000);
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+    tv.tv_sec = (time_t) (tt64 / 1000);
+#else  /* Native W32 */
+    tv.tv_sec = (long) (tt64 / 1000);
+#endif /* Native W32 */
+    tv.tv_usec = ((long) (tt64 % 1000)) * 1000;
     if (-1 == select (max + 1, &rs, &ws, &es, &tv))
     {
 #ifdef MHD_POSIX_SOCKETS
@@ -506,7 +507,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  int port = 1100;
+  uint16_t port = 1100;
   (void) argc;   /* Unused. Silent compiler warning. */
 
   if ((NULL == argv) || (0 == argv[0]))
@@ -516,9 +517,8 @@ main (int argc, char *const *argv)
     port += 15;
   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);
+  response = MHD_create_response_from_buffer_copy (strlen ("/hello_world"),
+                                                   "/hello_world");
   errorCount += testInternalGet (port++, 0);
   errorCount += testMultithreadedGet (port++, 0);
   errorCount += testMultithreadedPoolGet (port++, 0);
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c
index 62386657..89efca73 100644
--- a/src/testcurl/test_add_conn.c
+++ b/src/testcurl/test_add_conn.c
@@ -79,20 +79,19 @@
 
 /* Cleanup test: max number of concurrent daemons depending on maximum number
  * of open FDs. */
-#define CLEANUP_MAX_DAEMONS(max_fds) ( ((max_fds) < 10) ? 0 : \
-                                         ( (((max_fds) - 10) / \
-                                           (CLEANUP_NUM_REQS_PER_DAEMON * 5 \
-                                            + 3)) ) )
+#define CLEANUP_MAX_DAEMONS(max_fds) (unsigned int) \
+  ( ((max_fds) < 10) ? \
+    0 : ( (((max_fds) - 10) / (CLEANUP_NUM_REQS_PER_DAEMON * 5 + 3)) ) )
 
 #define EXPECTED_URI_BASE_PATH  "/hello_world"
 #define EXPECTED_URI_QUERY      "a=%26&b=c"
 #define EXPECTED_URI_FULL_PATH  EXPECTED_URI_BASE_PATH "?" EXPECTED_URI_QUERY
 
 /* Global parameters */
-static int oneone;         /**< Use HTTP/1.1 instead of HTTP/1.0 */
-static int no_listen;      /**< Start MHD daemons without listen socket */
-static int global_port;    /**< MHD daemons listen port number */
-static int cleanup_test;   /**< Test for final cleanup */
+static int oneone;           /**< Use HTTP/1.1 instead of HTTP/1.0 */
+static int no_listen;        /**< Start MHD daemons without listen socket */
+static uint16_t global_port; /**< MHD daemons listen port number */
+static int cleanup_test;     /**< Test for final cleanup */
 static int slow_reply = 0; /**< Slowdown MHD replies */
 static int ignore_response_errors = 0; /**< Do not fail test if CURL
                                             returns error */
@@ -151,15 +150,15 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
   const char *v;
+  (void) cls;
   (void) version;
   (void) upload_data;
   (void) upload_data_size;       /* Unused. Silence compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -200,9 +199,8 @@ ahc_echo (void *cls,
   if (slow_reply)
     usleep (200000);
 
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
                             response);
@@ -256,17 +254,17 @@ _externalErrorExit_func (const char *errDesc, const char 
*funcName, int lineNum)
 
 
 /* Static const value, indicates that result value was not set yet */
-static const int eMarker = 0xCE;
+static const unsigned int eMarker = 0xCE;
 
 
 static MHD_socket
-createListeningSocket (int *pport)
+createListeningSocket (uint16_t *pport)
 {
   MHD_socket skt;
   struct sockaddr_in sin;
   socklen_t sin_len;
 #ifdef MHD_POSIX_SOCKETS
-  static const int on = 1;
+  static int on = 1;
 #endif /* MHD_POSIX_SOCKETS */
 
   skt = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -301,7 +299,7 @@ createListeningSocket (int *pport)
     if (AF_INET != sin.sin_family)
       externalErrorExitDesc ("getsockname() returned wrong socket family");
 
-    *pport = (int) ntohs (sin.sin_port);
+    *pport = ntohs (sin.sin_port);
   }
 
   return skt;
@@ -339,14 +337,14 @@ struct addConnParam
 
   MHD_socket clent_sk;
   /* Non-zero indicate error */
-  volatile int result;
+  volatile unsigned int result;
 
 #ifdef HAVE_PTHREAD_H
   pthread_t addConnThread;
 #endif /* HAVE_PTHREAD_H */
 };
 
-static int
+static unsigned int
 doAcceptAndAddConnInThread (struct addConnParam *p)
 {
   struct sockaddr addr;
@@ -387,7 +385,7 @@ startThreadAddConn (struct addConnParam *param)
 }
 
 
-static int
+static unsigned int
 finishThreadAddConn (struct addConnParam *param)
 {
   struct addConnParam *result;
@@ -414,10 +412,10 @@ struct curlQueryParams
   const char *queryPath;
 
   /* Destination port for CURL query */
-  int queryPort;
+  uint16_t queryPort;
 
   /* CURL query result error flag */
-  volatile int queryError;
+  volatile unsigned int queryError;
 
 #ifdef HAVE_PTHREAD_H
   pthread_t queryThread;
@@ -425,7 +423,7 @@ struct curlQueryParams
 };
 
 static CURL *
-curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc)
+curlEasyInitForTest (const char *queryPath, uint16_t port, struct CBC *pcbc)
 {
   CURL *c;
 
@@ -459,7 +457,7 @@ curlEasyInitForTest (const char *queryPath, int port, 
struct CBC *pcbc)
 }
 
 
-static int
+static unsigned int
 doCurlQueryInThread (struct curlQueryParams *p)
 {
   CURL *c;
@@ -540,7 +538,7 @@ startThreadCurlQuery (struct curlQueryParams *param)
 }
 
 
-static int
+static unsigned int
 finishThreadCurlQuery (struct curlQueryParams *param)
 {
   struct curlQueryParams *result;
@@ -559,13 +557,13 @@ finishThreadCurlQuery (struct curlQueryParams *param)
 
 
 /* Perform test queries and shut down MHD daemon */
-static int
-performTestQueries (struct MHD_Daemon *d, int d_port)
+static unsigned int
+performTestQueries (struct MHD_Daemon *d, uint16_t d_port)
 {
   struct curlQueryParams qParam;
   struct addConnParam aParam;
-  int a_port;           /* Additional listening socket port */
-  int ret = 0;          /* Return value */
+  uint16_t a_port;      /* Additional listening socket port */
+  unsigned int ret = 0; /* Return value */
 
   qParam.queryPath = "http://127.0.0.1"; EXPECTED_URI_FULL_PATH;
   a_port = 0; /* auto-assign */
@@ -604,16 +602,16 @@ performTestQueries (struct MHD_Daemon *d, int d_port)
 
 
 /* Perform test for cleanup and shutdown MHD daemon */
-static int
-performTestCleanup (struct MHD_Daemon *d, int num_queries)
+static unsigned int
+performTestCleanup (struct MHD_Daemon *d, unsigned int num_queries)
 {
   struct curlQueryParams *qParamList;
   struct addConnParam aParam;
   MHD_socket lstn_sk;   /* Additional listening socket */
   MHD_socket *clntSkList;
-  int a_port;           /* Additional listening socket port */
-  int i;
-  int ret = 0;          /* Return value */
+  uint16_t a_port;      /* Additional listening socket port */
+  unsigned int i;
+  unsigned int ret = 0; /* Return value */
 
   a_port = 0; /* auto-assign */
 
@@ -704,7 +702,7 @@ enum testMhdPollType
 static unsigned int
 testNumThreadsForPool (enum testMhdPollType pollType)
 {
-  int numThreads = MHD_CPU_COUNT;
+  unsigned int numThreads = MHD_CPU_COUNT;
   if (! cleanup_test)
     return numThreads; /* No practical limit for non-cleanup test */
   if (CLEANUP_MAX_DAEMONS (sys_max_fds) < numThreads)
@@ -721,7 +719,7 @@ testNumThreadsForPool (enum testMhdPollType pollType)
 
 static struct MHD_Daemon *
 startTestMhdDaemon (enum testMhdThreadsType thrType,
-                    enum testMhdPollType pollType, int *pport)
+                    enum testMhdPollType pollType, uint16_t *pport)
 {
   struct MHD_Daemon *d;
   const union MHD_DaemonInfo *dinfo;
@@ -739,22 +737,23 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
   }
 
   if (testMhdThreadInternalPool != thrType)
-    d = MHD_start_daemon (((int) thrType) | ((int) pollType)
+    d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
                           | (thrType == testMhdThreadExternal ?
                              0 : MHD_USE_ITC)
                           | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0)
                           | MHD_USE_ERROR_LOG,
                           *pport, NULL, NULL,
-                          &ahc_echo, "GET",
+                          &ahc_echo, NULL,
                           MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                           MHD_OPTION_END);
   else
-    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType)
+    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
+                          | ((unsigned int) pollType)
                           | MHD_USE_ITC
                           | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0)
                           | MHD_USE_ERROR_LOG,
                           *pport, NULL, NULL,
-                          &ahc_echo, "GET",
+                          &ahc_echo, NULL,
                           MHD_OPTION_THREAD_POOL_SIZE,
                           testNumThreadsForPool (pollType),
                           MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -774,7 +773,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
       fprintf (stderr, "MHD_get_daemon_info() failed.\n");
       abort ();
     }
-    *pport = (int) dinfo->port;
+    *pport = dinfo->port;
   }
 
   return d;
@@ -784,7 +783,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
 /* Test runners */
 
 
-static int
+static unsigned int
 testExternalGet (void)
 {
   struct MHD_Daemon *d;
@@ -797,10 +796,10 @@ testExternalGet (void)
   CURLM *multi;
   time_t start;
   struct timeval tv;
-  int d_port = global_port; /* Daemon's port */
-  int a_port = 0;           /* Additional listening socket port */
+  uint16_t d_port = global_port; /* Daemon's port */
+  uint16_t a_port = 0;      /* Additional listening socket port */
   struct addConnParam aParam;
-  int ret = 0;              /* Return value of the test */
+  unsigned int ret = 0;     /* Return value of the test */
   const int c_no_listen = no_listen; /* Local const value to mute analyzer */
 
   d = startTestMhdDaemon (testMhdThreadExternal, testMhdPollBySelect, &d_port);
@@ -994,11 +993,11 @@ testExternalGet (void)
 
 
 #ifdef HAVE_PTHREAD_H
-static int
+static unsigned int
 testInternalGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
 
   d = startTestMhdDaemon (testMhdThreadInternal, pollType,
                           &d_port);
@@ -1009,11 +1008,11 @@ testInternalGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
 
   d = startTestMhdDaemon (testMhdThreadInternalPerConnection, pollType,
                           &d_port);
@@ -1026,11 +1025,11 @@ testMultithreadedGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedPoolGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
 
   d = startTestMhdDaemon (testMhdThreadInternalPool, pollType,
                           &d_port);
@@ -1042,17 +1041,17 @@ testMultithreadedPoolGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testStopRace (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
-  int a_port = 0;           /* Additional listening socket port */
+  uint16_t d_port = global_port; /* Daemon's port */
+  uint16_t a_port = 0;           /* Additional listening socket port */
   struct sockaddr_in sin;
   MHD_socket fd1;
   MHD_socket fd2;
   struct addConnParam aParam;
-  int ret = 0;              /* Return value of the test */
+  unsigned int ret = 0;              /* Return value of the test */
 
   d = startTestMhdDaemon (testMhdThreadInternal, pollType,
                           &d_port);
@@ -1140,14 +1139,15 @@ main (int argc, char *const *argv)
 #ifndef _WIN32
     /* Find system limit for number of open FDs. */
 #if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX)
-    sys_max_fds = sysconf (_SC_OPEN_MAX);
+    sys_max_fds = sysconf (_SC_OPEN_MAX) > 500000 ?
+                  500000 : (int) sysconf (_SC_OPEN_MAX);
 #else  /* ! HAVE_SYSCONF || ! _SC_OPEN_MAX */
     sys_max_fds = -1;
 #endif /* ! HAVE_SYSCONF || ! _SC_OPEN_MAX */
     if (0 > sys_max_fds)
     {
 #if defined(OPEN_MAX) && (0 < ((OPEN_MAX) +1))
-      sys_max_fds = OPEN_MAX;
+      sys_max_fds = OPEN_MAX > 500000 ? 500000 : (int) OPEN_MAX;
 #else  /* ! OPEN_MAX */
       sys_max_fds = 256; /* Use reasonable value */
 #endif /* ! OPEN_MAX */
diff --git a/src/testcurl/test_basicauth.c b/src/testcurl/test_basicauth.c
index f9ce2455..333ccfee 100644
--- a/src/testcurl/test_basicauth.c
+++ b/src/testcurl/test_basicauth.c
@@ -426,7 +426,7 @@ ahc_echo (void *cls,
 
 
 static CURL *
-setupCURL (void *cbc, int port, char *errbuf)
+setupCURL (void *cbc, uint16_t port, char *errbuf)
 {
   CURL *c;
   char url[512];
@@ -437,7 +437,8 @@ setupCURL (void *cbc, int port, char *errbuf)
     /* A workaround for some old libcurl versions, which ignore the specified
      * port by CURLOPT_PORT when authorisation is used. */
     res = snprintf (url, (sizeof(url) / sizeof(url[0])),
-                    "http://127.0.0.1:%d%s";, port, MHD_URI_BASE_PATH);
+                    "http://127.0.0.1:%u%s";, (unsigned int) port,
+                    MHD_URI_BASE_PATH);
     if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res))
       externalErrorExitDesc ("Cannot form request URL");
   }
diff --git a/src/testcurl/test_callback.c b/src/testcurl/test_callback.c
index 8b23ed02..49b11e36 100644
--- a/src/testcurl/test_callback.c
+++ b/src/testcurl/test_callback.c
@@ -47,7 +47,7 @@ called_twice (void *cls, uint64_t pos, char *buf, size_t max)
   {
     memcpy (buf, "test", 5);
     cls2->called = 1;
-    return strlen (buf);
+    return (ssize_t) strlen (buf);
   }
   if (cls2->called == 1)
   {
@@ -132,7 +132,7 @@ main (int argc, char **argv)
   int running;
   struct timeval tv;
   int extra;
-  int port;
+  uint16_t port;
   (void) argc; (void) argv; /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -157,7 +157,7 @@ main (int argc, char **argv)
     {
       MHD_stop_daemon (d); return 48;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
diff --git a/src/testcurl/test_concurrent_stop.c 
b/src/testcurl/test_concurrent_stop.c
index 306b2b5b..dec0d269 100644
--- a/src/testcurl/test_concurrent_stop.c
+++ b/src/testcurl/test_concurrent_stop.c
@@ -33,7 +33,6 @@
 #include <string.h>
 #include <time.h>
 #include <pthread.h>
-#include "gauger.h"
 
 #if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
 #undef MHD_CPU_COUNT
@@ -146,12 +145,12 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int marker;
-  const char *me = cls;
   enum MHD_Result ret;
+  (void) cls;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
   (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&marker != *req_cls)
   {
@@ -217,12 +216,12 @@ do_gets (void *param)
   int j;
   pthread_t par[PAR];
   char url[64];
-  int port = (int) (intptr_t) param;
+  uint16_t port = (uint16_t) (intptr_t) param;
 
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/hello_world";,
-            port);
+            "http://127.0.0.1:%u/hello_world";,
+            (unsigned int) port);
 
   for (j = 0; j < PAR; j++)
   {
@@ -246,8 +245,8 @@ do_gets (void *param)
 }
 
 
-pthread_t
-start_gets (int port)
+static pthread_t
+start_gets (uint16_t port)
 {
   pthread_t tid;
   continue_requesting = 1;
@@ -260,21 +259,21 @@ start_gets (int port)
 }
 
 
-static int
-testMultithreadedGet (int port,
-                      int poll_flag)
+static unsigned int
+testMultithreadedGet (uint16_t port,
+                      uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   pthread_t p;
-  int result;
+  unsigned int result;
 
   result = 0;
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         port,
                         NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_END);
   if (d == NULL)
     return 16;
@@ -286,7 +285,7 @@ testMultithreadedGet (int port,
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   client_error = CURLE_OK; /* clear client error state */
   p = start_gets (port);
@@ -306,20 +305,20 @@ testMultithreadedGet (int port,
 }
 
 
-static int
-testMultithreadedPoolGet (int port,
-                          int poll_flag)
+static unsigned int
+testMultithreadedPoolGet (uint16_t port,
+                          uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   pthread_t p;
-  int result;
+  unsigned int result;
 
   result = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         port,
                         NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -332,7 +331,7 @@ testMultithreadedPoolGet (int port,
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   client_error = CURLE_OK; /* clear client error state */
   p = start_gets (port);
@@ -356,7 +355,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  int port;
+  uint16_t port;
   (void) argc;   /* Unused. Silent compiler warning. */
   (void) argv;   /* Unused. Silent compiler warning. */
 
@@ -372,9 +371,8 @@ main (int argc, char *const *argv)
     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);
+  response = MHD_create_response_from_buffer_copy (strlen ("/hello_world"),
+                                                   "/hello_world");
   errorCount += testMultithreadedGet (port, 0);
   if (0 != port)
     port++;
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c
index f0e89395..442d4397 100644
--- a/src/testcurl/test_delete.c
+++ b/src/testcurl/test_delete.c
@@ -58,8 +58,8 @@ struct CBC
 static size_t
 putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
 {
-  unsigned int *pos = ptr;
-  unsigned int wrt;
+  size_t *pos = ptr;
+  size_t wrt;
 
   wrt = size * nmemb;
   if (wrt > 8 - (*pos))
@@ -115,25 +115,25 @@ ahc_echo (void *cls,
     *done = 1;
     return MHD_YES;
   }
-  response = MHD_create_response_from_buffer (strlen (url), (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
 }
 
 
-static int
-testInternalDelete ()
+static unsigned int
+testInternalDelete (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -156,7 +156,7 @@ testInternalDelete ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -198,17 +198,17 @@ testInternalDelete ()
 }
 
 
-static int
-testMultithreadedDelete ()
+static unsigned int
+testMultithreadedDelete (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -232,7 +232,7 @@ testMultithreadedDelete ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -275,17 +275,17 @@ testMultithreadedDelete ()
 }
 
 
-static int
-testMultithreadedPoolDelete ()
+static unsigned int
+testMultithreadedPoolDelete (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -310,7 +310,7 @@ testMultithreadedPoolDelete ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -353,8 +353,8 @@ testMultithreadedPoolDelete ()
 }
 
 
-static int
-testExternalDelete ()
+static unsigned int
+testExternalDelete (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -375,9 +375,9 @@ testExternalDelete ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -401,7 +401,7 @@ testExternalDelete ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c
index adc5f330..3388ffbc 100644
--- a/src/testcurl/test_digestauth.c
+++ b/src/testcurl/test_digestauth.c
@@ -349,7 +349,8 @@ setupCURL (void *cbc, uint16_t port)
     /* A workaround for some old libcurl versions, which ignore the specified
      * port by CURLOPT_PORT when digest authorisation is used. */
     res = snprintf (url, (sizeof(url) / sizeof(url[0])),
-                    "http://127.0.0.1:%d%s";, (int) port, MHD_URI_BASE_PATH);
+                    "http://127.0.0.1:%u%s";,
+                    (unsigned int) port, MHD_URI_BASE_PATH);
     if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res))
       externalErrorExitDesc ("Cannot form request URL");
   }
@@ -419,9 +420,9 @@ testDigestAuth (void)
 
   while (off < 8)
   {
-    len = read (fd,
-                rnd + off,
-                8 - off);
+    len = (size_t) read (fd,
+                         rnd + off,
+                         8 - off);
     if (len == (size_t) -1)
       externalErrorExitDesc ("Failed to read '/dev/urandom'");
     off += len;
diff --git a/src/testcurl/test_digestauth2.c b/src/testcurl/test_digestauth2.c
index ab8d2b07..a1a2a700 100644
--- a/src/testcurl/test_digestauth2.c
+++ b/src/testcurl/test_digestauth2.c
@@ -1098,7 +1098,7 @@ ahc_echo (void *cls,
  * @param uri_num the number of URI, should be 0, 1 or 2
  */
 static void
-setCURL_rq_path (CURL *c, unsigned int port, unsigned int uri_num)
+setCURL_rq_path (CURL *c, uint16_t port, unsigned int uri_num)
 {
   const char *req_path;
   char uri[512];
@@ -1113,7 +1113,7 @@ setCURL_rq_path (CURL *c, unsigned int port, unsigned int 
uri_num)
   /* A workaround for some old libcurl versions, which ignore the specified
    * port by CURLOPT_PORT when authorisation is used. */
   res = snprintf (uri, (sizeof(uri) / sizeof(uri[0])),
-                  "http://127.0.0.1:%u%s";, port,
+                  "http://127.0.0.1:%u%s";, (unsigned int) port,
                   req_path);
   if ((0 >= res) || ((sizeof(uri) / sizeof(uri[0])) <= (size_t) res))
     externalErrorExitDesc ("Cannot form request URL");
@@ -1124,7 +1124,7 @@ setCURL_rq_path (CURL *c, unsigned int port, unsigned int 
uri_num)
 
 
 static CURL *
-setupCURL (void *cbc, unsigned int port)
+setupCURL (void *cbc, uint16_t port)
 {
   CURL *c;
 
@@ -1394,7 +1394,7 @@ testDigestAuth (void)
   cbc.size = sizeof (buf);
   cbc.pos = 0;
   memset (cbc.buf, 0, cbc.size);
-  c = setupCURL (&cbc, (unsigned int) port);
+  c = setupCURL (&cbc, port);
   multi_reuse = NULL;
   /* First request */
   if (check_result (performQueryExternal (d, c, &multi_reuse), c, &cbc))
diff --git a/src/testcurl/test_digestauth_concurrent.c 
b/src/testcurl/test_digestauth_concurrent.c
index 792d15de..e7789cbe 100644
--- a/src/testcurl/test_digestauth_concurrent.c
+++ b/src/testcurl/test_digestauth_concurrent.c
@@ -361,7 +361,8 @@ setupCURL (void *cbc, uint16_t port, char *errbuf)
     /* A workaround for some old libcurl versions, which ignore the specified
      * port by CURLOPT_PORT when digest authorisation is used. */
     res = snprintf (url, (sizeof(url) / sizeof(url[0])),
-                    "http://127.0.0.1:%d%s";, (int) port, MHD_URI_BASE_PATH);
+                    "http://127.0.0.1:%u%s";, (unsigned int) port,
+                    MHD_URI_BASE_PATH);
     if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res))
       externalErrorExitDesc ("Cannot form request URL");
   }
diff --git a/src/testcurl/test_digestauth_emu_ext.c 
b/src/testcurl/test_digestauth_emu_ext.c
index b3925d13..e10944c7 100644
--- a/src/testcurl/test_digestauth_emu_ext.c
+++ b/src/testcurl/test_digestauth_emu_ext.c
@@ -530,6 +530,7 @@ ahc_echo (void *cls,
     case MHD_DAUTH_WRONG_QOP:
     case MHD_DAUTH_WRONG_ALGO:
     case MHD_DAUTH_TOO_LARGE:
+    case MHD_DAUTH_NONCE_OTHER_COND:
       fprintf (stderr, "'MHD_digest_auth_check3()' returned "
                "unexpected result: %d. ",
                check_res);
@@ -598,7 +599,7 @@ ahc_echo (void *cls,
 
 
 static CURL *
-setupCURL (void *cbc, int port)
+setupCURL (void *cbc, uint16_t port)
 {
   CURL *c;
   char url[512];
@@ -609,7 +610,8 @@ setupCURL (void *cbc, int port)
     /* A workaround for some old libcurl versions, which ignore the specified
      * port by CURLOPT_PORT when authorisation is used. */
     res = snprintf (url, (sizeof(url) / sizeof(url[0])),
-                    "http://127.0.0.1:%d%s";, port, MHD_URI_BASE_PATH);
+                    "http://127.0.0.1:%u%s";,
+                    (unsigned int) port, MHD_URI_BASE_PATH);
     if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res))
       externalErrorExitDesc ("Cannot form request URL");
   }
diff --git a/src/testcurl/test_digestauth_sha256.c 
b/src/testcurl/test_digestauth_sha256.c
index cf6ab8ff..82b79c1b 100644
--- a/src/testcurl/test_digestauth_sha256.c
+++ b/src/testcurl/test_digestauth_sha256.c
@@ -194,9 +194,9 @@ testDigestAuth (void)
   }
   while (off < 8)
   {
-    len = read (fd,
-                rnd + off,
-                8 - off);
+    len = (size_t) read (fd,
+                         rnd + off,
+                         8 - off);
     if (len == (size_t) -1)
     {
       fprintf (stderr,
@@ -262,8 +262,8 @@ testDigestAuth (void)
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/bar%%20foo?key=value";,
-            (int) port);
+            "http://127.0.0.1:%u/bar%%20foo?key=value";,
+            (unsigned int) port);
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, url);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
diff --git a/src/testcurl/test_digestauth_with_arguments.c 
b/src/testcurl/test_digestauth_with_arguments.c
index 903d90a2..f0c6cd4b 100644
--- a/src/testcurl/test_digestauth_with_arguments.c
+++ b/src/testcurl/test_digestauth_with_arguments.c
@@ -184,7 +184,7 @@ testDigestAuth (void)
   }
   while (off < 8)
   {
-    len = read (fd, rnd + off, 8 - off);
+    len = (size_t) read (fd, rnd + off, 8 - off);
     if (len == (size_t) -1)
     {
       fprintf (stderr,
@@ -239,9 +239,9 @@ testDigestAuth (void)
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/bar%%20foo?";
+            "http://127.0.0.1:%u/bar%%20foo?";
             "key=value&more=even%%20more&empty&=no_key&&same=one&&same=two",
-            (int) port);
+            (unsigned int) port);
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, url);
   curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index 8fe1c771..732bd3b1 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -58,7 +58,7 @@
 #endif
 
 static int oneone;
-static int global_port;
+static uint16_t global_port;
 
 struct CBC
 {
@@ -110,15 +110,15 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
   const char *v;
+  (void) cls;
   (void) version;
   (void) upload_data;
   (void) upload_data_size;       /* Unused. Silence compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -156,9 +156,8 @@ ahc_echo (void *cls,
              NULL == v ? "NULL" : v);
     _exit (19);
   }
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
                             response);
@@ -172,8 +171,8 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalGet (int poll_flag)
+static unsigned int
+testInternalGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -193,9 +192,9 @@ testInternalGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -208,7 +207,7 @@ testInternalGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -245,8 +244,8 @@ testInternalGet (int poll_flag)
 }
 
 
-static int
-testMultithreadedGet (int poll_flag)
+static unsigned int
+testMultithreadedGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -267,9 +266,9 @@ testMultithreadedGet (int poll_flag)
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -282,7 +281,7 @@ testMultithreadedGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -319,8 +318,8 @@ testMultithreadedGet (int poll_flag)
 }
 
 
-static int
-testMultithreadedPoolGet (int poll_flag)
+static unsigned int
+testMultithreadedPoolGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -340,9 +339,9 @@ testMultithreadedPoolGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                         MHD_OPTION_END);
@@ -356,7 +355,7 @@ testMultithreadedPoolGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -393,8 +392,8 @@ testMultithreadedPoolGet (int poll_flag)
 }
 
 
-static int
-testExternalGet ()
+static unsigned int
+testExternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -426,7 +425,7 @@ testExternalGet ()
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         global_port, NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -439,7 +438,7 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -578,8 +577,8 @@ testExternalGet ()
 }
 
 
-static int
-testUnknownPortGet (int poll_flag)
+static unsigned int
+testUnknownPortGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   const union MHD_DaemonInfo *di;
@@ -587,7 +586,7 @@ testUnknownPortGet (int poll_flag)
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   struct sockaddr_in addr;
   socklen_t addr_len = sizeof(addr);
@@ -600,8 +599,8 @@ testUnknownPortGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
-                        0, NULL, NULL, &ahc_echo, "GET",
+                        | (enum MHD_FLAG) poll_flag,
+                        0, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_SOCK_ADDR, &addr,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                         MHD_OPTION_END);
@@ -616,7 +615,7 @@ testUnknownPortGet (int poll_flag)
 
     if (addr.sin_family != AF_INET)
       return 26214;
-    port = (int) ntohs (addr.sin_port);
+    port = ntohs (addr.sin_port);
   }
   else
   {
@@ -626,13 +625,13 @@ testUnknownPortGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   snprintf (buf,
             sizeof(buf),
-            "http://127.0.0.1:%d%s";,
-            port,
+            "http://127.0.0.1:%u%s";,
+            (unsigned int) port,
             EXPECTED_URI_PATH);
 
   c = curl_easy_init ();
@@ -669,8 +668,8 @@ testUnknownPortGet (int poll_flag)
 }
 
 
-static int
-testStopRace (int poll_flag)
+static unsigned int
+testStopRace (uint32_t poll_flag)
 {
   struct sockaddr_in sin;
   MHD_socket fd;
@@ -686,9 +685,9 @@ testStopRace (int poll_flag)
 
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -701,7 +700,7 @@ testStopRace (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
 
   fd = socket (PF_INET, SOCK_STREAM, 0);
@@ -798,8 +797,8 @@ curlExcessFound (CURL *c,
 }
 
 
-static int
-testEmptyGet (int poll_flag)
+static unsigned int
+testEmptyGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -820,7 +819,7 @@ testEmptyGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
                         &ahc_empty, NULL,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -835,7 +834,7 @@ testEmptyGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index 4f7b5606..5c7b6f39 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -84,7 +84,7 @@ int chunked_forced;
 /**
  * MHD port used for testing
  */
-int port_global;
+uint16_t port_global;
 
 
 struct headers_check_result
@@ -93,7 +93,7 @@ struct headers_check_result
   int found_footer;
 };
 
-size_t
+static size_t
 lcurl_hdr_callback (char *buffer, size_t size, size_t nitems,
                     void *userdata)
 {
@@ -159,7 +159,9 @@ crc (void *cls,
 
   if (max < RESP_BLOCK_SIZE)
     abort ();                   /* should not happen in this testcase... */
-  memset (buf, 'A' + (pos / RESP_BLOCK_SIZE), RESP_BLOCK_SIZE);
+  memset (buf,
+          'A' + (char) (unsigned char) (pos / RESP_BLOCK_SIZE),
+          RESP_BLOCK_SIZE);
   return RESP_BLOCK_SIZE;
 }
 
@@ -183,16 +185,16 @@ ahc_echo (void *cls,
           const char *upload_data, size_t *upload_data_size, void **req_cls)
 {
   static int aptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
 
+  (void) cls;
   (void) url;
   (void) version;              /* Unused. Silent compiler warning. */
   (void) upload_data;
   (void) upload_data_size;     /* Unused. Silent compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&aptr != *req_cls)
   {
@@ -225,10 +227,11 @@ ahc_echo (void *cls,
       if (NULL == buf)
         _exit (99);
       for (pos = 0; pos < resp_size; pos += RESP_BLOCK_SIZE)
-        memset (buf + pos, 'A' + (pos / RESP_BLOCK_SIZE), RESP_BLOCK_SIZE);
+        memset (buf + pos,
+                'A' + (char) (unsigned char) (pos / RESP_BLOCK_SIZE),
+                RESP_BLOCK_SIZE);
 
-      response = MHD_create_response_from_buffer (resp_size, buf,
-                                                  MHD_RESPMEM_MUST_COPY);
+      response = MHD_create_response_from_buffer_copy (resp_size, buf);
       free (buf);
     }
     else
@@ -265,8 +268,8 @@ ahc_echo (void *cls,
 }
 
 
-static int
-validate (struct CBC cbc, int ebase)
+static unsigned int
+validate (struct CBC cbc, unsigned int ebase)
 {
   int i;
   char buf[RESP_BLOCK_SIZE];
@@ -307,15 +310,15 @@ validate (struct CBC cbc, int ebase)
 }
 
 
-static int
-testInternalGet ()
+static unsigned int
+testInternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
   struct curl_slist *h_list = NULL;
   struct headers_check_result hdr_check;
 
@@ -324,7 +327,7 @@ testInternalGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -335,7 +338,7 @@ testInternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
     if (0 == port_global)
       port_global = port; /* Re-use the same port for all checks */
   }
@@ -389,15 +392,15 @@ testInternalGet ()
 }
 
 
-static int
-testMultithreadedGet ()
+static unsigned int
+testMultithreadedGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
   struct curl_slist *h_list = NULL;
   struct headers_check_result hdr_check;
 
@@ -407,7 +410,7 @@ testMultithreadedGet ()
   cbc.pos = 0;
   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);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
@@ -418,7 +421,7 @@ testMultithreadedGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
     if (0 == port_global)
       port_global = port; /* Re-use the same port for all checks */
   }
@@ -472,15 +475,15 @@ testMultithreadedGet ()
 }
 
 
-static int
-testMultithreadedPoolGet ()
+static unsigned int
+testMultithreadedPoolGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
   struct curl_slist *h_list = NULL;
   struct headers_check_result hdr_check;
 
@@ -489,7 +492,7 @@ testMultithreadedPoolGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -502,7 +505,7 @@ testMultithreadedPoolGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
     if (0 == port_global)
       port_global = port; /* Re-use the same port for all checks */
   }
@@ -556,8 +559,8 @@ testMultithreadedPoolGet ()
 }
 
 
-static int
-testExternalGet ()
+static unsigned int
+testExternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -578,7 +581,7 @@ testExternalGet ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  int port;
+  uint16_t port;
   struct curl_slist *h_list = NULL;
   struct headers_check_result hdr_check;
 
@@ -588,7 +591,7 @@ testExternalGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
@@ -599,7 +602,7 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
     if (0 == port_global)
       port_global = port; /* Re-use the same port for all checks */
   }
diff --git a/src/testcurl/test_get_close_keep_alive.c 
b/src/testcurl/test_get_close_keep_alive.c
index 7857f2ad..3754325c 100644
--- a/src/testcurl/test_get_close_keep_alive.c
+++ b/src/testcurl/test_get_close_keep_alive.c
@@ -167,9 +167,9 @@ _libcurlErrorExit_func (const char *errDesc, const char 
*funcName, int lineNum)
                                   HDR_CONN_KEEP_ALIVE_VALUE
 
 /* Global parameters */
-static int oneone;         /**< Use HTTP/1.1 instead of HTTP/1.0 for requests*/
-static int conn_close;     /**< Don't use Keep-Alive */
-static int global_port;    /**< MHD daemons listen port number */
+static int oneone;           /**< Use HTTP/1.1 instead of HTTP/1.0 for 
requests*/
+static int conn_close;       /**< Don't use Keep-Alive */
+static uint16_t global_port; /**< MHD daemons listen port number */
 static int slow_reply = 0; /**< Slowdown MHD replies */
 static int ignore_response_errors = 0; /**< Do not fail test if CURL
                                             returns error */
@@ -238,7 +238,7 @@ struct headers_check_result
   int found_conn_keep_alive;
 };
 
-size_t
+static size_t
 lcurl_hdr_callback (char *buffer, size_t size, size_t nitems,
                     void *userdata)
 {
@@ -315,14 +315,14 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
+  (void) cls;
   (void) version;
   (void) upload_data;
   (void) upload_data_size;       /* Unused. Silence compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -333,9 +333,8 @@ ahc_echo (void *cls,
   if (slow_reply)
     usleep (200000);
 
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   if (NULL == response)
   {
     fprintf (stderr, "Failed to create response. Line: %d\n", __LINE__);
@@ -385,15 +384,15 @@ struct curlQueryParams
   const char *queryPath;
 
   /* Destination port for CURL query */
-  int queryPort;
+  uint16_t queryPort;
 
   /* CURL query result error flag */
-  volatile int queryError;
+  volatile unsigned int queryError;
 };
 
 
 static CURL *
-curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc,
+curlEasyInitForTest (const char *queryPath, uint16_t port, struct CBC *pcbc,
                      struct headers_check_result *hdr_chk_result,
                      int add_hdr_close, int add_hdr_k_alive)
 {
@@ -626,7 +625,7 @@ getMhdActiveConnections (struct MHD_Daemon *d)
 }
 
 
-static int
+static unsigned int
 doCurlQueryInThread (struct MHD_Daemon *d,
                      struct curlQueryParams *p,
                      int add_hdr_close,
@@ -854,11 +853,11 @@ doCurlQueryInThread (struct MHD_Daemon *d,
 
 
 /* Perform test queries and shut down MHD daemon */
-static int
-performTestQueries (struct MHD_Daemon *d, int d_port)
+static unsigned int
+performTestQueries (struct MHD_Daemon *d, uint16_t d_port)
 {
   struct curlQueryParams qParam;
-  int ret = 0;          /* Return value */
+  unsigned int ret = 0;          /* Return value */
   int i = 0;
   /* masks */
   const int m_mhd_close = 1 << (i++);
@@ -933,7 +932,7 @@ enum testMhdPollType
 static unsigned int
 testNumThreadsForPool (enum testMhdPollType pollType)
 {
-  int numThreads = MHD_CPU_COUNT;
+  unsigned int numThreads = MHD_CPU_COUNT;
   (void) pollType; /* Don't care about pollType for this test */
   return numThreads; /* No practical limit for non-cleanup test */
 }
@@ -941,7 +940,7 @@ testNumThreadsForPool (enum testMhdPollType pollType)
 
 static struct MHD_Daemon *
 startTestMhdDaemon (enum testMhdThreadsType thrType,
-                    enum testMhdPollType pollType, int *pport)
+                    enum testMhdPollType pollType, uint16_t *pport)
 {
   struct MHD_Daemon *d;
   const union MHD_DaemonInfo *dinfo;
@@ -957,17 +956,18 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
   }
 
   if (testMhdThreadInternalPool != thrType)
-    d = MHD_start_daemon (((int) thrType) | ((int) pollType)
+    d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
                           | MHD_USE_ERROR_LOG,
                           *pport, NULL, NULL,
-                          &ahc_echo, "GET",
+                          &ahc_echo, NULL,
                           MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
                           MHD_OPTION_END);
   else
-    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType)
+    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
+                          | ((unsigned int) pollType)
                           | MHD_USE_ERROR_LOG,
                           *pport, NULL, NULL,
-                          &ahc_echo, "GET",
+                          &ahc_echo, NULL,
                           MHD_OPTION_THREAD_POOL_SIZE,
                           testNumThreadsForPool (pollType),
                           MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -987,7 +987,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
       fprintf (stderr, "MHD_get_daemon_info() failed.\n");
       abort ();
     }
-    *pport = (int) dinfo->port;
+    *pport = dinfo->port;
     if (0 == global_port)
       global_port = *pport; /* Reuse the same port for all tests */
   }
@@ -999,11 +999,11 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
 /* Test runners */
 
 
-static int
+static unsigned int
 testExternalGet (void)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
 
   d = startTestMhdDaemon (testMhdThreadExternal, testMhdPollBySelect, &d_port);
 
@@ -1011,11 +1011,11 @@ testExternalGet (void)
 }
 
 
-static int
+static unsigned int
 testInternalGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
 
   d = startTestMhdDaemon (testMhdThreadInternal, pollType,
                           &d_port);
@@ -1024,11 +1024,11 @@ testInternalGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
 
   d = startTestMhdDaemon (testMhdThreadInternalPerConnection, pollType,
                           &d_port);
@@ -1036,11 +1036,11 @@ testMultithreadedGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedPoolGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
 
   d = startTestMhdDaemon (testMhdThreadInternalPool, pollType,
                           &d_port);
diff --git a/src/testcurl/test_get_empty.c b/src/testcurl/test_get_empty.c
index 32d6b16f..1dd4500d 100644
--- a/src/testcurl/test_get_empty.c
+++ b/src/testcurl/test_get_empty.c
@@ -58,7 +58,7 @@
 #endif
 
 static int oneone;
-static int global_port;
+static uint16_t global_port;
 
 struct CBC
 {
@@ -139,8 +139,8 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalGet (int poll_flag)
+static unsigned int
+testInternalGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -160,7 +160,7 @@ testInternalGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
                         &ahc_echo, "GET",
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -175,7 +175,7 @@ testInternalGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -210,8 +210,8 @@ testInternalGet (int poll_flag)
 }
 
 
-static int
-testMultithreadedGet (int poll_flag)
+static unsigned int
+testMultithreadedGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -232,7 +232,7 @@ testMultithreadedGet (int poll_flag)
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
                         &ahc_echo, "GET",
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -247,7 +247,7 @@ testMultithreadedGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -282,8 +282,8 @@ testMultithreadedGet (int poll_flag)
 }
 
 
-static int
-testMultithreadedPoolGet (int poll_flag)
+static unsigned int
+testMultithreadedPoolGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -303,7 +303,7 @@ testMultithreadedPoolGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
                         &ahc_echo, "GET",
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
@@ -319,7 +319,7 @@ testMultithreadedPoolGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -354,7 +354,7 @@ testMultithreadedPoolGet (int poll_flag)
 }
 
 
-static int
+static unsigned int
 testExternalGet ()
 {
   struct MHD_Daemon *d;
@@ -400,7 +400,7 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
@@ -537,8 +537,8 @@ testExternalGet ()
 }
 
 
-static int
-testUnknownPortGet (int poll_flag)
+static unsigned int
+testUnknownPortGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   const union MHD_DaemonInfo *di;
@@ -546,7 +546,7 @@ testUnknownPortGet (int poll_flag)
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   struct sockaddr_in addr;
   socklen_t addr_len = sizeof(addr);
@@ -559,7 +559,7 @@ testUnknownPortGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         0, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_SOCK_ADDR, &addr,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -575,7 +575,7 @@ testUnknownPortGet (int poll_flag)
 
     if (addr.sin_family != AF_INET)
       return 26214;
-    port = (int) ntohs (addr.sin_port);
+    port = ntohs (addr.sin_port);
   }
   else
   {
@@ -585,13 +585,13 @@ testUnknownPortGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   snprintf (buf,
             sizeof(buf),
-            "http://127.0.0.1:%d%s";,
-            port,
+            "http://127.0.0.1:%u%s";,
+            (unsigned int) port,
             EXPECTED_URI_PATH);
 
   c = curl_easy_init ();
@@ -626,8 +626,8 @@ testUnknownPortGet (int poll_flag)
 }
 
 
-static int
-testStopRace (int poll_flag)
+static unsigned int
+testStopRace (uint32_t poll_flag)
 {
   struct sockaddr_in sin;
   MHD_socket fd;
@@ -643,7 +643,7 @@ testStopRace (int poll_flag)
 
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
                         &ahc_echo, "GET",
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -658,7 +658,7 @@ testStopRace (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
 
   fd = socket (PF_INET, SOCK_STREAM, 0);
@@ -749,8 +749,8 @@ curlExcessFound (CURL *c, curl_infotype type, char *data, 
size_t size,
 }
 
 
-static int
-testEmptyGet (int poll_flag)
+static unsigned int
+testEmptyGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -771,7 +771,7 @@ testEmptyGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
+                        | (enum MHD_FLAG) poll_flag,
                         global_port, NULL, NULL,
                         &ahc_empty, NULL,
                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -786,7 +786,7 @@ testEmptyGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1"; EXPECTED_URI_PATH);
diff --git a/src/testcurl/test_get_iovec.c b/src/testcurl/test_get_iovec.c
index bcb610dc..f979ae6e 100644
--- a/src/testcurl/test_get_iovec.c
+++ b/src/testcurl/test_get_iovec.c
@@ -92,15 +92,20 @@ iov_free_callback (void *cls)
 }
 
 
+struct iovncont_data
+{
+  void *ptrs[TESTSTR_IOVCNT];
+};
+
 static void
 iovncont_free_callback (void *cls)
 {
-  struct MHD_IoVec *iov = cls;
+  struct iovncont_data *data = (struct iovncont_data *) cls;
   unsigned int i;
 
   for (i = 0; i < TESTSTR_IOVCNT; ++i)
-    free ((void *) iov[i].iov_base);
-  free (iov);
+    free (data->ptrs[i]);
+  free (data);
 }
 
 
@@ -126,7 +131,7 @@ check_read_data (const void *ptr, size_t len)
 
 
 static enum MHD_Result
-ahc_echo (void *cls,
+ahc_cont (void *cls,
           struct MHD_Connection *connection,
           const char *url,
           const char *method,
@@ -135,16 +140,16 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
   int *data;
   struct MHD_IoVec iov[TESTSTR_IOVCNT];
   int i;
+  (void) cls;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
   (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -164,8 +169,8 @@ ahc_echo (void *cls,
 
   for (i = 0; i < TESTSTR_IOVCNT; ++i)
   {
-    iov[i].iov_base = data + (i * (TESTSTR_SIZE / TESTSTR_IOVCNT
-                                   / sizeof(int)));
+    iov[i].iov_base = data + (((size_t) i)
+                              * (TESTSTR_SIZE / TESTSTR_IOVCNT / sizeof(int)));
     iov[i].iov_len = TESTSTR_SIZE / TESTSTR_IOVCNT;
   }
 
@@ -182,25 +187,25 @@ ahc_echo (void *cls,
 
 
 static enum MHD_Result
-ncont_echo (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 **req_cls)
+ahc_ncont (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 **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
-  int *data;
-  struct MHD_IoVec *iov;
+  struct MHD_IoVec iov[TESTSTR_IOVCNT];
+  struct iovncont_data *clear_cls;
   int i, j;
+  (void) cls;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
   (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -209,30 +214,33 @@ ncont_echo (void *cls,
   }
   *req_cls = NULL;
 
-  if (NULL == (iov = malloc (sizeof(struct MHD_IoVec) * TESTSTR_IOVCNT)))
-    return MHD_NO;
-
+  clear_cls = malloc (sizeof(struct iovncont_data));
+  if (NULL == clear_cls)
+    abort ();
   memset (iov, 0, sizeof(struct MHD_IoVec) * TESTSTR_IOVCNT);
 
   /* Create some test data. */
   for (j = TESTSTR_IOVCNT - 1; j >= 0; --j)
   {
-    if (NULL == (data = malloc (TESTSTR_IOVLEN)))
-      goto err_out;
-
-    iov[j].iov_base = data;
-    iov[j].iov_len = TESTSTR_IOVLEN;
+    int *data;
+    data = malloc (TESTSTR_IOVLEN);
+    if (NULL == data)
+      abort ();
+    clear_cls->ptrs[j] = (void *) data;
 
     for (i = 0; i < (int) (TESTSTR_IOVLEN / sizeof(int)); ++i)
     {
-      data[i] = i + (j * TESTSTR_IOVLEN / sizeof(int));
+      data[i] = i + (j * (int) (TESTSTR_IOVLEN / sizeof(int)));
     }
+    iov[j].iov_base = (const void *) data;
+    iov[j].iov_len = TESTSTR_IOVLEN;
+
   }
 
   response = MHD_create_response_from_iovec (iov,
                                              TESTSTR_IOVCNT,
                                              &iovncont_free_callback,
-                                             iov);
+                                             clear_cls);
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
                             response);
@@ -240,26 +248,17 @@ ncont_echo (void *cls,
   if (ret == MHD_NO)
     abort ();
   return ret;
-
-err_out:
-  for (j = 0; j < TESTSTR_IOVCNT; ++j)
-  {
-    if (NULL != iov[j].iov_base)
-      free ((void *) iov[j].iov_base);
-  }
-  free (iov);
-  return MHD_NO;
 }
 
 
-static int
+static unsigned int
 testInternalGet (bool contiguous)
 {
   struct MHD_Daemon *d;
   CURL *c;
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -277,12 +276,12 @@ testInternalGet (bool contiguous)
   if (contiguous)
   {
     d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                          port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                          port, NULL, NULL, &ahc_cont, NULL, MHD_OPTION_END);
   }
   else
   {
     d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                          port, NULL, NULL, &ncont_echo, "GET", 
MHD_OPTION_END);
+                          port, NULL, NULL, &ahc_ncont, NULL, MHD_OPTION_END);
   }
 
   if (d == NULL)
@@ -295,7 +294,7 @@ testInternalGet (bool contiguous)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -332,14 +331,14 @@ testInternalGet (bool contiguous)
 }
 
 
-static int
-testMultithreadedGet ()
+static unsigned int
+testMultithreadedGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -356,7 +355,7 @@ testMultithreadedGet ()
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
                         | MHD_USE_AUTO,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_cont, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
@@ -367,7 +366,7 @@ testMultithreadedGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -404,14 +403,14 @@ testMultithreadedGet ()
 }
 
 
-static int
-testMultithreadedPoolGet ()
+static unsigned int
+testMultithreadedPoolGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -427,7 +426,7 @@ testMultithreadedPoolGet ()
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
                         | MHD_USE_AUTO,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        port, NULL, NULL, &ahc_cont, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -440,7 +439,7 @@ testMultithreadedPoolGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -477,8 +476,8 @@ testMultithreadedPoolGet ()
 }
 
 
-static int
-testExternalGet ()
+static unsigned int
+testExternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -498,7 +497,7 @@ testExternalGet ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -514,7 +513,7 @@ testExternalGet ()
   cbc.size = sizeof(readbuf);
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_cont, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
@@ -525,7 +524,7 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -660,15 +659,15 @@ testExternalGet ()
 }
 
 
-static int
-testUnknownPortGet ()
+static unsigned int
+testUnknownPortGet (void)
 {
   struct MHD_Daemon *d;
   const union MHD_DaemonInfo *di;
   CURL *c;
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
   char buf[2048];
 
   struct sockaddr_in addr;
@@ -682,7 +681,7 @@ testUnknownPortGet ()
   cbc.size = sizeof(readbuf);
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        0, NULL, NULL, &ahc_echo, "GET",
+                        0, NULL, NULL, &ahc_cont, NULL,
                         MHD_OPTION_SOCK_ADDR, &addr,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -699,7 +698,7 @@ testUnknownPortGet ()
 
     if (addr.sin_family != AF_INET)
       return 26214;
-    port = (int) ntohs (addr.sin_port);
+    port = ntohs (addr.sin_port);
   }
   else
   {
@@ -709,11 +708,11 @@ testUnknownPortGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
-  snprintf (buf, sizeof(buf), "http://127.0.0.1:%d/";,
-            port);
+  snprintf (buf, sizeof(buf), "http://127.0.0.1:%u/";,
+            (unsigned int) port);
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, buf);
diff --git a/src/testcurl/test_get_response_cleanup.c 
b/src/testcurl/test_get_response_cleanup.c
index ededc88b..442f9f25 100644
--- a/src/testcurl/test_get_response_cleanup.c
+++ b/src/testcurl/test_get_response_cleanup.c
@@ -125,14 +125,13 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
+  (void) cls;
   (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);
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -153,12 +152,12 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalGet ()
+static unsigned int
+testInternalGet (void)
 {
   struct MHD_Daemon *d;
   pid_t curl;
-  int port;
+  uint16_t port;
   char url[127];
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -172,7 +171,7 @@ testInternalGet ()
 
   ok = 1;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -183,12 +182,12 @@ testInternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/";,
-            port);
+            "http://127.0.0.1:%u/";,
+            (unsigned int) port);
   curl = fork_curl (url);
   (void) sleep (1);
   kill_curl (curl);
@@ -201,12 +200,12 @@ testInternalGet ()
 }
 
 
-static int
-testMultithreadedGet ()
+static unsigned int
+testMultithreadedGet (void)
 {
   struct MHD_Daemon *d;
   pid_t curl;
-  int port;
+  uint16_t port;
   char url[127];
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -221,7 +220,7 @@ testMultithreadedGet ()
   ok = 1;
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 2,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -234,12 +233,12 @@ testMultithreadedGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/";,
-            port);
+            "http://127.0.0.1:%u/";,
+            (unsigned int) port);
   // fprintf (stderr, "Forking cURL!\n");
   curl = fork_curl (url);
   (void) sleep (1);
@@ -264,12 +263,12 @@ testMultithreadedGet ()
 }
 
 
-static int
-testMultithreadedPoolGet ()
+static unsigned int
+testMultithreadedPoolGet (void)
 {
   struct MHD_Daemon *d;
   pid_t curl;
-  int port;
+  uint16_t port;
   char url[127];
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -283,7 +282,7 @@ testMultithreadedPoolGet ()
 
   ok = 1;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -296,12 +295,12 @@ testMultithreadedPoolGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/";,
-            port);
+            "http://127.0.0.1:%u/";,
+            (unsigned int) port);
   curl = fork_curl (url);
   (void) sleep (1);
   kill_curl (curl);
@@ -314,8 +313,8 @@ testMultithreadedPoolGet ()
 }
 
 
-static int
-testExternalGet ()
+static unsigned int
+testExternalGet (void)
 {
   struct MHD_Daemon *d;
   fd_set rs;
@@ -325,7 +324,7 @@ testExternalGet ()
   time_t start;
   struct timeval tv;
   pid_t curl;
-  int port;
+  uint16_t port;
   char url[127];
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -339,7 +338,7 @@ testExternalGet ()
 
   ok = 1;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
@@ -350,12 +349,12 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/";,
-            port);
+            "http://127.0.0.1:%u/";,
+            (unsigned int) port);
   curl = fork_curl (url);
 
   start = time (NULL);
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index 4ca57e23..3e424b10 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -87,14 +87,14 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
   int fd;
+  (void) cls;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
   (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -119,15 +119,15 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalGet ()
+static unsigned int
+testInternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -142,7 +142,7 @@ testInternalGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -153,7 +153,7 @@ testInternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -190,15 +190,15 @@ testInternalGet ()
 }
 
 
-static int
-testMultithreadedGet ()
+static unsigned int
+testMultithreadedGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -214,7 +214,7 @@ testMultithreadedGet ()
   cbc.pos = 0;
   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);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
@@ -225,7 +225,7 @@ testMultithreadedGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -262,15 +262,15 @@ testMultithreadedGet ()
 }
 
 
-static int
-testMultithreadedPoolGet ()
+static unsigned int
+testMultithreadedPoolGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -285,7 +285,7 @@ testMultithreadedPoolGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -298,7 +298,7 @@ testMultithreadedPoolGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -335,8 +335,8 @@ testMultithreadedPoolGet ()
 }
 
 
-static int
-testExternalGet ()
+static unsigned int
+testExternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -357,7 +357,7 @@ testExternalGet ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -373,7 +373,7 @@ testExternalGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
@@ -384,7 +384,7 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/";);
@@ -526,8 +526,8 @@ testExternalGet ()
 }
 
 
-static int
-testUnknownPortGet ()
+static unsigned int
+testUnknownPortGet (void)
 {
   struct MHD_Daemon *d;
   const union MHD_DaemonInfo *di;
@@ -535,7 +535,7 @@ testUnknownPortGet ()
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   struct sockaddr_in addr;
   socklen_t addr_len = sizeof(addr);
@@ -548,7 +548,7 @@ testUnknownPortGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        0, NULL, NULL, &ahc_echo, "GET",
+                        0, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_SOCK_ADDR, &addr,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -565,7 +565,7 @@ testUnknownPortGet ()
 
     if (addr.sin_family != AF_INET)
       return 26214;
-    port = (int) ntohs (addr.sin_port);
+    port = (uint16_t) ntohs (addr.sin_port);
   }
   else
   {
@@ -575,11 +575,11 @@ testUnknownPortGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
-  snprintf (buf, sizeof(buf), "http://127.0.0.1:%d/";,
-            port);
+  snprintf (buf, sizeof(buf), "http://127.0.0.1:%u/";,
+            (unsigned int) port);
 
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, buf);
diff --git a/src/testcurl/test_get_wait.c b/src/testcurl/test_get_wait.c
index 708c82bd..a382a798 100644
--- a/src/testcurl/test_get_wait.c
+++ b/src/testcurl/test_get_wait.c
@@ -89,12 +89,12 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   enum MHD_Result ret;
+  (void) cls;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
   (void) upload_data; (void) upload_data_size;     /* Unused. Silent compiler 
warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -116,12 +116,12 @@ thread_gets (void *param)
   CURLcode errornum;
   unsigned int i;
   char url[64];
-  int port = (int) (intptr_t) param;
+  uint16_t port = (uint16_t) (intptr_t) param;
 
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d/hello_world";,
-            port);
+            "http://127.0.0.1:%u/hello_world";,
+            (unsigned int) port);
 
   c = curl_easy_init ();
   if (NULL == c)
@@ -156,8 +156,8 @@ thread_gets (void *param)
 }
 
 
-static int
-testRunWaitGet (int port, int poll_flag)
+static unsigned int
+testRunWaitGet (uint16_t port, uint32_t poll_flag)
 {
   pthread_t get_tid;
   struct MHD_Daemon *d;
@@ -175,8 +175,8 @@ testRunWaitGet (int port, int poll_flag)
   printf ("Starting MHD_run_wait() test with MHD in %s polling mode.\n",
           test_desc);
   signal_done = 0;
-  d = MHD_start_daemon (MHD_USE_ERROR_LOG | poll_flag,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+  d = MHD_start_daemon (MHD_USE_ERROR_LOG | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     abort ();
   if (0 == port)
@@ -185,7 +185,7 @@ testRunWaitGet (int port, int poll_flag)
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
     if ((NULL == dinfo) || (0 == dinfo->port) )
       abort ();
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   if (0 != pthread_create (&get_tid, NULL,
@@ -214,7 +214,7 @@ testRunWaitGet (int port, int poll_flag)
 int
 main (int argc, char *const *argv)
 {
-  int port = 1675;
+  uint16_t port = 1675;
   (void) argc;   /* Unused. Silent compiler warning. */
 
   if ((NULL == argv) || (0 == argv[0]))
@@ -224,9 +224,8 @@ main (int argc, char *const *argv)
     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);
+  response = MHD_create_response_from_buffer_static (strlen ("/hello_world"),
+                                                     "/hello_world");
   testRunWaitGet (port++, 0);
   if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL))
     testRunWaitGet (port++, MHD_USE_EPOLL);
diff --git a/src/testcurl/test_head.c b/src/testcurl/test_head.c
index f435a4f4..6ce78217 100644
--- a/src/testcurl/test_head.c
+++ b/src/testcurl/test_head.c
@@ -435,7 +435,7 @@ setCURL_rq_path (CURL *c, int uri_exist)
 
 
 static CURL *
-setupCURL (void *cbc, unsigned int port,
+setupCURL (void *cbc, uint16_t port,
            struct headers_check_result *hdr_chk_result)
 {
   CURL *c;
@@ -715,7 +715,7 @@ testHead (void)
   cbc.size = sizeof (buf);
   cbc.pos = 0;
   memset (cbc.buf, 0, cbc.size);
-  c = setupCURL (&cbc, (unsigned int) port, &rp_headers_check);
+  c = setupCURL (&cbc, port, &rp_headers_check);
   setCURL_rq_path (c, 1);
   multi_reuse = NULL;
   /* First request */
diff --git a/src/testcurl/test_iplimit.c b/src/testcurl/test_iplimit.c
index 509e3955..f60876e3 100644
--- a/src/testcurl/test_iplimit.c
+++ b/src/testcurl/test_iplimit.c
@@ -85,12 +85,12 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
+  (void) cls;
   (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -98,9 +98,8 @@ ahc_echo (void *cls,
     return MHD_YES;
   }
   *req_cls = NULL;
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -109,15 +108,15 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testMultithreadedGet ()
+static unsigned int
+testMultithreadedGet (void)
 {
   struct MHD_Daemon *d;
   char buf[2048];
   int k;
   unsigned int success;
   unsigned int failure;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -134,7 +133,7 @@ testMultithreadedGet ()
 
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
                         port, NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -147,7 +146,7 @@ testMultithreadedGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   for (k = 0; k < 3; ++k)
@@ -224,13 +223,13 @@ testMultithreadedGet ()
 }
 
 
-static int
-testMultithreadedPoolGet ()
+static unsigned int
+testMultithreadedPoolGet (void)
 {
   struct MHD_Daemon *d;
   char buf[2048];
   int k;
-  int port;
+  uint16_t port;
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
@@ -245,7 +244,7 @@ testMultithreadedPoolGet ()
     return 0;
 
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
@@ -259,7 +258,7 @@ testMultithreadedPoolGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   for (k = 0; k < 3; ++k)
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
index 161e0f0b..c46e120a 100644
--- a/src/testcurl/test_large_put.c
+++ b/src/testcurl/test_large_put.c
@@ -168,7 +168,7 @@ struct CBC
   size_t size;
 };
 
-char *
+static char *
 alloc_init (size_t buf_size)
 {
   static const char template[] =
@@ -286,9 +286,9 @@ ahc_echo (void *cls,
       *done = 1;   /* Whole request is processed. */
     return MHD_YES;
   }
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response =
+    MHD_create_response_from_buffer_copy (strlen (url),
+                                          (const void *) url);
   if (NULL == response)
     mhdErrorExitDesc ("Failed to create response");
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
@@ -297,7 +297,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testPutInternalThread (unsigned int add_flag)
 {
   struct MHD_Daemon *d;
@@ -307,7 +307,7 @@ testPutInternalThread (unsigned int add_flag)
   int done_flag = 0;
   CURLcode errornum;
   char buf[2048];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -338,7 +338,7 @@ testPutInternalThread (unsigned int add_flag)
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
     if ((NULL == dinfo) || (0 == dinfo->port) )
       mhdErrorExit ();
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   c = curl_easy_init ();
@@ -402,7 +402,7 @@ testPutInternalThread (unsigned int add_flag)
 }
 
 
-static int
+static unsigned int
 testPutThreadPerConn (unsigned int add_flag)
 {
   struct MHD_Daemon *d;
@@ -412,7 +412,7 @@ testPutThreadPerConn (unsigned int add_flag)
   int done_flag = 0;
   CURLcode errornum;
   char buf[2048];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -444,7 +444,7 @@ testPutThreadPerConn (unsigned int add_flag)
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
     if ((NULL == dinfo) || (0 == dinfo->port) )
       mhdErrorExit ();
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   c = curl_easy_init ();
@@ -507,7 +507,7 @@ testPutThreadPerConn (unsigned int add_flag)
 }
 
 
-static int
+static unsigned int
 testPutThreadPool (unsigned int add_flag)
 {
   struct MHD_Daemon *d;
@@ -517,7 +517,7 @@ testPutThreadPool (unsigned int add_flag)
   int done_flag = 0;
   CURLcode errornum;
   char buf[2048];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -549,7 +549,7 @@ testPutThreadPool (unsigned int add_flag)
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
     if ((NULL == dinfo) || (0 == dinfo->port) )
       mhdErrorExit ();
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   c = curl_easy_init ();
@@ -611,7 +611,7 @@ testPutThreadPool (unsigned int add_flag)
 }
 
 
-static int
+static unsigned int
 testPutExternal (void)
 {
   struct MHD_Daemon *d;
@@ -629,7 +629,7 @@ testPutExternal (void)
   size_t pos = 0;
   int done_flag = 0;
   char buf[2048];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -660,7 +660,7 @@ testPutExternal (void)
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
     if ((NULL == dinfo) || (0 == dinfo->port) )
       mhdErrorExit ();
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   c = curl_easy_init ();
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c
index e7450d92..6ed8d78d 100644
--- a/src/testcurl/test_long_header.c
+++ b/src/testcurl/test_long_header.c
@@ -80,24 +80,23 @@ ahc_echo (void *cls,
           const char *upload_data, size_t *upload_data_size,
           void **req_cls)
 {
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
+  (void) cls;
   (void) version; (void) upload_data;      /* Unused. Silent compiler warning. 
*/
   (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. 
*/
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
 }
 
 
-static int
+static unsigned int
 testLongUrlGet (size_t buff_size)
 {
   struct MHD_Daemon *d;
@@ -106,28 +105,27 @@ testLongUrlGet (size_t buff_size)
   struct CBC cbc;
   char *url;
   long code;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
   {
-    port = 1330 + buff_size % 20;
+    port = 1330 + (uint16_t) (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, NULL,
+                      MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+                      (size_t) buff_size, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -138,7 +136,7 @@ testLongUrlGet (size_t buff_size)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   url = malloc (VERY_LONG);
@@ -189,7 +187,7 @@ testLongUrlGet (size_t buff_size)
 }
 
 
-static int
+static unsigned int
 testLongHeaderGet (size_t buff_size)
 {
   struct MHD_Daemon *d;
@@ -199,13 +197,13 @@ testLongHeaderGet (size_t buff_size)
   char *url;
   long code;
   struct curl_slist *header = NULL;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
   {
-    port = 1331 + buff_size % 20;
+    port = 1331 + (uint16_t) (buff_size % 20);
     if (oneone)
       port += 5;
   }
@@ -213,15 +211,14 @@ testLongHeaderGet (size_t buff_size)
   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, NULL,
+                      MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+                      (size_t) buff_size, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
@@ -232,7 +229,7 @@ testLongHeaderGet (size_t buff_size)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   url = malloc (VERY_LONG);
diff --git a/src/testcurl/test_parse_cookies.c 
b/src/testcurl/test_parse_cookies.c
index 7de83c32..835e8934 100644
--- a/src/testcurl/test_parse_cookies.c
+++ b/src/testcurl/test_parse_cookies.c
@@ -146,7 +146,7 @@ ahc_echo (void *cls,
 
 
 /* Re-use the same port for all checks */
-static unsigned int port;
+static uint16_t port;
 
 static unsigned int
 testExternalGet (int test_number)
@@ -188,7 +188,7 @@ testExternalGet (int test_number)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
diff --git a/src/testcurl/test_patch.c b/src/testcurl/test_patch.c
index 100242a5..d5608335 100644
--- a/src/testcurl/test_patch.c
+++ b/src/testcurl/test_patch.c
@@ -58,8 +58,8 @@ struct CBC
 static size_t
 putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
 {
-  unsigned int *pos = ptr;
-  unsigned int wrt;
+  size_t *pos = ptr;
+  size_t wrt;
 
   wrt = size * nmemb;
   if (wrt > 8 - (*pos))
@@ -115,8 +115,8 @@ ahc_echo (void *cls,
     *done = 1;
     return MHD_YES;
   }
-  response = MHD_create_response_from_buffer (strlen (url), (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
@@ -126,7 +126,7 @@ ahc_echo (void *cls,
 static CURL *
 setup_curl (long port,
             struct CBC *cbc,
-            unsigned int *pos)
+            size_t *pos)
 {
   CURL *c;
 
@@ -156,17 +156,17 @@ setup_curl (long port,
 }
 
 
-static int
-testInternalPut ()
+static unsigned int
+testInternalPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -193,7 +193,7 @@ testInternalPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = setup_curl (port, &cbc, &pos);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
@@ -215,17 +215,17 @@ testInternalPut ()
 }
 
 
-static int
-testMultithreadedPut ()
+static unsigned int
+testMultithreadedPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -253,7 +253,7 @@ testMultithreadedPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = setup_curl (port, &cbc, &pos);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
@@ -276,17 +276,17 @@ testMultithreadedPut ()
 }
 
 
-static int
-testMultithreadedPoolPut ()
+static unsigned int
+testMultithreadedPoolPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -315,7 +315,7 @@ testMultithreadedPoolPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = setup_curl (port, &cbc, &pos);
   if (CURLE_OK != (errornum = curl_easy_perform (c)))
@@ -338,8 +338,8 @@ testMultithreadedPoolPut ()
 }
 
 
-static int
-testExternalPut ()
+static unsigned int
+testExternalPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -356,9 +356,9 @@ testExternalPut ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -386,7 +386,7 @@ testExternalPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = setup_curl (port, &cbc, &pos);
 
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c
index e36391fd..1102da5a 100644
--- a/src/testcurl/test_post.c
+++ b/src/testcurl/test_post.c
@@ -137,9 +137,9 @@ ahc_echo (void *cls,
   enum MHD_Result ret;
   (void) cls; (void) version;      /* Unused. Silent compiler warning. */
 
-  if (0 != strcmp ("POST", method))
+  if (0 != strcmp (MHD_HTTP_METHOD_POST, method))
   {
-    printf ("METHOD: %s\n", method);
+    fprintf (stderr, "METHOD: %s\n", method);
     return MHD_NO;              /* unexpected method */
   }
   pp = *req_cls;
@@ -152,9 +152,8 @@ ahc_echo (void *cls,
   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);
+    response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                     (const void *) url);
     ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
     MHD_destroy_response (response);
     MHD_destroy_post_processor (pp);
@@ -166,15 +165,15 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalPost ()
+static unsigned int
+testInternalPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -202,7 +201,7 @@ testInternalPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -242,15 +241,15 @@ testInternalPost ()
 }
 
 
-static int
-testMultithreadedPost ()
+static unsigned int
+testMultithreadedPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -279,7 +278,7 @@ testMultithreadedPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -319,15 +318,15 @@ testMultithreadedPost ()
 }
 
 
-static int
-testMultithreadedPoolPost ()
+static unsigned int
+testMultithreadedPoolPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -356,7 +355,7 @@ testMultithreadedPoolPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -396,8 +395,8 @@ testMultithreadedPoolPost ()
 }
 
 
-static int
-testExternalPost ()
+static unsigned int
+testExternalPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -418,7 +417,7 @@ testExternalPost ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -447,7 +446,7 @@ testExternalPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -608,7 +607,8 @@ ahc_cancel (void *cls,
 
   if (*req_cls == NULL)
   {
-    *req_cls = "wibble";
+    static int marker = 1;
+    *req_cls = &marker;
     /* We don't want the body. Send a 500. */
     response = MHD_create_response_empty (MHD_RF_NONE);
     ret = MHD_queue_response (connection, 500, response);
@@ -666,7 +666,7 @@ slowReadBuffer (void *p, size_t size, size_t nmemb, void 
*opaque)
 #define FLAG_COUNT 16
 
 
-static int
+static unsigned int
 testMultithreadedPostCancelPart (int flags)
 {
   struct MHD_Daemon *d;
@@ -677,9 +677,9 @@ testMultithreadedPostCancelPart (int flags)
   struct curl_slist *headers = NULL;
   long response_code;
   CURLcode cc;
-  int result = 0;
+  unsigned int result = 0;
   struct CRBC crbc;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -712,7 +712,7 @@ testMultithreadedPostCancelPart (int flags)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   crbc.buffer = "Test content";
@@ -768,8 +768,8 @@ testMultithreadedPostCancelPart (int flags)
 #endif /* ! _WIN32 */
     {
       fprintf (stderr,
-               "flibbet curl_easy_perform didn't fail as expected: `%s' %d\n",
-               curl_easy_strerror (errornum), errornum);
+               "flibbet curl_easy_perform didn't fail as expected: `%s' %u\n",
+               curl_easy_strerror (errornum), (unsigned int) errornum);
       result = 65536;
     }
     curl_easy_cleanup (c);
@@ -802,10 +802,10 @@ testMultithreadedPostCancelPart (int flags)
 }
 
 
-static int
-testMultithreadedPostCancel ()
+static unsigned int
+testMultithreadedPostCancel (void)
 {
-  int result = 0;
+  unsigned int result = 0;
   int flags;
   for (flags = 0; flags < FLAG_COUNT; ++flags)
     result |= testMultithreadedPostCancelPart (flags);
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index f9238faa..8a7e0d05 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -33,7 +33,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include "gauger.h"
 #include "mhd_has_in_name.h"
 
 #ifndef WINDOWS
@@ -118,8 +117,8 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalPost ()
+static unsigned int
+testInternalPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -128,7 +127,7 @@ testInternalPost ()
   CURLcode errornum;
   int i;
   char url[1024];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -153,7 +152,7 @@ testInternalPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   for (i = 0; i < LOOPCOUNT; i++)
   {
@@ -164,8 +163,8 @@ testInternalPost ()
     buf[0] = '\0';
     snprintf (url,
               sizeof (url),
-              "http://127.0.0.1:%d/hw%d";,
-              port,
+              "http://127.0.0.1:%u/hw%d";,
+              (unsigned int) port,
               i);
     curl_easy_setopt (c, CURLOPT_URL, url);
     curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
@@ -207,8 +206,8 @@ testInternalPost ()
 }
 
 
-static int
-testMultithreadedPost ()
+static unsigned int
+testMultithreadedPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -217,7 +216,7 @@ testMultithreadedPost ()
   CURLcode errornum;
   int i;
   char url[1024];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -245,7 +244,7 @@ testMultithreadedPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   for (i = 0; i < LOOPCOUNT; i++)
   {
@@ -256,8 +255,8 @@ testMultithreadedPost ()
     buf[0] = '\0';
     snprintf (url,
               sizeof (url),
-              "http://127.0.0.1:%d/hw%d";,
-              port,
+              "http://127.0.0.1:%u/hw%d";,
+              (unsigned int) port,
               i);
     curl_easy_setopt (c, CURLOPT_URL, url);
     curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
@@ -299,8 +298,8 @@ testMultithreadedPost ()
 }
 
 
-static int
-testMultithreadedPoolPost ()
+static unsigned int
+testMultithreadedPoolPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -309,7 +308,7 @@ testMultithreadedPoolPost ()
   CURLcode errornum;
   int i;
   char url[1024];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -336,7 +335,7 @@ testMultithreadedPoolPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   for (i = 0; i < LOOPCOUNT; i++)
   {
@@ -347,8 +346,8 @@ testMultithreadedPoolPost ()
     buf[0] = '\0';
     snprintf (url,
               sizeof (url),
-              "http://127.0.0.1:%d/hw%d";,
-              port,
+              "http://127.0.0.1:%u/hw%d";,
+              (unsigned int) port,
               i);
     curl_easy_setopt (c, CURLOPT_URL, url);
     curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
@@ -390,8 +389,8 @@ testMultithreadedPoolPost ()
 }
 
 
-static int
-testExternalPost ()
+static unsigned int
+testExternalPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -416,7 +415,7 @@ testExternalPost ()
   uint64_t timeout64;
   long ctimeout;
   char url[1024];
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -443,7 +442,7 @@ testExternalPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   multi = curl_multi_init ();
   if (multi == NULL)
@@ -460,8 +459,8 @@ testExternalPost ()
     buf[0] = '\0';
     snprintf (url,
               sizeof (url),
-              "http://127.0.0.1:%d/hw%d";,
-              port,
+              "http://127.0.0.1:%u/hw%d";,
+              (unsigned int) port,
               i);
     curl_easy_setopt (c, CURLOPT_URL, url);
     curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
@@ -523,8 +522,12 @@ testExternalPost ()
         timeout64 = (uint64_t) ctimeout;
       if (0 == running)
         timeout64 = 0; /* terminate quickly... */
-      tv.tv_sec = timeout64 / 1000;
-      tv.tv_usec = (timeout64 % 1000) * 1000;
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+      tv.tv_sec = (time_t) (timeout64 / 1000);
+#else  /* Native W32 */
+      tv.tv_sec = (long) (timeout64 / 1000);
+#endif /* Native W32 */
+      tv.tv_usec = (long) (1000 * (timeout64 % 1000));
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
       {
 #ifdef MHD_POSIX_SOCKETS
@@ -612,7 +615,7 @@ static unsigned long long start_time;
  * @return current time in ms
  */
 static unsigned long long
-now ()
+now (void)
 {
   struct timeval tv;
 
@@ -641,36 +644,24 @@ main (int argc, char *const *argv)
              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");
+             (double) 1000 * LOOPCOUNT
+             / ((double) (now () - start_time) + 1.0));
     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");
+             (double) 1000 * LOOPCOUNT
+             / ((double) (now () - start_time) + 1.0));
     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");
+             (double) 1000 * LOOPCOUNT
+             / ((double) (now () - start_time) + 1.0));
   }
   start_time = now ();
   errorCount += testExternalPost ();
@@ -678,12 +669,8 @@ main (int argc, char *const *argv)
            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");
+           (double) 1000 * LOOPCOUNT
+           / ((double) (now () - start_time) + 1.0));
   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 1ada80e2..e46250af 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -160,9 +160,8 @@ ahc_echo (void *cls,
     abort ();
   if ((eok == 3) && (0 == *upload_data_size))
   {
-    response = MHD_create_response_from_buffer (strlen (url),
-                                                (void *) url,
-                                                MHD_RESPMEM_MUST_COPY);
+    response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                     (const void *) url);
     ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
     MHD_destroy_response (response);
     MHD_destroy_post_processor (pp);
@@ -175,7 +174,7 @@ ahc_echo (void *cls,
 
 
 static struct curl_httppost *
-make_form ()
+make_form (void)
 {
   struct curl_httppost *post = NULL;
   struct curl_httppost *last = NULL;
@@ -188,8 +187,8 @@ make_form ()
 }
 
 
-static int
-testInternalPost ()
+static unsigned int
+testInternalPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -197,7 +196,7 @@ testInternalPost ()
   struct CBC cbc;
   CURLcode errornum;
   struct curl_httppost *pd;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -225,7 +224,7 @@ testInternalPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -266,8 +265,8 @@ testInternalPost ()
 }
 
 
-static int
-testMultithreadedPost ()
+static unsigned int
+testMultithreadedPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -275,7 +274,7 @@ testMultithreadedPost ()
   struct CBC cbc;
   CURLcode errornum;
   struct curl_httppost *pd;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -304,7 +303,7 @@ testMultithreadedPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -345,8 +344,8 @@ testMultithreadedPost ()
 }
 
 
-static int
-testMultithreadedPoolPost ()
+static unsigned int
+testMultithreadedPoolPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -354,7 +353,7 @@ testMultithreadedPoolPost ()
   struct CBC cbc;
   CURLcode errornum;
   struct curl_httppost *pd;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -383,7 +382,7 @@ testMultithreadedPoolPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -424,8 +423,8 @@ testMultithreadedPoolPost ()
 }
 
 
-static int
-testExternalPost ()
+static unsigned int
+testExternalPost (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -447,7 +446,7 @@ testExternalPost ()
   time_t start;
   struct timeval tv;
   struct curl_httppost *pd;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -476,7 +475,7 @@ testExternalPost ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
diff --git a/src/testcurl/test_process_arguments.c 
b/src/testcurl/test_process_arguments.c
index 24d5e72f..9aa713dc 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -72,13 +72,13 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
   const char *hdr;
+  (void) cls;
   (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -101,9 +101,8 @@ ahc_echo (void *cls,
                                       MHD_GET_ARGUMENT_KIND,
                                       NULL, NULL))
     abort ();
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -112,8 +111,8 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testExternalGet ()
+static unsigned int
+testExternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -134,7 +133,7 @@ testExternalGet ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -150,7 +149,7 @@ testExternalGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
@@ -161,7 +160,7 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL,
diff --git a/src/testcurl/test_process_headers.c 
b/src/testcurl/test_process_headers.c
index 98b08fbc..721e3073 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -92,13 +92,13 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
   const char *hdr;
+  (void) cls;
   (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -128,9 +128,8 @@ ahc_echo (void *cls,
   if ((hdr == NULL) || (0 != strcmp (hdr, "NowPresent")))
     abort ();
 
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   if (NULL == response)
     abort ();
   MHD_add_response_header (response, "MyHeader", "MyValue");
@@ -153,15 +152,15 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalGet ()
+static unsigned int
+testInternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -176,7 +175,7 @@ testInternalGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -187,7 +186,7 @@ testInternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -224,15 +223,15 @@ testInternalGet ()
 }
 
 
-static int
-testMultithreadedGet ()
+static unsigned int
+testMultithreadedGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -248,7 +247,7 @@ testMultithreadedGet ()
   cbc.pos = 0;
   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);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 16;
   if (0 == port)
@@ -259,7 +258,7 @@ testMultithreadedGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -296,15 +295,15 @@ testMultithreadedGet ()
 }
 
 
-static int
-testMultithreadedPoolGet ()
+static unsigned int
+testMultithreadedPoolGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -319,7 +318,7 @@ testMultithreadedPoolGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET",
+                        port, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
@@ -332,7 +331,7 @@ testMultithreadedPoolGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -369,8 +368,8 @@ testMultithreadedPoolGet ()
 }
 
 
-static int
-testExternalGet ()
+static unsigned int
+testExternalGet (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -391,7 +390,7 @@ testExternalGet ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -407,7 +406,7 @@ testExternalGet ()
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 256;
   if (0 == port)
@@ -418,7 +417,7 @@ testExternalGet ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index 761e1c5f..bc16ef52 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -58,8 +58,8 @@ struct CBC
 static size_t
 putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
 {
-  unsigned int *pos = ptr;
-  unsigned int wrt;
+  size_t *pos = ptr;
+  size_t wrt;
 
   wrt = size * nmemb;
   if (wrt > 8 - (*pos))
@@ -115,25 +115,25 @@ ahc_echo (void *cls,
     *done = 1;
     return MHD_YES;
   }
-  response = MHD_create_response_from_buffer (strlen (url), (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
 }
 
 
-static int
-testInternalPut ()
+static unsigned int
+testInternalPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -160,7 +160,7 @@ testInternalPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -201,17 +201,17 @@ testInternalPut ()
 }
 
 
-static int
-testMultithreadedPut ()
+static unsigned int
+testMultithreadedPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -239,7 +239,7 @@ testMultithreadedPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -281,17 +281,17 @@ testMultithreadedPut ()
 }
 
 
-static int
-testMultithreadedPoolPut ()
+static unsigned int
+testMultithreadedPoolPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -320,7 +320,7 @@ testMultithreadedPoolPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -362,8 +362,8 @@ testMultithreadedPoolPut ()
 }
 
 
-static int
-testExternalPut ()
+static unsigned int
+testExternalPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -380,9 +380,9 @@ testExternalPut ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -410,7 +410,7 @@ testExternalPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
diff --git a/src/testcurl/test_put_chunked.c b/src/testcurl/test_put_chunked.c
index 5820f2e0..3ec998d8 100644
--- a/src/testcurl/test_put_chunked.c
+++ b/src/testcurl/test_put_chunked.c
@@ -56,8 +56,8 @@ struct CBC
 static size_t
 putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
 {
-  unsigned int *pos = ptr;
-  unsigned int wrt;
+  size_t *pos = ptr;
+  size_t wrt;
 
   wrt = size * nmemb;
   if (wrt > 8 - (*pos))
@@ -92,10 +92,10 @@ ahc_echo (void *cls,
           const char *upload_data, size_t *upload_data_size,
           void **req_cls)
 {
-  int *done = cls;
+  size_t *done = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
-  int have;
+  size_t have;
   (void) version; (void) req_cls;   /* Unused. Silent compiler warning. */
 
   if (0 != strcmp ("PUT", method))
@@ -125,26 +125,25 @@ ahc_echo (void *cls,
 #endif
     return MHD_YES;
   }
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
 }
 
 
-static int
-testInternalPut ()
+static unsigned int
+testInternalPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
-  int done_flag = 0;
+  size_t pos = 0;
+  size_t done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -167,7 +166,7 @@ testInternalPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -208,17 +207,17 @@ testInternalPut ()
 }
 
 
-static int
-testMultithreadedPut ()
+static unsigned int
+testMultithreadedPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
-  int done_flag = 0;
+  size_t pos = 0;
+  size_t done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -242,7 +241,7 @@ testMultithreadedPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -284,17 +283,17 @@ testMultithreadedPut ()
 }
 
 
-static int
-testMultithreadedPoolPut ()
+static unsigned int
+testMultithreadedPoolPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
-  int done_flag = 0;
+  size_t pos = 0;
+  size_t done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -319,7 +318,7 @@ testMultithreadedPoolPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -361,8 +360,8 @@ testMultithreadedPoolPut ()
 }
 
 
-static int
-testExternalPut ()
+static unsigned int
+testExternalPut (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -383,9 +382,9 @@ testExternalPut ()
   struct CURLMsg *msg;
   time_t start;
   struct timeval tv;
-  unsigned int pos = 0;
-  int done_flag = 0;
-  int port;
+  size_t pos = 0;
+  size_t done_flag = 0;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -409,7 +408,7 @@ testExternalPut ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c
index f7703db7..6bd6967f 100644
--- a/src/testcurl/test_quiesce.c
+++ b/src/testcurl/test_quiesce.c
@@ -219,7 +219,7 @@ _checkCURLE_OK_func (CURLcode code, const char *curlFunc,
 /* Global parameters */
 static int verbose;                 /**< Be verbose */
 static int oneone;                  /**< If false use HTTP/1.0 for requests*/
-static int global_port;             /**< MHD daemons listen port number */
+static uint16_t global_port;        /**< MHD daemons listen port number */
 
 struct CBC
 {
@@ -251,11 +251,11 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
+  (void) cls;
   (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
   {
     fprintf (stderr, "Unexpected HTTP method '%s'. ", method);
     externalErrorExit ();
@@ -266,9 +266,8 @@ ahc_echo (void *cls,
     return MHD_YES;
   }
   *req_cls = NULL;
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   if (NULL == response)
     mhdErrorExitDesc ("MHD_create_response failed");
   /* Make sure that connection will not be reused */
@@ -317,7 +316,7 @@ ServeOneRequest (void *param)
   fd = *((MHD_socket *) param);
 
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        0, NULL, NULL, &ahc_echo, "GET",
+                        0, NULL, NULL, &ahc_echo, NULL,
                         MHD_OPTION_LISTEN_SOCKET, fd,
                         MHD_OPTION_NOTIFY_COMPLETED, &request_completed, &done,
                         MHD_OPTION_END);
@@ -395,8 +394,8 @@ setupCURL (void *cbc)
 }
 
 
-static int
-testGet (int type, int pool_count, int poll_flag)
+static unsigned int
+testGet (unsigned int type, int pool_count, uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -404,19 +403,20 @@ testGet (int type, int pool_count, int poll_flag)
   struct CBC cbc;
   MHD_socket fd;
   pthread_t thrd;
-  const char *thrdRet;
+  char *thrdRet;
 
   if (verbose)
-    printf ("testGet(%d, %d, %d) test started.\n",
-            type, pool_count, poll_flag);
+    printf ("testGet(%u, %d, %u) test started.\n",
+            type, pool_count, (unsigned int) poll_flag);
 
   cbc.buf = buf;
   cbc.size = sizeof(buf);
   cbc.pos = 0;
   if (pool_count > 0)
   {
-    d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag,
-                          global_port, NULL, NULL, &ahc_echo, "GET",
+    d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC
+                          | (enum MHD_FLAG) poll_flag,
+                          global_port, NULL, NULL, &ahc_echo, NULL,
                           MHD_OPTION_THREAD_POOL_SIZE,
                           (unsigned int) pool_count,
                           MHD_OPTION_END);
@@ -424,8 +424,9 @@ testGet (int type, int pool_count, int poll_flag)
   }
   else
   {
-    d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag,
-                          global_port, NULL, NULL, &ahc_echo, "GET",
+    d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC
+                          | (enum MHD_FLAG) poll_flag,
+                          global_port, NULL, NULL, &ahc_echo, NULL,
                           MHD_OPTION_END);
   }
   if (d == NULL)
@@ -436,7 +437,7 @@ testGet (int type, int pool_count, int poll_flag)
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
     if ((NULL == dinfo) || (0 == dinfo->port) )
       mhdErrorExit ();
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
 
   c = setupCURL (&cbc);
@@ -516,8 +517,8 @@ testGet (int type, int pool_count, int poll_flag)
 
   if (verbose)
   {
-    printf ("testGet(%d, %d, %d) test succeed.\n",
-            type, pool_count, poll_flag);
+    printf ("testGet(%u, %d, %u) test succeed.\n",
+            type, pool_count, (unsigned int) poll_flag);
     fflush (stdout);
   }
 
@@ -525,7 +526,7 @@ testGet (int type, int pool_count, int poll_flag)
 }
 
 
-static int
+static unsigned int
 testExternalGet (void)
 {
   struct MHD_Daemon *d;
@@ -555,7 +556,7 @@ testExternalGet (void)
   d = MHD_start_daemon (MHD_USE_ERROR_LOG,
                         global_port,
                         NULL, NULL,
-                        &ahc_echo, "GET",
+                        &ahc_echo, NULL,
                         MHD_OPTION_END);
   if (d == NULL)
     mhdErrorExitDesc ("Failed to start MHD daemon");
@@ -565,7 +566,7 @@ testExternalGet (void)
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
     if ((NULL == dinfo) || (0 == dinfo->port) )
       mhdErrorExit ();
-    global_port = (int) dinfo->port;
+    global_port = dinfo->port;
   }
 
   for (i = 0; i < 2; i++)
diff --git a/src/testcurl/test_quiesce_stream.c 
b/src/testcurl/test_quiesce_stream.c
index dbfd982b..b766012d 100644
--- a/src/testcurl/test_quiesce_stream.c
+++ b/src/testcurl/test_quiesce_stream.c
@@ -94,7 +94,7 @@ suspend_connection (struct MHD_Connection *connection)
 
 struct ContentReaderUserdata
 {
-  int bytes_written;
+  size_t bytes_written;
   struct MHD_Connection *connection;
 };
 
@@ -113,7 +113,7 @@ http_ContentReaderCallback (void *cls,
   if (userdata->bytes_written >= 1024)
   {
     fprintf (stderr,
-             "finish: %d\n",
+             "finish: %u\n",
              request_counter);
     return MHD_CONTENT_READER_END_OF_STREAM;
   }
@@ -155,7 +155,7 @@ http_AccessHandlerCallback (void *cls,
   {
     struct ContentReaderUserdata *userdata;
     fprintf (stderr,
-             "start: %d\n",
+             "start: %u\n",
              ++request_counter);
 
     userdata = malloc (sizeof(struct ContentReaderUserdata));
@@ -188,7 +188,7 @@ http_AccessHandlerCallback (void *cls,
 int
 main (void)
 {
-  int port;
+  uint16_t port;
   char command_line[1024];
   /* Flags */
   unsigned int daemon_flags
@@ -226,12 +226,12 @@ main (void)
     {
       MHD_stop_daemon (daemon); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   snprintf (command_line,
             sizeof (command_line),
-            "curl -s http://127.0.0.1:%d";,
-            port);
+            "curl -s http://127.0.0.1:%u";,
+            (unsigned int) port);
 
   if (0 != system (command_line))
   {
diff --git a/src/testcurl/test_termination.c b/src/testcurl/test_termination.c
index 239f10ec..47e873b0 100644
--- a/src/testcurl/test_termination.c
+++ b/src/testcurl/test_termination.c
@@ -98,7 +98,7 @@ int
 main (void)
 {
   struct MHD_Daemon *daemon;
-  int port;
+  uint16_t port;
   char url[255];
   CURL *curl;
   CURLcode success;
@@ -129,15 +129,15 @@ main (void)
     {
       MHD_stop_daemon (daemon); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
 
   curl = curl_easy_init ();
   /* curl_easy_setopt(curl, CURLOPT_POST, 1L); */
   snprintf (url,
             sizeof (url),
-            "http://127.0.0.1:%d";,
-            port);
+            "http://127.0.0.1:%u";,
+            (unsigned int) port);
   curl_easy_setopt (curl, CURLOPT_URL, url);
   curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, write_data);
 
diff --git a/src/testcurl/test_timeout.c b/src/testcurl/test_timeout.c
index 5c184a20..79f8c88d 100644
--- a/src/testcurl/test_timeout.c
+++ b/src/testcurl/test_timeout.c
@@ -45,7 +45,7 @@
  * Pause execution for specified number of milliseconds.
  * @param ms the number of milliseconds to sleep
  */
-void
+static void
 _MHD_sleep (uint32_t ms)
 {
 #if defined(_WIN32)
@@ -149,8 +149,8 @@ termination_cb (void *cls,
 static size_t
 putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
 {
-  unsigned int *pos = ptr;
-  unsigned int wrt;
+  size_t *pos = ptr;
+  size_t wrt;
 
   wrt = size * nmemb;
   if (wrt > 8 - (*pos))
@@ -197,7 +197,7 @@ ahc_echo (void *cls,
   enum MHD_Result ret;
   (void) version; (void) req_cls;   /* Unused. Silent compiler warning. */
 
-  if (0 != strcmp ("PUT", method))
+  if (0 != strcmp (MHD_HTTP_METHOD_PUT, method))
     return MHD_NO;              /* unexpected method */
   if ((*done) == 0)
   {
@@ -215,26 +215,25 @@ ahc_echo (void *cls,
     *done = 1;
     return MHD_YES;
   }
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   return ret;
 }
 
 
-static int
-testWithoutTimeout ()
+static unsigned int
+testWithoutTimeout (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
-  unsigned int pos = 0;
+  size_t pos = 0;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -265,7 +264,7 @@ testWithoutTimeout ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
@@ -311,8 +310,8 @@ testWithoutTimeout ()
 }
 
 
-static int
-testWithTimeout ()
+static unsigned int
+testWithTimeout (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -320,7 +319,7 @@ testWithTimeout ()
   struct CBC cbc;
   int done_flag = 0;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -351,7 +350,7 @@ testWithTimeout ()
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world";);
diff --git a/src/testcurl/test_toolarge.c b/src/testcurl/test_toolarge.c
index 42ea471f..2b94ab7b 100644
--- a/src/testcurl/test_toolarge.c
+++ b/src/testcurl/test_toolarge.c
@@ -219,7 +219,7 @@ _mhdErrorExit_func (const char *errDesc, const char 
*funcName, int lineNum)
 /* Global parameters */
 static int verbose;                 /**< Be verbose */
 static int oneone;                  /**< If false use HTTP/1.0 for requests*/
-static int global_port;             /**< MHD daemons listen port number */
+static uint16_t global_port;        /**< MHD daemons listen port number */
 static int large_req_method;        /**< Large request method */
 static int large_req_url;           /**< Large request URL */
 static int large_req_header_name; /**< Large request single header name */
@@ -256,12 +256,12 @@ test_global_cleanup (void)
 struct headers_check_result
 {
   unsigned int num_n1_headers;
-  unsigned int large_header_name_size;
-  unsigned int large_header_value_size;
+  size_t large_header_name_size;
+  size_t large_header_value_size;
   int large_header_valid;
 };
 
-size_t
+static size_t
 lcurl_hdr_callback (char *buffer, size_t size, size_t nitems,
                     void *userdata)
 {
@@ -281,7 +281,7 @@ lcurl_hdr_callback (char *buffer, size_t size, size_t 
nitems,
     if (NULL != col_ptr)
     {
       const char *const name = buffer;
-      const size_t name_len = col_ptr - buffer;
+      const size_t name_len = (size_t) (col_ptr - buffer);
       const size_t val_pos = name_len + 2;
       const size_t val_len = data_size - val_pos - 2; /* 2 = strlen("\r\n") */
       const char *const value = buffer + val_pos;
@@ -367,12 +367,12 @@ check_uri_cb (void *cls,
 struct mhd_header_checker_param
 {
   unsigned int num_n1_headers;
-  unsigned int large_header_name_size;
-  unsigned int large_header_value_size;
+  size_t large_header_name_size;
+  size_t large_header_value_size;
   int large_header_valid;
 };
 
-enum MHD_Result
+static enum MHD_Result
 headerCheckerInterator (void *cls,
                         enum MHD_ValueKind kind,
                         const char *key,
@@ -489,9 +489,9 @@ ahcCheck (void *cls,
                                        &param->header_check_param))
     mhdErrorExitDesc ("Wrong number of headers in the request");
 
-  response = MHD_create_response_from_buffer (param->rp_data_size,
-                                              (void *) param->rp_data,
-                                              MHD_RESPMEM_MUST_COPY);
+  response =
+    MHD_create_response_from_buffer_copy (param->rp_data_size,
+                                          (const void *) param->rp_data);
   if (NULL == response)
     mhdErrorExitDesc ("Failed to create response");
 
@@ -520,10 +520,10 @@ ahcCheck (void *cls,
       externalErrorExit ();
     large_hrd_name[0] = '0'; /* Name starts with zero for unique 
identification */
     for (i = 1; i < large_hdr_name_size; i++)
-      large_hrd_name[i] = 'a' + i % ('z' - 'a' + 1);
+      large_hrd_name[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1));
     large_hrd_name[large_hdr_name_size] = 0;
     for (i = 0; i < large_hdr_value_size; i++)
-      large_hrd_value[i] = 'Z' - i % ('Z' - 'A' + 1);
+      large_hrd_value[i] = 'Z' - (char) (unsigned char) (i % ('Z' - 'A' + 1));
     if (NULL != large_hrd_value)
       large_hrd_value[large_hdr_value_size] = 0;
     if (MHD_YES != MHD_add_response_header (response,
@@ -549,7 +549,7 @@ ahcCheck (void *cls,
 
 static CURL *
 curlEasyInitForTest (const char *queryPath, const char *method,
-                     int port,
+                     uint16_t port,
                      struct lcurl_data_cb_param *dcbp,
                      struct headers_check_result *hdr_chk_result,
                      struct curl_slist *headers)
@@ -701,13 +701,13 @@ struct curlQueryParams
   const char *method;
 
   /* Destination port for CURL query */
-  int queryPort;
+  uint16_t queryPort;
 
   /* List of additional request headers */
   struct curl_slist *headers;
 
   /* CURL query result error flag */
-  volatile int queryError;
+  volatile unsigned int queryError;
 
   /* Response HTTP code, zero if no response */
   volatile int responseCode;
@@ -715,7 +715,7 @@ struct curlQueryParams
 
 
 /* Returns zero for successful response and non-zero for failed response */
-static int
+static unsigned int
 doCurlQueryInThread (struct MHD_Daemon *d,
                      struct curlQueryParams *p,
                      struct headers_check_result *hdr_res,
@@ -810,13 +810,13 @@ doCurlQueryInThread (struct MHD_Daemon *d,
 
 
 /* Perform test queries, shut down MHD daemon, and free parameters */
-static int
-performTestQueries (struct MHD_Daemon *d, int d_port,
+static unsigned int
+performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
                     struct ahc_cls_type *ahc_param,
                     struct check_uri_cls *uri_cb_param)
 {
   struct curlQueryParams qParam;
-  int ret = 0;          /* Return value */
+  unsigned int ret = 0;          /* Return value */
   struct headers_check_result rp_headers_check;
   char *buf;
   size_t i;
@@ -845,7 +845,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
   if (large_req_method)
   {
     for (i = 0; i < TEST_START_SIZE; i++)
-      buf[i] = 'A' + i % ('Z' - 'A' + 1);
+      buf[i] = 'A' + (char) (unsigned char) (i % ('Z' - 'A' + 1));
     for (; i <= TEST_FAIL_SIZE; i++)
     {
       buf[i] = 0;
@@ -890,7 +890,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
       if (0 != rp_headers_check.large_header_name_size)
         mhdErrorExitDesc ("Detected unexpected large reply header");
 
-      buf[i] = 'A' + i % ('Z' - 'A' + 1);
+      buf[i] = 'A' + (char) (unsigned char) (i % ('Z' - 'A' + 1));
     }
   }
   else if (large_req_url)
@@ -901,7 +901,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
     memcpy (buf, URL_SCHEME_HOST, base_size);
     url[0] = '/';
     for (i = 1; i < TEST_START_SIZE; i++)
-      url[i] = 'a' + i % ('z' - 'a' + 1);
+      url[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1));
     for (; i <= TEST_FAIL_SIZE; i++)
     {
       url[i] = 0;
@@ -947,14 +947,14 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
       if (0 != rp_headers_check.large_header_name_size)
         mhdErrorExitDesc ("Detected unexpected large reply header");
 
-      url[i] = 'a' + i % ('z' - 'a' + 1);
+      url[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1));
     }
   }
   else if (large_req_header_name)
   {
     buf[0] = '0'; /* Name starts with zero for unique identification */
     for (i = 1; i < TEST_START_SIZE; i++)
-      buf[i] = 'a' + i % ('z' - 'a' + 1);
+      buf[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1));
     for (; i <= TEST_FAIL_SIZE; i++)
     {
       struct curl_slist *curl_headers;
@@ -1020,7 +1020,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
         mhdErrorExitDesc ("Detected unexpected large reply header");
 
       curl_slist_free_all (curl_headers);
-      buf[i] = 'a' + i % ('z' - 'a' + 1);
+      buf[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1));
     }
   }
   else if (large_req_header_value)
@@ -1029,7 +1029,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
     /* Name starts with zero for unique identification */
     memcpy (buf, "0: ", 3); /* Note: strlen(": Z") is less than 
strlen(URL_SCHEME_HOST) */
     for (i = 0; i < TEST_START_SIZE; i++)
-      hdr_value[i] = 'Z' - i % ('Z' - 'A' + 1);
+      hdr_value[i] = 'Z' - (char) (unsigned char) (i % ('Z' - 'A' + 1));
     for (; i <= TEST_FAIL_SIZE; i++)
     {
       struct curl_slist *curl_headers;
@@ -1094,7 +1094,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
         mhdErrorExitDesc ("Detected unexpected large reply header");
 
       curl_slist_free_all (curl_headers);
-      hdr_value[i] = 'Z' - i % ('Z' - 'A' + 1);
+      hdr_value[i] = 'Z' - (char) (unsigned char) (i % ('Z' - 'A' + 1));
     }
   }
   else if (large_req_headers)
@@ -1353,7 +1353,7 @@ enum testMhdPollType
 static unsigned int
 testNumThreadsForPool (enum testMhdPollType pollType)
 {
-  int numThreads = MHD_CPU_COUNT;
+  unsigned int numThreads = MHD_CPU_COUNT;
   (void) pollType; /* Don't care about pollType for this test */
   return numThreads; /* No practical limit for non-cleanup test */
 }
@@ -1361,7 +1361,7 @@ testNumThreadsForPool (enum testMhdPollType pollType)
 
 static struct MHD_Daemon *
 startTestMhdDaemon (enum testMhdThreadsType thrType,
-                    enum testMhdPollType pollType, int *pport,
+                    enum testMhdPollType pollType, uint16_t *pport,
                     struct ahc_cls_type **ahc_param,
                     struct check_uri_cls **uri_cb_param)
 {
@@ -1404,7 +1404,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
   }
 
   if (testMhdThreadInternalPool != thrType)
-    d = MHD_start_daemon (((int) thrType) | ((int) pollType)
+    d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
                           | (verbose ? MHD_USE_ERROR_LOG : 0),
                           *pport, NULL, NULL,
                           &ahcCheck, *ahc_param,
@@ -1414,7 +1414,8 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
                           (size_t) BUFFER_SIZE,
                           MHD_OPTION_END);
   else
-    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType)
+    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
+                          | ((unsigned int) pollType)
                           | (verbose ? MHD_USE_ERROR_LOG : 0),
                           *pport, NULL, NULL,
                           &ahcCheck, *ahc_param,
@@ -1440,7 +1441,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
       fprintf (stderr, "MHD_get_daemon_info() failed.\n");
       abort ();
     }
-    *pport = (int) dinfo->port;
+    *pport = dinfo->port;
     if (0 == global_port)
       global_port = *pport; /* Reuse the same port for all tests */
   }
@@ -1452,11 +1453,11 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
 /* Test runners */
 
 
-static int
+static unsigned int
 testExternalGet (void)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
@@ -1467,11 +1468,11 @@ testExternalGet (void)
 }
 
 
-static int
+static unsigned int
 testInternalGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
@@ -1482,11 +1483,11 @@ testInternalGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
@@ -1496,11 +1497,11 @@ testMultithreadedGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedPoolGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
index 5bc28323..bca27606 100644
--- a/src/testcurl/test_tricky.c
+++ b/src/testcurl/test_tricky.c
@@ -211,7 +211,7 @@ _mhdErrorExit_func (const char *errDesc, const char 
*funcName, int lineNum)
 /* Global parameters */
 static int verbose;                 /**< Be verbose */
 static int oneone;                  /**< If false use HTTP/1.0 for requests*/
-static int global_port;             /**< MHD daemons listen port number */
+static uint16_t global_port;        /**< MHD daemons listen port number */
 static int response_timeout_val = TIMEOUTS_VAL;
 
 static int tricky_url;              /**< Tricky request URL */
@@ -246,7 +246,7 @@ struct headers_check_result
 };
 
 
-size_t
+static size_t
 lcurl_hdr_callback (char *buffer, size_t size, size_t nitems,
                     void *userdata)
 {
@@ -314,7 +314,7 @@ struct mhd_header_checker_param
   int found_header4;
 };
 
-enum MHD_Result
+static enum MHD_Result
 headerCheckerInterator (void *cls,
                         enum MHD_ValueKind kind,
                         const char *key,
@@ -425,9 +425,9 @@ ahcCheck (void *cls,
                                        &param->header_check_param))
     mhdErrorExitDesc ("Wrong number of headers in the request");
 
-  response = MHD_create_response_from_buffer (param->rp_data_size,
-                                              (void *) param->rp_data,
-                                              MHD_RESPMEM_MUST_COPY);
+  response =
+    MHD_create_response_from_buffer_copy (param->rp_data_size,
+                                          (const void *) param->rp_data);
   if (NULL == response)
     mhdErrorExitDesc ("Failed to create response");
 
@@ -455,13 +455,13 @@ struct curlQueryParams
   const char *method;
 
   /* Destination port for CURL query */
-  int queryPort;
+  uint16_t queryPort;
 
   /* List of additional request headers */
   struct curl_slist *headers;
 
   /* CURL query result error flag */
-  volatile int queryError;
+  volatile unsigned int queryError;
 
   /* Response HTTP code, zero if no response */
   volatile int responseCode;
@@ -623,7 +623,7 @@ performQueryExternal (struct MHD_Daemon *d, CURL *c)
 
 
 /* Returns zero for successful response and non-zero for failed response */
-static int
+static unsigned int
 doCurlQueryInThread (struct MHD_Daemon *d,
                      struct curlQueryParams *p,
                      struct headers_check_result *hdr_res,
@@ -722,13 +722,13 @@ doCurlQueryInThread (struct MHD_Daemon *d,
 
 
 /* Perform test queries, shut down MHD daemon, and free parameters */
-static int
-performTestQueries (struct MHD_Daemon *d, int d_port,
+static unsigned int
+performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
                     struct ahc_cls_type *ahc_param,
                     struct check_uri_cls *uri_cb_param)
 {
   struct curlQueryParams qParam;
-  int ret = 0;          /* Return value */
+  unsigned int ret = 0;          /* Return value */
   struct headers_check_result rp_headers_check;
   struct curl_slist *curl_headers;
   curl_headers = NULL;
@@ -923,7 +923,7 @@ enum testMhdPollType
 static unsigned int
 testNumThreadsForPool (enum testMhdPollType pollType)
 {
-  int numThreads = MHD_CPU_COUNT;
+  unsigned int numThreads = MHD_CPU_COUNT;
   (void) pollType; /* Don't care about pollType for this test */
   return numThreads; /* No practical limit for non-cleanup test */
 }
@@ -931,7 +931,7 @@ testNumThreadsForPool (enum testMhdPollType pollType)
 
 static struct MHD_Daemon *
 startTestMhdDaemon (enum testMhdThreadsType thrType,
-                    enum testMhdPollType pollType, int *pport,
+                    enum testMhdPollType pollType, uint16_t *pport,
                     struct ahc_cls_type **ahc_param,
                     struct check_uri_cls **uri_cb_param)
 {
@@ -962,7 +962,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
   }
 
   if (testMhdThreadInternalPool != thrType)
-    d = MHD_start_daemon (((int) thrType) | ((int) pollType)
+    d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
                           | (verbose ? MHD_USE_ERROR_LOG : 0),
                           *pport, NULL, NULL,
                           &ahcCheck, *ahc_param,
@@ -970,7 +970,8 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
                           *uri_cb_param,
                           MHD_OPTION_END);
   else
-    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType)
+    d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
+                          | ((unsigned int) pollType)
                           | (verbose ? MHD_USE_ERROR_LOG : 0),
                           *pport, NULL, NULL,
                           &ahcCheck, *ahc_param,
@@ -994,7 +995,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
       fprintf (stderr, "MHD_get_daemon_info() failed.\n");
       abort ();
     }
-    *pport = (int) dinfo->port;
+    *pport = dinfo->port;
     if (0 == global_port)
       global_port = *pport; /* Reuse the same port for all tests */
   }
@@ -1006,11 +1007,11 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
 /* Test runners */
 
 
-static int
+static unsigned int
 testExternalGet (void)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
@@ -1021,11 +1022,11 @@ testExternalGet (void)
 }
 
 
-static int
+static unsigned int
 testInternalGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
@@ -1036,11 +1037,11 @@ testInternalGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
@@ -1050,11 +1051,11 @@ testMultithreadedGet (enum testMhdPollType pollType)
 }
 
 
-static int
+static unsigned int
 testMultithreadedPoolGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
 
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c
index 0145b5f1..18c6ab37 100644
--- a/src/testcurl/test_urlparse.c
+++ b/src/testcurl/test_urlparse.c
@@ -101,12 +101,12 @@ ahc_echo (void *cls,
           void **req_cls)
 {
   static int ptr;
-  const char *me = cls;
   struct MHD_Response *response;
   enum MHD_Result ret;
+  (void) cls;
   (void) version; (void) upload_data; (void) upload_data_size;       /* 
Unused. Silent compiler warning. */
 
-  if (0 != strcmp (me, method))
+  if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
     return MHD_NO;              /* unexpected method */
   if (&ptr != *req_cls)
   {
@@ -118,9 +118,8 @@ ahc_echo (void *cls,
                              &test_values,
                              NULL);
   *req_cls = NULL;
-  response = MHD_create_response_from_buffer (strlen (url),
-                                              (void *) url,
-                                              MHD_RESPMEM_MUST_COPY);
+  response = MHD_create_response_from_buffer_copy (strlen (url),
+                                                   (const void *) url);
   ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
   if (ret == MHD_NO)
@@ -129,15 +128,15 @@ ahc_echo (void *cls,
 }
 
 
-static int
-testInternalGet (int poll_flag)
+static unsigned int
+testInternalGet (uint32_t poll_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
   char buf[2048];
   struct CBC cbc;
   CURLcode errornum;
-  int port;
+  uint16_t port;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -152,8 +151,8 @@ testInternalGet (int poll_flag)
   cbc.size = 2048;
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
-                        | poll_flag,
-                        port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
+                        | (enum MHD_FLAG) poll_flag,
+                        port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
   if (d == NULL)
     return 1;
   if (0 == port)
@@ -164,7 +163,7 @@ testInternalGet (int poll_flag)
     {
       MHD_stop_daemon (d); return 32;
     }
-    port = (int) dinfo->port;
+    port = dinfo->port;
   }
   c = curl_easy_init ();
   curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world?a=b&c=&d";);
diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c
index c3f4a0fb..e2b86ffe 100644
--- a/src/testzzuf/test_get.c
+++ b/src/testzzuf/test_get.c
@@ -104,7 +104,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testInternalGet ()
 {
   struct MHD_Daemon *d;
@@ -116,9 +116,9 @@ 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 ();
@@ -150,7 +150,7 @@ testInternalGet ()
 }
 
 
-static int
+static unsigned int
 testMultithreadedGet ()
 {
   struct MHD_Daemon *d;
@@ -196,7 +196,7 @@ testMultithreadedGet ()
 }
 
 
-static int
+static unsigned int
 testExternalGet ()
 {
   struct MHD_Daemon *d;
diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c
index 491dab61..8013494f 100644
--- a/src/testzzuf/test_get_chunked.c
+++ b/src/testzzuf/test_get_chunked.c
@@ -146,7 +146,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testInternalGet ()
 {
   struct MHD_Daemon *d;
@@ -158,9 +158,9 @@ 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 ();
@@ -189,7 +189,7 @@ testInternalGet ()
 }
 
 
-static int
+static unsigned int
 testMultithreadedGet ()
 {
   struct MHD_Daemon *d;
@@ -232,7 +232,7 @@ testMultithreadedGet ()
 }
 
 
-static int
+static unsigned int
 testExternalGet ()
 {
   struct MHD_Daemon *d;
diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c
index f6a2d4a2..c0259398 100644
--- a/src/testzzuf/test_long_header.c
+++ b/src/testzzuf/test_long_header.c
@@ -106,7 +106,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testLongUrlGet ()
 {
   struct MHD_Daemon *d;
@@ -119,15 +119,15 @@ 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;
@@ -173,7 +173,7 @@ testLongUrlGet ()
 }
 
 
-static int
+static unsigned int
 testLongHeaderGet ()
 {
   struct MHD_Daemon *d;
@@ -187,15 +187,15 @@ 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 ();
diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c
index 0b184467..895c5fce 100644
--- a/src/testzzuf/test_post.c
+++ b/src/testzzuf/test_post.c
@@ -160,7 +160,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testInternalPost ()
 {
   struct MHD_Daemon *d;
@@ -172,11 +172,11 @@ 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 ();
@@ -213,7 +213,7 @@ testInternalPost ()
 }
 
 
-static int
+static unsigned int
 testMultithreadedPost ()
 {
   struct MHD_Daemon *d;
@@ -267,7 +267,7 @@ testMultithreadedPost ()
 }
 
 
-static int
+static unsigned int
 testExternalPost ()
 {
   struct MHD_Daemon *d;
diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c
index 9538f3ca..b16b0cdd 100644
--- a/src/testzzuf/test_post_form.c
+++ b/src/testzzuf/test_post_form.c
@@ -179,7 +179,7 @@ make_form ()
 }
 
 
-static int
+static unsigned int
 testInternalPost ()
 {
   struct MHD_Daemon *d;
@@ -192,11 +192,11 @@ 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 ();
@@ -231,7 +231,7 @@ testInternalPost ()
 }
 
 
-static int
+static unsigned int
 testMultithreadedPost ()
 {
   struct MHD_Daemon *d;
@@ -283,7 +283,7 @@ testMultithreadedPost ()
 }
 
 
-static int
+static unsigned int
 testExternalPost ()
 {
   struct MHD_Daemon *d;
diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c
index ee6eee2a..9e3749d1 100644
--- a/src/testzzuf/test_put.c
+++ b/src/testzzuf/test_put.c
@@ -127,7 +127,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testInternalPut ()
 {
   struct MHD_Daemon *d;
@@ -141,10 +141,10 @@ 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 ();
@@ -180,7 +180,7 @@ testInternalPut ()
 }
 
 
-static int
+static unsigned int
 testMultithreadedPut ()
 {
   struct MHD_Daemon *d;
@@ -233,7 +233,7 @@ testMultithreadedPut ()
 }
 
 
-static int
+static unsigned int
 testExternalPut ()
 {
   struct MHD_Daemon *d;
diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c
index 34c03215..3dd67e43 100644
--- a/src/testzzuf/test_put_chunked.c
+++ b/src/testzzuf/test_put_chunked.c
@@ -137,7 +137,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testInternalPut ()
 {
   struct MHD_Daemon *d;
@@ -190,7 +190,7 @@ testInternalPut ()
 }
 
 
-static int
+static unsigned int
 testMultithreadedPut ()
 {
   struct MHD_Daemon *d;
@@ -249,7 +249,7 @@ testMultithreadedPut ()
 }
 
 
-static int
+static unsigned int
 testExternalPut ()
 {
   struct MHD_Daemon *d;
diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c
index de70f12a..900284ef 100644
--- a/src/testzzuf/test_put_large.c
+++ b/src/testzzuf/test_put_large.c
@@ -141,7 +141,7 @@ ahc_echo (void *cls,
 }
 
 
-static int
+static unsigned int
 testInternalPut ()
 {
   struct MHD_Daemon *d;
@@ -155,10 +155,10 @@ 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 ();
@@ -195,7 +195,7 @@ testInternalPut ()
 }
 
 
-static int
+static unsigned int
 testMultithreadedPut ()
 {
   struct MHD_Daemon *d;
@@ -249,7 +249,7 @@ testMultithreadedPut ()
 }
 
 
-static int
+static unsigned int
 testExternalPut ()
 {
   struct MHD_Daemon *d;

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



reply via email to

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