aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_get_response_cleanup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_get_response_cleanup.c')
-rw-r--r--src/testcurl/test_get_response_cleanup.c10
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
80static void 81static void
81kill_curl (pid_t pid) 82kill_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
100static void 102static void
101push_free_callback (void *cls) 103push_free_callback (void *cls)
102{ 104{
@@ -165,19 +167,20 @@ testInternalGet ()
165 return 0; 167 return 0;
166} 168}
167 169
170
168static int 171static int
169testMultithreadedGet () 172testMultithreadedGet ()
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
204static int 208static int
205testMultithreadedPoolGet () 209testMultithreadedPoolGet ()
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
227static int 232static int
228testExternalGet () 233testExternalGet ()
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)