summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-11-27 23:46:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-11-27 23:46:29 +0000
commit6e38cc9048a2ab2a28dca6cb357b091a3ee4317c (patch)
tree5dc2a4956d315213016a90a4781882f1472b0472 /src
parenta240f4d1df0775723eadb942a15f3100b44bb2db (diff)
downloadcurl-6e38cc9048a2ab2a28dca6cb357b091a3ee4317c.tar.gz
- Markus Koetter provided a polished and updated version of Chad Monroe's TFTP
rework patch that now integrates TFTP properly into libcurl so that it can be used non-blocking with the multi interface and more. BLKSIZE also works. The --tftp-blksize option was added to allow setting the TFTP BLKSIZE from the command line.
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index b9ac7adb4..b5c1d89b7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -602,7 +602,7 @@ struct Configurable {
char *ftp_account; /* for ACCT */
char *ftp_alternative_to_user; /* send command if USER/PASS fails */
int ftp_filemethod;
-
+ long tftp_blksize; /* TFTP BLKSIZE option */
bool ignorecl; /* --ignore-content-length */
bool disable_sessionid;
@@ -877,6 +877,7 @@ static void help(void)
" --stderr <file> Where to redirect stderr. - means stdout",
" --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",
" -1/--tlsv1 Use TLSv1 (SSL)",
" --trace <file> Write a debug trace to the given file",
@@ -1732,12 +1733,13 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
{"$3", "keepalive-time", TRUE},
{"$4", "post302", FALSE},
{"$5", "noproxy", TRUE},
+
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
{"$6", "socks5-gssapi-service", TRUE},
{"$7", "socks5-gssapi-nec", FALSE},
#endif
{"$8", "proxy1.0", TRUE},
-
+ {"$9", "tftp-blksize", TRUE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
{"2", "sslv2", FALSE},
@@ -2264,6 +2266,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
GetStr(&config->proxy, nextarg);
config->proxyver = CURLPROXY_HTTP_1_0;
break;
+ case '9': /* --tftp-blksize */
+ str2num(&config->tftp_blksize, nextarg);
+ break;
}
break;
case '#': /* --progress-bar */
@@ -5000,6 +5005,9 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
my_setopt(curl, CURLOPT_POSTREDIR, config->post301 |
(config->post302 ? CURL_REDIR_POST_302 : FALSE));
+ if(config->tftp_blksize)
+ my_setopt(curl, CURLOPT_TFTP_BLKSIZE, config->tftp_blksize);
+
retry_numretries = config->req_retry;
retrystart = cutil_tvnow();