From cd20202b450fa714275ee597c4d71cd8cb0c207f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 18 Jun 2019 17:10:33 +0200 Subject: minimize scopes --- src/twister/taler-twister-service.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c index 918dd5d..250ea53 100644 --- a/src/twister/taler-twister-service.c +++ b/src/twister/taler-twister-service.c @@ -1506,10 +1506,10 @@ create_response (void *cls, GNUNET_assert (*upload_data_size + hr->io_len > hr->io_len); GNUNET_array_grow (hr->io_buf, - hr->io_size, - GNUNET_MAX - (hr->io_size * 2 + 1024, - *upload_data_size + hr->io_len)); + hr->io_size, + GNUNET_MAX + (hr->io_size * 2 + 1024, + *upload_data_size + hr->io_len)); } /* Finally copy upload data. */ @@ -1532,9 +1532,10 @@ create_response (void *cls, "Finished processing UPLOAD\n"); if (0 != hr->io_len) { + const char *ce; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Attempting to decompress\n"); - const char *ce; ce = MHD_lookup_connection_value (con, MHD_HEADER_KIND, @@ -1551,6 +1552,7 @@ create_response (void *cls, if ((NULL != ce) && (0 == strcmp ("application/json", ce))) { json_error_t error; + hr->json = json_loadb (hr->io_buf, hr->io_len, JSON_DECODE_ANY, @@ -1962,13 +1964,15 @@ mhd_completed_cb (void *cls, "Resetting cURL handle\n"); curl_multi_remove_handle (curl_multi, hr->curl); - curl_slist_free_all (hr->headers); - hr->headers = NULL; curl_easy_cleanup (hr->curl); hr->curl = NULL; hr->io_len = 0; } - + if (NULL != hr->headers) + { + curl_slist_free_all (hr->headers); + hr->headers = NULL; + } if ( (NULL != hr->response) && (curl_failure_response != hr->response) ) /* Destroy non-error responses... (?) */ @@ -2211,6 +2215,7 @@ do_shutdown (void *cls) target_server_base_url = NULL; } + /** * Connect to a unix domain socket. * -- cgit v1.2.3