commit b6568fa0fd9590bf4812c2488950e49df5d098d5
parent c0aea528e2a7d470558792270564c0b0b80cfa95
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Thu, 16 Jul 2026 00:03:45 +0200
more robust test for upload data that also works for chunked encoding
Diffstat:
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/src/challenger/challenger-httpd_setup.c b/src/challenger/challenger-httpd_setup.c
@@ -89,7 +89,6 @@ CH_handler_setup (struct CH_HandlerContext *hc,
struct SetupContext *sc = hc->ctx;
unsigned long long client_id;
const char *client_secret;
- const char *cl;
if (NULL == sc)
{
@@ -100,25 +99,17 @@ CH_handler_setup (struct CH_HandlerContext *hc,
hc->ctx = sc;
return MHD_YES;
}
- cl = MHD_lookup_connection_value (hc->connection,
- MHD_HEADER_KIND,
- MHD_HTTP_HEADER_CONTENT_LENGTH);
- /* If we have a body (Content-length set and not zero) and we
- are not yet done parsing it, try to parse it! */
if ( (NULL == sc->root) &&
- (NULL != cl) &&
- (0 != strcmp ("0",
- cl)) )
+ (0 != *upload_data_size) )
{
/* parse byte stream upload into JSON */
enum GNUNET_GenericReturnValue res;
#if DEBUG
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Handling upload of `%.*s' (%s)\n",
+ "Handling upload of `%.*s'\n",
(int) *upload_data_size,
- upload_data,
- cl);
+ upload_data);
#endif
res = TALER_MHD_parse_post_json (hc->connection,
&sc->opaque_post_parsing_context,