libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit b0b57638a0adf41d9f03f206700d8064794eeb98
parent e2cd9eaf55ec6afb6612b797870aacea71bf41f8
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Fri, 27 Nov 2026 12:03:57 +0100

post_example.c: fixed the order of operations in not_found_page()

Diffstat:
Msrc/examples/post_example.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/examples/post_example.c b/src/examples/post_example.c @@ -446,9 +446,6 @@ not_found_page (const void *cls, (const void *) NOT_FOUND_ERROR); if (NULL == response) return MHD_NO; - ret = MHD_queue_response (connection, - MHD_HTTP_NOT_FOUND, - response); if (MHD_YES != MHD_add_response_header (response, MHD_HTTP_HEADER_CONTENT_ENCODING, @@ -457,6 +454,9 @@ not_found_page (const void *cls, fprintf (stderr, "Failed to set content encoding header!\n"); } + ret = MHD_queue_response (connection, + MHD_HTTP_NOT_FOUND, + response); MHD_destroy_response (response); return ret; }