gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (7059c019 -> 0c132072)


From: gnunet
Subject: [libmicrohttpd] branch master updated (7059c019 -> 0c132072)
Date: Thu, 24 Sep 2020 14:20:53 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 7059c019 test_digestauth_sha256: do not test without sha256 support on 
libcurl
     new 6130a29d test_concurrent_stop: renamed vars for clarity
     new 68452021 test_concurrent_stop: removed unused define
     new 0c132072 test_concurrent_stop: check for client errors

The 3 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/testcurl/test_concurrent_stop.c | 44 ++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 13 deletions(-)

diff --git a/src/testcurl/test_concurrent_stop.c 
b/src/testcurl/test_concurrent_stop.c
index 6716f491..842a35c6 100644
--- a/src/testcurl/test_concurrent_stop.c
+++ b/src/testcurl/test_concurrent_stop.c
@@ -40,12 +40,6 @@
 #define CPU_COUNT 2
 #endif
 
-/**
- * How many rounds of operations do we do for each
- * test (total number of requests will be ROUNDS * PAR).
- */
-#define ROUNDS 50000
-
 /**
  * How many requests do we do in parallel?
  */
@@ -73,6 +67,11 @@ static volatile int watchdog_continue;
 
 static const char *watchdog_obj;
 
+/**
+ * Indicate that client detected error
+ */
+static volatile CURLcode client_error;
+
 static void *
 thread_watchdog (void *param)
 {
@@ -142,9 +141,9 @@ ahc_echo (void *cls,
           const char *version,
           const char *upload_data,
           size_t *upload_data_size,
-          void **unused)
+          void **usr_data)
 {
-  static int ptr;
+  static int marker;
   const char *me = cls;
   enum MHD_Result ret;
   (void) url; (void) version;                      /* Unused. Silent compiler 
warning. */
@@ -152,12 +151,12 @@ ahc_echo (void *cls,
 
   if (0 != strcmp (me, method))
     return MHD_NO;              /* unexpected method */
-  if (&ptr != *unused)
+  if (&marker != *usr_data)
   {
-    *unused = &ptr;
+    *usr_data = ▮
     return MHD_YES;
   }
-  *unused = NULL;
+  *usr_data = NULL;
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
                             response);
@@ -201,6 +200,7 @@ thread_gets (void *param)
     if (CURLE_OK != errornum)
     {
       curl_easy_cleanup (c);
+      client_error = errornum;
       return NULL;
     }
   }
@@ -264,7 +264,9 @@ testMultithreadedGet (int port,
 {
   struct MHD_Daemon *d;
   pthread_t p;
+  int result;
 
+  result = 0;
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
                         | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
                         | poll_flag,
@@ -284,14 +286,21 @@ testMultithreadedGet (int port,
     }
     port = (int) dinfo->port;
   }
+  client_error = CURLE_OK; /* clear client error state */
   p = start_gets (port);
   (void) sleep (1);
   start_watchdog (10, "daemon_stop() in testMultithreadedGet");
+  if (CURLE_OK != client_error) /* poor sync, but enough for test */
+  {
+    result = 64;
+    fprintf (stderr, "libcurl reported at least one error: \"%s\"\n",
+             curl_easy_strerror (client_error));
+  }
   MHD_stop_daemon (d);
   stop_watchdog ();
   continue_requesting = 0;
   pthread_join (p, NULL);
-  return 0;
+  return result;
 }
 
 
@@ -301,7 +310,9 @@ testMultithreadedPoolGet (int port,
 {
   struct MHD_Daemon *d;
   pthread_t p;
+  int result;
 
+  result = 0;
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
                         | poll_flag,
                         port,
@@ -321,14 +332,21 @@ testMultithreadedPoolGet (int port,
     }
     port = (int) dinfo->port;
   }
+  client_error = CURLE_OK; /* clear client error state */
   p = start_gets (port);
   (void) sleep (1);
   start_watchdog (10, "daemon_stop() in testMultithreadedPoolGet");
+  if (CURLE_OK != client_error) /* poor sync, but enough for test */
+  {
+    result = 64;
+    fprintf (stderr, "libcurl reported at least one error: \"%s\"\n",
+             curl_easy_strerror (client_error));
+  }
   MHD_stop_daemon (d);
   stop_watchdog ();
   continue_requesting = 0;
   pthread_join (p, NULL);
-  return 0;
+  return result;
 }
 
 

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