aboutsummaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-05-14 15:07:47 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-05-14 15:07:47 +0300
commit85ae657849685d27b79ae6b14f7248d81ec99d2c (patch)
tree5766712bc12b799cba3ee40058782b66d494d008 /doc/examples
parent4fc1bbfd5bf3196e1f603e443b51ddec911305b4 (diff)
downloadlibmicrohttpd-85ae657849685d27b79ae6b14f7248d81ec99d2c.tar.gz
libmicrohttpd-85ae657849685d27b79ae6b14f7248d81ec99d2c.zip
Replaced MHD_RESPMEM_PERSISTENT usage in examples and code
New functions do not produce compiler warnings.
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/tlsauthentication.c3
-rw-r--r--doc/examples/websocket.c25
2 files changed, 14 insertions, 14 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);