gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r32568 - in libmicrohttpd: . src/examples src/testcurl src/


From: gnunet
Subject: [GNUnet-SVN] r32568 - in libmicrohttpd: . src/examples src/testcurl src/testcurl/https
Date: Thu, 6 Mar 2014 14:22:36 +0100

Author: Karlson2k
Date: 2014-03-06 14:22:35 +0100 (Thu, 06 Mar 2014)
New Revision: 32568

Modified:
   libmicrohttpd/configure.ac
   libmicrohttpd/src/examples/Makefile.am
   libmicrohttpd/src/examples/benchmark.c
   libmicrohttpd/src/examples/benchmark_https.c
   libmicrohttpd/src/examples/demo.c
   libmicrohttpd/src/testcurl/Makefile.am
   libmicrohttpd/src/testcurl/https/Makefile.am
   libmicrohttpd/src/testcurl/https/test_https_get_parallel.c
   libmicrohttpd/src/testcurl/https/test_https_get_parallel_threads.c
   libmicrohttpd/src/testcurl/perf_get.c
   libmicrohttpd/src/testcurl/perf_get_concurrent.c
   libmicrohttpd/src/testcurl/test_get.c
   libmicrohttpd/src/testcurl/test_get_chunked.c
   libmicrohttpd/src/testcurl/test_get_response_cleanup.c
   libmicrohttpd/src/testcurl/test_get_sendfile.c
   libmicrohttpd/src/testcurl/test_iplimit.c
   libmicrohttpd/src/testcurl/test_large_put.c
   libmicrohttpd/src/testcurl/test_post.c
   libmicrohttpd/src/testcurl/test_post_loop.c
   libmicrohttpd/src/testcurl/test_postform.c
   libmicrohttpd/src/testcurl/test_process_headers.c
   libmicrohttpd/src/testcurl/test_put.c
   libmicrohttpd/src/testcurl/test_put_chunked.c
   libmicrohttpd/src/testcurl/test_quiesce.c
   libmicrohttpd/src/testcurl/test_start_stop.c
Log:
Use number of CPUs in tests and examples

Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac  2014-03-06 13:21:39 UTC (rev 32567)
+++ libmicrohttpd/configure.ac  2014-03-06 13:22:35 UTC (rev 32568)
@@ -645,6 +645,8 @@
 AC_MSG_RESULT($use_gcov)
 AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
 
+AX_COUNT_CPUS
+AC_SUBST([CPU_COUNT])
 
 AC_SUBST(MHD_LIB_CPPFLAGS)
 AC_SUBST(MHD_LIB_CFLAGS)

Modified: libmicrohttpd/src/examples/Makefile.am
===================================================================
--- libmicrohttpd/src/examples/Makefile.am      2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/examples/Makefile.am      2014-03-06 13:22:35 UTC (rev 
32568)
@@ -6,6 +6,8 @@
 
 AM_CFLAGS = @LIBGCRYPT_CFLAGS@
 
+CPU_COUNT_DEF = -DCPU_COUNT=$(CPU_COUNT)
+
 if USE_COVERAGE
   AM_CFLAGS += --coverage
 endif
@@ -72,6 +74,8 @@
  demo.c
 demo_CFLAGS = \
  $(PTHREAD_CFLAGS) $(AM_CFLAGS)
+demo_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(CPU_COUNT_DEF)
 demo_LDADD = \
  $(top_builddir)/src/microhttpd/libmicrohttpd.la  \
  $(PTHREAD_LIBS) -lmagic
@@ -87,11 +91,15 @@
 
 benchmark_SOURCES = \
  benchmark.c 
+benchmark_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(CPU_COUNT_DEF)
 benchmark_LDADD = \
  $(top_builddir)/src/microhttpd/libmicrohttpd.la  
 
 benchmark_https_SOURCES = \
  benchmark_https.c 
+benchmark_https_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(CPU_COUNT_DEF)
 benchmark_https_LDADD = \
  $(top_builddir)/src/microhttpd/libmicrohttpd.la  
 

Modified: libmicrohttpd/src/examples/benchmark.c
===================================================================
--- libmicrohttpd/src/examples/benchmark.c      2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/examples/benchmark.c      2014-03-06 13:22:35 UTC (rev 
32568)
@@ -25,6 +25,13 @@
 #include "platform.h"
 #include <microhttpd.h>
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 #define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
 
 
@@ -34,7 +41,7 @@
  * Number of threads to run in the thread pool.  Should (roughly) match
  * the number of cores on your system.
  */
-#define NUMBER_OF_THREADS 4
+#define NUMBER_OF_THREADS CPU_COUNT
 
 static unsigned int small_deltas[SMALL];
 

Modified: libmicrohttpd/src/examples/benchmark_https.c
===================================================================
--- libmicrohttpd/src/examples/benchmark_https.c        2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/examples/benchmark_https.c        2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -25,6 +25,13 @@
 #include "platform.h"
 #include <microhttpd.h>
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 #define PAGE "<html><head><title>libmicrohttpd 
demo</title></head><body>libmicrohttpd demo</body></html>"
 
 
@@ -34,7 +41,7 @@
  * Number of threads to run in the thread pool.  Should (roughly) match
  * the number of cores on your system.
  */
-#define NUMBER_OF_THREADS 4
+#define NUMBER_OF_THREADS CPU_COUNT
 
 static unsigned int small_deltas[SMALL];
 

Modified: libmicrohttpd/src/examples/demo.c
===================================================================
--- libmicrohttpd/src/examples/demo.c   2014-03-06 13:21:39 UTC (rev 32567)
+++ libmicrohttpd/src/examples/demo.c   2014-03-06 13:22:35 UTC (rev 32568)
@@ -39,11 +39,18 @@
 #include <limits.h>
 #include <ctype.h>
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 /**
  * Number of threads to run in the thread pool.  Should (roughly) match
  * the number of cores on your system.
  */
-#define NUMBER_OF_THREADS 8
+#define NUMBER_OF_THREADS CPU_COUNT
 
 /**
  * How many bytes of a file do we give to libmagic to determine the mime type?

Modified: libmicrohttpd/src/testcurl/Makefile.am
===================================================================
--- libmicrohttpd/src/testcurl/Makefile.am      2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/Makefile.am      2014-03-06 13:22:35 UTC (rev 
32568)
@@ -9,6 +9,7 @@
 endif
 
 AM_CPPFLAGS = \
+-DCPU_COUNT=$(CPU_COUNT) \
 -I$(top_srcdir) \
 -I$(top_srcdir)/src/microhttpd \
 -I$(top_srcdir)/src/include \

Modified: libmicrohttpd/src/testcurl/https/Makefile.am
===================================================================
--- libmicrohttpd/src/testcurl/https/Makefile.am        2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/testcurl/https/Makefile.am        2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -4,6 +4,8 @@
   AM_CFLAGS = --coverage
 endif
 
+CPU_COUNT_DEF = -DCPU_COUNT=$(CPU_COUNT)
+
 AM_CPPFLAGS = \
   -I$(top_srcdir)/src/include \
   -I$(top_srcdir)/src/microhttpd \
@@ -59,6 +61,8 @@
 test_https_get_parallel_SOURCES = \
   test_https_get_parallel.c \
   tls_test_common.c
+test_https_get_parallel_CPPFLAGS = \
+  $(AM_CPPFLAGS) $(CPU_COUNT_DEF)
 test_https_get_parallel_CFLAGS = \
   $(PTHREAD_CFLAGS) $(AM_CFLAGS)
 test_https_get_parallel_LDADD = \
@@ -77,6 +81,8 @@
 test_https_get_parallel_threads_SOURCES = \
   test_https_get_parallel_threads.c \
   tls_test_common.c
+test_https_get_parallel_threads_CPPFLAGS = \
+  $(AM_CPPFLAGS) $(CPU_COUNT_DEF)
 test_https_get_parallel_threads_CFLAGS = \
   $(PTHREAD_CFLAGS) $(AM_CFLAGS)
 test_https_get_parallel_threads_LDADD = \

Modified: libmicrohttpd/src/testcurl/https/test_https_get_parallel.c
===================================================================
--- libmicrohttpd/src/testcurl/https/test_https_get_parallel.c  2014-03-06 
13:21:39 UTC (rev 32567)
+++ libmicrohttpd/src/testcurl/https/test_https_get_parallel.c  2014-03-06 
13:22:35 UTC (rev 32568)
@@ -33,6 +33,13 @@
 #include <gcrypt.h>
 #include "tls_test_common.h"
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 4
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 4
+#endif
+
 extern const char srv_key_pem[];
 extern const char srv_self_signed_cert_pem[];
 
@@ -94,7 +101,7 @@
                        int curl_proto_version)
 {
   int i;
-  int client_count = 3;
+  int client_count = (CPU_COUNT - 1);
   void *client_thread_ret;
   pthread_t client_arr[client_count];
   struct https_test_data client_args =

Modified: libmicrohttpd/src/testcurl/https/test_https_get_parallel_threads.c
===================================================================
--- libmicrohttpd/src/testcurl/https/test_https_get_parallel_threads.c  
2014-03-06 13:21:39 UTC (rev 32567)
+++ libmicrohttpd/src/testcurl/https/test_https_get_parallel_threads.c  
2014-03-06 13:22:35 UTC (rev 32568)
@@ -35,6 +35,13 @@
 #include <gcrypt.h>
 #include "tls_test_common.h"
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 4
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 4
+#endif
+
 extern const char srv_key_pem[];
 extern const char srv_self_signed_cert_pem[];
 
@@ -94,7 +101,7 @@
                        int curl_proto_version)
 {
   int i;
-  int client_count = 3;
+  int client_count = (CPU_COUNT - 1);
   void *client_thread_ret;
   pthread_t client_arr[client_count];
   struct https_test_data client_args =

Modified: libmicrohttpd/src/testcurl/perf_get.c
===================================================================
--- libmicrohttpd/src/testcurl/perf_get.c       2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/perf_get.c       2014-03-06 13:22:35 UTC (rev 
32568)
@@ -50,6 +50,13 @@
 #include <sys/socket.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 /**
  * How many rounds of operations do we do for each
  * test?
@@ -306,7 +313,7 @@
   cbc.size = 2048;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   start_timer ();

Modified: libmicrohttpd/src/testcurl/perf_get_concurrent.c
===================================================================
--- libmicrohttpd/src/testcurl/perf_get_concurrent.c    2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/testcurl/perf_get_concurrent.c    2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -41,6 +41,13 @@
 #include <time.h>
 #include "gauger.h"
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 /**
  * How many rounds of operations do we do for each
  * test (total number of requests will be ROUNDS * PAR).
@@ -50,7 +57,7 @@
 /**
  * How many requests do we do in parallel?
  */
-#define PAR 4
+#define PAR CPU_COUNT
 
 /**
  * Do we use HTTP 1.1?
@@ -262,7 +269,7 @@
 
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | poll_flag,
                         port, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   start_timer ();

Modified: libmicrohttpd/src/testcurl/test_get.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get.c       2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_get.c       2014-03-06 13:22:35 UTC (rev 
32568)
@@ -46,6 +46,13 @@
 #include <sys/socket.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 static int oneone;
 
 struct CBC
@@ -214,7 +221,7 @@
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | poll_flag,
                         1081, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   c = curl_easy_init ();

Modified: libmicrohttpd/src/testcurl/test_get_chunked.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get_chunked.c       2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/testcurl/test_get_chunked.c       2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -40,6 +40,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 struct CBC
 {
   char *buf;
@@ -243,7 +250,7 @@
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   c = curl_easy_init ();

Modified: libmicrohttpd/src/testcurl/test_get_response_cleanup.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get_response_cleanup.c      2014-03-06 
13:21:39 UTC (rev 32567)
+++ libmicrohttpd/src/testcurl/test_get_response_cleanup.c      2014-03-06 
13:22:35 UTC (rev 32568)
@@ -48,6 +48,13 @@
 #include <windows.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 #define TESTSTR "/* DO NOT CHANGE THIS LINE */"
 
 static int oneone;
@@ -202,7 +209,7 @@
 
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 64;
   ok = 1;

Modified: libmicrohttpd/src/testcurl/test_get_sendfile.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get_sendfile.c      2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/testcurl/test_get_sendfile.c      2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -40,6 +40,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 #define TESTSTR "This is the content of the test file we are sending using 
sendfile (if available)"
 
 char *sourcefile;
@@ -218,7 +225,7 @@
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   c = curl_easy_init ();

Modified: libmicrohttpd/src/testcurl/test_iplimit.c
===================================================================
--- libmicrohttpd/src/testcurl/test_iplimit.c   2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_iplimit.c   2014-03-06 13:22:35 UTC (rev 
32568)
@@ -44,6 +44,13 @@
 #include <windows.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 static int oneone;
 
 struct CBC
@@ -208,7 +215,7 @@
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081, NULL, NULL, &ahc_echo, "GET",
                         MHD_OPTION_PER_IP_CONNECTION_LIMIT, 2,
-                        MHD_OPTION_THREAD_POOL_SIZE, 4,
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
                         MHD_OPTION_END);
   if (d == NULL)
     return 16;

Modified: libmicrohttpd/src/testcurl/test_large_put.c
===================================================================
--- libmicrohttpd/src/testcurl/test_large_put.c 2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_large_put.c 2014-03-06 13:22:35 UTC (rev 
32568)
@@ -36,6 +36,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 static int oneone;
 
 /**
@@ -267,7 +274,7 @@
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081,
                         NULL, NULL, &ahc_echo, &done_flag,
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, 
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) 
(1024*1024),
                        MHD_OPTION_END);
   if (d == NULL)

Modified: libmicrohttpd/src/testcurl/test_post.c
===================================================================
--- libmicrohttpd/src/testcurl/test_post.c      2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_post.c      2014-03-06 13:22:35 UTC (rev 
32568)
@@ -43,6 +43,13 @@
 #include <windows.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 #define POST_DATA "name=daniel&project=curl"
 
 static int oneone;
@@ -273,7 +280,7 @@
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081, NULL, NULL, &ahc_echo, NULL,
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, 
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,       
                
                        MHD_OPTION_END);
   if (d == NULL)

Modified: libmicrohttpd/src/testcurl/test_post_loop.c
===================================================================
--- libmicrohttpd/src/testcurl/test_post_loop.c 2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_post_loop.c 2014-03-06 13:22:35 UTC (rev 
32568)
@@ -37,6 +37,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 #define POST_DATA "<?xml version='1.0' 
?>\n<xml>\n<data-id>1</data-id>\n</xml>\n"
 
 #define LOOPCOUNT 1000
@@ -242,7 +249,7 @@
   cbc.size = 2048;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081, NULL, NULL, &ahc_echo, NULL,
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   for (i = 0; i < LOOPCOUNT; i++)

Modified: libmicrohttpd/src/testcurl/test_postform.c
===================================================================
--- libmicrohttpd/src/testcurl/test_postform.c  2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_postform.c  2014-03-06 13:22:35 UTC (rev 
32568)
@@ -39,6 +39,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 static int oneone;
 
 struct CBC
@@ -290,7 +297,7 @@
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081, NULL, NULL, &ahc_echo, NULL,
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, 
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
                        MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,       
                
                        MHD_OPTION_END);
   if (d == NULL)

Modified: libmicrohttpd/src/testcurl/test_process_headers.c
===================================================================
--- libmicrohttpd/src/testcurl/test_process_headers.c   2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/testcurl/test_process_headers.c   2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -37,6 +37,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 static int oneone;
 
 struct CBC
@@ -250,7 +257,7 @@
   cbc.pos = 0;
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         21080, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   c = curl_easy_init ();

Modified: libmicrohttpd/src/testcurl/test_put.c
===================================================================
--- libmicrohttpd/src/testcurl/test_put.c       2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_put.c       2014-03-06 13:22:35 UTC (rev 
32568)
@@ -36,6 +36,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 static int oneone;
 
 struct CBC
@@ -240,7 +247,7 @@
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         1081,
                         NULL, NULL, &ahc_echo, &done_flag,
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   c = curl_easy_init ();

Modified: libmicrohttpd/src/testcurl/test_put_chunked.c
===================================================================
--- libmicrohttpd/src/testcurl/test_put_chunked.c       2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/testcurl/test_put_chunked.c       2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -37,6 +37,13 @@
 #include <unistd.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 struct CBC
 {
   char *buf;
@@ -250,7 +257,7 @@
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
                         11081,
                         NULL, NULL, &ahc_echo, &done_flag,
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 16;
   c = curl_easy_init ();

Modified: libmicrohttpd/src/testcurl/test_quiesce.c
===================================================================
--- libmicrohttpd/src/testcurl/test_quiesce.c   2014-03-06 13:21:39 UTC (rev 
32567)
+++ libmicrohttpd/src/testcurl/test_quiesce.c   2014-03-06 13:22:35 UTC (rev 
32568)
@@ -39,6 +39,13 @@
 #include <sys/socket.h>
 #endif
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
+
 static int oneone;
 
 
@@ -436,16 +443,16 @@
     return 2;
   errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 0, 0);
   errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION, 0, 0);
-  errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 4, 0);
+  errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, 0);
   errorCount += testExternalGet ();
 #ifndef WINDOWS
   errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 0, MHD_USE_POLL);
   errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION, 0, MHD_USE_POLL);
-  errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 4, MHD_USE_POLL);
+  errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, MHD_USE_POLL);
 #endif
 #if EPOLL_SUPPORT
   errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 0, 
MHD_USE_EPOLL_LINUX_ONLY);
-  errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 4, 
MHD_USE_EPOLL_LINUX_ONLY);
+  errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, 
MHD_USE_EPOLL_LINUX_ONLY);
 #endif
   if (errorCount != 0)
     fprintf (stderr, "Error (code: %u)\n", errorCount);

Modified: libmicrohttpd/src/testcurl/test_start_stop.c
===================================================================
--- libmicrohttpd/src/testcurl/test_start_stop.c        2014-03-06 13:21:39 UTC 
(rev 32567)
+++ libmicrohttpd/src/testcurl/test_start_stop.c        2014-03-06 13:22:35 UTC 
(rev 32568)
@@ -28,7 +28,14 @@
 #include <curl/curl.h>
 #include <microhttpd.h>
 
+#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
+#undef CPU_COUNT
+#endif
+#if !defined(CPU_COUNT)
+#define CPU_COUNT 2
+#endif
 
+
 static int
 ahc_echo (void *cls,
           struct MHD_Connection *connection,
@@ -75,7 +82,7 @@
 
   d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | poll_flag,
                         1081, NULL, NULL, &ahc_echo, "GET",
-                        MHD_OPTION_THREAD_POOL_SIZE, 4, MHD_OPTION_END);
+                        MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, 
MHD_OPTION_END);
   if (d == NULL)
     return 4;
   MHD_stop_daemon (d);




reply via email to

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