[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 03/11: perf_get_concurrent11: added new tes
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 03/11: perf_get_concurrent11: added new test, fixed "11" mode detection |
Date: |
Sun, 26 May 2019 23:46:47 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit dc4af6f6001a35f965a088d9b20d6a26cd94254a
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Sun May 26 17:06:04 2019 +0300
perf_get_concurrent11: added new test, fixed "11" mode detection
---
src/testcurl/Makefile.am | 12 +++++++++++-
src/testcurl/perf_get_concurrent.c | 38 ++++++++++++++++++++------------------
2 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index fde060c5..c8bb5cec 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -29,6 +29,7 @@ THREAD_ONLY_TESTS = \
if HAVE_POSIX_THREADS
THREAD_ONLY_TESTS += \
+ perf_get_concurrent11 \
test_quiesce \
test_concurrent_stop \
perf_get_concurrent
@@ -144,13 +145,22 @@ perf_get_LDADD = \
perf_get_concurrent_SOURCES = \
perf_get_concurrent.c \
- gauger.h
+ gauger.h mhd_has_in_name.h
perf_get_concurrent_CFLAGS = \
$(PTHREAD_CFLAGS) $(AM_CFLAGS)
perf_get_concurrent_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
$(PTHREAD_LIBS) @LIBCURL@
+perf_get_concurrent11_SOURCES = \
+ perf_get_concurrent.c \
+ gauger.h mhd_has_in_name.h
+perf_get_concurrent11_CFLAGS = \
+ $(PTHREAD_CFLAGS) $(AM_CFLAGS)
+perf_get_concurrent11_LDADD = \
+ $(top_builddir)/src/microhttpd/libmicrohttpd.la \
+ $(PTHREAD_LIBS) @LIBCURL@
+
test_digestauth_SOURCES = \
test_digestauth.c
test_digestauth_LDADD = \
diff --git a/src/testcurl/perf_get_concurrent.c
b/src/testcurl/perf_get_concurrent.c
index 2c685867..336a1d1e 100644
--- a/src/testcurl/perf_get_concurrent.c
+++ b/src/testcurl/perf_get_concurrent.c
@@ -41,6 +41,7 @@
#include <time.h>
#include <pthread.h>
#include "gauger.h"
+#include "mhd_has_in_name.h"
#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
#undef CPU_COUNT
@@ -182,23 +183,23 @@ thread_gets (void *param)
unsigned int i;
char * const url = (char*) param;
+ c = curl_easy_init ();
+ curl_easy_setopt (c, CURLOPT_URL, url);
+ curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer);
+ curl_easy_setopt (c, CURLOPT_WRITEDATA, NULL);
+ curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L);
+ curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
+ if (oneone)
+ curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+ else
+ curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+ curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
+ /* NOTE: use of CONNECTTIMEOUT without also
+ setting NOSIGNAL results in really weird
+ crashes on my system! */
+ curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L);
for (i=0;i<ROUNDS;i++)
{
- c = curl_easy_init ();
- curl_easy_setopt (c, CURLOPT_URL, url);
- curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer);
- curl_easy_setopt (c, CURLOPT_WRITEDATA, NULL);
- curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
- curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
- if (oneone)
- curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
- else
- curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
- curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L);
- /* NOTE: use of CONNECTTIMEOUT without also
- setting NOSIGNAL results in really weird
- crashes on my system! */
- curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1);
if (CURLE_OK != (errornum = curl_easy_perform (c)))
{
fprintf (stderr,
@@ -207,8 +208,8 @@ thread_gets (void *param)
curl_easy_cleanup (c);
return "curl error";
}
- curl_easy_cleanup (c);
}
+ curl_easy_cleanup (c);
return NULL;
}
@@ -467,8 +468,9 @@ main (int argc, char *const *argv)
int port = 1100;
(void)argc; /* Unused. Silent compiler warning. */
- oneone = (NULL != strrchr (argv[0], (int) '/')) ?
- (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
+ if (NULL == argv || 0 == argv[0])
+ return 99;
+ oneone = has_in_name (argv[0], "11");
if (oneone)
port += 15;
if (0 != curl_global_init (CURL_GLOBAL_WIN32))
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libmicrohttpd] branch master updated (29e20dfb -> 3544e5c1), gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 02/11: perf_get_concurrent: fixed exhausting of local ports on multi-core machines, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 01/11: test_concurrent_stop: heavily rewritten, added watchdog, avoided exhausting of ports, fixed resource leakage., gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 04/11: curl tests: fixed detection of "11" marker on w32, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 05/11: test_https_get_select: fixed usage of uninitialized variable, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 03/11: perf_get_concurrent11: added new test, fixed "11" mode detection,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 06/11: tests: properly setup CURL options, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 07/11: tests: fixed compiler warnings on W32, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 10/11: ChangeLog updated, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 09/11: daemon: flush stderr after each write for debug builds, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 11/11: test_shutdown_*: fixed for W32, gnunet, 2019/05/26
- [GNUnet-SVN] [libmicrohttpd] 08/11: test_get: implemented more detailed reports, gnunet, 2019/05/26