From 85ae657849685d27b79ae6b14f7248d81ec99d2c Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Sat, 14 May 2022 15:07:47 +0300 Subject: Replaced MHD_RESPMEM_PERSISTENT usage in examples and code New functions do not produce compiler warnings. --- doc/examples/tlsauthentication.c | 3 +-- doc/examples/websocket.c | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'doc/examples') 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) size_t slen; const char *strbase = "Basic realm="; - response = MHD_create_response_from_buffer (0, NULL, - MHD_RESPMEM_PERSISTENT); + response = MHD_create_response_empty (MHD_RF_NONE); if (! response) return MHD_NO; 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, if (0 == strcmp (url, "/")) { /* Default page for visiting the server */ - struct MHD_Response *response = MHD_create_response_from_buffer ( - strlen (PAGE), - PAGE, - MHD_RESPMEM_PERSISTENT); + struct MHD_Response *response; + response = MHD_create_response_from_buffer_static (strlen (PAGE), + PAGE); ret = MHD_queue_response (connection, MHD_HTTP_OK, response); @@ -400,10 +399,11 @@ access_handler (void *cls, else { /* return error page */ - struct MHD_Response *response = MHD_create_response_from_buffer ( - strlen (PAGE_INVALID_WEBSOCKET_REQUEST), - PAGE_INVALID_WEBSOCKET_REQUEST, - MHD_RESPMEM_PERSISTENT); + struct MHD_Response *response; + response = + MHD_create_response_from_buffer_static (strlen ( + PAGE_INVALID_WEBSOCKET_REQUEST), + PAGE_INVALID_WEBSOCKET_REQUEST); ret = MHD_queue_response (connection, MHD_HTTP_BAD_REQUEST, response); @@ -412,10 +412,11 @@ access_handler (void *cls, } else { - struct MHD_Response *response = MHD_create_response_from_buffer ( - strlen (PAGE_NOT_FOUND), - PAGE_NOT_FOUND, - MHD_RESPMEM_PERSISTENT); + struct MHD_Response *response; + response = + MHD_create_response_from_buffer_static (strlen ( + PAGE_NOT_FOUND), + PAGE_NOT_FOUND); ret = MHD_queue_response (connection, MHD_HTTP_NOT_FOUND, response); -- cgit v1.2.3