commit 6b86b4a11f1a52c625bcd9081322be6a41d93c07
parent 9f2c4a48c0f828a13e57033d39096944e7472f0d
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 30 Jun 2026 22:55:56 +0200
clean up MHD2 responses on failure
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/mhd/mhd2_responses.c b/src/mhd/mhd2_responses.c
@@ -204,7 +204,7 @@ TALER_MHD2_reply_json (struct MHD_Request *request,
sc);
GNUNET_assert (0);
- return NULL;
+ return MHD_action_abort_request (request);
}
json_len = strlen (json_str);
/* try to compress the body */
@@ -221,7 +221,7 @@ TALER_MHD2_reply_json (struct MHD_Request *request,
{
free (json_str);
GNUNET_break (0);
- return NULL;
+ return MHD_action_abort_request (request);
}
TALER_MHD2_add_global_headers (response,
false);
@@ -239,7 +239,7 @@ TALER_MHD2_reply_json (struct MHD_Request *request,
{
GNUNET_break (0);
MHD_response_destroy (response);
- return NULL;
+ return MHD_action_abort_request (request);
}
}
@@ -270,7 +270,7 @@ TALER_MHD2_reply_cors_preflight (struct MHD_Request *request)
response = MHD_response_from_empty (MHD_HTTP_STATUS_NO_CONTENT);
if (NULL == response)
- return NULL;
+ return MHD_action_abort_request (request);
/* This adds the Access-Control-Allow-Origin header.
* All endpoints of the exchange allow CORS. */
TALER_MHD2_add_global_headers (response,
@@ -365,7 +365,7 @@ TALER_MHD2_reply_agpl (struct MHD_Request *request,
if (NULL == response)
{
GNUNET_break (0);
- return MHD_NO;
+ return MHD_action_abort_request (request);
}
TALER_MHD2_add_global_headers (response,
true);
@@ -380,7 +380,7 @@ TALER_MHD2_reply_agpl (struct MHD_Request *request,
{
GNUNET_break (0);
MHD_response_destroy (response);
- return NULL;
+ return MHD_action_abort_request (request);
}
return MHD_action_from_response (request,
response);
@@ -402,7 +402,7 @@ TALER_MHD2_reply_static (struct MHD_Request *request,
if (NULL == response)
{
GNUNET_break (0);
- return NULL;
+ return MHD_action_abort_request (request);
}
TALER_MHD2_add_global_headers (response,
true);