[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37991 - libmicrohttpd/src/testcurl
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37991 - libmicrohttpd/src/testcurl |
Date: |
Fri, 23 Sep 2016 16:57:06 +0200 |
Author: grothoff
Date: 2016-09-23 16:57:05 +0200 (Fri, 23 Sep 2016)
New Revision: 37991
Modified:
libmicrohttpd/src/testcurl/perf_get.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_large_put.c
libmicrohttpd/src/testcurl/test_parse_cookies.c
libmicrohttpd/src/testcurl/test_process_arguments.c
Log:
more select() return value checks in testcases
Modified: libmicrohttpd/src/testcurl/perf_get.c
===================================================================
--- libmicrohttpd/src/testcurl/perf_get.c 2016-09-23 14:30:36 UTC (rev
37990)
+++ libmicrohttpd/src/testcurl/perf_get.c 2016-09-23 14:57:05 UTC (rev
37991)
@@ -28,7 +28,7 @@
* so the performance scores calculated with this code
* should NOT be used to compare with other HTTP servers
* (since MHD is actually better); only the relative
- * scores between MHD versions are meaningful.
+ * scores between MHD versions are meaningful.
* Furthermore, this code ONLY tests MHD processing
* a single request at a time. This is again
* not universally meaningful (i.e. when comparing
@@ -80,11 +80,11 @@
/**
- * Get the current timestamp
+ * Get the current timestamp
*
* @return current time in ms
*/
-static unsigned long long
+static unsigned long long
now ()
{
struct timeval tv;
@@ -98,7 +98,7 @@
/**
* Start the timer.
*/
-static void
+static void
start_timer()
{
start_time = now ();
@@ -110,7 +110,7 @@
*
* @param desc description of the threading mode we used
*/
-static void
+static void
stop (const char *desc)
{
double rps = ((double) (ROUNDS * 1000)) / ((double) (now() - start_time));
@@ -136,8 +136,8 @@
static size_t
-copyBuffer (void *ptr,
- size_t size, size_t nmemb,
+copyBuffer (void *ptr,
+ size_t size, size_t nmemb,
void *ctx)
{
struct CBC *cbc = ctx;
@@ -346,7 +346,7 @@
}
curl_easy_cleanup (c);
}
- stop (0 != (poll_flag & MHD_USE_POLL) ? "thread pool with poll" :
+ stop (0 != (poll_flag & MHD_USE_POLL) ? "thread pool with poll" :
0 != (poll_flag & MHD_USE_EPOLL) ? "thread pool with epoll" : "thread
pool with select");
MHD_stop_daemon (d);
if (cbc.pos != strlen ("/hello_world"))
@@ -451,7 +451,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
Modified: libmicrohttpd/src/testcurl/test_get.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get.c 2016-09-23 14:30:36 UTC (rev
37990)
+++ libmicrohttpd/src/testcurl/test_get.c 2016-09-23 14:57:05 UTC (rev
37991)
@@ -357,7 +357,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
Modified: libmicrohttpd/src/testcurl/test_get_chunked.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get_chunked.c 2016-09-23 14:30:36 UTC
(rev 37990)
+++ libmicrohttpd/src/testcurl/test_get_chunked.c 2016-09-23 14:57:05 UTC
(rev 37991)
@@ -367,7 +367,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
Modified: libmicrohttpd/src/testcurl/test_get_response_cleanup.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get_response_cleanup.c 2016-09-23
14:30:36 UTC (rev 37990)
+++ libmicrohttpd/src/testcurl/test_get_response_cleanup.c 2016-09-23
14:57:05 UTC (rev 37991)
@@ -71,10 +71,10 @@
if (ret != 0)
return ret;
execlp ("curl", "curl", "-s", "-N", "-o", "/dev/null", "-GET", url, NULL);
- fprintf (stderr,
+ fprintf (stderr,
"Failed to exec curl: %s\n",
strerror (errno));
- _exit (-1);
+ _exit (-1);
}
static void
@@ -130,7 +130,7 @@
return MHD_YES;
}
*unused = NULL;
- response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
+ response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
32 * 1024,
&push_callback,
&ok,
@@ -241,7 +241,7 @@
if (d == NULL)
return 256;
curl = fork_curl ("http://127.0.0.1:1082/");
-
+
start = time (NULL);
while ((time (NULL) - start < 2))
{
@@ -256,7 +256,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (max + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (max + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
MHD_run (d);
}
kill_curl (curl);
@@ -274,7 +278,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (max + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (max + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
MHD_run (d);
}
// fprintf (stderr, "Stopping daemon!\n");
Modified: libmicrohttpd/src/testcurl/test_get_sendfile.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get_sendfile.c 2016-09-23 14:30:36 UTC
(rev 37990)
+++ libmicrohttpd/src/testcurl/test_get_sendfile.c 2016-09-23 14:57:05 UTC
(rev 37991)
@@ -355,7 +355,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
Modified: libmicrohttpd/src/testcurl/test_large_put.c
===================================================================
--- libmicrohttpd/src/testcurl/test_large_put.c 2016-09-23 14:30:36 UTC (rev
37990)
+++ libmicrohttpd/src/testcurl/test_large_put.c 2016-09-23 14:57:05 UTC (rev
37991)
@@ -130,7 +130,7 @@
return MHD_YES;
}
response = MHD_create_response_from_buffer (strlen (url),
- (void *) url,
+ (void *) url,
MHD_RESPMEM_MUST_COPY);
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
MHD_destroy_response (response);
@@ -154,7 +154,7 @@
cbc.pos = 0;
d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
1080,
- NULL, NULL, &ahc_echo, &done_flag,
+ NULL, NULL, &ahc_echo, &done_flag,
MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)
(1024*1024),
MHD_OPTION_END);
if (d == NULL)
@@ -212,7 +212,7 @@
cbc.pos = 0;
d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
1081,
- NULL, NULL, &ahc_echo, &done_flag,
+ NULL, NULL, &ahc_echo, &done_flag,
MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)
(1024*1024),
MHD_OPTION_END);
if (d == NULL)
@@ -419,7 +419,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
Modified: libmicrohttpd/src/testcurl/test_parse_cookies.c
===================================================================
--- libmicrohttpd/src/testcurl/test_parse_cookies.c 2016-09-23 14:30:36 UTC
(rev 37990)
+++ libmicrohttpd/src/testcurl/test_parse_cookies.c 2016-09-23 14:57:05 UTC
(rev 37991)
@@ -201,7 +201,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
Modified: libmicrohttpd/src/testcurl/test_process_arguments.c
===================================================================
--- libmicrohttpd/src/testcurl/test_process_arguments.c 2016-09-23 14:30:36 UTC
(rev 37990)
+++ libmicrohttpd/src/testcurl/test_process_arguments.c 2016-09-23 14:57:05 UTC
(rev 37991)
@@ -200,7 +200,11 @@
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37991 - libmicrohttpd/src/testcurl,
gnunet <=