summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-11 23:49:36 +0200
committerChristian Grothoff <christian@grothoff.org>2019-10-11 23:49:36 +0200
commitd804a0c8a705ad0ec1f8eacbba4ff847b2e7e8f7 (patch)
treeb72dbc468922ca694a1aa78b1df94dfe30ead34d
parent05dd20ef517ebbb131f935c73dbbefac4f6cd683 (diff)
downloadtwister-d804a0c8a705ad0ec1f8eacbba4ff847b2e7e8f7.tar.gz
twister-d804a0c8a705ad0ec1f8eacbba4ff847b2e7e8f7.tar.bz2
twister-d804a0c8a705ad0ec1f8eacbba4ff847b2e7e8f7.zip
-rw-r--r--src/twister/taler-twister-service.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c
index 51173a3..06676e8 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -316,51 +316,51 @@ static unsigned int hack_response_code;
* Will point to a JSON object to delete. Only cares about
* _download_ objects.
*/
-static char *delete_path = NULL;
+static char *delete_path;
/**
* Will point to a JSON _string_ object
* which will get a character flipped.
* Only checked against _download_ objects.
*/
-static char *flip_path_dl = NULL;
+static char *flip_path_dl;
/**
* Will point to a JSON _string_ object
* which will get a character flipped.
* Only checked against _upload_ objects.
*/
-static char *flip_path_ul = NULL;
+static char *flip_path_ul;
/**
* Will point to a JSON object to modify.
* Only checked against _download_ objects.
*/
-static char *modify_path_dl = NULL;
+static char *modify_path_dl;
/**
* Will point to a JSON object to modify.
* Only checked against _upload_ objects.
*/
-static char *modify_path_ul = NULL;
+static char *modify_path_ul;
/**
* If true, will randomly truncate the request body
* to upload to the proxied service.
*/
-static unsigned int malform_upload = GNUNET_NO;
+static unsigned int malform_upload;
/**
* If true, will randomly truncate the response body
* before returning to the client.
*/
-static unsigned int malform = GNUNET_NO;
+static unsigned int malform;
/**
* New value to give the modified field.
* Both for upload and download mods.
*/
-static char *modify_value = NULL;
+static char *modify_value;
/**
* Size of the malformed body to be uploaded to the
@@ -925,7 +925,6 @@ con_val_iter (void *cls,
char *new_value = NULL;
(void) kind;
-
if (0 == strcmp (MHD_HTTP_HEADER_HOST,
key))
{
@@ -989,7 +988,6 @@ walk_object (const char *path,
char **target,
json_t *json)
{
-
json_t *element;
json_t *cur;
char *token;
@@ -1004,7 +1002,6 @@ walk_object (const char *path,
last_token = strrchr (path_dup, '.') + 1;
/* Give first nondelim char. */
token = strtok (path_dup, ".");
-
if (NULL == (element = json))
{
TALER_LOG_ERROR ("Attempting to walk a non JSON response!\n");
@@ -1018,7 +1015,6 @@ walk_object (const char *path,
last_token, last_token);
if (NULL == token)
return GNUNET_SYSERR; // path was ".", refuse to process it.
-
if (NULL != (cur = json_object_get (element,
token)))
{
@@ -1026,7 +1022,6 @@ walk_object (const char *path,
token = strtok (NULL, ".");
continue;
}
-
if (NULL != (cur = json_array_get (element,
(unsigned int) strtoul
(token, NULL, 10))))
@@ -1038,7 +1033,6 @@ walk_object (const char *path,
TALER_LOG_WARNING ("Path token '%s' not found\n",
token);
GNUNET_free (path_dup);
-
return GNUNET_NO;
}
@@ -1061,7 +1055,6 @@ walk_object (const char *path,
*target = GNUNET_strdup (last_token);
*parent = element;
GNUNET_free (path_dup);
-
return GNUNET_OK;
}
@@ -1121,13 +1114,12 @@ modify_object (struct MHD_Connection *con,
goto perform_modbody;
}
- TALER_LOG_ERROR ("Unvalid new value given: %s\n",
+ TALER_LOG_ERROR ("Invalid new value given: %s\n",
modify_value);
GNUNET_free (target);
- json_decref (new_value);
return GNUNET_SYSERR;
- perform_modbody:
+perform_modbody:
ret_modify = -1;
if (json_is_object (parent))
ret_modify = json_object_set (parent,