diff options
Diffstat (limited to 'src/testcurl/test_get_response_cleanup.c')
-rw-r--r-- | src/testcurl/test_get_response_cleanup.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/testcurl/test_get_response_cleanup.c b/src/testcurl/test_get_response_cleanup.c index 26b2ecda..2833899c 100644 --- a/src/testcurl/test_get_response_cleanup.c +++ b/src/testcurl/test_get_response_cleanup.c | |||
@@ -77,6 +77,7 @@ fork_curl (const char *url) | |||
77 | _exit (-1); | 77 | _exit (-1); |
78 | } | 78 | } |
79 | 79 | ||
80 | |||
80 | static void | 81 | static void |
81 | kill_curl (pid_t pid) | 82 | kill_curl (pid_t pid) |
82 | { | 83 | { |
@@ -97,6 +98,7 @@ push_callback (void *cls, uint64_t pos, char *buf, size_t max) | |||
97 | return 1; | 98 | return 1; |
98 | } | 99 | } |
99 | 100 | ||
101 | |||
100 | static void | 102 | static void |
101 | push_free_callback (void *cls) | 103 | push_free_callback (void *cls) |
102 | { | 104 | { |
@@ -165,19 +167,20 @@ testInternalGet () | |||
165 | return 0; | 167 | return 0; |
166 | } | 168 | } |
167 | 169 | ||
170 | |||
168 | static int | 171 | static int |
169 | testMultithreadedGet () | 172 | testMultithreadedGet () |
170 | { | 173 | { |
171 | struct MHD_Daemon *d; | 174 | struct MHD_Daemon *d; |
172 | pid_t curl; | 175 | pid_t curl; |
173 | 176 | ||
177 | ok = 1; | ||
174 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, | 178 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, |
175 | 1081, NULL, NULL, &ahc_echo, "GET", | 179 | 1081, NULL, NULL, &ahc_echo, "GET", |
176 | MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 2, | 180 | MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 2, |
177 | MHD_OPTION_END); | 181 | MHD_OPTION_END); |
178 | if (d == NULL) | 182 | if (d == NULL) |
179 | return 16; | 183 | return 16; |
180 | ok = 1; | ||
181 | //fprintf (stderr, "Forking cURL!\n"); | 184 | //fprintf (stderr, "Forking cURL!\n"); |
182 | curl = fork_curl ("http://127.0.0.1:1081/"); | 185 | curl = fork_curl ("http://127.0.0.1:1081/"); |
183 | sleep (1); | 186 | sleep (1); |
@@ -201,18 +204,19 @@ testMultithreadedGet () | |||
201 | return 0; | 204 | return 0; |
202 | } | 205 | } |
203 | 206 | ||
207 | |||
204 | static int | 208 | static int |
205 | testMultithreadedPoolGet () | 209 | testMultithreadedPoolGet () |
206 | { | 210 | { |
207 | struct MHD_Daemon *d; | 211 | struct MHD_Daemon *d; |
208 | pid_t curl; | 212 | pid_t curl; |
209 | 213 | ||
214 | ok = 1; | ||
210 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, | 215 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, |
211 | 1081, NULL, NULL, &ahc_echo, "GET", | 216 | 1081, NULL, NULL, &ahc_echo, "GET", |
212 | MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, MHD_OPTION_END); | 217 | MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, MHD_OPTION_END); |
213 | if (d == NULL) | 218 | if (d == NULL) |
214 | return 64; | 219 | return 64; |
215 | ok = 1; | ||
216 | curl = fork_curl ("http://127.0.0.1:1081/"); | 220 | curl = fork_curl ("http://127.0.0.1:1081/"); |
217 | sleep (1); | 221 | sleep (1); |
218 | kill_curl (curl); | 222 | kill_curl (curl); |
@@ -224,6 +228,7 @@ testMultithreadedPoolGet () | |||
224 | return 0; | 228 | return 0; |
225 | } | 229 | } |
226 | 230 | ||
231 | |||
227 | static int | 232 | static int |
228 | testExternalGet () | 233 | testExternalGet () |
229 | { | 234 | { |
@@ -236,6 +241,7 @@ testExternalGet () | |||
236 | struct timeval tv; | 241 | struct timeval tv; |
237 | pid_t curl; | 242 | pid_t curl; |
238 | 243 | ||
244 | ok = 1; | ||
239 | d = MHD_start_daemon (MHD_USE_ERROR_LOG, | 245 | d = MHD_start_daemon (MHD_USE_ERROR_LOG, |
240 | 1082, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); | 246 | 1082, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); |
241 | if (d == NULL) | 247 | if (d == NULL) |