gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 08/08: test_large_put: added poll() and epo


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 08/08: test_large_put: added poll() and epoll testing.
Date: Sun, 22 Jan 2017 22:12:17 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit c623d35dcc88d0e90a239289b947f0199ad02d5b
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Sun Jan 22 23:24:24 2017 +0300

    test_large_put: added poll() and epoll testing.
---
 src/testcurl/test_large_put.c | 47 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 10 deletions(-)

diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
index 7a8be9d2..d701e64d 100644
--- a/src/testcurl/test_large_put.c
+++ b/src/testcurl/test_large_put.c
@@ -173,7 +173,7 @@ ahc_echo (void *cls,
 
 
 static int
-testPutInternalThread ()
+testPutInternalThread (unsigned int add_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -186,7 +186,7 @@ testPutInternalThread ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
add_flag,
                         1080,
                         NULL, NULL, &ahc_echo, &done_flag,
                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read 
? 1024 : (PUT_SIZE * 4)),
@@ -231,7 +231,7 @@ testPutInternalThread ()
 }
 
 static int
-testPutThreadPerConn ()
+testPutThreadPerConn (unsigned int add_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -244,7 +244,8 @@ testPutThreadPerConn ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD |
+                          MHD_USE_ERROR_LOG | add_flag,
                         1081,
                         NULL, NULL, &ahc_echo, &done_flag,
                         MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read 
? 1024 : (PUT_SIZE * 4)),
@@ -292,7 +293,7 @@ testPutThreadPerConn ()
 }
 
 static int
-testPutThreadPool ()
+testPutThreadPool (unsigned int add_flag)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -305,7 +306,7 @@ testPutThreadPool ()
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 
add_flag,
                         1081,
                         NULL, NULL, &ahc_echo, &done_flag,
                         MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
@@ -354,7 +355,7 @@ testPutThreadPool ()
 }
 
 static int
-testPutExternal ()
+testPutExternal (void)
 {
   struct MHD_Daemon *d;
   CURL *c;
@@ -513,15 +514,15 @@ main (int argc, char *const *argv)
   put_buffer = alloc_init (PUT_SIZE);
   if (NULL == put_buffer)
     return 99;
-  lastErr = testPutInternalThread ();
+  lastErr = testPutInternalThread (0);
   if (verbose && 0 != lastErr)
     fprintf (stderr, "Error during testing with internal thread with 
select().\n");
   errorCount += lastErr;
-  lastErr = testPutThreadPerConn ();
+  lastErr = testPutThreadPerConn (0);
   if (verbose && 0 != lastErr)
     fprintf (stderr, "Error during testing with internal thread per connection 
with select().\n");
   errorCount += lastErr;
-  lastErr = testPutThreadPool ();
+  lastErr = testPutThreadPool (0);
   if (verbose && 0 != lastErr)
     fprintf (stderr, "Error during testing with thread pool per connection 
with select().\n");
   errorCount += lastErr;
@@ -529,6 +530,32 @@ main (int argc, char *const *argv)
   if (verbose && 0 != lastErr)
     fprintf (stderr, "Error during testing with external select().\n");
   errorCount += lastErr;
+  if (MHD_is_feature_supported(MHD_FEATURE_POLL))
+    {
+      lastErr = testPutInternalThread (MHD_USE_POLL);
+      if (verbose && 0 != lastErr)
+        fprintf (stderr, "Error during testing with internal thread with 
poll().\n");
+      errorCount += lastErr;
+      lastErr = testPutThreadPerConn (MHD_USE_POLL);
+      if (verbose && 0 != lastErr)
+        fprintf (stderr, "Error during testing with internal thread per 
connection with poll().\n");
+      errorCount += lastErr;
+      lastErr = testPutThreadPool (MHD_USE_POLL);
+      if (verbose && 0 != lastErr)
+        fprintf (stderr, "Error during testing with thread pool per connection 
with poll().\n");
+      errorCount += lastErr;
+    }
+  if (MHD_is_feature_supported(MHD_FEATURE_EPOLL))
+    {
+      lastErr = testPutInternalThread (MHD_USE_EPOLL);
+      if (verbose && 0 != lastErr)
+        fprintf (stderr, "Error during testing with internal thread with 
epoll.\n");
+      errorCount += lastErr;
+      lastErr = testPutThreadPool (MHD_USE_EPOLL);
+      if (verbose && 0 != lastErr)
+        fprintf (stderr, "Error during testing with thread pool per connection 
with epoll.\n");
+      errorCount += lastErr;
+    }
   free (put_buffer);
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);

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



reply via email to

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