mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
check rvalues from MHD_add_response_header in examples
This commit is contained in:
+32
-12
@@ -292,9 +292,14 @@ serve_simple_form (const void *cls,
|
|||||||
if (NULL == response)
|
if (NULL == response)
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
add_session_cookie (session, response);
|
add_session_cookie (session, response);
|
||||||
MHD_add_response_header (response,
|
if (MHD_YES !=
|
||||||
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
MHD_add_response_header (response,
|
||||||
mime);
|
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
||||||
|
mime))
|
||||||
|
{
|
||||||
|
fprintf (stderr,
|
||||||
|
"Failed to set content encoding header!\n");
|
||||||
|
}
|
||||||
ret = MHD_queue_response (connection,
|
ret = MHD_queue_response (connection,
|
||||||
MHD_HTTP_OK,
|
MHD_HTTP_OK,
|
||||||
response);
|
response);
|
||||||
@@ -342,9 +347,14 @@ fill_v1_form (const void *cls,
|
|||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
}
|
}
|
||||||
add_session_cookie (session, response);
|
add_session_cookie (session, response);
|
||||||
MHD_add_response_header (response,
|
if (MHD_YES !=
|
||||||
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
MHD_add_response_header (response,
|
||||||
mime);
|
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
||||||
|
mime))
|
||||||
|
{
|
||||||
|
fprintf (stderr,
|
||||||
|
"Failed to set content encoding header!\n");
|
||||||
|
}
|
||||||
ret = MHD_queue_response (connection,
|
ret = MHD_queue_response (connection,
|
||||||
MHD_HTTP_OK,
|
MHD_HTTP_OK,
|
||||||
response);
|
response);
|
||||||
@@ -394,9 +404,14 @@ fill_v1_v2_form (const void *cls,
|
|||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
}
|
}
|
||||||
add_session_cookie (session, response);
|
add_session_cookie (session, response);
|
||||||
MHD_add_response_header (response,
|
if (MHD_YES !=
|
||||||
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
MHD_add_response_header (response,
|
||||||
mime);
|
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
||||||
|
mime))
|
||||||
|
{
|
||||||
|
fprintf (stderr,
|
||||||
|
"Failed to set content encoding header!\n");
|
||||||
|
}
|
||||||
ret = MHD_queue_response (connection,
|
ret = MHD_queue_response (connection,
|
||||||
MHD_HTTP_OK,
|
MHD_HTTP_OK,
|
||||||
response);
|
response);
|
||||||
@@ -433,9 +448,14 @@ not_found_page (const void *cls,
|
|||||||
ret = MHD_queue_response (connection,
|
ret = MHD_queue_response (connection,
|
||||||
MHD_HTTP_NOT_FOUND,
|
MHD_HTTP_NOT_FOUND,
|
||||||
response);
|
response);
|
||||||
MHD_add_response_header (response,
|
if (MHD_YES !=
|
||||||
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
MHD_add_response_header (response,
|
||||||
mime);
|
MHD_HTTP_HEADER_CONTENT_ENCODING,
|
||||||
|
mime))
|
||||||
|
{
|
||||||
|
fprintf (stderr,
|
||||||
|
"Failed to set content encoding header!\n");
|
||||||
|
}
|
||||||
MHD_destroy_response (response);
|
MHD_destroy_response (response);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user