diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-05-15 11:51:42 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-05-15 11:51:42 +0200 |
commit | 381051f98408cac24968e0d12f95effb5c30a26b (patch) | |
tree | ccb618bf4ac9b3422acc2885dc1b279cb05114c1 | |
parent | 5b9947e19fd9f53f6dbdc0b2f519ce96468b0386 (diff) | |
download | twister-381051f98408cac24968e0d12f95effb5c30a26b.tar.gz twister-381051f98408cac24968e0d12f95effb5c30a26b.tar.bz2 twister-381051f98408cac24968e0d12f95effb5c30a26b.zip |
Bring difference into the service component.
-rw-r--r-- | src/twister/taler-twister-service.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c index c4c52fc..eb6db0c 100644 --- a/src/twister/taler-twister-service.c +++ b/src/twister/taler-twister-service.c @@ -256,7 +256,9 @@ static char delete_path[TWISTER_PATH_LENGTH] = {'\0'}; * Will point to a JSON string object which will get a * character flipped. */ -static char flip_path[TWISTER_PATH_LENGTH] = {'\0'}; +static char flip_path_dl[TWISTER_PATH_LENGTH] = {'\0'}; + +static char flip_path_ul[TWISTER_PATH_LENGTH] = {'\0'}; /** * Will point to a JSON object to modify @@ -1028,7 +1030,8 @@ modify_object (struct MHD_Connection *con, static void flip_object (struct MHD_Connection *con, - struct HttpRequest *hr) + struct HttpRequest *hr, + char *flip_path) { char *target; json_t *parent; @@ -1434,11 +1437,11 @@ create_response (void *cls, hack_response_code = 0; /* reset for next request */ } - if ('\0' != flip_path[0]) + if ('\0' != flip_path_dl[0]) { TALER_LOG_DEBUG ("Will flip path: %s\n", - flip_path); - flip_object (con, hr); + flip_path_dl); + flip_object (con, hr, flip_path_dl); } if ('\0' != delete_path[0]) @@ -1975,12 +1978,22 @@ handle_modify_path (void *cls, * @param src received message */ static void -handle_flip_path (void *cls, - const struct TWISTER_FlipPath *src) +handle_flip_path_dl (void *cls, + const struct TWISTER_FlipPath *src) { struct GNUNET_SERVICE_Client *c = cls; - strcpy (flip_path, src->path); + strcpy (flip_path_dl, src->path); + send_acknowledgement (c); +} + +static void +handle_flip_path_ul (void *cls, + const struct TWISTER_FlipPath *src) +{ + struct GNUNET_SERVICE_Client *c = cls; + + strcpy (flip_path_ul, src->path); send_acknowledgement (c); } @@ -2052,12 +2065,15 @@ GNUNET_SERVICE_MAIN struct TWISTER_DeletePath, NULL), - GNUNET_MQ_hd_fixed_size (flip_path, - TWISTER_MESSAGE_TYPE_FLIP_PATH_DL, + GNUNET_MQ_hd_fixed_size (flip_path_ul, + TWISTER_MESSAGE_TYPE_FLIP_PATH_UL, struct TWISTER_FlipPath, NULL), - + GNUNET_MQ_hd_fixed_size (flip_path_dl, + TWISTER_MESSAGE_TYPE_FLIP_PATH_DL, + struct TWISTER_FlipPath, + NULL), GNUNET_MQ_handler_end ()); |