summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-01-07 20:53:36 +0100
committerChristian Grothoff <christian@grothoff.org>2021-01-07 20:53:42 +0100
commit2508e5471b48a1343939d91f45731d5bd79b1c95 (patch)
tree4ec1469df0fc1271962df3c76bfb578b7446b13e
parent863077cbd4b5ccffdcc6b1e03b9814be137d2569 (diff)
downloadtwister-2508e5471b48a1343939d91f45731d5bd79b1c95.tar.gz
twister-2508e5471b48a1343939d91f45731d5bd79b1c95.tar.bz2
twister-2508e5471b48a1343939d91f45731d5bd79b1c95.zip
fix remaining #6679 issues in twister
-rw-r--r--src/twister/taler-twister.c189
1 files changed, 98 insertions, 91 deletions
diff --git a/src/twister/taler-twister.c b/src/twister/taler-twister.c
index 94a9aa8..1f03de8 100644
--- a/src/twister/taler-twister.c
+++ b/src/twister/taler-twister.c
@@ -166,14 +166,14 @@ run (void *cls,
if ( (0 != malform_upload) &&
(NULL != TALER_TWISTER_malform_upload
- (tth,
+ (tth,
&handle_acknowledgement,
NULL)))
num_ops++;
if ( (0 != malform_response) &&
(NULL != TALER_TWISTER_malform
- (tth,
+ (tth,
&handle_acknowledgement,
NULL)))
num_ops++;
@@ -186,7 +186,7 @@ run (void *cls,
if ( (0 != hack_response_code) &&
(NULL != TALER_TWISTER_change_response_code
- (tth,
+ (tth,
hack_response_code,
&handle_acknowledgement,
NULL)) )
@@ -194,7 +194,7 @@ run (void *cls,
if ( (NULL != flip_path_ul) &&
(NULL != TALER_TWISTER_flip_upload
- (tth,
+ (tth,
flip_path_ul,
&handle_acknowledgement,
NULL)) )
@@ -202,7 +202,7 @@ run (void *cls,
if ( (NULL != flip_path_dl) &&
(NULL != TALER_TWISTER_flip_download
- (tth,
+ (tth,
flip_path_dl,
&handle_acknowledgement,
NULL)) )
@@ -210,7 +210,7 @@ run (void *cls,
if ( (NULL != delete_path) &&
(NULL != TALER_TWISTER_delete_path
- (tth,
+ (tth,
delete_path,
&handle_acknowledgement,
NULL)) )
@@ -227,11 +227,11 @@ run (void *cls,
}
if (NULL != TALER_TWISTER_modify_path_ul
- (tth,
- modify_path_ul,
- modify_value,
- &handle_acknowledgement,
- NULL))
+ (tth,
+ modify_path_ul,
+ modify_value,
+ &handle_acknowledgement,
+ NULL))
num_ops++;
}
@@ -246,11 +246,11 @@ run (void *cls,
}
if (NULL != TALER_TWISTER_modify_path_dl
- (tth,
- modify_path_dl,
- modify_value,
- &handle_acknowledgement,
- NULL))
+ (tth,
+ modify_path_dl,
+ modify_value,
+ &handle_acknowledgement,
+ NULL))
num_ops++;
}
@@ -265,11 +265,11 @@ run (void *cls,
}
if (NULL != TALER_TWISTER_modify_header_dl
- (tth,
- modify_header_dl,
- modify_value,
- &handle_acknowledgement,
- NULL))
+ (tth,
+ modify_header_dl,
+ modify_value,
+ &handle_acknowledgement,
+ NULL))
num_ops++;
}
@@ -297,109 +297,116 @@ main (int argc,
GNUNET_GETOPT_option_string
('X',
- "modify-ul",
- "PATH",
- gettext_noop
- ("Modify upload object pointed by PATH,"
- " require --value.\n"),
- &modify_path_ul),
+ "modify-ul",
+ "PATH",
+ gettext_noop
+ ("Modify upload object pointed by PATH,"
+ " require --value.\n"),
+ &modify_path_ul),
GNUNET_GETOPT_option_string
('m',
- "modify-dl",
- "PATH",
- gettext_noop
- ("Modify download object pointed by PATH,"
- " require --value.\n"),
- &modify_path_dl),
+ "modify-dl",
+ "PATH",
+ gettext_noop
+ ("Modify download object pointed by PATH,"
+ " require --value.\n"),
+ &modify_path_dl),
GNUNET_GETOPT_option_string
('H',
- "modify-header-dl",
- "HEADER",
- gettext_noop
- ("Modify download HTTP header HEADER,"
- " require --value.\n"),
- &modify_header_dl),
+ "modify-header-dl",
+ "HEADER",
+ gettext_noop
+ ("Modify download HTTP header HEADER,"
+ " require --value.\n"),
+ &modify_header_dl),
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),
+ "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-dl",
- "PATH",
- gettext_noop
- ("Flip a char in the *string* download"
- " object pointed by PATH.\n"),
- &flip_path_dl),
+ "flip-dl",
+ "PATH",
+ gettext_noop
+ ("Flip a char in the *string* download"
+ " object pointed by PATH.\n"),
+ &flip_path_dl),
GNUNET_GETOPT_option_string
('V',
- "value",
- "VALUE",
- gettext_noop
- ("Make VALUE the new value of the field"
- " pointed by PATH. Note: in this version,"
- " numbers will be always parsed and _set_"
- " as strings."),
- &modify_value),
+ "value",
+ "VALUE",
+ gettext_noop
+ ("Make VALUE the new value of the field"
+ " pointed by PATH. Note: in this version,"
+ " numbers will be always parsed and _set_"
+ " as strings."),
+ &modify_value),
GNUNET_GETOPT_option_string
('d',
- "deleteobject",
- "PATH",
- gettext_noop
- ("Delete the object pointed by PATH.\n"),
- &delete_path),
+ "deleteobject",
+ "PATH",
+ gettext_noop
+ ("Delete the object pointed by PATH.\n"),
+ &delete_path),
GNUNET_GETOPT_option_flag
('a',
- "checkalive",
- gettext_noop
- ("Check if twister accepts IPC connections\n"),
- &check_alive),
+ "checkalive",
+ gettext_noop
+ ("Check if twister accepts IPC connections\n"),
+ &check_alive),
GNUNET_GETOPT_option_flag
('U',
- "malformupload",
- gettext_noop
- ("Randomly truncate proxied request"),
- &malform_upload),
+ "malformupload",
+ gettext_noop
+ ("Randomly truncate proxied request"),
+ &malform_upload),
GNUNET_GETOPT_option_flag
('M',
- "malform",
- gettext_noop
- ("Randomly truncate proxied response"),
- &malform_response),
+ "malform",
+ gettext_noop
+ ("Randomly truncate proxied response"),
+ &malform_response),
GNUNET_GETOPT_option_uint
('r',
- "responsecode",
- "STATUS",
- gettext_noop
- ("Set the next response code to STATUS"),
- &hack_response_code),
+ "responsecode",
+ "STATUS",
+ gettext_noop
+ ("Set the next response code to STATUS"),
+ &hack_response_code),
GNUNET_GETOPT_OPTION_END
};
+ enum GNUNET_GenericReturnValue ret;
- status = 1;
if (GNUNET_OK !=
- GNUNET_PROGRAM_run (
- argc,
- argv,
- "taler-twister",
- gettext_noop
- ("Control taler-twister service."),
- options,
- &run, NULL))
- return 2;
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 4;
+ status = 1;
+ ret = GNUNET_PROGRAM_run (
+ argc,
+ argv,
+ "taler-twister",
+ gettext_noop ("Control taler-twister service."),
+ options,
+ &run, NULL);
+ GNUNET_free_nz ((void *) argv);
+ if (GNUNET_SYSERR == ret)
+ return 3;
+ if (GNUNET_NO == ret)
+ return 0;
return status;
}