summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch/fetch.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2001-03-24 00:32:11 +0000
committerdes <des@FreeBSD.org>2001-03-24 00:32:11 +0000
commitdeabc3a3798d11fd3d8f93b0effcb681e11660b4 (patch)
treed38c246b337be92b698c8e8a50d0e2cb60b20ed1 /usr.bin/fetch/fetch.c
parentbfaef3b3b9e81cd8473ce5a40cbd703c74aa6b87 (diff)
downloadFreeBSD-src-deabc3a3798d11fd3d8f93b0effcb681e11660b4.zip
FreeBSD-src-deabc3a3798d11fd3d8f93b0effcb681e11660b4.tar.gz
Now that libfetch uses the high port range by default, add a -U option to
make it use the low (default) port range instead.
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-rw-r--r--usr.bin/fetch/fetch.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index 3325346..1251315 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -55,7 +55,6 @@ char *c_dirname; /* -c: remote directory */
int d_flag; /* -d: direct connection */
int F_flag; /* -F: restart without checking mtime */
char *f_filename; /* -f: file to fetch */
-int H_flag; /* -H: use high port */
char *h_hostname; /* -h: host to fetch from */
int l_flag; /* -l: link rather than copy file: URLs */
int m_flag; /* -[Mm]: mirror mode */
@@ -68,10 +67,11 @@ int once_flag; /* -1: stop at first successful file */
int p_flag; /* -[Pp]: use passive FTP */
int R_flag; /* -R: don't delete partially transferred files */
int r_flag; /* -r: restart previously interrupted transfer */
-u_int T_secs = 0; /* -T: transfer timeout in seconds */
-int s_flag; /* -s: show size, don't fetch */
off_t S_size; /* -S: require size to match */
+int s_flag; /* -s: show size, don't fetch */
+u_int T_secs = 0; /* -T: transfer timeout in seconds */
int t_flag; /*! -t: workaround TCP bug */
+int U_flag; /* -U: do not use high ports */
int v_level = 1; /* -v: verbosity level */
int v_tty; /* stdout is a tty */
u_int w_secs; /* -w: retry delay */
@@ -234,8 +234,8 @@ fetch(char *URL, char *path)
strcat(flags, "p");
if (d_flag)
strcat(flags, "d");
- if (H_flag)
- strcat(flags, "h");
+ if (U_flag)
+ strcat(flags, "l");
timeout = T_secs ? T_secs : ftp_timeout;
}
@@ -537,7 +537,7 @@ main(int argc, char *argv[])
int c, e, r;
while ((c = getopt(argc, argv,
- "146AaB:bc:dFf:h:lHMmnPpo:qRrS:sT:tvw:")) != EOF)
+ "146AaB:bc:dFf:Hh:lMmnPpo:qRrS:sT:tUvw:")) != EOF)
switch (c) {
case '1':
once_flag = 1;
@@ -575,7 +575,7 @@ main(int argc, char *argv[])
f_filename = optarg;
break;
case 'H':
- H_flag = 1;
+ warnx("The -H option is now implicit, use -U to disable\n");
break;
case 'h':
h_hostname = optarg;
@@ -626,6 +626,9 @@ main(int argc, char *argv[])
t_flag = 1;
warnx("warning: the -t option is deprecated");
break;
+ case 'U':
+ U_flag = 1;
+ break;
case 'v':
v_level++;
break;
OpenPOWER on IntegriCloud