diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-14 15:07:47 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-14 15:07:47 +0300 |
commit | 85ae657849685d27b79ae6b14f7248d81ec99d2c (patch) | |
tree | 5766712bc12b799cba3ee40058782b66d494d008 | |
parent | 4fc1bbfd5bf3196e1f603e443b51ddec911305b4 (diff) | |
download | libmicrohttpd-85ae657849685d27b79ae6b14f7248d81ec99d2c.tar.gz libmicrohttpd-85ae657849685d27b79ae6b14f7248d81ec99d2c.zip |
Replaced MHD_RESPMEM_PERSISTENT usage in examples and code
New functions do not produce compiler warnings.
-rw-r--r-- | doc/examples/tlsauthentication.c | 3 | ||||
-rw-r--r-- | doc/examples/websocket.c | 25 | ||||
-rw-r--r-- | src/examples/connection_close.c | 5 | ||||
-rw-r--r-- | src/examples/minimal_example_empty.c | 4 | ||||
-rw-r--r-- | src/examples/minimal_example_empty_tls.c | 4 | ||||
-rw-r--r-- | src/examples/websocket_chatserver_example.c | 22 | ||||
-rw-r--r-- | src/microhttpd/test_response_entries.c | 2 | ||||
-rw-r--r-- | src/testcurl/https/test_empty_response.c | 3 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_https_session_info.c | 5 | ||||
-rw-r--r-- | src/testcurl/https/tls_test_common.c | 5 | ||||
-rw-r--r-- | src/testcurl/test_digestauth.c | 15 | ||||
-rw-r--r-- | src/testcurl/test_digestauth_concurrent.c | 15 | ||||
-rw-r--r-- | src/testcurl/test_digestauth_sha256.c | 15 | ||||
-rw-r--r-- | src/testcurl/test_digestauth_with_arguments.c | 14 | ||||
-rw-r--r-- | src/testcurl/test_get.c | 4 | ||||
-rw-r--r-- | src/testcurl/test_get_chunked.c | 3 | ||||
-rw-r--r-- | src/testcurl/test_get_empty.c | 8 | ||||
-rw-r--r-- | src/testcurl/test_post.c | 3 | ||||
-rw-r--r-- | src/testcurl/test_post_loop.c | 4 | ||||
-rw-r--r-- | src/testcurl/test_termination.c | 3 |
21 files changed, 67 insertions, 99 deletions
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c index 3c39a0f5..57556d0b 100644 --- a/doc/examples/tlsauthentication.c +++ b/doc/examples/tlsauthentication.c | |||
@@ -130,8 +130,7 @@ ask_for_authentication (struct MHD_Connection *connection, const char *realm) | |||
130 | size_t slen; | 130 | size_t slen; |
131 | const char *strbase = "Basic realm="; | 131 | const char *strbase = "Basic realm="; |
132 | 132 | ||
133 | response = MHD_create_response_from_buffer (0, NULL, | 133 | response = MHD_create_response_empty (MHD_RF_NONE); |
134 | MHD_RESPMEM_PERSISTENT); | ||
135 | if (! response) | 134 | if (! response) |
136 | return MHD_NO; | 135 | return MHD_NO; |
137 | 136 | ||
diff --git a/doc/examples/websocket.c b/doc/examples/websocket.c index 77bc55cd..018d4c5a 100644 --- a/doc/examples/websocket.c +++ b/doc/examples/websocket.c | |||
@@ -330,10 +330,9 @@ access_handler (void *cls, | |||
330 | if (0 == strcmp (url, "/")) | 330 | if (0 == strcmp (url, "/")) |
331 | { | 331 | { |
332 | /* Default page for visiting the server */ | 332 | /* Default page for visiting the server */ |
333 | struct MHD_Response *response = MHD_create_response_from_buffer ( | 333 | struct MHD_Response *response; |
334 | strlen (PAGE), | 334 | response = MHD_create_response_from_buffer_static (strlen (PAGE), |
335 | PAGE, | 335 | PAGE); |
336 | MHD_RESPMEM_PERSISTENT); | ||
337 | ret = MHD_queue_response (connection, | 336 | ret = MHD_queue_response (connection, |
338 | MHD_HTTP_OK, | 337 | MHD_HTTP_OK, |
339 | response); | 338 | response); |
@@ -400,10 +399,11 @@ access_handler (void *cls, | |||
400 | else | 399 | else |
401 | { | 400 | { |
402 | /* return error page */ | 401 | /* return error page */ |
403 | struct MHD_Response *response = MHD_create_response_from_buffer ( | 402 | struct MHD_Response *response; |
404 | strlen (PAGE_INVALID_WEBSOCKET_REQUEST), | 403 | response = |
405 | PAGE_INVALID_WEBSOCKET_REQUEST, | 404 | MHD_create_response_from_buffer_static (strlen ( |
406 | MHD_RESPMEM_PERSISTENT); | 405 | PAGE_INVALID_WEBSOCKET_REQUEST), |
406 | PAGE_INVALID_WEBSOCKET_REQUEST); | ||
407 | ret = MHD_queue_response (connection, | 407 | ret = MHD_queue_response (connection, |
408 | MHD_HTTP_BAD_REQUEST, | 408 | MHD_HTTP_BAD_REQUEST, |
409 | response); | 409 | response); |
@@ -412,10 +412,11 @@ access_handler (void *cls, | |||
412 | } | 412 | } |
413 | else | 413 | else |
414 | { | 414 | { |
415 | struct MHD_Response *response = MHD_create_response_from_buffer ( | 415 | struct MHD_Response *response; |
416 | strlen (PAGE_NOT_FOUND), | 416 | response = |
417 | PAGE_NOT_FOUND, | 417 | MHD_create_response_from_buffer_static (strlen ( |
418 | MHD_RESPMEM_PERSISTENT); | 418 | PAGE_NOT_FOUND), |
419 | PAGE_NOT_FOUND); | ||
419 | ret = MHD_queue_response (connection, | 420 | ret = MHD_queue_response (connection, |
420 | MHD_HTTP_NOT_FOUND, | 421 | MHD_HTTP_NOT_FOUND, |
421 | response); | 422 | response); |
diff --git a/src/examples/connection_close.c b/src/examples/connection_close.c index e5f787a3..8558eb46 100644 --- a/src/examples/connection_close.c +++ b/src/examples/connection_close.c | |||
@@ -61,9 +61,8 @@ ahc_echo (void *cls, | |||
61 | return MHD_YES; | 61 | return MHD_YES; |
62 | } | 62 | } |
63 | *req_cls = NULL; /* reset when done */ | 63 | *req_cls = NULL; /* reset when done */ |
64 | response = MHD_create_response_from_buffer (strlen (me), | 64 | response = MHD_create_response_from_buffer_static (strlen (me), |
65 | (void *) me, | 65 | me); |
66 | MHD_RESPMEM_PERSISTENT); | ||
67 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 66 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
68 | MHD_destroy_response (response); | 67 | MHD_destroy_response (response); |
69 | return ret; | 68 | return ret; |
diff --git a/src/examples/minimal_example_empty.c b/src/examples/minimal_example_empty.c index 43719a24..84837f08 100644 --- a/src/examples/minimal_example_empty.c +++ b/src/examples/minimal_example_empty.c | |||
@@ -55,9 +55,7 @@ ahc_echo (void *cls, | |||
55 | return MHD_YES; | 55 | return MHD_YES; |
56 | } | 56 | } |
57 | *req_cls = NULL; /* reset when done */ | 57 | *req_cls = NULL; /* reset when done */ |
58 | response = MHD_create_response_from_buffer (0, | 58 | response = MHD_create_response_empty (MHD_RF_NONE); |
59 | NULL, | ||
60 | MHD_RESPMEM_PERSISTENT); | ||
61 | ret = MHD_queue_response (connection, | 59 | ret = MHD_queue_response (connection, |
62 | MHD_HTTP_NO_CONTENT, | 60 | MHD_HTTP_NO_CONTENT, |
63 | response); | 61 | response); |
diff --git a/src/examples/minimal_example_empty_tls.c b/src/examples/minimal_example_empty_tls.c index 9c352717..c8c3763f 100644 --- a/src/examples/minimal_example_empty_tls.c +++ b/src/examples/minimal_example_empty_tls.c | |||
@@ -55,9 +55,7 @@ ahc_echo (void *cls, | |||
55 | return MHD_YES; | 55 | return MHD_YES; |
56 | } | 56 | } |
57 | *req_cls = NULL; /* reset when done */ | 57 | *req_cls = NULL; /* reset when done */ |
58 | response = MHD_create_response_from_buffer (0, | 58 | response = MHD_create_response_empty (MHD_RF_NONE); |
59 | NULL, | ||
60 | MHD_RESPMEM_PERSISTENT); | ||
61 | ret = MHD_queue_response (connection, | 59 | ret = MHD_queue_response (connection, |
62 | MHD_HTTP_NO_CONTENT, | 60 | MHD_HTTP_NO_CONTENT, |
63 | response); | 61 | response); |
diff --git a/src/examples/websocket_chatserver_example.c b/src/examples/websocket_chatserver_example.c index 052b4221..cc3005a2 100644 --- a/src/examples/websocket_chatserver_example.c +++ b/src/examples/websocket_chatserver_example.c | |||
@@ -2163,10 +2163,9 @@ access_handler (void *cls, | |||
2163 | if (0 == strcmp (url, "/")) | 2163 | if (0 == strcmp (url, "/")) |
2164 | { | 2164 | { |
2165 | /* Default page for visiting the server */ | 2165 | /* Default page for visiting the server */ |
2166 | struct MHD_Response *response = MHD_create_response_from_buffer (strlen ( | 2166 | struct MHD_Response *response; |
2167 | PAGE), | 2167 | response = MHD_create_response_from_buffer_static (strlen (PAGE), |
2168 | PAGE, | 2168 | PAGE); |
2169 | MHD_RESPMEM_PERSISTENT); | ||
2170 | ret = MHD_queue_response (connection, | 2169 | ret = MHD_queue_response (connection, |
2171 | MHD_HTTP_OK, | 2170 | MHD_HTTP_OK, |
2172 | response); | 2171 | response); |
@@ -2259,10 +2258,10 @@ access_handler (void *cls, | |||
2259 | else | 2258 | else |
2260 | { | 2259 | { |
2261 | /* return error page */ | 2260 | /* return error page */ |
2262 | struct MHD_Response *response = MHD_create_response_from_buffer (strlen ( | 2261 | struct MHD_Response *response; |
2263 | PAGE_INVALID_WEBSOCKET_REQUEST), | 2262 | response = MHD_create_response_from_buffer_static (strlen ( |
2264 | PAGE_INVALID_WEBSOCKET_REQUEST, | 2263 | PAGE_INVALID_WEBSOCKET_REQUEST), |
2265 | MHD_RESPMEM_PERSISTENT); | 2264 | PAGE_INVALID_WEBSOCKET_REQUEST); |
2266 | ret = MHD_queue_response (connection, | 2265 | ret = MHD_queue_response (connection, |
2267 | MHD_HTTP_BAD_REQUEST, | 2266 | MHD_HTTP_BAD_REQUEST, |
2268 | response); | 2267 | response); |
@@ -2271,10 +2270,9 @@ access_handler (void *cls, | |||
2271 | } | 2270 | } |
2272 | else | 2271 | else |
2273 | { | 2272 | { |
2274 | struct MHD_Response *response = MHD_create_response_from_buffer (strlen ( | 2273 | struct MHD_Response *response; |
2275 | PAGE_NOT_FOUND), | 2274 | response = MHD_create_response_from_buffer_static (strlen (PAGE_NOT_FOUND), |
2276 | PAGE_NOT_FOUND, | 2275 | PAGE_NOT_FOUND); |
2277 | MHD_RESPMEM_PERSISTENT); | ||
2278 | ret = MHD_queue_response (connection, | 2276 | ret = MHD_queue_response (connection, |
2279 | MHD_HTTP_NOT_FOUND, | 2277 | MHD_HTTP_NOT_FOUND, |
2280 | response); | 2278 | response); |
diff --git a/src/microhttpd/test_response_entries.c b/src/microhttpd/test_response_entries.c index 5386b8da..7e1b18a8 100644 --- a/src/microhttpd/test_response_entries.c +++ b/src/microhttpd/test_response_entries.c | |||
@@ -54,7 +54,7 @@ main (int argc, | |||
54 | (void) argv; /* Unused. Silence compiler warning. */ | 54 | (void) argv; /* Unused. Silence compiler warning. */ |
55 | struct MHD_Response *r; | 55 | struct MHD_Response *r; |
56 | 56 | ||
57 | r = MHD_create_response_from_buffer (0, "", MHD_RESPMEM_PERSISTENT); | 57 | r = MHD_create_response_empty (MHD_RF_NONE); |
58 | if (NULL == r) | 58 | if (NULL == r) |
59 | { | 59 | { |
60 | fprintf (stderr, "Cannot create a response.\n"); | 60 | fprintf (stderr, "Cannot create a response.\n"); |
diff --git a/src/testcurl/https/test_empty_response.c b/src/testcurl/https/test_empty_response.c index f4cce216..b338fa2e 100644 --- a/src/testcurl/https/test_empty_response.c +++ b/src/testcurl/https/test_empty_response.c | |||
@@ -52,8 +52,7 @@ ahc_echo (void *cls, | |||
52 | (void) cls; (void) url; (void) method; (void) version; /* Unused. Silent compiler warning. */ | 52 | (void) cls; (void) url; (void) method; (void) version; /* Unused. Silent compiler warning. */ |
53 | (void) upload_data; (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */ | 53 | (void) upload_data; (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */ |
54 | 54 | ||
55 | response = MHD_create_response_from_buffer (0, NULL, | 55 | response = MHD_create_response_empty (MHD_RF_NONE); |
56 | MHD_RESPMEM_PERSISTENT); | ||
57 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 56 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
58 | MHD_destroy_response (response); | 57 | MHD_destroy_response (response); |
59 | return ret; | 58 | return ret; |
diff --git a/src/testcurl/https/test_https_get.c b/src/testcurl/https/test_https_get.c index 968a0b96..184cc48e 100644 --- a/src/testcurl/https/test_https_get.c +++ b/src/testcurl/https/test_https_get.c | |||
@@ -120,9 +120,7 @@ ahc_empty (void *cls, | |||
120 | return MHD_YES; | 120 | return MHD_YES; |
121 | } | 121 | } |
122 | *req_cls = NULL; | 122 | *req_cls = NULL; |
123 | response = MHD_create_response_from_buffer (0, | 123 | response = MHD_create_response_empty (MHD_RF_NONE); |
124 | NULL, | ||
125 | MHD_RESPMEM_PERSISTENT); | ||
126 | ret = MHD_queue_response (connection, | 124 | ret = MHD_queue_response (connection, |
127 | MHD_HTTP_OK, | 125 | MHD_HTTP_OK, |
128 | response); | 126 | response); |
diff --git a/src/testcurl/https/test_https_session_info.c b/src/testcurl/https/test_https_session_info.c index e428e278..b0ccb576 100644 --- a/src/testcurl/https/test_https_session_info.c +++ b/src/testcurl/https/test_https_session_info.c | |||
@@ -84,9 +84,8 @@ query_session_ahc (void *cls, struct MHD_Connection *connection, | |||
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | response = MHD_create_response_from_buffer (strlen (EMPTY_PAGE), | 87 | response = MHD_create_response_from_buffer_static (strlen (EMPTY_PAGE), |
88 | (void *) EMPTY_PAGE, | 88 | EMPTY_PAGE); |
89 | MHD_RESPMEM_PERSISTENT); | ||
90 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 89 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
91 | MHD_destroy_response (response); | 90 | MHD_destroy_response (response); |
92 | return ret; | 91 | return ret; |
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c index 8d33e5d4..f3c561fe 100644 --- a/src/testcurl/https/tls_test_common.c +++ b/src/testcurl/https/tls_test_common.c | |||
@@ -224,9 +224,8 @@ http_ahc (void *cls, | |||
224 | return MHD_YES; | 224 | return MHD_YES; |
225 | } | 225 | } |
226 | *req_cls = NULL; /* reset when done */ | 226 | *req_cls = NULL; /* reset when done */ |
227 | response = MHD_create_response_from_buffer (strlen (test_data), | 227 | response = MHD_create_response_from_buffer_static (strlen (test_data), |
228 | (void *) test_data, | 228 | test_data); |
229 | MHD_RESPMEM_PERSISTENT); | ||
230 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 229 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
231 | MHD_destroy_response (response); | 230 | MHD_destroy_response (response); |
232 | return ret; | 231 | return ret; |
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c index e05e4f31..6f22c1f2 100644 --- a/src/testcurl/test_digestauth.c +++ b/src/testcurl/test_digestauth.c | |||
@@ -282,9 +282,8 @@ ahc_echo (void *cls, | |||
282 | if ( (username == NULL) || | 282 | if ( (username == NULL) || |
283 | (0 != strcmp (username, "testuser")) ) | 283 | (0 != strcmp (username, "testuser")) ) |
284 | { | 284 | { |
285 | response = MHD_create_response_from_buffer (strlen (DENIED), | 285 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
286 | DENIED, | 286 | DENIED); |
287 | MHD_RESPMEM_PERSISTENT); | ||
288 | if (NULL == response) | 287 | if (NULL == response) |
289 | mhdErrorExitDesc ("MHD_create_response_from_buffer failed"); | 288 | mhdErrorExitDesc ("MHD_create_response_from_buffer failed"); |
290 | ret = MHD_queue_auth_fail_response2 (connection, | 289 | ret = MHD_queue_auth_fail_response2 (connection, |
@@ -307,9 +306,8 @@ ahc_echo (void *cls, | |||
307 | MHD_free (username); | 306 | MHD_free (username); |
308 | if (ret_e != MHD_DAUTH_OK) | 307 | if (ret_e != MHD_DAUTH_OK) |
309 | { | 308 | { |
310 | response = MHD_create_response_from_buffer (strlen (DENIED), | 309 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
311 | DENIED, | 310 | DENIED); |
312 | MHD_RESPMEM_PERSISTENT); | ||
313 | if (NULL == response) | 311 | if (NULL == response) |
314 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); | 312 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); |
315 | ret = MHD_queue_auth_fail_response2 (connection, | 313 | ret = MHD_queue_auth_fail_response2 (connection, |
@@ -324,9 +322,8 @@ ahc_echo (void *cls, | |||
324 | MHD_destroy_response (response); | 322 | MHD_destroy_response (response); |
325 | return ret; | 323 | return ret; |
326 | } | 324 | } |
327 | response = MHD_create_response_from_buffer (strlen (PAGE), | 325 | response = MHD_create_response_from_buffer_static (strlen (PAGE), |
328 | PAGE, | 326 | PAGE); |
329 | MHD_RESPMEM_PERSISTENT); | ||
330 | if (NULL == response) | 327 | if (NULL == response) |
331 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); | 328 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); |
332 | ret = MHD_queue_response (connection, | 329 | ret = MHD_queue_response (connection, |
diff --git a/src/testcurl/test_digestauth_concurrent.c b/src/testcurl/test_digestauth_concurrent.c index 5795c686..045b673d 100644 --- a/src/testcurl/test_digestauth_concurrent.c +++ b/src/testcurl/test_digestauth_concurrent.c | |||
@@ -293,9 +293,8 @@ ahc_echo (void *cls, | |||
293 | if ( (username == NULL) || | 293 | if ( (username == NULL) || |
294 | (0 != strcmp (username, "testuser")) ) | 294 | (0 != strcmp (username, "testuser")) ) |
295 | { | 295 | { |
296 | response = MHD_create_response_from_buffer (strlen (DENIED), | 296 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
297 | DENIED, | 297 | DENIED); |
298 | MHD_RESPMEM_PERSISTENT); | ||
299 | if (NULL == response) | 298 | if (NULL == response) |
300 | mhdErrorExitDesc ("MHD_create_response_from_buffer failed"); | 299 | mhdErrorExitDesc ("MHD_create_response_from_buffer failed"); |
301 | ret = MHD_queue_auth_fail_response2 (connection, | 300 | ret = MHD_queue_auth_fail_response2 (connection, |
@@ -318,9 +317,8 @@ ahc_echo (void *cls, | |||
318 | MHD_free (username); | 317 | MHD_free (username); |
319 | if (ret_e != MHD_DAUTH_OK) | 318 | if (ret_e != MHD_DAUTH_OK) |
320 | { | 319 | { |
321 | response = MHD_create_response_from_buffer (strlen (DENIED), | 320 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
322 | DENIED, | 321 | DENIED); |
323 | MHD_RESPMEM_PERSISTENT); | ||
324 | if (NULL == response) | 322 | if (NULL == response) |
325 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); | 323 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); |
326 | ret = MHD_queue_auth_fail_response2 (connection, | 324 | ret = MHD_queue_auth_fail_response2 (connection, |
@@ -335,9 +333,8 @@ ahc_echo (void *cls, | |||
335 | MHD_destroy_response (response); | 333 | MHD_destroy_response (response); |
336 | return ret; | 334 | return ret; |
337 | } | 335 | } |
338 | response = MHD_create_response_from_buffer (strlen (PAGE), | 336 | response = MHD_create_response_from_buffer_static (strlen (PAGE), |
339 | PAGE, | 337 | PAGE); |
340 | MHD_RESPMEM_PERSISTENT); | ||
341 | if (NULL == response) | 338 | if (NULL == response) |
342 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); | 339 | mhdErrorExitDesc ("MHD_create_response_from_buffer() failed"); |
343 | ret = MHD_queue_response (connection, | 340 | ret = MHD_queue_response (connection, |
diff --git a/src/testcurl/test_digestauth_sha256.c b/src/testcurl/test_digestauth_sha256.c index bfab4a7e..90e5ad5f 100644 --- a/src/testcurl/test_digestauth_sha256.c +++ b/src/testcurl/test_digestauth_sha256.c | |||
@@ -111,9 +111,8 @@ ahc_echo (void *cls, | |||
111 | if ( (username == NULL) || | 111 | if ( (username == NULL) || |
112 | (0 != strcmp (username, "testuser")) ) | 112 | (0 != strcmp (username, "testuser")) ) |
113 | { | 113 | { |
114 | response = MHD_create_response_from_buffer (strlen (DENIED), | 114 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
115 | DENIED, | 115 | DENIED); |
116 | MHD_RESPMEM_PERSISTENT); | ||
117 | ret = MHD_queue_auth_fail_response2 (connection, | 116 | ret = MHD_queue_auth_fail_response2 (connection, |
118 | realm, | 117 | realm, |
119 | MY_OPAQUE, | 118 | MY_OPAQUE, |
@@ -132,9 +131,8 @@ ahc_echo (void *cls, | |||
132 | MHD_free (username); | 131 | MHD_free (username); |
133 | if (ret_e != MHD_DAUTH_OK) | 132 | if (ret_e != MHD_DAUTH_OK) |
134 | { | 133 | { |
135 | response = MHD_create_response_from_buffer (strlen (DENIED), | 134 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
136 | DENIED, | 135 | DENIED); |
137 | MHD_RESPMEM_PERSISTENT); | ||
138 | if (NULL == response) | 136 | if (NULL == response) |
139 | return MHD_NO; | 137 | return MHD_NO; |
140 | ret = MHD_queue_auth_fail_response2 (connection, | 138 | ret = MHD_queue_auth_fail_response2 (connection, |
@@ -147,9 +145,8 @@ ahc_echo (void *cls, | |||
147 | MHD_destroy_response (response); | 145 | MHD_destroy_response (response); |
148 | return ret; | 146 | return ret; |
149 | } | 147 | } |
150 | response = MHD_create_response_from_buffer (strlen (PAGE), | 148 | response = MHD_create_response_from_buffer_static (strlen (PAGE), |
151 | PAGE, | 149 | PAGE); |
152 | MHD_RESPMEM_PERSISTENT); | ||
153 | ret = MHD_queue_response (connection, | 150 | ret = MHD_queue_response (connection, |
154 | MHD_HTTP_OK, | 151 | MHD_HTTP_OK, |
155 | response); | 152 | response); |
diff --git a/src/testcurl/test_digestauth_with_arguments.c b/src/testcurl/test_digestauth_with_arguments.c index 773fd5f5..843e4684 100644 --- a/src/testcurl/test_digestauth_with_arguments.c +++ b/src/testcurl/test_digestauth_with_arguments.c | |||
@@ -104,9 +104,8 @@ ahc_echo (void *cls, | |||
104 | if ( (username == NULL) || | 104 | if ( (username == NULL) || |
105 | (0 != strcmp (username, "testuser")) ) | 105 | (0 != strcmp (username, "testuser")) ) |
106 | { | 106 | { |
107 | response = MHD_create_response_from_buffer (strlen (DENIED), | 107 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
108 | DENIED, | 108 | DENIED); |
109 | MHD_RESPMEM_PERSISTENT); | ||
110 | ret = MHD_queue_auth_fail_response2 (connection, realm, | 109 | ret = MHD_queue_auth_fail_response2 (connection, realm, |
111 | MY_OPAQUE, | 110 | MY_OPAQUE, |
112 | response, | 111 | response, |
@@ -123,9 +122,8 @@ ahc_echo (void *cls, | |||
123 | MHD_free (username); | 122 | MHD_free (username); |
124 | if (ret_e != MHD_DAUTH_OK) | 123 | if (ret_e != MHD_DAUTH_OK) |
125 | { | 124 | { |
126 | response = MHD_create_response_from_buffer (strlen (DENIED), | 125 | response = MHD_create_response_from_buffer_static (strlen (DENIED), |
127 | DENIED, | 126 | DENIED); |
128 | MHD_RESPMEM_PERSISTENT); | ||
129 | if (NULL == response) | 127 | if (NULL == response) |
130 | return MHD_NO; | 128 | return MHD_NO; |
131 | ret = MHD_queue_auth_fail_response2 (connection, realm, | 129 | ret = MHD_queue_auth_fail_response2 (connection, realm, |
@@ -137,8 +135,8 @@ ahc_echo (void *cls, | |||
137 | MHD_destroy_response (response); | 135 | MHD_destroy_response (response); |
138 | return ret; | 136 | return ret; |
139 | } | 137 | } |
140 | response = MHD_create_response_from_buffer (strlen (PAGE), PAGE, | 138 | response = MHD_create_response_from_buffer_static (strlen (PAGE), |
141 | MHD_RESPMEM_PERSISTENT); | 139 | PAGE); |
142 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 140 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
143 | MHD_destroy_response (response); | 141 | MHD_destroy_response (response); |
144 | return ret; | 142 | return ret; |
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c index a60c0797..8fe1c771 100644 --- a/src/testcurl/test_get.c +++ b/src/testcurl/test_get.c | |||
@@ -765,9 +765,7 @@ ahc_empty (void *cls, | |||
765 | return MHD_YES; | 765 | return MHD_YES; |
766 | } | 766 | } |
767 | *req_cls = NULL; | 767 | *req_cls = NULL; |
768 | response = MHD_create_response_from_buffer (0, | 768 | response = MHD_create_response_empty (MHD_RF_NONE); |
769 | NULL, | ||
770 | MHD_RESPMEM_PERSISTENT); | ||
771 | ret = MHD_queue_response (connection, | 769 | ret = MHD_queue_response (connection, |
772 | MHD_HTTP_OK, | 770 | MHD_HTTP_OK, |
773 | response); | 771 | response); |
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c index 876016cc..4f7b5606 100644 --- a/src/testcurl/test_get_chunked.c +++ b/src/testcurl/test_get_chunked.c | |||
@@ -232,8 +232,7 @@ ahc_echo (void *cls, | |||
232 | free (buf); | 232 | free (buf); |
233 | } | 233 | } |
234 | else | 234 | else |
235 | response = MHD_create_response_from_buffer (0, NULL, | 235 | response = MHD_create_response_empty (MHD_RF_NONE); |
236 | MHD_RESPMEM_PERSISTENT); | ||
237 | } | 236 | } |
238 | if (NULL == response) | 237 | if (NULL == response) |
239 | abort (); | 238 | abort (); |
diff --git a/src/testcurl/test_get_empty.c b/src/testcurl/test_get_empty.c index fdbb2d42..32d6b16f 100644 --- a/src/testcurl/test_get_empty.c +++ b/src/testcurl/test_get_empty.c | |||
@@ -125,9 +125,7 @@ ahc_echo (void *cls, | |||
125 | return MHD_YES; | 125 | return MHD_YES; |
126 | } | 126 | } |
127 | *req_cls = NULL; | 127 | *req_cls = NULL; |
128 | response = MHD_create_response_from_buffer (0, | 128 | response = MHD_create_response_empty (MHD_RF_NONE); |
129 | NULL, | ||
130 | MHD_RESPMEM_PERSISTENT); | ||
131 | ret = MHD_queue_response (connection, | 129 | ret = MHD_queue_response (connection, |
132 | MHD_HTTP_NO_CONTENT, | 130 | MHD_HTTP_NO_CONTENT, |
133 | response); | 131 | response); |
@@ -723,9 +721,7 @@ ahc_empty (void *cls, | |||
723 | return MHD_YES; | 721 | return MHD_YES; |
724 | } | 722 | } |
725 | *req_cls = NULL; | 723 | *req_cls = NULL; |
726 | response = MHD_create_response_from_buffer (0, | 724 | response = MHD_create_response_empty (MHD_RF_NONE); |
727 | NULL, | ||
728 | MHD_RESPMEM_PERSISTENT); | ||
729 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 725 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
730 | MHD_destroy_response (response); | 726 | MHD_destroy_response (response); |
731 | if (ret == MHD_NO) | 727 | if (ret == MHD_NO) |
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c index 90b8f48a..e36391fd 100644 --- a/src/testcurl/test_post.c +++ b/src/testcurl/test_post.c | |||
@@ -610,8 +610,7 @@ ahc_cancel (void *cls, | |||
610 | { | 610 | { |
611 | *req_cls = "wibble"; | 611 | *req_cls = "wibble"; |
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_from_buffer (0, NULL, | 613 | response = MHD_create_response_empty (MHD_RF_NONE); |
614 | MHD_RESPMEM_PERSISTENT); | ||
615 | ret = MHD_queue_response (connection, 500, response); | 614 | ret = MHD_queue_response (connection, 500, response); |
616 | if (ret != MHD_YES) | 615 | if (ret != MHD_YES) |
617 | fprintf (stderr, "Failed to queue response\n"); | 616 | fprintf (stderr, "Failed to queue response\n"); |
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c index 37cd121b..ec42ffce 100644 --- a/src/testcurl/test_post_loop.c +++ b/src/testcurl/test_post_loop.c | |||
@@ -103,8 +103,8 @@ ahc_echo (void *cls, | |||
103 | { | 103 | { |
104 | if (*req_cls != &marker) | 104 | if (*req_cls != &marker) |
105 | abort (); | 105 | abort (); |
106 | response = MHD_create_response_from_buffer (2, "OK", | 106 | response = MHD_create_response_from_buffer_static (2, |
107 | MHD_RESPMEM_PERSISTENT); | 107 | "OK"); |
108 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 108 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
109 | MHD_destroy_response (response); | 109 | MHD_destroy_response (response); |
110 | *req_cls = NULL; | 110 | *req_cls = NULL; |
diff --git a/src/testcurl/test_termination.c b/src/testcurl/test_termination.c index 72b77219..239f10ec 100644 --- a/src/testcurl/test_termination.c +++ b/src/testcurl/test_termination.c | |||
@@ -78,8 +78,7 @@ connection_handler (void *cls, | |||
78 | } | 78 | } |
79 | 79 | ||
80 | response = | 80 | response = |
81 | MHD_create_response_from_buffer (strlen ("Response"), "Response", | 81 | MHD_create_response_from_buffer_static (strlen ("Response"), "Response"); |
82 | MHD_RESPMEM_PERSISTENT); | ||
83 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 82 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |
84 | MHD_destroy_response (response); | 83 | MHD_destroy_response (response); |
85 | 84 | ||