summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2015-08-24 00:15:01 -0400
committerJay Satiro <raysatiro@yahoo.com>2016-02-23 03:01:07 -0500
commit186546f1c5ffa62526bd57deb5b9fd6e68da2a5e (patch)
tree064b4a45b134258416407201b82e53bd621c1f55 /src
parent9dc3eaee2901875d87690de62b427fa7cf96fead (diff)
downloadcurl-186546f1c5ffa62526bd57deb5b9fd6e68da2a5e.tar.gz
TFTP: add option to suppress TFTP option requests (Part 2)
- Add tests. - Add an example to CURLOPT_TFTP_NO_OPTIONS.3. - Add --tftp-no-options to expose CURLOPT_TFTP_NO_OPTIONS. Bug: https://github.com/curl/curl/issues/481
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.h1
-rw-r--r--src/tool_getparam.c4
-rw-r--r--src/tool_help.c3
-rw-r--r--src/tool_operate.c4
4 files changed, 11 insertions, 1 deletions
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index 3632560af..fb6c7aec4 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -183,6 +183,7 @@ struct OperationConfig {
char *ftp_alternative_to_user; /* send command if USER/PASS fails */
int ftp_filemethod;
long tftp_blksize; /* TFTP BLKSIZE option */
+ bool tftp_no_options; /* do not send TFTP options requests */
bool ignorecl; /* --ignore-content-length */
bool disable_sessionid;
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 164881a57..61f50464b 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -180,6 +180,7 @@ static const struct LongShort aliases[]= {
{"$P", "service-name", TRUE},
{"$Q", "proto-default", TRUE},
{"$R", "expect100-timeout", TRUE},
+ {"$S", "tftp-no-options", FALSE},
{"0", "http1.0", FALSE},
{"01", "http1.1", FALSE},
{"02", "http2", FALSE},
@@ -1005,6 +1006,9 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
if(err)
return err;
break;
+ case 'S': /* --tftp-no-options */
+ config->tftp_no_options = toggle;
+ break;
}
break;
case '#': /* --progress-bar */
diff --git a/src/tool_help.c b/src/tool_help.c
index 1af1ad100..a1a6fb493 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -221,7 +221,8 @@ static const char *const helptext[] = {
" --tcp-nodelay Use the TCP_NODELAY option",
" -t, --telnet-option OPT=VAL Set telnet option",
" --tftp-blksize VALUE Set TFTP BLKSIZE option (must be >512)",
- " -z, --time-cond TIME Transfer based on a time condition",
+ " --tftp-no-options Do not send TFTP options requests",
+ " -z, --time-cond TIME Transfer based on a time condition",
" -1, --tlsv1 Use >= TLSv1 (SSL)",
" --tlsv1.0 Use TLSv1.0 (SSL)",
" --tlsv1.1 Use TLSv1.1 (SSL)",
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 69d60769d..29e0df8c2 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1354,6 +1354,10 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt_str(curl, CURLOPT_EXPECT_100_TIMEOUT_MS,
(long)(config->expect100timeout*1000));
+ /* new in 7.48.0 */
+ if(config->tftp_no_options)
+ my_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
+
/* initialize retry vars for loop below */
retry_sleep_default = (config->retry_delay) ?
config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */