twister

HTTP fault injector for testing
Log | Files | Refs | README | LICENSE

commit 01d0d3f64cb0cdc33773d5f6f824914e62b887e8
parent e87c597a85f0bfbe031c83f1cb47279380ffa6be
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Thu, 17 May 2018 10:15:48 +0200

actual upload-object-modifying logic.

Diffstat:
Msrc/twister/taler-twister-service.c | 28+++++++++++++++++++++++++++-
Msrc/twister/taler-twister.c | 2++
2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c @@ -1256,7 +1256,7 @@ create_response (void *cls, if ('\0' != flip_path_ul[0]) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Going to modify the upload object (%s)\n", + "Going to flip the upload object (%s)\n", hr->io_buf); hr->json = json_loads (hr->io_buf, @@ -1278,6 +1278,32 @@ create_response (void *cls, json_decref (hr->json); } + if ('\0' != modify_path_ul[0]) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Going to modify the upload object (%s)\n", + hr->io_buf); + + hr->json = json_loads (hr->io_buf, + JSON_REJECT_DUPLICATES, + NULL); + modify_object (con, + hr->json, + modify_path_ul); + + json_dumpb (hr->json, + hr->io_buf, +/* Existing io_len is enough to accomodate this encoding. */ + hr->io_len, + JSON_COMPACT); + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Modified (?) upload object (%s)\n", + hr->io_buf); + json_decref (hr->json); + } + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Generating curl request\n"); hr->curl = curl_easy_init (); diff --git a/src/twister/taler-twister.c b/src/twister/taler-twister.c @@ -213,6 +213,7 @@ run (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "New value not given, give -V|--value also\n"); + GNUNET_SCHEDULER_shutdown (); return; } @@ -231,6 +232,7 @@ run (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "New value not given, give -V|--value also\n"); + GNUNET_SCHEDULER_shutdown (); return; }