gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (8da22ca0 -> 28f723b2


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (8da22ca0 -> 28f723b2)
Date: Mon, 30 Oct 2017 21:38:13 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 8da22ca0 Silenced compiler warnings in src/testcurl.
     new dc96775e MHD_queue_response(): ignore response, but return OK if 
daemon is shut down. This will avoid race condition: if daemon is shutting down 
in parallel, response may be queued but aborted later. Therefore, returning 
"MHD_OK" will unify situation from application point of view.
     new 28f723b2 Silenced compiler warnings in src/testcurl/https, minor fixes.

The 2 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:
 src/microhttpd/connection.c                        |  5 +++++
 src/testcurl/https/test_empty_response.c           |  5 +++--
 src/testcurl/https/test_https_get.c                |  1 +
 src/testcurl/https/test_https_get_parallel.c       |  3 +++
 .../https/test_https_get_parallel_threads.c        |  3 +++
 src/testcurl/https/test_https_get_select.c         |  4 ++--
 src/testcurl/https/test_https_multi_daemon.c       |  6 ++++--
 src/testcurl/https/test_https_session_info.c       |  6 ++++--
 src/testcurl/https/test_https_sni.c                |  4 +++-
 src/testcurl/https/test_https_time_out.c           |  3 ++-
 src/testcurl/https/test_tls_authentication.c       |  7 ++-----
 src/testcurl/https/test_tls_options.c              |  2 ++
 src/testcurl/https/tls_test_common.c               | 22 +++++++++++++++-------
 13 files changed, 49 insertions(+), 22 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 9b040418..b19c67fa 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3880,6 +3880,11 @@ MHD_queue_response (struct MHD_Connection *connection,
         (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) )
     return MHD_NO;
   daemon = connection->daemon;
+
+  if (daemon->shutdown)
+    return MHD_YES; /* If daemon was shut down in parallel,
+                     * response will be aborted now or on later stage. */
+
   if ( (!connection->suspended) &&
        (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) &&
        (!MHD_thread_ID_match_current_(connection->pid.ID)) )
diff --git a/src/testcurl/https/test_empty_response.c 
b/src/testcurl/https/test_empty_response.c
index d4a15168..ba7136a8 100644
--- a/src/testcurl/https/test_empty_response.c
+++ b/src/testcurl/https/test_empty_response.c
@@ -35,8 +35,6 @@
 
 extern const char srv_key_pem[];
 extern const char srv_self_signed_cert_pem[];
-extern const char srv_signed_cert_pem[];
-extern const char srv_signed_key_pem[];
 
 static int oneone;
 
@@ -51,6 +49,8 @@ ahc_echo (void *cls,
 {
   struct MHD_Response *response;
   int ret;
+  (void)cls;(void)url;(void)method;(void)version;               /* Unused. 
Silent compiler warning. */
+  (void)upload_data;(void)upload_data_size;(void)unused;        /* Unused. 
Silent compiler warning. */
 
   response = MHD_create_response_from_buffer (0, NULL,
                                              MHD_RESPMEM_PERSISTENT);
@@ -220,6 +220,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
+  (void)argc;   /* Unused. Silent compiler warning. */
 
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
diff --git a/src/testcurl/https/test_https_get.c 
b/src/testcurl/https/test_https_get.c
index dfbf5dbc..7573315d 100644
--- a/src/testcurl/https/test_https_get.c
+++ b/src/testcurl/https/test_https_get.c
@@ -131,6 +131,7 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *aes256_sha_tlsv1   = "AES256-SHA";
   const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA";
+  (void)argc;   /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
diff --git a/src/testcurl/https/test_https_get_parallel.c 
b/src/testcurl/https/test_https_get_parallel.c
index 89fd6a05..91d870d8 100644
--- a/src/testcurl/https/test_https_get_parallel.c
+++ b/src/testcurl/https/test_https_get_parallel.c
@@ -84,6 +84,7 @@ test_single_client (void *cls, int port, const char 
*cipher_suite,
   void *client_thread_ret;
   struct https_test_data client_args =
     { NULL, port, cipher_suite, curl_proto_version };
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   client_thread_ret = https_transfer_thread_adapter (&client_args);
   if (client_thread_ret != NULL)
@@ -109,6 +110,7 @@ test_parallel_clients (void * cls, int port, const char 
*cipher_suite,
   pthread_t client_arr[client_count];
   struct https_test_data client_args =
     { NULL, port, cipher_suite, curl_proto_version };
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   for (i = 0; i < client_count; ++i)
     {
@@ -138,6 +140,7 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *aes256_sha = "AES256-SHA";
   int port;
+  (void)argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
diff --git a/src/testcurl/https/test_https_get_parallel_threads.c 
b/src/testcurl/https/test_https_get_parallel_threads.c
index f577edd9..832b206f 100644
--- a/src/testcurl/https/test_https_get_parallel_threads.c
+++ b/src/testcurl/https/test_https_get_parallel_threads.c
@@ -84,6 +84,7 @@ test_single_client (void *cls, int port, const char 
*cipher_suite,
   void *client_thread_ret;
   struct https_test_data client_args =
     { NULL, port, cipher_suite, curl_proto_version };
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   client_thread_ret = https_transfer_thread_adapter (&client_args);
   if (client_thread_ret != NULL)
@@ -109,6 +110,7 @@ test_parallel_clients (void *cls, int port, const char 
*cipher_suite,
   pthread_t client_arr[client_count];
   struct https_test_data client_args =
     { NULL, port, cipher_suite, curl_proto_version };
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   for (i = 0; i < client_count; ++i)
     {
@@ -139,6 +141,7 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *ssl_version;
   int port;
+  (void)argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
diff --git a/src/testcurl/https/test_https_get_select.c 
b/src/testcurl/https/test_https_get_select.c
index 06964c82..5e1fa238 100644
--- a/src/testcurl/https/test_https_get_select.c
+++ b/src/testcurl/https/test_https_get_select.c
@@ -36,8 +36,6 @@
 
 extern const char srv_key_pem[];
 extern const char srv_self_signed_cert_pem[];
-extern const char srv_signed_cert_pem[];
-extern const char srv_signed_key_pem[];
 
 static int oneone;
 
@@ -54,6 +52,7 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)version;(void)upload_data;(void)upload_data_size;       /* Unused. 
Silent compiler warning. */
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
@@ -249,6 +248,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
+  (void)argc;   /* Unused. Silent compiler warning. */
 
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
diff --git a/src/testcurl/https/test_https_multi_daemon.c 
b/src/testcurl/https/test_https_multi_daemon.c
index b1c61ba3..75017662 100644
--- a/src/testcurl/https/test_https_multi_daemon.c
+++ b/src/testcurl/https/test_https_multi_daemon.c
@@ -34,7 +34,6 @@
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
-extern int curl_check_version (const char *req_version, ...);
 extern const char srv_key_pem[];
 extern const char srv_self_signed_cert_pem[];
 
@@ -43,7 +42,7 @@ extern const char srv_self_signed_cert_pem[];
  * doesn't affect the other
  */
 static int
-test_concurent_daemon_pair (void *cls, 
+test_concurent_daemon_pair (void *cls,
                            const char *cipher_suite,
                             int proto_version)
 {
@@ -51,6 +50,8 @@ test_concurent_daemon_pair (void *cls,
   struct MHD_Daemon *d1;
   struct MHD_Daemon *d2;
   int port1, port2;
+  (void)cls;    /* Unused. Silent compiler warning. */
+
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port1 = port2 = 0;
@@ -127,6 +128,7 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   FILE *cert;
   const char *aes256_sha = "AES256-SHA";
+  (void)argc; (void)argv;       /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
diff --git a/src/testcurl/https/test_https_session_info.c 
b/src/testcurl/https/test_https_session_info.c
index f21e03b0..f0bee495 100644
--- a/src/testcurl/https/test_https_session_info.c
+++ b/src/testcurl/https/test_https_session_info.c
@@ -32,7 +32,6 @@
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
-extern int curl_check_version (const char *req_version, ...);
 extern const char srv_key_pem[];
 extern const char srv_self_signed_cert_pem[];
 
@@ -45,11 +44,13 @@ struct MHD_Daemon *d;
 static int
 query_session_ahc (void *cls, struct MHD_Connection *connection,
                    const char *url, const char *method,
-                   const char *upload_data, const char *version,
+                   const char *version, const char *upload_data,
                    size_t *upload_data_size, void **ptr)
 {
   struct MHD_Response *response;
   int ret;
+  (void)cls;(void)url;(void)method;(void)version;       /* Unused. Silent 
compiler warning. */
+  (void)upload_data;(void)upload_data_size;             /* Unused. Silent 
compiler warning. */
 
   if (NULL == *ptr)
     {
@@ -190,6 +191,7 @@ main (int argc, char *const *argv)
 #if LIBCURL_VERSION_NUM >= 0x072200
   unsigned int errorCount = 0;
   const char *ssl_version;
+  (void)argc;   /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
diff --git a/src/testcurl/https/test_https_sni.c 
b/src/testcurl/https/test_https_sni.c
index 6c1da540..1567730c 100644
--- a/src/testcurl/https/test_https_sni.c
+++ b/src/testcurl/https/test_https_sni.c
@@ -145,6 +145,7 @@ sni_callback (gnutls_session_t session,
   size_t name_len;
   struct Hosts *host;
   unsigned int type;
+  (void)req_ca_dn;(void)nreqs;(void)pk_algos;(void)pk_algos_length;   /* 
Unused. Silent compiler warning. */
 
   name_len = sizeof (name);
   if (GNUTLS_E_SUCCESS !=
@@ -255,6 +256,7 @@ main (int argc, char *const *argv)
   unsigned int error_count = 0;
   struct MHD_Daemon *d;
   int port;
+  (void)argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -315,7 +317,7 @@ main (int argc, char *const *argv)
 
 #else
 
-int main ()
+int main (void)
 {
   fprintf (stderr,
            "SNI not supported by GnuTLS < 3.0\n");
diff --git a/src/testcurl/https/test_https_time_out.c 
b/src/testcurl/https/test_https_time_out.c
index 587d311c..e46923eb 100644
--- a/src/testcurl/https/test_https_time_out.c
+++ b/src/testcurl/https/test_https_time_out.c
@@ -54,7 +54,7 @@ test_tls_session_time_out (gnutls_session_t session, int port)
   struct sockaddr_in sa;
 
   sd = socket (AF_INET, SOCK_STREAM, 0);
-  if (sd == -1)
+  if (sd == MHD_INVALID_SOCKET)
     {
       fprintf (stderr, "Failed to create socket: %s\n", strerror (errno));
       return -1;
@@ -110,6 +110,7 @@ main (int argc, char *const *argv)
   gnutls_datum_t cert;
   gnutls_certificate_credentials_t xcred;
   int port;
+  (void)argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
diff --git a/src/testcurl/https/test_tls_authentication.c 
b/src/testcurl/https/test_tls_authentication.c
index e3bc2626..734a2a4a 100644
--- a/src/testcurl/https/test_tls_authentication.c
+++ b/src/testcurl/https/test_tls_authentication.c
@@ -34,11 +34,6 @@
 #endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
-extern int curl_check_version (const char *req_version, ...);
-extern const char test_file_data[];
-
-extern const char ca_key_pem[];
-extern const char ca_cert_pem[];
 extern const char srv_signed_cert_pem[];
 extern const char srv_signed_key_pem[];
 
@@ -51,6 +46,7 @@ test_secure_get (void * cls, char *cipher_suite, int 
proto_version)
   int ret;
   struct MHD_Daemon *d;
   int port;
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -90,6 +86,7 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
   char *aes256_sha = "AES256-SHA";
+  (void)argc; (void)argv;       /* Unused. Silent compiler warning. */
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
diff --git a/src/testcurl/https/test_tls_options.c 
b/src/testcurl/https/test_tls_options.c
index 6eed7932..6d393bf2 100644
--- a/src/testcurl/https/test_tls_options.c
+++ b/src/testcurl/https/test_tls_options.c
@@ -47,6 +47,7 @@ test_unmatching_ssl_version (void * cls, int port, const char 
*cipher_suite,
                              int curl_req_ssl_version)
 {
   struct CBC cbc;
+  (void)cls;    /* Unused. Silent compiler warning. */
   if (NULL == (cbc.buf = malloc (sizeof (char) * 256)))
     {
       fprintf (stderr, "Error: failed to allocate: %s\n",
@@ -90,6 +91,7 @@ main (int argc, char *const *argv)
   int daemon_flags =
     MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_TLS | MHD_USE_ERROR_LOG;
   int port;
+  (void)argc; (void)argv;       /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
diff --git a/src/testcurl/https/tls_test_common.c 
b/src/testcurl/https/tls_test_common.c
index e929334b..54466a2a 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -73,6 +73,7 @@ test_daemon_get (void *cls,
   CURLcode errornum;
   char url[255];
   size_t len;
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   len = strlen (test_data);
   if (NULL == (cbc.buf = malloc (sizeof (char) * len)))
@@ -166,12 +167,14 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void 
*ctx)
  */
 int
 http_ahc (void *cls, struct MHD_Connection *connection,
-          const char *url, const char *method, const char *upload_data,
-          const char *version, size_t *upload_data_size, void **ptr)
+          const char *url, const char *method, const char *version,
+          const char *upload_data, size_t *upload_data_size, void **ptr)
 {
   static int aptr;
   struct MHD_Response *response;
   int ret;
+  (void)cls;(void)url;(void)version;            /* Unused. Silent compiler 
warning. */
+  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler 
warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
@@ -193,11 +196,13 @@ http_ahc (void *cls, struct MHD_Connection *connection,
 /* HTTP access handler call back */
 int
 http_dummy_ahc (void *cls, struct MHD_Connection *connection,
-                const char *url, const char *method, const char *upload_data,
-                const char *version, size_t *upload_data_size,
+                const char *url, const char *method, const char *version,
+                const char *upload_data, size_t *upload_data_size,
                 void **ptr)
 {
-  return 0;
+  (void)cls;(void)connection;(void)url;(void)method;(void)version;      /* 
Unused. Silent compiler warning. */
+  (void)upload_data;(void)upload_data_size;(void)ptr;                   /* 
Unused. Silent compiler warning. */
+ return 0;
 }
 
 /**
@@ -273,6 +278,7 @@ gen_test_file_url (char *url,
   int ret = 0;
   char *doc_path;
   size_t doc_path_len;
+  size_t i;
   /* setup test file path, url */
 #ifdef PATH_MAX
   doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX;
@@ -293,7 +299,7 @@ gen_test_file_url (char *url,
       return -1;
     }
 #ifdef WINDOWS
-  for (int i = 0; i < doc_path_len; i++)
+  for (i = 0; i < doc_path_len; i++)
   {
     if (doc_path[i] == 0)
       break;
@@ -316,7 +322,7 @@ gen_test_file_url (char *url,
                 "https://127.0.0.1";,
                 port,
                 doc_path,
-                "urlpath") >= url_len)
+                "urlpath") >= (long long)url_len)
     ret = -1;
 
   free (doc_path);
@@ -337,6 +343,7 @@ test_https_transfer (void *cls,
   int ret = 0;
   struct CBC cbc;
   char url[255];
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   len = strlen (test_data);
   if (NULL == (cbc.buf = malloc (sizeof (char) * len)))
@@ -490,6 +497,7 @@ test_wrap (const char *test_name, int
   int ret;
   va_list arg_list;
   struct MHD_Daemon *d;
+  (void)cls;    /* Unused. Silent compiler warning. */
 
   va_start (arg_list, proto_version);
   port = setup_testcase (&d, port, daemon_flags, arg_list);

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



reply via email to

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