diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-26 19:16:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-26 19:16:59 +0000 |
commit | 29dae094f2b8269e481012374b61b7295ca99dac (patch) | |
tree | 1f0b6d7345f6d3e07c96ca0f7a223627767f58cd /src/testcurl/daemontest_get_response_cleanup.c | |
parent | c36962f2c19a8d97f4faa0446b93984a75842c8e (diff) | |
download | libmicrohttpd-29dae094f2b8269e481012374b61b7295ca99dac.tar.gz libmicrohttpd-29dae094f2b8269e481012374b61b7295ca99dac.zip |
report failure to exec curl
Diffstat (limited to 'src/testcurl/daemontest_get_response_cleanup.c')
-rw-r--r-- | src/testcurl/daemontest_get_response_cleanup.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/testcurl/daemontest_get_response_cleanup.c b/src/testcurl/daemontest_get_response_cleanup.c index 90550c45..d2e52e9d 100644 --- a/src/testcurl/daemontest_get_response_cleanup.c +++ b/src/testcurl/daemontest_get_response_cleanup.c | |||
@@ -57,6 +57,9 @@ fork_curl (const char *url) | |||
57 | if (ret != 0) | 57 | if (ret != 0) |
58 | return ret; | 58 | return ret; |
59 | execlp ("curl", "curl", "-s", "-N", "-o", "/dev/null", "-GET", url, NULL); | 59 | execlp ("curl", "curl", "-s", "-N", "-o", "/dev/null", "-GET", url, NULL); |
60 | fprintf (stderr, | ||
61 | "Failed to exec curl: %s\n", | ||
62 | strerror (errno)); | ||
60 | _exit (-1); | 63 | _exit (-1); |
61 | } | 64 | } |
62 | 65 | ||
@@ -65,7 +68,7 @@ kill_curl (pid_t pid) | |||
65 | { | 68 | { |
66 | int status; | 69 | int status; |
67 | 70 | ||
68 | // fprintf (stderr, "Killing curl\n"); | 71 | //fprintf (stderr, "Killing curl\n"); |
69 | kill (pid, SIGTERM); | 72 | kill (pid, SIGTERM); |
70 | waitpid (pid, &status, 0); | 73 | waitpid (pid, &status, 0); |
71 | } | 74 | } |
@@ -85,7 +88,7 @@ push_free_callback (void *cls) | |||
85 | { | 88 | { |
86 | int *ok = cls; | 89 | int *ok = cls; |
87 | 90 | ||
88 | // fprintf (stderr, "Cleanup callback called!\n"); | 91 | //fprintf (stderr, "Cleanup callback called!\n"); |
89 | *ok = 0; | 92 | *ok = 0; |
90 | } | 93 | } |
91 | 94 | ||
@@ -104,6 +107,7 @@ ahc_echo (void *cls, | |||
104 | struct MHD_Response *response; | 107 | struct MHD_Response *response; |
105 | int ret; | 108 | int ret; |
106 | 109 | ||
110 | //fprintf (stderr, "In CB: %s!\n", method); | ||
107 | if (0 != strcmp (me, method)) | 111 | if (0 != strcmp (me, method)) |
108 | return MHD_NO; /* unexpected method */ | 112 | return MHD_NO; /* unexpected method */ |
109 | if (&ptr != *unused) | 113 | if (&ptr != *unused) |
@@ -160,6 +164,7 @@ testMultithreadedGet () | |||
160 | if (d == NULL) | 164 | if (d == NULL) |
161 | return 16; | 165 | return 16; |
162 | ok = 1; | 166 | ok = 1; |
167 | //fprintf (stderr, "Forking cURL!\n"); | ||
163 | curl = fork_curl ("http://localhost:1081/"); | 168 | curl = fork_curl ("http://localhost:1081/"); |
164 | sleep (1); | 169 | sleep (1); |
165 | kill_curl (curl); | 170 | kill_curl (curl); |
@@ -174,7 +179,7 @@ testMultithreadedGet () | |||
174 | } | 179 | } |
175 | kill_curl (curl); | 180 | kill_curl (curl); |
176 | sleep (1); | 181 | sleep (1); |
177 | // fprintf (stderr, "Stopping daemon!\n"); | 182 | //fprintf (stderr, "Stopping daemon!\n"); |
178 | MHD_stop_daemon (d); | 183 | MHD_stop_daemon (d); |
179 | if (ok != 0) | 184 | if (ok != 0) |
180 | return 32; | 185 | return 32; |
@@ -198,7 +203,7 @@ testMultithreadedPoolGet () | |||
198 | sleep (1); | 203 | sleep (1); |
199 | kill_curl (curl); | 204 | kill_curl (curl); |
200 | sleep (1); | 205 | sleep (1); |
201 | // fprintf (stderr, "Stopping daemon!\n"); | 206 | //fprintf (stderr, "Stopping daemon!\n"); |
202 | MHD_stop_daemon (d); | 207 | MHD_stop_daemon (d); |
203 | if (ok != 0) | 208 | if (ok != 0) |
204 | return 128; | 209 | return 128; |