Replaced MHD_RESPMEM_PERSISTENT usage in examples and code

New functions do not produce compiler warnings.
This commit is contained in:
Evgeny Grin (Karlson2k)
2022-05-14 15:07:47 +03:00
parent 4fc1bbfd5b
commit 85ae657849
21 changed files with 67 additions and 99 deletions
+1 -2
View File
@@ -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;
+13 -12
View File
@@ -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);