From 7e84b5570adeaa027f8c7861caf6af7943edcd0b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 8 Dec 2021 18:12:28 +0100 Subject: fix error handling for very large uploads, fix re-generation of /keys response after Expires expires --- src/mhd/mhd_parsing.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/mhd/mhd_parsing.c') diff --git a/src/mhd/mhd_parsing.c b/src/mhd/mhd_parsing.c index b55a3db32..4415c82a8 100644 --- a/src/mhd/mhd_parsing.c +++ b/src/mhd/mhd_parsing.c @@ -27,12 +27,6 @@ #include "taler_mhd_lib.h" -/** - * Maximum POST request size. - */ -#define REQUEST_BUFFER_MAX (1024 * 1024) - - /** * Process a POST request containing a JSON object. This function * realizes an MHD POST processor that will (incrementally) process @@ -65,7 +59,7 @@ TALER_MHD_parse_post_json (struct MHD_Connection *connection, { enum GNUNET_JSON_PostResult pr; - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, + pr = GNUNET_JSON_post_parser (TALER_MHD_REQUEST_BUFFER_MAX, connection, con_cls, upload_data, @@ -87,9 +81,9 @@ TALER_MHD_parse_post_json (struct MHD_Connection *connection, return GNUNET_YES; case GNUNET_JSON_PR_REQUEST_TOO_LARGE: GNUNET_break (NULL == *json); - return (MHD_NO == - TALER_MHD_reply_request_too_large - (connection)) ? GNUNET_SYSERR : GNUNET_NO; + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Closing connection, upload too large\n"); + return MHD_NO; case GNUNET_JSON_PR_JSON_INVALID: GNUNET_break (NULL == *json); return (MHD_YES == -- cgit v1.2.3