Evgeny Grin (Karlson2k) 4 лет назад
Родитель
Сommit
9ce7aa953a

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
src/microhttpd/test_postprocessor_amp.c


Разница между файлами не показана из-за своего большого размера
+ 3 - 2
src/microhttpd/test_postprocessor_md.c


+ 4 - 4
src/microhttpd/test_upgrade.c

@@ -1131,13 +1131,13 @@ test_upgrade (int flags,
     abort ();
   if (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD) )
   {
-    enum MHD_FLAG flags;
+    enum MHD_FLAG used_flags;
 
     /* make address sanitizer happy */
-    memcpy (&flags,
+    memcpy (&used_flags,
             real_flags /* ->flags */,
-            sizeof (flags));
-    run_mhd_loop (d, flags);
+            sizeof (used_flags));
+    run_mhd_loop (d, used_flags);
   }
   pthread_join (pt_client,
                 NULL);

+ 4 - 4
src/microhttpd/test_upgrade_large.c

@@ -1336,13 +1336,13 @@ test_upgrade (int flags,
     abort ();
   if (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD) )
   {
-    enum MHD_FLAG flags;
+    enum MHD_FLAG used_flags;
 
     /* make address sanitizer happy */
-    memcpy (&flags,
+    memcpy (&used_flags,
             real_flags /* ->flags */,
-            sizeof (flags));
-    run_mhd_loop (d, flags);
+            sizeof (used_flags));
+    run_mhd_loop (d, used_flags);
   }
   pthread_join (pt_client,
                 NULL);

+ 1 - 1
src/testcurl/https/test_empty_response.c

@@ -78,6 +78,7 @@ testInternalSelectGet ()
   time_t start;
   struct timeval tv;
   int port;
+  char *aes256_sha = "AES256-SHA";
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -107,7 +108,6 @@ testInternalSelectGet ()
     }
     port = (int) dinfo->port;
   }
-  char *aes256_sha = "AES256-SHA";
   if (curl_uses_nss_ssl () == 0)
   {
     aes256_sha = "rsa_aes_256_sha";

+ 2 - 1
src/testcurl/https/test_https_get_parallel.c

@@ -140,6 +140,7 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *aes256_sha = "AES256-SHA";
   int port;
+  unsigned int iseed;
   (void) argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -148,7 +149,7 @@ main (int argc, char *const *argv)
     port = 3020;
 
   /* initialize random seed used by curl clients */
-  unsigned int iseed = (unsigned int) time (NULL);
+  iseed = (unsigned int) time (NULL);
   srand (iseed);
   if (! testsuite_curl_global_init ())
     return 99;

+ 3 - 2
src/testcurl/https/test_https_get_parallel_threads.c

@@ -142,6 +142,8 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *ssl_version;
   int port;
+  unsigned int iseed;
+  char *aes256_sha = "AES256-SHA";
   (void) argc;   /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -150,7 +152,7 @@ main (int argc, char *const *argv)
     port = 3010;
 
   /* initialize random seed used by curl clients */
-  unsigned int iseed = (unsigned int) time (NULL);
+  iseed = (unsigned int) time (NULL);
 
 #ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
@@ -174,7 +176,6 @@ main (int argc, char *const *argv)
     return 77;
   }
 
-  char *aes256_sha = "AES256-SHA";
   if (curl_uses_nss_ssl () == 0)
   {
     aes256_sha = "rsa_aes_256_sha";

+ 1 - 1
src/testcurl/https/test_https_session_info.c

@@ -103,6 +103,7 @@ test_query_session ()
   CURLcode errornum;
   char url[256];
   int port;
+  const char *aes256_sha = "AES256-SHA";
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -142,7 +143,6 @@ test_query_session ()
     port = (int) dinfo->port;
   }
 
-  const char *aes256_sha = "AES256-SHA";
   if (curl_uses_nss_ssl () == 0)
   {
     aes256_sha = "rsa_aes_256_sha";

+ 1 - 1
src/testcurl/https/test_https_time_out.c

@@ -103,7 +103,7 @@ test_tls_session_time_out (gnutls_session_t session, int port)
 int
 main (int argc, char *const *argv)
 {
-  int errorCount = 0;;
+  int errorCount = 0;
   struct MHD_Daemon *d;
   gnutls_session_t session;
   gnutls_datum_t key;

+ 3 - 3
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;
+  char url[255];
   (void) cls;    /* Unused. Silent compiler warning. */
   if (NULL == (cbc.buf = malloc (sizeof (char) * 256)))
   {
@@ -57,7 +58,6 @@ test_unmatching_ssl_version (void *cls, int port, const char *cipher_suite,
   cbc.size = 256;
   cbc.pos = 0;
 
-  char url[255];
   if (gen_test_file_url (url,
                          sizeof (url),
                          port))
@@ -93,6 +93,8 @@ main (int argc, char *const *argv)
     MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD
     | MHD_USE_TLS | MHD_USE_ERROR_LOG;
   int port;
+  const char *aes128_sha = "AES128-SHA";
+  const char *aes256_sha = "AES256-SHA";
   (void) argc; (void) argv;       /* Unused. Silent compiler warning. */
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -126,8 +128,6 @@ main (int argc, char *const *argv)
   if (! testsuite_curl_global_init ())
     return 99;
 
-  const char *aes128_sha = "AES128-SHA";
-  const char *aes256_sha = "AES256-SHA";
   if (curl_uses_nss_ssl () == 0)
   {
     aes128_sha = "rsa_aes_128_sha";

+ 4 - 3
src/testcurl/test_add_conn.c

@@ -77,9 +77,10 @@
 
 /* Cleanup test: max number of concurrent daemons depending on maximum number
  * of open FDs. */
-#define CLEANUP_MAX_DAEMONS(max_fds) (((max_fds) - 10) / \
-                                      (CLEANUP_NUM_REQS_PER_DAEMON * 5 \
-                                       + 3))
+#define CLEANUP_MAX_DAEMONS(max_fds) ( ((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"

+ 2 - 2
src/testcurl/test_get_response_cleanup.c

@@ -109,10 +109,10 @@ push_callback (void *cls, uint64_t pos, char *buf, size_t max)
 static void
 push_free_callback (void *cls)
 {
-  int *ok = cls;
+  int *ok_p = cls;
 
   // fprintf (stderr, "Cleanup callback called!\n");
-  *ok = 0;
+  *ok_p = 0;
 }
 
 

+ 1 - 1
src/testcurl/test_quiesce.c

@@ -108,8 +108,8 @@ static void
 request_completed (void *cls, struct MHD_Connection *connection,
                    void **con_cls, enum MHD_RequestTerminationCode code)
 {
-  (void) connection; (void) con_cls; (void) code;    /* Unused. Silent compiler warning. */
   int *done = (int *) cls;
+  (void) connection; (void) con_cls; (void) code;    /* Unused. Silent compiler warning. */
   *done = 1;
 }
 

+ 23 - 20
src/testcurl/test_quiesce_stream.c

@@ -73,13 +73,14 @@ static void
 suspend_connection (struct MHD_Connection *connection)
 {
   pthread_t thread_id;
+  int status;
 
   /* fprintf (stderr, "Calling suspend\n"); */
   MHD_suspend_connection (connection);
-  int status = pthread_create (&thread_id,
-                               NULL,
-                               &resume_connection,
-                               connection);
+  status = pthread_create (&thread_id,
+                           NULL,
+                           &resume_connection,
+                           connection);
   if (0 != status)
   {
     fprintf (stderr,
@@ -143,6 +144,7 @@ http_AccessHandlerCallback (void *cls,
                             void **con_cls)
 {
   enum MHD_Result ret;
+  struct MHD_Response *response;
   (void) cls; (void) url;                        /* Unused. Silent compiler warning. */
   (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
   (void) upload_data_size;                       /* Unused. Silent compiler warning. */
@@ -150,12 +152,12 @@ http_AccessHandlerCallback (void *cls,
   /* Never respond on first call */
   if (NULL == *con_cls)
   {
+    struct ContentReaderUserdata *userdata;
     fprintf (stderr,
              "start: %d\n",
              ++request_counter);
 
-    struct ContentReaderUserdata *userdata = malloc (sizeof(struct
-                                                            ContentReaderUserdata));
+    userdata = malloc (sizeof(struct ContentReaderUserdata));
 
     if (NULL == userdata)
       return MHD_NO;
@@ -166,7 +168,7 @@ http_AccessHandlerCallback (void *cls,
   }
 
   /* Second call: create response */
-  struct MHD_Response *response
+  response
     = MHD_create_response_from_callback (-1,
                                          32 * 1024,
                                          &http_ContentReaderCallback,
@@ -187,6 +189,13 @@ main (void)
 {
   int port;
   char command_line[1024];
+  /* Flags */
+  unsigned int daemon_flags
+    = MHD_USE_INTERNAL_POLLING_THREAD
+      | MHD_USE_AUTO
+      | MHD_ALLOW_SUSPEND_RESUME
+      | MHD_USE_ITC;
+  struct MHD_Daemon *daemon;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -197,21 +206,15 @@ main (void)
   MHD_set_panic_func (&http_PanicCallback,
                       NULL);
 
-  /* Flags */
-  unsigned int daemon_flags
-    = MHD_USE_INTERNAL_POLLING_THREAD
-      | MHD_USE_AUTO
-      | MHD_ALLOW_SUSPEND_RESUME
-      | MHD_USE_ITC;
 
   /* Create daemon */
-  struct MHD_Daemon *daemon = MHD_start_daemon (daemon_flags,
-                                                port,
-                                                NULL,
-                                                NULL,
-                                                &http_AccessHandlerCallback,
-                                                NULL,
-                                                MHD_OPTION_END);
+  daemon = MHD_start_daemon (daemon_flags,
+                             port,
+                             NULL,
+                             NULL,
+                             &http_AccessHandlerCallback,
+                             NULL,
+                             MHD_OPTION_END);
   if (NULL == daemon)
     return 1;
   if (0 == port)

+ 6 - 3
src/testcurl/test_termination.c

@@ -57,6 +57,8 @@ connection_handler (void *cls,
                     void **ptr)
 {
   static int i;
+  struct MHD_Response *response;
+  enum MHD_Result ret;
   (void) cls; (void) url;                        /* Unused. Silent compiler warning. */
   (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
   (void) upload_data_size;                       /* Unused. Silent compiler warning. */
@@ -73,10 +75,10 @@ connection_handler (void *cls,
     return MHD_YES;
   }
 
-  struct MHD_Response *response =
+  response =
     MHD_create_response_from_buffer (strlen ("Response"), "Response",
                                      MHD_RESPMEM_PERSISTENT);
-  enum MHD_Result ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
+  ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
   MHD_destroy_response (response);
 
   return ret;
@@ -98,6 +100,7 @@ main (void)
   int port;
   char url[255];
   CURL *curl;
+  CURLcode success;
 
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
@@ -137,7 +140,7 @@ main (void)
   curl_easy_setopt (curl, CURLOPT_URL, url);
   curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, write_data);
 
-  CURLcode success = curl_easy_perform (curl);
+  success = curl_easy_perform (curl);
   if (success != 0)
   {
     fprintf (stderr, "CURL Error");

+ 1 - 1
src/testzzuf/test_long_header.c

@@ -239,8 +239,8 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
-  (void) argc;   /* Unused. Silent compiler warning. */
   const char *sl;
+  (void) argc;   /* Unused. Silent compiler warning. */
 
   sl = strrchr (argv[0], (int) '/');
   oneone = (NULL != sl) ? (NULL != strstr (sl, "11")) : 0;

Некоторые файлы не были показаны из-за большого количества измененных файлов