Commit Graph

228 Commits

Author SHA1 Message Date
des
52e26e275d The FTP_TIMEOUT and HTTP_TIMEOUT environment variables were ignored because
T_secs already had a non-zero default.  Unbreak by moving the default to
ftp_timeout / http_timeout.

Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
MFC after:	2 weeks
2009-01-17 13:34:56 +00:00
murray
a12379d1b7 1. Update fetch to consistently return 1 on error, as the man page states,
rather than usually returning 1 but in a few instances using a sysexits(3)
   return value.

2. Remove a few unused variables from libfetch.

PR:		docs/122470  (1, only)
Reviewed by:	des
> Description of fields to fill in above:                     76 columns --|
> PR:            If a GNATS PR is affected by the change.
> Submitted by:  If someone else sent in the change.
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

M    usr.bin/fetch/fetch.c
M    lib/libfetch/fetch.c
2008-12-17 18:00:18 +00:00
murray
72a890ccd7 Add support for HTTP 1.1 If-Modified-Since behavior.
fetch(1) accepts a new argument -i <file> that if specified will cause
the file to be downloaded only if it is more recent than the mtime of
<file>.

libfetch(3) accepts the mtime in the url structure and a flag to
indicate when this behavior is desired.

PR:		bin/87841
Submitted by:	Jukka A. Ukkonen <jau@iki.fi> (partially)
Reviewed by:	des, ru
MFC after:	3 weeks
2008-12-15 08:27:44 +00:00
ru
29bd0877a3 Improve usage and sync SYNOPSIS with usage. 2008-12-13 17:48:06 +00:00
des
a5ecf5f20c Apply the same defaults to https as to http.
Submitted by:	Mike Tancsa <mike@sentex.net>
MFC after:	1 week
2008-12-11 06:54:36 +00:00
obrien
4dd155254a Use the SCHEME_ knobs rather than knowing what they expand to.
Reviewed by:	des
2008-08-21 14:12:34 +00:00
des
5679753564 List all environment variables supported by libfetch, along with a reference
to the fetch(3) man page.

MFC after:	1 week
2007-12-28 19:47:37 +00:00
des
7ae37b64c4 Try to preserve ownership and permissions when replacing an existing file.
PR:		bin/104702
Submitted by:	Kevin Day <toasty@dragondata.com>
MFC after:	1 week
2006-11-10 22:05:41 +00:00
jkoshy
2f864fe90e Fix a typo.
Submitted by:	Pawel Worach <pawel.worach at gmail dot com>
MFC after:	1 week
2006-04-22 03:04:24 +00:00
ru
388e590f95 Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
des
60d5ca9446 Only clear sb.st_size if it is clearly wrong or meaningless. This fixes
mirror mode.

PR:		bin/86940
MFC after:	2 weeks
2005-12-30 23:36:26 +00:00
des
b2e56535e3 Reflect progress in process title.
Submitted by:	flz
MFC after:	2 weeks
2005-12-30 18:17:11 +00:00
ru
1541af42f1 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ru
7f3c7f0d46 Sort sections. 2005-01-18 13:43:56 +00:00
ru
6cc4b6c220 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
ru
f4c44b761b NOCRYPT -> NO_CRYPT 2004-12-21 10:16:04 +00:00
cperciva
b2b632794a Fix buffer overflow. This is FreeBSD-SA-04:16.fetch.
Approved by:	des
2004-11-18 12:01:30 +00:00
des
d59f3ddc7e Update copyright years. 2004-09-21 18:35:21 +00:00
des
d64962e198 The check for r_flag was accidentally removed in the previous commit.
Submitted by:	SANETO Takanori <sanewo@ba2.so-net.ne.jp>
MFC after:	3 days
2004-08-26 15:51:10 +00:00
des
0fd9856a46 Fix a couple of edge cases in which sb.st_size may be incorrect or
meaningless.  In particular, don't assume that it is left untouched if
stat(2) fails; that assumption happens to fail at high optimization
levels on some platforms.

MFC after:	1 week
2004-08-15 22:22:35 +00:00
cperciva
e629b37603 Join the 21st century: Cryptography is no longer an optional component
of releases.  The -DNOCRYPT build option still exists for anyone who
really wants to build non-cryptographic binaries, but the "crypto"
release distribution is now part of "base", and anyone installing from a
release will get cryptographic binaries.

Approved by:	re (scottl), markm
Discussed on:	freebsd-current, in late April 2004
2004-08-06 07:27:08 +00:00
cperciva
a440052210 Document the behaviour of the "-o file" option when "file" is a directory
(downloaded file(s) are created inside the directory).

MFC after:	3 days
2004-07-30 08:43:16 +00:00
des
12cbe81d02 Don't strip trailing linear whitespace from passwords.
MFC after:	2 weeks
2004-07-27 11:34:25 +00:00
des
f67167048a Style nits. 2004-07-27 11:30:35 +00:00
des
415c7523ba Truncate long file names in stat_display(), as was originally intended.
MFC after:	1 week
2004-07-05 11:21:50 +00:00
des
603c0cfb20 The description of the -S option in the man page says we won't fail if the
remote size is unknown, but we do.  Resolve this in the man page's favor.

Requested by:   Andre Albsmeier <andre.albsmeier@siemens.com>
MFC after:	1 week
2004-06-24 13:43:57 +00:00
le
db8317e983 Fix integer overflow in the file size output when dealing with
large files (i.e. DVD images).

Reviewed by:  des@
2004-05-19 11:07:30 +00:00
ru
8650a6ced7 Restore part of the word that got (accidentally) removed.
Removed whitespace at EOL.
2004-05-19 09:46:37 +00:00
des
1a789b31d8 Workaround for servers that ignore byte ranges when using chunked
encoding.

MFC after:	3 days
2004-04-06 12:24:26 +00:00
des
cc042ab91e Remove EXAMPLES section which duplicates text in fetch(3). 2004-02-27 10:27:01 +00:00
des
bba9cb7afc Use %zu for size_t, like God intended. 2004-02-18 21:51:02 +00:00
des
dbcd81038b Fix printf() format bug in previous commit (size_t != int).
Use %ju and an (uintmax_t) cast to print size_t values.
Use %jd and an (intmax_t) cast to print off_t values.
Use off_t variables to hold the difference between two off_t values.
Don't bother with unsigned char where char will do nicely.
2004-02-18 21:37:36 +00:00
des
f27860b0cf Revamp the statistics code, and switch to a much more compact display
format.  The old code tried to produce the exact same output as the
pre-libfetch implementation, but I no longer see any value in this.
2004-02-18 15:12:00 +00:00
wes
db65d6a17c Remove the inadvertant HTML additions to this man page.
These appear to have been inserted in the PR text by gnatsweb.

Noticed by:		des (maintainer)
2004-01-28 18:51:24 +00:00
wes
ff2070cfd4 Revert changes of rev 1.55; replace with strong encouragement to
read fetch(3) as well.

Requested by:	des (maintainer)
2004-01-26 07:55:30 +00:00
des
02665f350f Previous commit did the reverse of what the log message said (and of
what I intended to do).  Really remove my middle name.
2004-01-26 07:09:12 +00:00
des
42f562f3a8 I don't normally use my middle name, so remove it from attributions in
man pages (though not from copyright notices).  While I'm here, add email
addresses where appropriate.
2004-01-25 11:39:42 +00:00
wes
cb7f6e4238 Document fetch(1) environment variables in fetch(1) man page, instead of
taking lazy users on the arduous journey through SEE ALSO to fetch(3).

PR:		docs/61759
Submitted by:	Christian S.J. Peron <maneo@bsdpro.com>
2004-01-23 04:50:48 +00:00
ru
ecf79cde9e Finish the reversion of rev. 1.52. 2003-09-08 18:58:47 +00:00
ru
35d5e319f1 Make sure the crypto versions of libfetch and fetch(1) appear in
the "crypto" distribution.

Approved by:	des
2003-07-22 13:54:31 +00:00
trhodes
d46752fb9c Revert 1.52. This should have been added to fetch.3.
Discussed with:	des, ru
2003-06-10 20:34:50 +00:00
des
e5d2d778eb Retire the useless NOSECURE knob.
Approved by:	re (scottl)
2003-05-19 15:52:01 +00:00
trhodes
80d62fd7dc Add an EXAMPLES section.
Xref sh(1) as we use environment variables.

PR:		43899
Reviewed by:	des
2003-05-17 15:46:46 +00:00
des
da6d6f33ac Mark fetch(1) as c99- and WARNS6-clean. 2003-05-01 14:40:55 +00:00
des
2bcbb73b91 Use floating point arithmetic to compute the ETA to avoid integer overflow
during slow transfers of large files.
2003-03-11 21:33:43 +00:00
des
7f82e9791f Clean up the ETA logic a bit and make sure it works for restarted transfers. 2003-03-11 08:21:51 +00:00
des
e75fbc13e3 Clarify that -r implies -R. 2003-03-11 08:21:16 +00:00
ru
0dea541567 mdoc(7) police: Scheduled sweep. 2003-02-24 22:53:26 +00:00
des
d0a96d2181 Slight cleanup of the ETA / BPS code. Avoid a division by zero. 2003-01-23 13:06:13 +00:00
des
0c1d7b9b17 Document netrc support. 2003-01-22 18:35:20 +00:00