diff options
Diffstat (limited to 'src/testcurl/perf_get.c')
-rw-r--r-- | src/testcurl/perf_get.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c index 98578173..ac6a23f3 100644 --- a/src/testcurl/perf_get.c +++ b/src/testcurl/perf_get.c | |||
@@ -207,7 +207,10 @@ testInternalGet (int port, int poll_flag) | |||
207 | { MHD_stop_daemon (d); return 32; } | 207 | { MHD_stop_daemon (d); return 32; } |
208 | port = (int)dinfo->port; | 208 | port = (int)dinfo->port; |
209 | } | 209 | } |
210 | sprintf(url, "http://127.0.0.1:%d/hello_world", port); | 210 | snprintf (url, |
211 | sizeof (url), | ||
212 | "http://127.0.0.1:%d/hello_world", | ||
213 | port); | ||
211 | start_timer (); | 214 | start_timer (); |
212 | for (i=0;i<ROUNDS;i++) | 215 | for (i=0;i<ROUNDS;i++) |
213 | { | 216 | { |
@@ -278,7 +281,10 @@ testMultithreadedGet (int port, int poll_flag) | |||
278 | { MHD_stop_daemon (d); return 32; } | 281 | { MHD_stop_daemon (d); return 32; } |
279 | port = (int)dinfo->port; | 282 | port = (int)dinfo->port; |
280 | } | 283 | } |
281 | sprintf(url, "http://127.0.0.1:%d/hello_world", port); | 284 | snprintf (url, |
285 | sizeof (url), | ||
286 | "http://127.0.0.1:%d/hello_world", | ||
287 | port); | ||
282 | start_timer (); | 288 | start_timer (); |
283 | for (i=0;i<ROUNDS;i++) | 289 | for (i=0;i<ROUNDS;i++) |
284 | { | 290 | { |
@@ -350,7 +356,10 @@ testMultithreadedPoolGet (int port, int poll_flag) | |||
350 | { MHD_stop_daemon (d); return 32; } | 356 | { MHD_stop_daemon (d); return 32; } |
351 | port = (int)dinfo->port; | 357 | port = (int)dinfo->port; |
352 | } | 358 | } |
353 | sprintf(url, "http://127.0.0.1:%d/hello_world", port); | 359 | snprintf (url, |
360 | sizeof (url), | ||
361 | "http://127.0.0.1:%d/hello_world", | ||
362 | port); | ||
354 | start_timer (); | 363 | start_timer (); |
355 | for (i=0;i<ROUNDS;i++) | 364 | for (i=0;i<ROUNDS;i++) |
356 | { | 365 | { |
@@ -424,8 +433,10 @@ testExternalGet (int port) | |||
424 | cbc.buf = buf; | 433 | cbc.buf = buf; |
425 | cbc.size = 2048; | 434 | cbc.size = 2048; |
426 | d = MHD_start_daemon (MHD_USE_ERROR_LOG, | 435 | d = MHD_start_daemon (MHD_USE_ERROR_LOG, |
427 | port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); | 436 | port, NULL, NULL, |
428 | if (d == NULL) | 437 | &ahc_echo, "GET", |
438 | MHD_OPTION_END); | ||
439 | if (NULL == d) | ||
429 | return 256; | 440 | return 256; |
430 | if (0 == port) | 441 | if (0 == port) |
431 | { | 442 | { |
@@ -435,7 +446,10 @@ testExternalGet (int port) | |||
435 | { MHD_stop_daemon (d); return 32; } | 446 | { MHD_stop_daemon (d); return 32; } |
436 | port = (int)dinfo->port; | 447 | port = (int)dinfo->port; |
437 | } | 448 | } |
438 | sprintf(url, "http://127.0.0.1:%d/hello_world", port); | 449 | snprintf (url, |
450 | sizeof (url), | ||
451 | "http://127.0.0.1:%d/hello_world", | ||
452 | port); | ||
439 | start_timer (); | 453 | start_timer (); |
440 | multi = curl_multi_init (); | 454 | multi = curl_multi_init (); |
441 | if (multi == NULL) | 455 | if (multi == NULL) |