summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-18 17:10:33 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-18 17:10:33 +0200
commitcd20202b450fa714275ee597c4d71cd8cb0c207f (patch)
tree81f0a3c5cca616eee045f6125270cd3be9c8d346
parent7cc3f427cd601521b799bfe5a50a7c26e0a29e32 (diff)
downloadtwister-cd20202b450fa714275ee597c4d71cd8cb0c207f.tar.gz
twister-cd20202b450fa714275ee597c4d71cd8cb0c207f.tar.bz2
twister-cd20202b450fa714275ee597c4d71cd8cb0c207f.zip
minimize scopes
-rw-r--r--src/twister/taler-twister-service.c21
1 files 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.
*