gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-twister] 02/11: Differentiate between bit-flipping i


From: gnunet
Subject: [GNUnet-SVN] [taler-twister] 02/11: Differentiate between bit-flipping in download and upload.
Date: Wed, 16 May 2018 10:41:57 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository twister.

commit 5b9947e19fd9f53f6dbdc0b2f519ce96468b0386
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue May 15 11:46:31 2018 +0200

    Differentiate between bit-flipping in download and upload.
---
 src/twister/taler-twister-service.c | 11 ++++++++++-
 src/twister/taler-twister.c         | 30 +++++++++++++++++++++++-------
 src/twister/twister.h               |  4 +++-
 src/twister/twister_api.c           |  2 +-
 4 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/src/twister/taler-twister-service.c 
b/src/twister/taler-twister-service.c
index ded29f0..c4c52fc 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -1237,6 +1237,15 @@ create_response (void *cls,
    * generate curl request to the proxied service.  */
   if (NULL == hr->curl)
   {
+    #if 0
+    if (GNUNET_YES == flip_upload)
+    {
+      /* */
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Going to modify the upload object\n"),
+    }
+    #endif
+
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Generating curl request\n");
     hr->curl = curl_easy_init ();
@@ -2044,7 +2053,7 @@ GNUNET_SERVICE_MAIN
                          NULL),
 
  GNUNET_MQ_hd_fixed_size (flip_path,
-                         TWISTER_MESSAGE_TYPE_FLIP_PATH,
+                         TWISTER_MESSAGE_TYPE_FLIP_PATH_DL,
                          struct TWISTER_FlipPath,
                          NULL),
 
diff --git a/src/twister/taler-twister.c b/src/twister/taler-twister.c
index 3ff4a04..d82d1d8 100644
--- a/src/twister/taler-twister.c
+++ b/src/twister/taler-twister.c
@@ -65,7 +65,9 @@ static int malform_upload;
 /**
  * Path to the string json object to flip.
  */
-static char *flip_path;
+static char *flip_path_dl;
+
+static char *flip_path_ul;
 
 /**
  * Path to the object to modify.
@@ -178,12 +180,18 @@ run (void *cls,
           NULL)) )
     num_ops++;
 
-  /* TODO: add other operations here */
+  if ( (NULL != flip_path_ul) &&
+       (NULL != TALER_TWISTER_flip_path
+         (tth,
+          flip_path_ul,
+          &handle_acknowledgement,
+          NULL)) )
+    num_ops++;
 
-  if ( (NULL != flip_path) &&
+  if ( (NULL != flip_path_dl) &&
        (NULL != TALER_TWISTER_flip_path
          (tth,
-          flip_path,
+          flip_path_dl,
           &handle_acknowledgement,
           NULL)) )
     num_ops++;
@@ -243,12 +251,20 @@ main (int argc,
        &modify_path),
 
     GNUNET_GETOPT_option_string
+      ('F',
+       "flip-ul",
+       "PATH",
+       gettext_noop
+         ("Flip a char in the _string_ upload object pointed by PATH.\n"),
+       &flip_path_ul),
+
+    GNUNET_GETOPT_option_string
       ('f',
-       "flip",
+       "flip-dl",
        "PATH",
        gettext_noop
-         ("Flip a char in the _string_ object pointed by PATH.\n"),
-       &flip_path),
+         ("Flip a char in the _string_ download object pointed by PATH.\n"),
+       &flip_path_dl),
 
     GNUNET_GETOPT_option_string
       ('V',
diff --git a/src/twister/twister.h b/src/twister/twister.h
index 3e943f7..59ae659 100644
--- a/src/twister/twister.h
+++ b/src/twister/twister.h
@@ -51,7 +51,9 @@
 
 #define TWISTER_MESSAGE_TYPE_MALFORM_UPLOAD 6
 
-#define TWISTER_MESSAGE_TYPE_FLIP_PATH 7
+#define TWISTER_MESSAGE_TYPE_FLIP_PATH_DL 7
+
+#define TWISTER_MESSAGE_TYPE_FLIP_PATH_UL 8
 
 GNUNET_NETWORK_STRUCT_BEGIN
 struct TWISTER_Malform
diff --git a/src/twister/twister_api.c b/src/twister/twister_api.c
index aa96e6f..16bd71c 100644
--- a/src/twister/twister_api.c
+++ b/src/twister/twister_api.c
@@ -306,7 +306,7 @@ TALER_TWISTER_flip_path
                                     op);
   /* Prepare *env*elope. */
   env = GNUNET_MQ_msg
-    (src, TWISTER_MESSAGE_TYPE_FLIP_PATH);
+    (src, TWISTER_MESSAGE_TYPE_FLIP_PATH_DL);
   /* Put data into the envelope. */
   strcpy (src->path, path);
   /* Send message. */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]