aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-09-30 15:32:43 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-10-01 15:00:34 +0300
commit53207f93b0886adddf9bc0fa6ac1ba88db7a6682 (patch)
tree579197e64fa48aa40741f4321c661519e5f0ffa9
parentb34d7a3e0293cfd3248000bacfc5f5ae52903e21 (diff)
downloadlibmicrohttpd-53207f93b0886adddf9bc0fa6ac1ba88db7a6682.tar.gz
libmicrohttpd-53207f93b0886adddf9bc0fa6ac1ba88db7a6682.zip
testcurl: Muted some compiler warnings, minor refactoring
Used new API for creating of responses to avoid 'const' drops
-rw-r--r--src/testcurl/perf_get.c23
-rw-r--r--src/testcurl/perf_get_concurrent.c37
-rw-r--r--src/testcurl/test_add_conn.c15
-rw-r--r--src/testcurl/test_concurrent_stop.c13
-rw-r--r--src/testcurl/test_delete.c4
-rw-r--r--src/testcurl/test_digestauth_emu_ext.c1
-rw-r--r--src/testcurl/test_get.c21
-rw-r--r--src/testcurl/test_get_chunked.c15
-rw-r--r--src/testcurl/test_get_close_keep_alive.c13
-rw-r--r--src/testcurl/test_get_iovec.c81
-rw-r--r--src/testcurl/test_get_response_cleanup.c13
-rw-r--r--src/testcurl/test_get_sendfile.c14
-rw-r--r--src/testcurl/test_get_wait.c11
-rw-r--r--src/testcurl/test_iplimit.c13
-rw-r--r--src/testcurl/test_large_put.c6
-rw-r--r--src/testcurl/test_long_header.c15
-rw-r--r--src/testcurl/test_patch.c4
-rw-r--r--src/testcurl/test_post.c16
-rw-r--r--src/testcurl/test_post_loop.c8
-rw-r--r--src/testcurl/test_postform.c5
-rw-r--r--src/testcurl/test_process_arguments.c11
-rw-r--r--src/testcurl/test_process_headers.c17
-rw-r--r--src/testcurl/test_put.c4
-rw-r--r--src/testcurl/test_put_chunked.c5
-rw-r--r--src/testcurl/test_quiesce.c19
-rw-r--r--src/testcurl/test_quiesce_stream.c4
-rw-r--r--src/testcurl/test_timeout.c7
-rw-r--r--src/testcurl/test_toolarge.c10
-rw-r--r--src/testcurl/test_tricky.c10
-rw-r--r--src/testcurl/test_urlparse.c11
30 files changed, 208 insertions, 218 deletions
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index a9298b2a..825e4778 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -166,12 +166,12 @@ ahc_echo (void *cls,
166 void **req_cls) 166 void **req_cls)
167{ 167{
168 static int ptr; 168 static int ptr;
169 const char *me = cls;
170 enum MHD_Result ret; 169 enum MHD_Result ret;
170 (void) cls;
171 (void) url; (void) version; /* Unused. Silent compiler warning. */ 171 (void) url; (void) version; /* Unused. Silent compiler warning. */
172 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 172 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
173 173
174 if (0 != strcmp (me, method)) 174 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
175 return MHD_NO; /* unexpected method */ 175 return MHD_NO; /* unexpected method */
176 if (&ptr != *req_cls) 176 if (&ptr != *req_cls)
177 { 177 {
@@ -203,8 +203,8 @@ testInternalGet (int port, int poll_flag)
203 cbc.buf = buf; 203 cbc.buf = buf;
204 cbc.size = 2048; 204 cbc.size = 2048;
205 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 205 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
206 | poll_flag, 206 | (enum MHD_FLAG) poll_flag,
207 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 207 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
208 if (d == NULL) 208 if (d == NULL)
209 return 1; 209 return 1;
210 if (0 == port) 210 if (0 == port)
@@ -282,8 +282,8 @@ testMultithreadedGet (int port, int poll_flag)
282 cbc.size = 2048; 282 cbc.size = 2048;
283 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION 283 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
284 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 284 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
285 | poll_flag, 285 | (enum MHD_FLAG) poll_flag,
286 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 286 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
287 if (d == NULL) 287 if (d == NULL)
288 return 16; 288 return 16;
289 if (0 == port) 289 if (0 == port)
@@ -363,8 +363,8 @@ testMultithreadedPoolGet (int port, int poll_flag)
363 cbc.buf = buf; 363 cbc.buf = buf;
364 cbc.size = 2048; 364 cbc.size = 2048;
365 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 365 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
366 | poll_flag, 366 | (enum MHD_FLAG) poll_flag,
367 port, NULL, NULL, &ahc_echo, "GET", 367 port, NULL, NULL, &ahc_echo, NULL,
368 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 368 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
369 MHD_OPTION_END); 369 MHD_OPTION_END);
370 if (d == NULL) 370 if (d == NULL)
@@ -459,7 +459,7 @@ testExternalGet (int port)
459 cbc.size = 2048; 459 cbc.size = 2048;
460 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 460 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
461 port, NULL, NULL, 461 port, NULL, NULL,
462 &ahc_echo, "GET", 462 &ahc_echo, NULL,
463 MHD_OPTION_END); 463 MHD_OPTION_END);
464 if (NULL == d) 464 if (NULL == d)
465 return 256; 465 return 256;
@@ -638,9 +638,8 @@ main (int argc, char *const *argv)
638 port += 15; 638 port += 15;
639 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 639 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
640 return 2; 640 return 2;
641 response = MHD_create_response_from_buffer (strlen ("/hello_world"), 641 response = MHD_create_response_from_buffer_copy (strlen ("/hello_world"),
642 "/hello_world", 642 "/hello_world");
643 MHD_RESPMEM_MUST_COPY);
644 errorCount += testExternalGet (port++); 643 errorCount += testExternalGet (port++);
645 if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS)) 644 if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
646 { 645 {
diff --git a/src/testcurl/perf_get_concurrent.c b/src/testcurl/perf_get_concurrent.c
index f0b4e923..203fead1 100644
--- a/src/testcurl/perf_get_concurrent.c
+++ b/src/testcurl/perf_get_concurrent.c
@@ -157,12 +157,12 @@ ahc_echo (void *cls,
157 void **req_cls) 157 void **req_cls)
158{ 158{
159 static int ptr; 159 static int ptr;
160 const char *me = cls;
161 enum MHD_Result ret; 160 enum MHD_Result ret;
161 (void) cls;
162 (void) url; (void) version; /* Unused. Silent compiler warning. */ 162 (void) url; (void) version; /* Unused. Silent compiler warning. */
163 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 163 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
164 164
165 if (0 != strcmp (me, method)) 165 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
166 return MHD_NO; /* unexpected method */ 166 return MHD_NO; /* unexpected method */
167 if (&ptr != *req_cls) 167 if (&ptr != *req_cls)
168 { 168 {
@@ -184,6 +184,7 @@ thread_gets (void *param)
184 CURLcode errornum; 184 CURLcode errornum;
185 unsigned int i; 185 unsigned int i;
186 char *const url = (char *) param; 186 char *const url = (char *) param;
187 static char curl_err_marker[] = "curl error";
187 188
188 c = curl_easy_init (); 189 c = curl_easy_init ();
189 curl_easy_setopt (c, CURLOPT_URL, url); 190 curl_easy_setopt (c, CURLOPT_URL, url);
@@ -208,7 +209,7 @@ thread_gets (void *param)
208 "curl_easy_perform failed: `%s'\n", 209 "curl_easy_perform failed: `%s'\n",
209 curl_easy_strerror (errornum)); 210 curl_easy_strerror (errornum));
210 curl_easy_cleanup (c); 211 curl_easy_cleanup (c);
211 return "curl error"; 212 return curl_err_marker;
212 } 213 }
213 } 214 }
214 curl_easy_cleanup (c); 215 curl_easy_cleanup (c);
@@ -225,6 +226,7 @@ do_gets (void *param)
225 char url[64]; 226 char url[64];
226 int port = (int) (intptr_t) param; 227 int port = (int) (intptr_t) param;
227 char *err = NULL; 228 char *err = NULL;
229 static char pthr_err_marker[] = "pthread_create error";
228 230
229 snprintf (url, 231 snprintf (url,
230 sizeof (url), 232 sizeof (url),
@@ -236,7 +238,7 @@ do_gets (void *param)
236 { 238 {
237 for (j--; j >= 0; j--) 239 for (j--; j >= 0; j--)
238 pthread_join (par[j], NULL); 240 pthread_join (par[j], NULL);
239 return "pthread_create error"; 241 return pthr_err_marker;
240 } 242 }
241 } 243 }
242 for (j = 0; j < PAR; j++) 244 for (j = 0; j < PAR; j++)
@@ -269,8 +271,8 @@ testInternalGet (int port, int poll_flag)
269 271
270 signal_done = 0; 272 signal_done = 0;
271 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 273 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
272 | poll_flag, 274 | (enum MHD_FLAG) poll_flag,
273 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 275 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
274 if (d == NULL) 276 if (d == NULL)
275 return 1; 277 return 1;
276 if (0 == port) 278 if (0 == port)
@@ -320,8 +322,8 @@ testMultithreadedGet (int port, int poll_flag)
320 signal_done = 0; 322 signal_done = 0;
321 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION 323 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
322 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 324 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
323 | poll_flag, 325 | (enum MHD_FLAG) poll_flag,
324 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 326 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
325 if (d == NULL) 327 if (d == NULL)
326 return 16; 328 return 16;
327 if (0 == port) 329 if (0 == port)
@@ -367,8 +369,8 @@ testMultithreadedPoolGet (int port, int poll_flag)
367 369
368 signal_done = 0; 370 signal_done = 0;
369 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 371 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
370 | poll_flag, 372 | (enum MHD_FLAG) poll_flag,
371 port, NULL, NULL, &ahc_echo, "GET", 373 port, NULL, NULL, &ahc_echo, NULL,
372 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 374 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
373 MHD_OPTION_END); 375 MHD_OPTION_END);
374 if (d == NULL) 376 if (d == NULL)
@@ -418,7 +420,7 @@ testExternalGet (int port)
418 420
419 signal_done = 0; 421 signal_done = 0;
420 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 422 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
421 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 423 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
422 if (d == NULL) 424 if (d == NULL)
423 return 256; 425 return 256;
424 if (0 == port) 426 if (0 == port)
@@ -453,8 +455,12 @@ testExternalGet (int port)
453 tret = MHD_get_timeout64 (d, &tt64); 455 tret = MHD_get_timeout64 (d, &tt64);
454 if (MHD_YES != tret) 456 if (MHD_YES != tret)
455 tt64 = 1; 457 tt64 = 1;
456 tv.tv_sec = tt64 / 1000; 458#if ! defined(_WIN32) || defined(__CYGWIN__)
457 tv.tv_usec = 1000 * (tt64 % 1000); 459 tv.tv_sec = (time_t) (tt64 / 1000);
460#else /* Native W32 */
461 tv.tv_sec = (long) (tt64 / 1000);
462#endif /* Native W32 */
463 tv.tv_usec = ((long) (tt64 % 1000)) * 1000;
458 if (-1 == select (max + 1, &rs, &ws, &es, &tv)) 464 if (-1 == select (max + 1, &rs, &ws, &es, &tv))
459 { 465 {
460#ifdef MHD_POSIX_SOCKETS 466#ifdef MHD_POSIX_SOCKETS
@@ -511,9 +517,8 @@ main (int argc, char *const *argv)
511 port += 15; 517 port += 15;
512 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 518 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
513 return 2; 519 return 2;
514 response = MHD_create_response_from_buffer (strlen ("/hello_world"), 520 response = MHD_create_response_from_buffer_copy (strlen ("/hello_world"),
515 "/hello_world", 521 "/hello_world");
516 MHD_RESPMEM_MUST_COPY);
517 errorCount += testInternalGet (port++, 0); 522 errorCount += testInternalGet (port++, 0);
518 errorCount += testMultithreadedGet (port++, 0); 523 errorCount += testMultithreadedGet (port++, 0);
519 errorCount += testMultithreadedPoolGet (port++, 0); 524 errorCount += testMultithreadedPoolGet (port++, 0);
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c
index 62386657..085d5e69 100644
--- a/src/testcurl/test_add_conn.c
+++ b/src/testcurl/test_add_conn.c
@@ -151,15 +151,15 @@ ahc_echo (void *cls,
151 void **req_cls) 151 void **req_cls)
152{ 152{
153 static int ptr; 153 static int ptr;
154 const char *me = cls;
155 struct MHD_Response *response; 154 struct MHD_Response *response;
156 enum MHD_Result ret; 155 enum MHD_Result ret;
157 const char *v; 156 const char *v;
157 (void) cls;
158 (void) version; 158 (void) version;
159 (void) upload_data; 159 (void) upload_data;
160 (void) upload_data_size; /* Unused. Silence compiler warning. */ 160 (void) upload_data_size; /* Unused. Silence compiler warning. */
161 161
162 if (0 != strcmp (me, method)) 162 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
163 return MHD_NO; /* unexpected method */ 163 return MHD_NO; /* unexpected method */
164 if (&ptr != *req_cls) 164 if (&ptr != *req_cls)
165 { 165 {
@@ -200,9 +200,8 @@ ahc_echo (void *cls,
200 if (slow_reply) 200 if (slow_reply)
201 usleep (200000); 201 usleep (200000);
202 202
203 response = MHD_create_response_from_buffer (strlen (url), 203 response = MHD_create_response_from_buffer_copy (strlen (url),
204 (void *) url, 204 (const void *) url);
205 MHD_RESPMEM_MUST_COPY);
206 ret = MHD_queue_response (connection, 205 ret = MHD_queue_response (connection,
207 MHD_HTTP_OK, 206 MHD_HTTP_OK,
208 response); 207 response);
@@ -266,7 +265,7 @@ createListeningSocket (int *pport)
266 struct sockaddr_in sin; 265 struct sockaddr_in sin;
267 socklen_t sin_len; 266 socklen_t sin_len;
268#ifdef MHD_POSIX_SOCKETS 267#ifdef MHD_POSIX_SOCKETS
269 static const int on = 1; 268 static int on = 1;
270#endif /* MHD_POSIX_SOCKETS */ 269#endif /* MHD_POSIX_SOCKETS */
271 270
272 skt = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); 271 skt = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -745,7 +744,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
745 | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) 744 | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0)
746 | MHD_USE_ERROR_LOG, 745 | MHD_USE_ERROR_LOG,
747 *pport, NULL, NULL, 746 *pport, NULL, NULL,
748 &ahc_echo, "GET", 747 &ahc_echo, NULL,
749 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 748 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
750 MHD_OPTION_END); 749 MHD_OPTION_END);
751 else 750 else
@@ -754,7 +753,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
754 | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) 753 | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0)
755 | MHD_USE_ERROR_LOG, 754 | MHD_USE_ERROR_LOG,
756 *pport, NULL, NULL, 755 *pport, NULL, NULL,
757 &ahc_echo, "GET", 756 &ahc_echo, NULL,
758 MHD_OPTION_THREAD_POOL_SIZE, 757 MHD_OPTION_THREAD_POOL_SIZE,
759 testNumThreadsForPool (pollType), 758 testNumThreadsForPool (pollType),
760 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 759 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
diff --git a/src/testcurl/test_concurrent_stop.c b/src/testcurl/test_concurrent_stop.c
index e427ea42..d40f911b 100644
--- a/src/testcurl/test_concurrent_stop.c
+++ b/src/testcurl/test_concurrent_stop.c
@@ -145,12 +145,12 @@ ahc_echo (void *cls,
145 void **req_cls) 145 void **req_cls)
146{ 146{
147 static int marker; 147 static int marker;
148 const char *me = cls;
149 enum MHD_Result ret; 148 enum MHD_Result ret;
149 (void) cls;
150 (void) url; (void) version; /* Unused. Silent compiler warning. */ 150 (void) url; (void) version; /* Unused. Silent compiler warning. */
151 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 151 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
152 152
153 if (0 != strcmp (me, method)) 153 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
154 return MHD_NO; /* unexpected method */ 154 return MHD_NO; /* unexpected method */
155 if (&marker != *req_cls) 155 if (&marker != *req_cls)
156 { 156 {
@@ -273,7 +273,7 @@ testMultithreadedGet (int port,
273 | poll_flag, 273 | poll_flag,
274 port, 274 port,
275 NULL, NULL, 275 NULL, NULL,
276 &ahc_echo, "GET", 276 &ahc_echo, NULL,
277 MHD_OPTION_END); 277 MHD_OPTION_END);
278 if (d == NULL) 278 if (d == NULL)
279 return 16; 279 return 16;
@@ -318,7 +318,7 @@ testMultithreadedPoolGet (int port,
318 | poll_flag, 318 | poll_flag,
319 port, 319 port,
320 NULL, NULL, 320 NULL, NULL,
321 &ahc_echo, "GET", 321 &ahc_echo, NULL,
322 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 322 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
323 MHD_OPTION_END); 323 MHD_OPTION_END);
324 if (d == NULL) 324 if (d == NULL)
@@ -371,9 +371,8 @@ main (int argc, char *const *argv)
371 port += 5; 371 port += 5;
372 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 372 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
373 return 2; 373 return 2;
374 response = MHD_create_response_from_buffer (strlen ("/hello_world"), 374 response = MHD_create_response_from_buffer_copy (strlen ("/hello_world"),
375 "/hello_world", 375 "/hello_world");
376 MHD_RESPMEM_MUST_COPY);
377 errorCount += testMultithreadedGet (port, 0); 376 errorCount += testMultithreadedGet (port, 0);
378 if (0 != port) 377 if (0 != port)
379 port++; 378 port++;
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c
index f0e89395..91b51851 100644
--- a/src/testcurl/test_delete.c
+++ b/src/testcurl/test_delete.c
@@ -115,8 +115,8 @@ ahc_echo (void *cls,
115 *done = 1; 115 *done = 1;
116 return MHD_YES; 116 return MHD_YES;
117 } 117 }
118 response = MHD_create_response_from_buffer (strlen (url), (void *) url, 118 response = MHD_create_response_from_buffer_copy (strlen (url),
119 MHD_RESPMEM_MUST_COPY); 119 (const void *) url);
120 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 120 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
121 MHD_destroy_response (response); 121 MHD_destroy_response (response);
122 return ret; 122 return ret;
diff --git a/src/testcurl/test_digestauth_emu_ext.c b/src/testcurl/test_digestauth_emu_ext.c
index b3925d13..10e04477 100644
--- a/src/testcurl/test_digestauth_emu_ext.c
+++ b/src/testcurl/test_digestauth_emu_ext.c
@@ -530,6 +530,7 @@ ahc_echo (void *cls,
530 case MHD_DAUTH_WRONG_QOP: 530 case MHD_DAUTH_WRONG_QOP:
531 case MHD_DAUTH_WRONG_ALGO: 531 case MHD_DAUTH_WRONG_ALGO:
532 case MHD_DAUTH_TOO_LARGE: 532 case MHD_DAUTH_TOO_LARGE:
533 case MHD_DAUTH_NONCE_OTHER_COND:
533 fprintf (stderr, "'MHD_digest_auth_check3()' returned " 534 fprintf (stderr, "'MHD_digest_auth_check3()' returned "
534 "unexpected result: %d. ", 535 "unexpected result: %d. ",
535 check_res); 536 check_res);
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index 8fe1c771..09641fc5 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -110,15 +110,15 @@ ahc_echo (void *cls,
110 void **req_cls) 110 void **req_cls)
111{ 111{
112 static int ptr; 112 static int ptr;
113 const char *me = cls;
114 struct MHD_Response *response; 113 struct MHD_Response *response;
115 enum MHD_Result ret; 114 enum MHD_Result ret;
116 const char *v; 115 const char *v;
116 (void) cls;
117 (void) version; 117 (void) version;
118 (void) upload_data; 118 (void) upload_data;
119 (void) upload_data_size; /* Unused. Silence compiler warning. */ 119 (void) upload_data_size; /* Unused. Silence compiler warning. */
120 120
121 if (0 != strcmp (me, method)) 121 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
122 return MHD_NO; /* unexpected method */ 122 return MHD_NO; /* unexpected method */
123 if (&ptr != *req_cls) 123 if (&ptr != *req_cls)
124 { 124 {
@@ -156,9 +156,8 @@ ahc_echo (void *cls,
156 NULL == v ? "NULL" : v); 156 NULL == v ? "NULL" : v);
157 _exit (19); 157 _exit (19);
158 } 158 }
159 response = MHD_create_response_from_buffer (strlen (url), 159 response = MHD_create_response_from_buffer_copy (strlen (url),
160 (void *) url, 160 (const void *) url);
161 MHD_RESPMEM_MUST_COPY);
162 ret = MHD_queue_response (connection, 161 ret = MHD_queue_response (connection,
163 MHD_HTTP_OK, 162 MHD_HTTP_OK,
164 response); 163 response);
@@ -195,7 +194,7 @@ testInternalGet (int poll_flag)
195 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 194 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
196 | poll_flag, 195 | poll_flag,
197 global_port, NULL, NULL, 196 global_port, NULL, NULL,
198 &ahc_echo, "GET", 197 &ahc_echo, NULL,
199 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 198 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
200 MHD_OPTION_END); 199 MHD_OPTION_END);
201 if (d == NULL) 200 if (d == NULL)
@@ -269,7 +268,7 @@ testMultithreadedGet (int poll_flag)
269 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 268 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
270 | poll_flag, 269 | poll_flag,
271 global_port, NULL, NULL, 270 global_port, NULL, NULL,
272 &ahc_echo, "GET", 271 &ahc_echo, NULL,
273 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 272 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
274 MHD_OPTION_END); 273 MHD_OPTION_END);
275 if (d == NULL) 274 if (d == NULL)
@@ -342,7 +341,7 @@ testMultithreadedPoolGet (int poll_flag)
342 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 341 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
343 | poll_flag, 342 | poll_flag,
344 global_port, NULL, NULL, 343 global_port, NULL, NULL,
345 &ahc_echo, "GET", 344 &ahc_echo, NULL,
346 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 345 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
347 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 346 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
348 MHD_OPTION_END); 347 MHD_OPTION_END);
@@ -426,7 +425,7 @@ testExternalGet ()
426 cbc.pos = 0; 425 cbc.pos = 0;
427 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 426 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
428 global_port, NULL, NULL, 427 global_port, NULL, NULL,
429 &ahc_echo, "GET", 428 &ahc_echo, NULL,
430 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 429 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
431 MHD_OPTION_END); 430 MHD_OPTION_END);
432 if (d == NULL) 431 if (d == NULL)
@@ -601,7 +600,7 @@ testUnknownPortGet (int poll_flag)
601 cbc.pos = 0; 600 cbc.pos = 0;
602 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 601 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
603 | poll_flag, 602 | poll_flag,
604 0, NULL, NULL, &ahc_echo, "GET", 603 0, NULL, NULL, &ahc_echo, NULL,
605 MHD_OPTION_SOCK_ADDR, &addr, 604 MHD_OPTION_SOCK_ADDR, &addr,
606 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 605 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
607 MHD_OPTION_END); 606 MHD_OPTION_END);
@@ -688,7 +687,7 @@ testStopRace (int poll_flag)
688 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 687 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
689 | poll_flag, 688 | poll_flag,
690 global_port, NULL, NULL, 689 global_port, NULL, NULL,
691 &ahc_echo, "GET", 690 &ahc_echo, NULL,
692 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 691 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
693 MHD_OPTION_END); 692 MHD_OPTION_END);
694 if (d == NULL) 693 if (d == NULL)
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index 4f7b5606..5cc5aea9 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -183,16 +183,16 @@ ahc_echo (void *cls,
183 const char *upload_data, size_t *upload_data_size, void **req_cls) 183 const char *upload_data, size_t *upload_data_size, void **req_cls)
184{ 184{
185 static int aptr; 185 static int aptr;
186 const char *me = cls;
187 struct MHD_Response *response; 186 struct MHD_Response *response;
188 enum MHD_Result ret; 187 enum MHD_Result ret;
189 188
189 (void) cls;
190 (void) url; 190 (void) url;
191 (void) version; /* Unused. Silent compiler warning. */ 191 (void) version; /* Unused. Silent compiler warning. */
192 (void) upload_data; 192 (void) upload_data;
193 (void) upload_data_size; /* Unused. Silent compiler warning. */ 193 (void) upload_data_size; /* Unused. Silent compiler warning. */
194 194
195 if (0 != strcmp (me, method)) 195 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
196 return MHD_NO; /* unexpected method */ 196 return MHD_NO; /* unexpected method */
197 if (&aptr != *req_cls) 197 if (&aptr != *req_cls)
198 { 198 {
@@ -227,8 +227,7 @@ ahc_echo (void *cls,
227 for (pos = 0; pos < resp_size; pos += RESP_BLOCK_SIZE) 227 for (pos = 0; pos < resp_size; pos += RESP_BLOCK_SIZE)
228 memset (buf + pos, 'A' + (pos / RESP_BLOCK_SIZE), RESP_BLOCK_SIZE); 228 memset (buf + pos, 'A' + (pos / RESP_BLOCK_SIZE), RESP_BLOCK_SIZE);
229 229
230 response = MHD_create_response_from_buffer (resp_size, buf, 230 response = MHD_create_response_from_buffer_copy (resp_size, buf);
231 MHD_RESPMEM_MUST_COPY);
232 free (buf); 231 free (buf);
233 } 232 }
234 else 233 else
@@ -324,7 +323,7 @@ testInternalGet ()
324 cbc.size = 2048; 323 cbc.size = 2048;
325 cbc.pos = 0; 324 cbc.pos = 0;
326 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 325 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
327 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 326 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
328 if (d == NULL) 327 if (d == NULL)
329 return 1; 328 return 1;
330 if (0 == port) 329 if (0 == port)
@@ -407,7 +406,7 @@ testMultithreadedGet ()
407 cbc.pos = 0; 406 cbc.pos = 0;
408 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION 407 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
409 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 408 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
410 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 409 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
411 if (d == NULL) 410 if (d == NULL)
412 return 16; 411 return 16;
413 if (0 == port) 412 if (0 == port)
@@ -489,7 +488,7 @@ testMultithreadedPoolGet ()
489 cbc.size = 2048; 488 cbc.size = 2048;
490 cbc.pos = 0; 489 cbc.pos = 0;
491 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 490 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
492 port, NULL, NULL, &ahc_echo, "GET", 491 port, NULL, NULL, &ahc_echo, NULL,
493 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 492 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
494 MHD_OPTION_END); 493 MHD_OPTION_END);
495 if (d == NULL) 494 if (d == NULL)
@@ -588,7 +587,7 @@ testExternalGet ()
588 cbc.size = 2048; 587 cbc.size = 2048;
589 cbc.pos = 0; 588 cbc.pos = 0;
590 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 589 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
591 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 590 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
592 if (d == NULL) 591 if (d == NULL)
593 return 256; 592 return 256;
594 if (0 == port) 593 if (0 == port)
diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c
index 7857f2ad..ef020833 100644
--- a/src/testcurl/test_get_close_keep_alive.c
+++ b/src/testcurl/test_get_close_keep_alive.c
@@ -315,14 +315,14 @@ ahc_echo (void *cls,
315 void **req_cls) 315 void **req_cls)
316{ 316{
317 static int ptr; 317 static int ptr;
318 const char *me = cls;
319 struct MHD_Response *response; 318 struct MHD_Response *response;
320 enum MHD_Result ret; 319 enum MHD_Result ret;
320 (void) cls;
321 (void) version; 321 (void) version;
322 (void) upload_data; 322 (void) upload_data;
323 (void) upload_data_size; /* Unused. Silence compiler warning. */ 323 (void) upload_data_size; /* Unused. Silence compiler warning. */
324 324
325 if (0 != strcmp (me, method)) 325 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
326 return MHD_NO; /* unexpected method */ 326 return MHD_NO; /* unexpected method */
327 if (&ptr != *req_cls) 327 if (&ptr != *req_cls)
328 { 328 {
@@ -333,9 +333,8 @@ ahc_echo (void *cls,
333 if (slow_reply) 333 if (slow_reply)
334 usleep (200000); 334 usleep (200000);
335 335
336 response = MHD_create_response_from_buffer (strlen (url), 336 response = MHD_create_response_from_buffer_copy (strlen (url),
337 (void *) url, 337 (const void *) url);
338 MHD_RESPMEM_MUST_COPY);
339 if (NULL == response) 338 if (NULL == response)
340 { 339 {
341 fprintf (stderr, "Failed to create response. Line: %d\n", __LINE__); 340 fprintf (stderr, "Failed to create response. Line: %d\n", __LINE__);
@@ -960,14 +959,14 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
960 d = MHD_start_daemon (((int) thrType) | ((int) pollType) 959 d = MHD_start_daemon (((int) thrType) | ((int) pollType)
961 | MHD_USE_ERROR_LOG, 960 | MHD_USE_ERROR_LOG,
962 *pport, NULL, NULL, 961 *pport, NULL, NULL,
963 &ahc_echo, "GET", 962 &ahc_echo, NULL,
964 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 963 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
965 MHD_OPTION_END); 964 MHD_OPTION_END);
966 else 965 else
967 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType) 966 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType)
968 | MHD_USE_ERROR_LOG, 967 | MHD_USE_ERROR_LOG,
969 *pport, NULL, NULL, 968 *pport, NULL, NULL,
970 &ahc_echo, "GET", 969 &ahc_echo, NULL,
971 MHD_OPTION_THREAD_POOL_SIZE, 970 MHD_OPTION_THREAD_POOL_SIZE,
972 testNumThreadsForPool (pollType), 971 testNumThreadsForPool (pollType),
973 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 972 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
diff --git a/src/testcurl/test_get_iovec.c b/src/testcurl/test_get_iovec.c
index bcb610dc..4e59c56f 100644
--- a/src/testcurl/test_get_iovec.c
+++ b/src/testcurl/test_get_iovec.c
@@ -92,15 +92,20 @@ iov_free_callback (void *cls)
92} 92}
93 93
94 94
95struct iovncont_data
96{
97 void *ptrs[TESTSTR_IOVCNT];
98};
99
95static void 100static void
96iovncont_free_callback (void *cls) 101iovncont_free_callback (void *cls)
97{ 102{
98 struct MHD_IoVec *iov = cls; 103 struct iovncont_data *data = (struct iovncont_data *) cls;
99 unsigned int i; 104 unsigned int i;
100 105
101 for (i = 0; i < TESTSTR_IOVCNT; ++i) 106 for (i = 0; i < TESTSTR_IOVCNT; ++i)
102 free ((void *) iov[i].iov_base); 107 free (data->ptrs[i]);
103 free (iov); 108 free (data);
104} 109}
105 110
106 111
@@ -126,7 +131,7 @@ check_read_data (const void *ptr, size_t len)
126 131
127 132
128static enum MHD_Result 133static enum MHD_Result
129ahc_echo (void *cls, 134ahc_cont (void *cls,
130 struct MHD_Connection *connection, 135 struct MHD_Connection *connection,
131 const char *url, 136 const char *url,
132 const char *method, 137 const char *method,
@@ -135,16 +140,16 @@ ahc_echo (void *cls,
135 void **req_cls) 140 void **req_cls)
136{ 141{
137 static int ptr; 142 static int ptr;
138 const char *me = cls;
139 struct MHD_Response *response; 143 struct MHD_Response *response;
140 enum MHD_Result ret; 144 enum MHD_Result ret;
141 int *data; 145 int *data;
142 struct MHD_IoVec iov[TESTSTR_IOVCNT]; 146 struct MHD_IoVec iov[TESTSTR_IOVCNT];
143 int i; 147 int i;
148 (void) cls;
144 (void) url; (void) version; /* Unused. Silent compiler warning. */ 149 (void) url; (void) version; /* Unused. Silent compiler warning. */
145 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 150 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
146 151
147 if (0 != strcmp (me, method)) 152 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
148 return MHD_NO; /* unexpected method */ 153 return MHD_NO; /* unexpected method */
149 if (&ptr != *req_cls) 154 if (&ptr != *req_cls)
150 { 155 {
@@ -182,25 +187,25 @@ ahc_echo (void *cls,
182 187
183 188
184static enum MHD_Result 189static enum MHD_Result
185ncont_echo (void *cls, 190ahc_ncont (void *cls,
186 struct MHD_Connection *connection, 191 struct MHD_Connection *connection,
187 const char *url, 192 const char *url,
188 const char *method, 193 const char *method,
189 const char *version, 194 const char *version,
190 const char *upload_data, size_t *upload_data_size, 195 const char *upload_data, size_t *upload_data_size,
191 void **req_cls) 196 void **req_cls)
192{ 197{
193 static int ptr; 198 static int ptr;
194 const char *me = cls;
195 struct MHD_Response *response; 199 struct MHD_Response *response;
196 enum MHD_Result ret; 200 enum MHD_Result ret;
197 int *data; 201 struct MHD_IoVec iov[TESTSTR_IOVCNT];
198 struct MHD_IoVec *iov; 202 struct iovncont_data *clear_cls;
199 int i, j; 203 int i, j;
204 (void) cls;
200 (void) url; (void) version; /* Unused. Silent compiler warning. */ 205 (void) url; (void) version; /* Unused. Silent compiler warning. */
201 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 206 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
202 207
203 if (0 != strcmp (me, method)) 208 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
204 return MHD_NO; /* unexpected method */ 209 return MHD_NO; /* unexpected method */
205 if (&ptr != *req_cls) 210 if (&ptr != *req_cls)
206 { 211 {
@@ -209,30 +214,33 @@ ncont_echo (void *cls,
209 } 214 }
210 *req_cls = NULL; 215 *req_cls = NULL;
211 216
212 if (NULL == (iov = malloc (sizeof(struct MHD_IoVec) * TESTSTR_IOVCNT))) 217 clear_cls = malloc (sizeof(struct iovncont_data));
213 return MHD_NO; 218 if (NULL == clear_cls)
214 219 abort ();
215 memset (iov, 0, sizeof(struct MHD_IoVec) * TESTSTR_IOVCNT); 220 memset (iov, 0, sizeof(struct MHD_IoVec) * TESTSTR_IOVCNT);
216 221
217 /* Create some test data. */ 222 /* Create some test data. */
218 for (j = TESTSTR_IOVCNT - 1; j >= 0; --j) 223 for (j = TESTSTR_IOVCNT - 1; j >= 0; --j)
219 { 224 {
220 if (NULL == (data = malloc (TESTSTR_IOVLEN))) 225 int *data;
221 goto err_out; 226 data = malloc (TESTSTR_IOVLEN);
222 227 if (NULL == data)
223 iov[j].iov_base = data; 228 abort ();
224 iov[j].iov_len = TESTSTR_IOVLEN; 229 clear_cls->ptrs[j] = (void *) data;
225 230
226 for (i = 0; i < (int) (TESTSTR_IOVLEN / sizeof(int)); ++i) 231 for (i = 0; i < (int) (TESTSTR_IOVLEN / sizeof(int)); ++i)
227 { 232 {
228 data[i] = i + (j * TESTSTR_IOVLEN / sizeof(int)); 233 data[i] = i + (j * TESTSTR_IOVLEN / sizeof(int));
229 } 234 }
235 iov[j].iov_base = (const void *) data;
236 iov[j].iov_len = TESTSTR_IOVLEN;
237
230 } 238 }
231 239
232 response = MHD_create_response_from_iovec (iov, 240 response = MHD_create_response_from_iovec (iov,
233 TESTSTR_IOVCNT, 241 TESTSTR_IOVCNT,
234 &iovncont_free_callback, 242 &iovncont_free_callback,
235 iov); 243 clear_cls);
236 ret = MHD_queue_response (connection, 244 ret = MHD_queue_response (connection,
237 MHD_HTTP_OK, 245 MHD_HTTP_OK,
238 response); 246 response);
@@ -240,15 +248,6 @@ ncont_echo (void *cls,
240 if (ret == MHD_NO) 248 if (ret == MHD_NO)
241 abort (); 249 abort ();
242 return ret; 250 return ret;
243
244err_out:
245 for (j = 0; j < TESTSTR_IOVCNT; ++j)
246 {
247 if (NULL != iov[j].iov_base)
248 free ((void *) iov[j].iov_base);
249 }
250 free (iov);
251 return MHD_NO;
252} 251}
253 252
254 253
@@ -277,12 +276,12 @@ testInternalGet (bool contiguous)
277 if (contiguous) 276 if (contiguous)
278 { 277 {
279 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 278 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
280 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 279 port, NULL, NULL, &ahc_cont, NULL, MHD_OPTION_END);
281 } 280 }
282 else 281 else
283 { 282 {
284 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 283 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
285 port, NULL, NULL, &ncont_echo, "GET", MHD_OPTION_END); 284 port, NULL, NULL, &ahc_ncont, NULL, MHD_OPTION_END);
286 } 285 }
287 286
288 if (d == NULL) 287 if (d == NULL)
@@ -356,7 +355,7 @@ testMultithreadedGet ()
356 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION 355 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
357 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 356 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
358 | MHD_USE_AUTO, 357 | MHD_USE_AUTO,
359 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 358 port, NULL, NULL, &ahc_cont, NULL, MHD_OPTION_END);
360 if (d == NULL) 359 if (d == NULL)
361 return 16; 360 return 16;
362 if (0 == port) 361 if (0 == port)
@@ -427,7 +426,7 @@ testMultithreadedPoolGet ()
427 cbc.pos = 0; 426 cbc.pos = 0;
428 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 427 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
429 | MHD_USE_AUTO, 428 | MHD_USE_AUTO,
430 port, NULL, NULL, &ahc_echo, "GET", 429 port, NULL, NULL, &ahc_cont, NULL,
431 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 430 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
432 MHD_OPTION_END); 431 MHD_OPTION_END);
433 if (d == NULL) 432 if (d == NULL)
@@ -514,7 +513,7 @@ testExternalGet ()
514 cbc.size = sizeof(readbuf); 513 cbc.size = sizeof(readbuf);
515 cbc.pos = 0; 514 cbc.pos = 0;
516 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 515 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
517 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 516 port, NULL, NULL, &ahc_cont, NULL, MHD_OPTION_END);
518 if (d == NULL) 517 if (d == NULL)
519 return 256; 518 return 256;
520 if (0 == port) 519 if (0 == port)
@@ -682,7 +681,7 @@ testUnknownPortGet ()
682 cbc.size = sizeof(readbuf); 681 cbc.size = sizeof(readbuf);
683 cbc.pos = 0; 682 cbc.pos = 0;
684 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 683 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
685 0, NULL, NULL, &ahc_echo, "GET", 684 0, NULL, NULL, &ahc_cont, NULL,
686 MHD_OPTION_SOCK_ADDR, &addr, 685 MHD_OPTION_SOCK_ADDR, &addr,
687 MHD_OPTION_END); 686 MHD_OPTION_END);
688 if (d == NULL) 687 if (d == NULL)
diff --git a/src/testcurl/test_get_response_cleanup.c b/src/testcurl/test_get_response_cleanup.c
index ededc88b..fcda2349 100644
--- a/src/testcurl/test_get_response_cleanup.c
+++ b/src/testcurl/test_get_response_cleanup.c
@@ -125,14 +125,13 @@ ahc_echo (void *cls,
125 void **req_cls) 125 void **req_cls)
126{ 126{
127 static int ptr; 127 static int ptr;
128 const char *me = cls;
129 struct MHD_Response *response; 128 struct MHD_Response *response;
130 enum MHD_Result ret; 129 enum MHD_Result ret;
130 (void) cls;
131 (void) url; (void) version; /* Unused. Silent compiler warning. */ 131 (void) url; (void) version; /* Unused. Silent compiler warning. */
132 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 132 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
133 133
134 // fprintf (stderr, "In CB: %s!\n", method); 134 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
135 if (0 != strcmp (me, method))
136 return MHD_NO; /* unexpected method */ 135 return MHD_NO; /* unexpected method */
137 if (&ptr != *req_cls) 136 if (&ptr != *req_cls)
138 { 137 {
@@ -172,7 +171,7 @@ testInternalGet ()
172 171
173 ok = 1; 172 ok = 1;
174 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 173 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
175 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 174 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
176 if (d == NULL) 175 if (d == NULL)
177 return 1; 176 return 1;
178 if (0 == port) 177 if (0 == port)
@@ -221,7 +220,7 @@ testMultithreadedGet ()
221 ok = 1; 220 ok = 1;
222 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION 221 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
223 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 222 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
224 port, NULL, NULL, &ahc_echo, "GET", 223 port, NULL, NULL, &ahc_echo, NULL,
225 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 2, 224 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 2,
226 MHD_OPTION_END); 225 MHD_OPTION_END);
227 if (d == NULL) 226 if (d == NULL)
@@ -283,7 +282,7 @@ testMultithreadedPoolGet ()
283 282
284 ok = 1; 283 ok = 1;
285 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 284 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
286 port, NULL, NULL, &ahc_echo, "GET", 285 port, NULL, NULL, &ahc_echo, NULL,
287 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 286 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
288 MHD_OPTION_END); 287 MHD_OPTION_END);
289 if (d == NULL) 288 if (d == NULL)
@@ -339,7 +338,7 @@ testExternalGet ()
339 338
340 ok = 1; 339 ok = 1;
341 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 340 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
342 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 341 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
343 if (d == NULL) 342 if (d == NULL)
344 return 256; 343 return 256;
345 if (0 == port) 344 if (0 == port)
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index 4ca57e23..2a28481f 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -87,14 +87,14 @@ ahc_echo (void *cls,
87 void **req_cls) 87 void **req_cls)
88{ 88{
89 static int ptr; 89 static int ptr;
90 const char *me = cls;
91 struct MHD_Response *response; 90 struct MHD_Response *response;
92 enum MHD_Result ret; 91 enum MHD_Result ret;
93 int fd; 92 int fd;
93 (void) cls;
94 (void) url; (void) version; /* Unused. Silent compiler warning. */ 94 (void) url; (void) version; /* Unused. Silent compiler warning. */
95 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 95 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
96 96
97 if (0 != strcmp (me, method)) 97 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
98 return MHD_NO; /* unexpected method */ 98 return MHD_NO; /* unexpected method */
99 if (&ptr != *req_cls) 99 if (&ptr != *req_cls)
100 { 100 {
@@ -142,7 +142,7 @@ testInternalGet ()
142 cbc.size = 2048; 142 cbc.size = 2048;
143 cbc.pos = 0; 143 cbc.pos = 0;
144 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 144 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
145 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 145 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
146 if (d == NULL) 146 if (d == NULL)
147 return 1; 147 return 1;
148 if (0 == port) 148 if (0 == port)
@@ -214,7 +214,7 @@ testMultithreadedGet ()
214 cbc.pos = 0; 214 cbc.pos = 0;
215 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION 215 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
216 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 216 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
217 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 217 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
218 if (d == NULL) 218 if (d == NULL)
219 return 16; 219 return 16;
220 if (0 == port) 220 if (0 == port)
@@ -285,7 +285,7 @@ testMultithreadedPoolGet ()
285 cbc.size = 2048; 285 cbc.size = 2048;
286 cbc.pos = 0; 286 cbc.pos = 0;
287 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 287 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
288 port, NULL, NULL, &ahc_echo, "GET", 288 port, NULL, NULL, &ahc_echo, NULL,
289 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 289 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
290 MHD_OPTION_END); 290 MHD_OPTION_END);
291 if (d == NULL) 291 if (d == NULL)
@@ -373,7 +373,7 @@ testExternalGet ()
373 cbc.size = 2048; 373 cbc.size = 2048;
374 cbc.pos = 0; 374 cbc.pos = 0;
375 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 375 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
376 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 376 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
377 if (d == NULL) 377 if (d == NULL)
378 return 256; 378 return 256;
379 if (0 == port) 379 if (0 == port)
@@ -548,7 +548,7 @@ testUnknownPortGet ()
548 cbc.size = 2048; 548 cbc.size = 2048;
549 cbc.pos = 0; 549 cbc.pos = 0;
550 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 550 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
551 0, NULL, NULL, &ahc_echo, "GET", 551 0, NULL, NULL, &ahc_echo, NULL,
552 MHD_OPTION_SOCK_ADDR, &addr, 552 MHD_OPTION_SOCK_ADDR, &addr,
553 MHD_OPTION_END); 553 MHD_OPTION_END);
554 if (d == NULL) 554 if (d == NULL)
diff --git a/src/testcurl/test_get_wait.c b/src/testcurl/test_get_wait.c
index 708c82bd..b2938fdf 100644
--- a/src/testcurl/test_get_wait.c
+++ b/src/testcurl/test_get_wait.c
@@ -89,12 +89,12 @@ ahc_echo (void *cls,
89 void **req_cls) 89 void **req_cls)
90{ 90{
91 static int ptr; 91 static int ptr;
92 const char *me = cls;
93 enum MHD_Result ret; 92 enum MHD_Result ret;
93 (void) cls;
94 (void) url; (void) version; /* Unused. Silent compiler warning. */ 94 (void) url; (void) version; /* Unused. Silent compiler warning. */
95 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 95 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
96 96
97 if (0 != strcmp (me, method)) 97 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
98 return MHD_NO; /* unexpected method */ 98 return MHD_NO; /* unexpected method */
99 if (&ptr != *req_cls) 99 if (&ptr != *req_cls)
100 { 100 {
@@ -176,7 +176,7 @@ testRunWaitGet (int port, int poll_flag)
176 test_desc); 176 test_desc);
177 signal_done = 0; 177 signal_done = 0;
178 d = MHD_start_daemon (MHD_USE_ERROR_LOG | poll_flag, 178 d = MHD_start_daemon (MHD_USE_ERROR_LOG | poll_flag,
179 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 179 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
180 if (d == NULL) 180 if (d == NULL)
181 abort (); 181 abort ();
182 if (0 == port) 182 if (0 == port)
@@ -224,9 +224,8 @@ main (int argc, char *const *argv)
224 port += 5; 224 port += 5;
225 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 225 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
226 return 2; 226 return 2;
227 response = MHD_create_response_from_buffer (strlen ("/hello_world"), 227 response = MHD_create_response_from_buffer_static (strlen ("/hello_world"),
228 "/hello_world", 228 "/hello_world");
229 MHD_RESPMEM_MUST_COPY);
230 testRunWaitGet (port++, 0); 229 testRunWaitGet (port++, 0);
231 if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL)) 230 if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_EPOLL))
232 testRunWaitGet (port++, MHD_USE_EPOLL); 231 testRunWaitGet (port++, MHD_USE_EPOLL);
diff --git a/src/testcurl/test_iplimit.c b/src/testcurl/test_iplimit.c
index 509e3955..daeac0cf 100644
--- a/src/testcurl/test_iplimit.c
+++ b/src/testcurl/test_iplimit.c
@@ -85,12 +85,12 @@ ahc_echo (void *cls,
85 void **req_cls) 85 void **req_cls)
86{ 86{
87 static int ptr; 87 static int ptr;
88 const char *me = cls;
89 struct MHD_Response *response; 88 struct MHD_Response *response;
90 enum MHD_Result ret; 89 enum MHD_Result ret;
90 (void) cls;
91 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 91 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
92 92
93 if (0 != strcmp (me, method)) 93 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
94 return MHD_NO; /* unexpected method */ 94 return MHD_NO; /* unexpected method */
95 if (&ptr != *req_cls) 95 if (&ptr != *req_cls)
96 { 96 {
@@ -98,9 +98,8 @@ ahc_echo (void *cls,
98 return MHD_YES; 98 return MHD_YES;
99 } 99 }
100 *req_cls = NULL; 100 *req_cls = NULL;
101 response = MHD_create_response_from_buffer (strlen (url), 101 response = MHD_create_response_from_buffer_copy (strlen (url),
102 (void *) url, 102 (const void *) url);
103 MHD_RESPMEM_MUST_COPY);
104 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 103 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
105 MHD_destroy_response (response); 104 MHD_destroy_response (response);
106 if (ret == MHD_NO) 105 if (ret == MHD_NO)
@@ -134,7 +133,7 @@ testMultithreadedGet ()
134 133
135 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 134 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
136 port, NULL, NULL, 135 port, NULL, NULL,
137 &ahc_echo, "GET", 136 &ahc_echo, NULL,
138 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2, 137 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2,
139 MHD_OPTION_END); 138 MHD_OPTION_END);
140 if (d == NULL) 139 if (d == NULL)
@@ -245,7 +244,7 @@ testMultithreadedPoolGet ()
245 return 0; 244 return 0;
246 245
247 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 246 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
248 port, NULL, NULL, &ahc_echo, "GET", 247 port, NULL, NULL, &ahc_echo, NULL,
249 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2, 248 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2,
250 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 249 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
251 MHD_OPTION_END); 250 MHD_OPTION_END);
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
index 161e0f0b..4b7fae46 100644
--- a/src/testcurl/test_large_put.c
+++ b/src/testcurl/test_large_put.c
@@ -286,9 +286,9 @@ ahc_echo (void *cls,
286 *done = 1; /* Whole request is processed. */ 286 *done = 1; /* Whole request is processed. */
287 return MHD_YES; 287 return MHD_YES;
288 } 288 }
289 response = MHD_create_response_from_buffer (strlen (url), 289 response =
290 (void *) url, 290 MHD_create_response_from_buffer_copy (strlen (url),
291 MHD_RESPMEM_MUST_COPY); 291 (const void *) url);
292 if (NULL == response) 292 if (NULL == response)
293 mhdErrorExitDesc ("Failed to create response"); 293 mhdErrorExitDesc ("Failed to create response");
294 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 294 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c
index feaefed5..c1d07cb3 100644
--- a/src/testcurl/test_long_header.c
+++ b/src/testcurl/test_long_header.c
@@ -80,17 +80,16 @@ ahc_echo (void *cls,
80 const char *upload_data, size_t *upload_data_size, 80 const char *upload_data, size_t *upload_data_size,
81 void **req_cls) 81 void **req_cls)
82{ 82{
83 const char *me = cls;
84 struct MHD_Response *response; 83 struct MHD_Response *response;
85 enum MHD_Result ret; 84 enum MHD_Result ret;
85 (void) cls;
86 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 86 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
87 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */ 87 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
88 88
89 if (0 != strcmp (me, method)) 89 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
90 return MHD_NO; /* unexpected method */ 90 return MHD_NO; /* unexpected method */
91 response = MHD_create_response_from_buffer (strlen (url), 91 response = MHD_create_response_from_buffer_copy (strlen (url),
92 (void *) url, 92 (const void *) url);
93 MHD_RESPMEM_MUST_COPY);
94 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 93 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
95 MHD_destroy_response (response); 94 MHD_destroy_response (response);
96 return ret; 95 return ret;
@@ -124,8 +123,7 @@ testLongUrlGet (size_t buff_size)
124 port, 123 port,
125 &apc_all, 124 &apc_all,
126 NULL, 125 NULL,
127 &ahc_echo, 126 &ahc_echo, NULL,
128 "GET",
129 MHD_OPTION_CONNECTION_MEMORY_LIMIT, 127 MHD_OPTION_CONNECTION_MEMORY_LIMIT,
130 (size_t) buff_size, MHD_OPTION_END); 128 (size_t) buff_size, MHD_OPTION_END);
131 if (d == NULL) 129 if (d == NULL)
@@ -218,8 +216,7 @@ testLongHeaderGet (size_t buff_size)
218 port, 216 port,
219 &apc_all, 217 &apc_all,
220 NULL, 218 NULL,
221 &ahc_echo, 219 &ahc_echo, NULL,
222 "GET",
223 MHD_OPTION_CONNECTION_MEMORY_LIMIT, 220 MHD_OPTION_CONNECTION_MEMORY_LIMIT,
224 (size_t) buff_size, MHD_OPTION_END); 221 (size_t) buff_size, MHD_OPTION_END);
225 if (d == NULL) 222 if (d == NULL)
diff --git a/src/testcurl/test_patch.c b/src/testcurl/test_patch.c
index 100242a5..26d9fec3 100644
--- a/src/testcurl/test_patch.c
+++ b/src/testcurl/test_patch.c
@@ -115,8 +115,8 @@ ahc_echo (void *cls,
115 *done = 1; 115 *done = 1;
116 return MHD_YES; 116 return MHD_YES;
117 } 117 }
118 response = MHD_create_response_from_buffer (strlen (url), (void *) url, 118 response = MHD_create_response_from_buffer_copy (strlen (url),
119 MHD_RESPMEM_MUST_COPY); 119 (const void *) url);
120 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 120 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
121 MHD_destroy_response (response); 121 MHD_destroy_response (response);
122 return ret; 122 return ret;
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c
index e36391fd..d97839c0 100644
--- a/src/testcurl/test_post.c
+++ b/src/testcurl/test_post.c
@@ -137,9 +137,9 @@ ahc_echo (void *cls,
137 enum MHD_Result ret; 137 enum MHD_Result ret;
138 (void) cls; (void) version; /* Unused. Silent compiler warning. */ 138 (void) cls; (void) version; /* Unused. Silent compiler warning. */
139 139
140 if (0 != strcmp ("POST", method)) 140 if (0 != strcmp (MHD_HTTP_METHOD_POST, method))
141 { 141 {
142 printf ("METHOD: %s\n", method); 142 fprintf (stderr, "METHOD: %s\n", method);
143 return MHD_NO; /* unexpected method */ 143 return MHD_NO; /* unexpected method */
144 } 144 }
145 pp = *req_cls; 145 pp = *req_cls;
@@ -152,9 +152,8 @@ ahc_echo (void *cls,
152 MHD_post_process (pp, upload_data, *upload_data_size); 152 MHD_post_process (pp, upload_data, *upload_data_size);
153 if ((eok == 3) && (0 == *upload_data_size)) 153 if ((eok == 3) && (0 == *upload_data_size))
154 { 154 {
155 response = MHD_create_response_from_buffer (strlen (url), 155 response = MHD_create_response_from_buffer_copy (strlen (url),
156 (void *) url, 156 (const void *) url);
157 MHD_RESPMEM_MUST_COPY);
158 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 157 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
159 MHD_destroy_response (response); 158 MHD_destroy_response (response);
160 MHD_destroy_post_processor (pp); 159 MHD_destroy_post_processor (pp);
@@ -608,7 +607,8 @@ ahc_cancel (void *cls,
608 607
609 if (*req_cls == NULL) 608 if (*req_cls == NULL)
610 { 609 {
611 *req_cls = "wibble"; 610 static int marker = 1;
611 *req_cls = &marker;
612 /* We don't want the body. Send a 500. */ 612 /* We don't want the body. Send a 500. */
613 response = MHD_create_response_empty (MHD_RF_NONE); 613 response = MHD_create_response_empty (MHD_RF_NONE);
614 ret = MHD_queue_response (connection, 500, response); 614 ret = MHD_queue_response (connection, 500, response);
@@ -768,8 +768,8 @@ testMultithreadedPostCancelPart (int flags)
768#endif /* ! _WIN32 */ 768#endif /* ! _WIN32 */
769 { 769 {
770 fprintf (stderr, 770 fprintf (stderr,
771 "flibbet curl_easy_perform didn't fail as expected: `%s' %d\n", 771 "flibbet curl_easy_perform didn't fail as expected: `%s' %u\n",
772 curl_easy_strerror (errornum), errornum); 772 curl_easy_strerror (errornum), (unsigned int) errornum);
773 result = 65536; 773 result = 65536;
774 } 774 }
775 curl_easy_cleanup (c); 775 curl_easy_cleanup (c);
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index dbfd170d..b4a22eb1 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -522,8 +522,12 @@ testExternalPost ()
522 timeout64 = (uint64_t) ctimeout; 522 timeout64 = (uint64_t) ctimeout;
523 if (0 == running) 523 if (0 == running)
524 timeout64 = 0; /* terminate quickly... */ 524 timeout64 = 0; /* terminate quickly... */
525 tv.tv_sec = timeout64 / 1000; 525#if ! defined(_WIN32) || defined(__CYGWIN__)
526 tv.tv_usec = (timeout64 % 1000) * 1000; 526 tv.tv_sec = (time_t) (timeout64 / 1000);
527#else /* Native W32 */
528 tv.tv_sec = (long) (timeout64 / 1000);
529#endif /* Native W32 */
530 tv.tv_usec = (long) (1000 * (timeout64 % 1000));
527 if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv)) 531 if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
528 { 532 {
529#ifdef MHD_POSIX_SOCKETS 533#ifdef MHD_POSIX_SOCKETS
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c
index 1ada80e2..b429777b 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -160,9 +160,8 @@ ahc_echo (void *cls,
160 abort (); 160 abort ();
161 if ((eok == 3) && (0 == *upload_data_size)) 161 if ((eok == 3) && (0 == *upload_data_size))
162 { 162 {
163 response = MHD_create_response_from_buffer (strlen (url), 163 response = MHD_create_response_from_buffer_copy (strlen (url),
164 (void *) url, 164 (const void *) url);
165 MHD_RESPMEM_MUST_COPY);
166 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 165 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
167 MHD_destroy_response (response); 166 MHD_destroy_response (response);
168 MHD_destroy_post_processor (pp); 167 MHD_destroy_post_processor (pp);
diff --git a/src/testcurl/test_process_arguments.c b/src/testcurl/test_process_arguments.c
index 24d5e72f..d3176423 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -72,13 +72,13 @@ ahc_echo (void *cls,
72 void **req_cls) 72 void **req_cls)
73{ 73{
74 static int ptr; 74 static int ptr;
75 const char *me = cls;
76 struct MHD_Response *response; 75 struct MHD_Response *response;
77 enum MHD_Result ret; 76 enum MHD_Result ret;
78 const char *hdr; 77 const char *hdr;
78 (void) cls;
79 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 79 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
80 80
81 if (0 != strcmp (me, method)) 81 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
82 return MHD_NO; /* unexpected method */ 82 return MHD_NO; /* unexpected method */
83 if (&ptr != *req_cls) 83 if (&ptr != *req_cls)
84 { 84 {
@@ -101,9 +101,8 @@ ahc_echo (void *cls,
101 MHD_GET_ARGUMENT_KIND, 101 MHD_GET_ARGUMENT_KIND,
102 NULL, NULL)) 102 NULL, NULL))
103 abort (); 103 abort ();
104 response = MHD_create_response_from_buffer (strlen (url), 104 response = MHD_create_response_from_buffer_copy (strlen (url),
105 (void *) url, 105 (const void *) url);
106 MHD_RESPMEM_MUST_COPY);
107 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 106 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
108 MHD_destroy_response (response); 107 MHD_destroy_response (response);
109 if (ret == MHD_NO) 108 if (ret == MHD_NO)
@@ -150,7 +149,7 @@ testExternalGet ()
150 cbc.size = 2048; 149 cbc.size = 2048;
151 cbc.pos = 0; 150 cbc.pos = 0;
152 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 151 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
153 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 152 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
154 if (d == NULL) 153 if (d == NULL)
155 return 256; 154 return 256;
156 if (0 == port) 155 if (0 == port)
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c
index 98b08fbc..0c9d6133 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -92,13 +92,13 @@ ahc_echo (void *cls,
92 void **req_cls) 92 void **req_cls)
93{ 93{
94 static int ptr; 94 static int ptr;
95 const char *me = cls;
96 struct MHD_Response *response; 95 struct MHD_Response *response;
97 enum MHD_Result ret; 96 enum MHD_Result ret;
98 const char *hdr; 97 const char *hdr;
98 (void) cls;
99 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 99 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
100 100
101 if (0 != strcmp (me, method)) 101 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
102 return MHD_NO; /* unexpected method */ 102 return MHD_NO; /* unexpected method */
103 if (&ptr != *req_cls) 103 if (&ptr != *req_cls)
104 { 104 {
@@ -128,9 +128,8 @@ ahc_echo (void *cls,
128 if ((hdr == NULL) || (0 != strcmp (hdr, "NowPresent"))) 128 if ((hdr == NULL) || (0 != strcmp (hdr, "NowPresent")))
129 abort (); 129 abort ();
130 130
131 response = MHD_create_response_from_buffer (strlen (url), 131 response = MHD_create_response_from_buffer_copy (strlen (url),
132 (void *) url, 132 (const void *) url);
133 MHD_RESPMEM_MUST_COPY);
134 if (NULL == response) 133 if (NULL == response)
135 abort (); 134 abort ();
136 MHD_add_response_header (response, "MyHeader", "MyValue"); 135 MHD_add_response_header (response, "MyHeader", "MyValue");
@@ -176,7 +175,7 @@ testInternalGet ()
176 cbc.size = 2048; 175 cbc.size = 2048;
177 cbc.pos = 0; 176 cbc.pos = 0;
178 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 177 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
179 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 178 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
180 if (d == NULL) 179 if (d == NULL)
181 return 1; 180 return 1;
182 if (0 == port) 181 if (0 == port)
@@ -248,7 +247,7 @@ testMultithreadedGet ()
248 cbc.pos = 0; 247 cbc.pos = 0;
249 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION 248 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
250 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 249 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
251 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 250 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
252 if (d == NULL) 251 if (d == NULL)
253 return 16; 252 return 16;
254 if (0 == port) 253 if (0 == port)
@@ -319,7 +318,7 @@ testMultithreadedPoolGet ()
319 cbc.size = 2048; 318 cbc.size = 2048;
320 cbc.pos = 0; 319 cbc.pos = 0;
321 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 320 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
322 port, NULL, NULL, &ahc_echo, "GET", 321 port, NULL, NULL, &ahc_echo, NULL,
323 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 322 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
324 MHD_OPTION_END); 323 MHD_OPTION_END);
325 if (d == NULL) 324 if (d == NULL)
@@ -407,7 +406,7 @@ testExternalGet ()
407 cbc.size = 2048; 406 cbc.size = 2048;
408 cbc.pos = 0; 407 cbc.pos = 0;
409 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 408 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
410 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 409 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
411 if (d == NULL) 410 if (d == NULL)
412 return 256; 411 return 256;
413 if (0 == port) 412 if (0 == port)
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index 761e1c5f..d2da48ac 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -115,8 +115,8 @@ ahc_echo (void *cls,
115 *done = 1; 115 *done = 1;
116 return MHD_YES; 116 return MHD_YES;
117 } 117 }
118 response = MHD_create_response_from_buffer (strlen (url), (void *) url, 118 response = MHD_create_response_from_buffer_copy (strlen (url),
119 MHD_RESPMEM_MUST_COPY); 119 (const void *) url);
120 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 120 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
121 MHD_destroy_response (response); 121 MHD_destroy_response (response);
122 return ret; 122 return ret;
diff --git a/src/testcurl/test_put_chunked.c b/src/testcurl/test_put_chunked.c
index 5820f2e0..d877a2ae 100644
--- a/src/testcurl/test_put_chunked.c
+++ b/src/testcurl/test_put_chunked.c
@@ -125,9 +125,8 @@ ahc_echo (void *cls,
125#endif 125#endif
126 return MHD_YES; 126 return MHD_YES;
127 } 127 }
128 response = MHD_create_response_from_buffer (strlen (url), 128 response = MHD_create_response_from_buffer_copy (strlen (url),
129 (void *) url, 129 (const void *) url);
130 MHD_RESPMEM_MUST_COPY);
131 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 130 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
132 MHD_destroy_response (response); 131 MHD_destroy_response (response);
133 return ret; 132 return ret;
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c
index f7703db7..7425f839 100644
--- a/src/testcurl/test_quiesce.c
+++ b/src/testcurl/test_quiesce.c
@@ -251,11 +251,11 @@ ahc_echo (void *cls,
251 void **req_cls) 251 void **req_cls)
252{ 252{
253 static int ptr; 253 static int ptr;
254 const char *me = cls;
255 struct MHD_Response *response; 254 struct MHD_Response *response;
255 (void) cls;
256 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 256 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
257 257
258 if (0 != strcmp (me, method)) 258 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
259 { 259 {
260 fprintf (stderr, "Unexpected HTTP method '%s'. ", method); 260 fprintf (stderr, "Unexpected HTTP method '%s'. ", method);
261 externalErrorExit (); 261 externalErrorExit ();
@@ -266,9 +266,8 @@ ahc_echo (void *cls,
266 return MHD_YES; 266 return MHD_YES;
267 } 267 }
268 *req_cls = NULL; 268 *req_cls = NULL;
269 response = MHD_create_response_from_buffer (strlen (url), 269 response = MHD_create_response_from_buffer_copy (strlen (url),
270 (void *) url, 270 (const void *) url);
271 MHD_RESPMEM_MUST_COPY);
272 if (NULL == response) 271 if (NULL == response)
273 mhdErrorExitDesc ("MHD_create_response failed"); 272 mhdErrorExitDesc ("MHD_create_response failed");
274 /* Make sure that connection will not be reused */ 273 /* Make sure that connection will not be reused */
@@ -317,7 +316,7 @@ ServeOneRequest (void *param)
317 fd = *((MHD_socket *) param); 316 fd = *((MHD_socket *) param);
318 317
319 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 318 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
320 0, NULL, NULL, &ahc_echo, "GET", 319 0, NULL, NULL, &ahc_echo, NULL,
321 MHD_OPTION_LISTEN_SOCKET, fd, 320 MHD_OPTION_LISTEN_SOCKET, fd,
322 MHD_OPTION_NOTIFY_COMPLETED, &request_completed, &done, 321 MHD_OPTION_NOTIFY_COMPLETED, &request_completed, &done,
323 MHD_OPTION_END); 322 MHD_OPTION_END);
@@ -404,7 +403,7 @@ testGet (int type, int pool_count, int poll_flag)
404 struct CBC cbc; 403 struct CBC cbc;
405 MHD_socket fd; 404 MHD_socket fd;
406 pthread_t thrd; 405 pthread_t thrd;
407 const char *thrdRet; 406 char *thrdRet;
408 407
409 if (verbose) 408 if (verbose)
410 printf ("testGet(%d, %d, %d) test started.\n", 409 printf ("testGet(%d, %d, %d) test started.\n",
@@ -416,7 +415,7 @@ testGet (int type, int pool_count, int poll_flag)
416 if (pool_count > 0) 415 if (pool_count > 0)
417 { 416 {
418 d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag, 417 d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag,
419 global_port, NULL, NULL, &ahc_echo, "GET", 418 global_port, NULL, NULL, &ahc_echo, NULL,
420 MHD_OPTION_THREAD_POOL_SIZE, 419 MHD_OPTION_THREAD_POOL_SIZE,
421 (unsigned int) pool_count, 420 (unsigned int) pool_count,
422 MHD_OPTION_END); 421 MHD_OPTION_END);
@@ -425,7 +424,7 @@ testGet (int type, int pool_count, int poll_flag)
425 else 424 else
426 { 425 {
427 d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag, 426 d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag,
428 global_port, NULL, NULL, &ahc_echo, "GET", 427 global_port, NULL, NULL, &ahc_echo, NULL,
429 MHD_OPTION_END); 428 MHD_OPTION_END);
430 } 429 }
431 if (d == NULL) 430 if (d == NULL)
@@ -555,7 +554,7 @@ testExternalGet (void)
555 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 554 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
556 global_port, 555 global_port,
557 NULL, NULL, 556 NULL, NULL,
558 &ahc_echo, "GET", 557 &ahc_echo, NULL,
559 MHD_OPTION_END); 558 MHD_OPTION_END);
560 if (d == NULL) 559 if (d == NULL)
561 mhdErrorExitDesc ("Failed to start MHD daemon"); 560 mhdErrorExitDesc ("Failed to start MHD daemon");
diff --git a/src/testcurl/test_quiesce_stream.c b/src/testcurl/test_quiesce_stream.c
index dbfd982b..12b35903 100644
--- a/src/testcurl/test_quiesce_stream.c
+++ b/src/testcurl/test_quiesce_stream.c
@@ -113,7 +113,7 @@ http_ContentReaderCallback (void *cls,
113 if (userdata->bytes_written >= 1024) 113 if (userdata->bytes_written >= 1024)
114 { 114 {
115 fprintf (stderr, 115 fprintf (stderr,
116 "finish: %d\n", 116 "finish: %u\n",
117 request_counter); 117 request_counter);
118 return MHD_CONTENT_READER_END_OF_STREAM; 118 return MHD_CONTENT_READER_END_OF_STREAM;
119 } 119 }
@@ -155,7 +155,7 @@ http_AccessHandlerCallback (void *cls,
155 { 155 {
156 struct ContentReaderUserdata *userdata; 156 struct ContentReaderUserdata *userdata;
157 fprintf (stderr, 157 fprintf (stderr,
158 "start: %d\n", 158 "start: %u\n",
159 ++request_counter); 159 ++request_counter);
160 160
161 userdata = malloc (sizeof(struct ContentReaderUserdata)); 161 userdata = malloc (sizeof(struct ContentReaderUserdata));
diff --git a/src/testcurl/test_timeout.c b/src/testcurl/test_timeout.c
index 5c184a20..1b41bcb2 100644
--- a/src/testcurl/test_timeout.c
+++ b/src/testcurl/test_timeout.c
@@ -197,7 +197,7 @@ ahc_echo (void *cls,
197 enum MHD_Result ret; 197 enum MHD_Result ret;
198 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */ 198 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
199 199
200 if (0 != strcmp ("PUT", method)) 200 if (0 != strcmp (MHD_HTTP_METHOD_PUT, method))
201 return MHD_NO; /* unexpected method */ 201 return MHD_NO; /* unexpected method */
202 if ((*done) == 0) 202 if ((*done) == 0)
203 { 203 {
@@ -215,9 +215,8 @@ ahc_echo (void *cls,
215 *done = 1; 215 *done = 1;
216 return MHD_YES; 216 return MHD_YES;
217 } 217 }
218 response = MHD_create_response_from_buffer (strlen (url), 218 response = MHD_create_response_from_buffer_copy (strlen (url),
219 (void *) url, 219 (const void *) url);
220 MHD_RESPMEM_MUST_COPY);
221 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 220 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
222 MHD_destroy_response (response); 221 MHD_destroy_response (response);
223 return ret; 222 return ret;
diff --git a/src/testcurl/test_toolarge.c b/src/testcurl/test_toolarge.c
index 42ea471f..30f0d922 100644
--- a/src/testcurl/test_toolarge.c
+++ b/src/testcurl/test_toolarge.c
@@ -261,7 +261,7 @@ struct headers_check_result
261 int large_header_valid; 261 int large_header_valid;
262}; 262};
263 263
264size_t 264static size_t
265lcurl_hdr_callback (char *buffer, size_t size, size_t nitems, 265lcurl_hdr_callback (char *buffer, size_t size, size_t nitems,
266 void *userdata) 266 void *userdata)
267{ 267{
@@ -372,7 +372,7 @@ struct mhd_header_checker_param
372 int large_header_valid; 372 int large_header_valid;
373}; 373};
374 374
375enum MHD_Result 375static enum MHD_Result
376headerCheckerInterator (void *cls, 376headerCheckerInterator (void *cls,
377 enum MHD_ValueKind kind, 377 enum MHD_ValueKind kind,
378 const char *key, 378 const char *key,
@@ -489,9 +489,9 @@ ahcCheck (void *cls,
489 &param->header_check_param)) 489 &param->header_check_param))
490 mhdErrorExitDesc ("Wrong number of headers in the request"); 490 mhdErrorExitDesc ("Wrong number of headers in the request");
491 491
492 response = MHD_create_response_from_buffer (param->rp_data_size, 492 response =
493 (void *) param->rp_data, 493 MHD_create_response_from_buffer_copy (param->rp_data_size,
494 MHD_RESPMEM_MUST_COPY); 494 (const void *) param->rp_data);
495 if (NULL == response) 495 if (NULL == response)
496 mhdErrorExitDesc ("Failed to create response"); 496 mhdErrorExitDesc ("Failed to create response");
497 497
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
index 5bc28323..b3042f61 100644
--- a/src/testcurl/test_tricky.c
+++ b/src/testcurl/test_tricky.c
@@ -246,7 +246,7 @@ struct headers_check_result
246}; 246};
247 247
248 248
249size_t 249static size_t
250lcurl_hdr_callback (char *buffer, size_t size, size_t nitems, 250lcurl_hdr_callback (char *buffer, size_t size, size_t nitems,
251 void *userdata) 251 void *userdata)
252{ 252{
@@ -314,7 +314,7 @@ struct mhd_header_checker_param
314 int found_header4; 314 int found_header4;
315}; 315};
316 316
317enum MHD_Result 317static enum MHD_Result
318headerCheckerInterator (void *cls, 318headerCheckerInterator (void *cls,
319 enum MHD_ValueKind kind, 319 enum MHD_ValueKind kind,
320 const char *key, 320 const char *key,
@@ -425,9 +425,9 @@ ahcCheck (void *cls,
425 &param->header_check_param)) 425 &param->header_check_param))
426 mhdErrorExitDesc ("Wrong number of headers in the request"); 426 mhdErrorExitDesc ("Wrong number of headers in the request");
427 427
428 response = MHD_create_response_from_buffer (param->rp_data_size, 428 response =
429 (void *) param->rp_data, 429 MHD_create_response_from_buffer_copy (param->rp_data_size,
430 MHD_RESPMEM_MUST_COPY); 430 (const void *) param->rp_data);
431 if (NULL == response) 431 if (NULL == response)
432 mhdErrorExitDesc ("Failed to create response"); 432 mhdErrorExitDesc ("Failed to create response");
433 433
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c
index 0145b5f1..71ac668b 100644
--- a/src/testcurl/test_urlparse.c
+++ b/src/testcurl/test_urlparse.c
@@ -101,12 +101,12 @@ ahc_echo (void *cls,
101 void **req_cls) 101 void **req_cls)
102{ 102{
103 static int ptr; 103 static int ptr;
104 const char *me = cls;
105 struct MHD_Response *response; 104 struct MHD_Response *response;
106 enum MHD_Result ret; 105 enum MHD_Result ret;
106 (void) cls;
107 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 107 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
108 108
109 if (0 != strcmp (me, method)) 109 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
110 return MHD_NO; /* unexpected method */ 110 return MHD_NO; /* unexpected method */
111 if (&ptr != *req_cls) 111 if (&ptr != *req_cls)
112 { 112 {
@@ -118,9 +118,8 @@ ahc_echo (void *cls,
118 &test_values, 118 &test_values,
119 NULL); 119 NULL);
120 *req_cls = NULL; 120 *req_cls = NULL;
121 response = MHD_create_response_from_buffer (strlen (url), 121 response = MHD_create_response_from_buffer_copy (strlen (url),
122 (void *) url, 122 (const void *) url);
123 MHD_RESPMEM_MUST_COPY);
124 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 123 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
125 MHD_destroy_response (response); 124 MHD_destroy_response (response);
126 if (ret == MHD_NO) 125 if (ret == MHD_NO)
@@ -153,7 +152,7 @@ testInternalGet (int poll_flag)
153 cbc.pos = 0; 152 cbc.pos = 0;
154 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 153 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
155 | poll_flag, 154 | poll_flag,
156 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 155 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
157 if (d == NULL) 156 if (d == NULL)
158 return 1; 157 return 1;
159 if (0 == port) 158 if (0 == port)