[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-twister] 18/34: avoid duplicating tokenized string.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-twister] 18/34: avoid duplicating tokenized string. |
Date: |
Sat, 17 Mar 2018 01:58:09 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository twister.
commit 63c64f0bd49165cebc77a15aafb836e396ac789a
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Mar 8 17:06:46 2018 +0100
avoid duplicating tokenized string.
---
src/twister/taler-twister-service.c | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/src/twister/taler-twister-service.c
b/src/twister/taler-twister-service.c
index f4db07c..ae3d3d0 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -810,7 +810,10 @@ con_val_iter (void *cls,
/**
* Delete object within the proxied response.
- * Always queues a response
+ * Always queues a response; only deletes the object if it is
+ * found within the response, otherwise return it verbatim (but
+ * will look for it into the next response). Will flush the
+ * operation once the wanted object has been found.
*
* @return MHD_YES / MHD_NO depending on successful / failing
* response queueing.
@@ -823,7 +826,6 @@ delete_object (struct MHD_Connection *con,
json_t *element;
json_t *cur;
json_error_t error;
- char *delete_path_dup;
char *token;
char *last_token;
char *mod_body;
@@ -838,15 +840,9 @@ delete_object (struct MHD_Connection *con,
hr->response);
}
- /* unstable if not dup'd. XXX: to be tested again without.
- * To be freed. */
- delete_path_dup = GNUNET_strdup (delete_path);
+ last_token = strrchr (delete_path, '.') + 1;
/* Give first nondelim char. */
- last_token = strrchr (delete_path_dup, '.') + 1;
- TALER_LOG_DEBUG ("Last token: address@hidden",
- last_token,
- last_token);
- token = strtok (delete_path_dup, ".");
+ token = strtok (delete_path, ".");
element = parsed_response;
do
{
@@ -1194,13 +1190,8 @@ create_response (void *cls,
hack_response_code = 0; /* reset for next request */
}
- /* Empty the object pointed by `delete_path` ONLY IF
- it is found within this response, otherwise it leaves
- the response untouched. */
if ('\0' != delete_path[0])
- {
return delete_object (con, hr);
- }
/* response might have been modified. */
return MHD_queue_response (con,
@@ -1209,7 +1200,7 @@ create_response (void *cls,
}
-/* ******************** MHD HTTP setup and event loop ******************** */
+/* ************ MHD HTTP setup and event loop *************** */
/**
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-twister] 06/34: helper function., (continued)
- [GNUnet-SVN] [taler-twister] 06/34: helper function., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 15/34: testing empty-object feature., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 03/34: get path parsing to compile., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 07/34: fix actual object emptying., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 13/34: conditional delete., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 30/34: body malformation test CMD., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 14/34: logging, gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 12/34: test command to empty objects., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 16/34: fix proxied response headers., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 17/34: moving object-killer into helper function., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 18/34: avoid duplicating tokenized string.,
gnunet <=
- [GNUnet-SVN] [taler-twister] 02/34: parse proxied response., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 27/34: fix last path token detection., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 28/34: new-line, gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 33/34: rely again on RNG., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 25/34: make mods cumulative, gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 20/34: option name., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 24/34: add testing-lib command to modify responses., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 31/34: implement upload data malformation., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 34/34: leading slash when constructing twister url., gnunet, 2018/03/16
- [GNUnet-SVN] [taler-twister] 19/34: renaming operation., gnunet, 2018/03/16