Commit Graph

123 Commits

Author SHA1 Message Date
des
a5b3701c0f Restore the old semantics of deleting the output file when interrupted.
Some people liked this and some didn't, so POLA won.
2000-07-26 07:28:33 +00:00
des
940f460113 Don't print summary in quiet mode. 2000-07-21 14:21:29 +00:00
des
718bd18cbb Don't display a running count in quiet mode.
Don't add the offset to the size; it's libfetch's job to report the correct
size of the requested file.
2000-07-21 11:08:03 +00:00
des
d353957b7a Fix two bugs related to resumed transfers:
- if the dates didn't match, fetch would append the received file to the
    existing file instead of replacing it.

  - if the local file was complete and up-to-date, fetch would miscalculate
    the expected size and report a failure instead of a success, because it
    had no way of knowing that the server was actually resending the entire
    file since the requested offset was invalid.
2000-07-19 23:56:45 +00:00
des
4fe17b2e96 Braino: don't use passive mode unless the user requests it.
PR:		bin/20025
Submitted by:	HIYAMA Takeshi <th@cis.ibaraki.ac.jp>
2000-07-19 09:12:36 +00:00
ben
a3956e21a3 * Remove description of obsolete -t option.
* Insert newline before "and" in ".Fl c and".

Approved by:	des
2000-07-18 21:05:11 +00:00
des
0b5aec4337 The description of the semantics of -v and -q has long since been OBE. 2000-07-17 22:44:36 +00:00
des
91e128c004 While I'm at it, break a line that was too long, remove a pointless diagnostic
and adjust the verbosity level of another.
2000-07-17 22:44:00 +00:00
des
66762edfcb Document the fact that -r and -m are mutually exclusive. 2000-07-17 21:51:48 +00:00
des
3dbc6d12fb Rearrange / rewrite large portions of fetch() to take advantage of new
libfetch features (fetchRestartCalls, fetchXGet()).

Since it doesn't make much sense to have m_flag and r_flag set at the same
time, and it can actually cause trouble in some cases, die if they're both
set.

Set the SA_RESETHAND flag for SIGINT so that when we've caught one, we can
kill ourselves with a second SIGINT (thus notifying our parent of our tragic
fate) instead of just exiting.

These changes fix several problems that would show up when fetching ports,
as well as speeding up HTTP transfers quite a bit (at least for relatively
small files).

Most of these changes were prompted by an interaction problem with an HTTP
server called SWS-1.0, which exhibited two bugs, the first of which prevented
fetch from working around the second (the first was not sending content-type
in reply to HEAD requests, the second was sending garbage after the end of
the requested file).
2000-07-17 21:49:01 +00:00
des
122aef9d8d Better signal handling.
Submitted by:   green
2000-07-16 00:47:00 +00:00
des
44f8d4bd9c Fix a bug in the stats display that showed up when resuming aborted transfers.
Submitted by:	green
2000-07-13 08:37:39 +00:00
des
c70a66dcdc Rework the stats code for the nth time. Much cleaner now.
Always display the completion percentage if stderr is a tty.
Drop the char-by-char transfer mode, it was based on an incorrect assumption
regarding the semantics of fread().
Finally (I hope) straighten out the business of setting the mtime, as well as
when to remove the output file and when not to.
Thanks are owed to the many who have provided nearly instantaneous and
highly constructive feedback and suggestions about these matters.
2000-07-12 20:53:07 +00:00
des
09424ec57b Now that the HTTP code supports timeouts, we don't need to use alarm()
around the call to fetchStat().
Catch SIGINT, and rework the signal handling so it doesn't skimp on the
cleanup after a timeout or interrupt. Also, don't just bail out after a
timeout; there may be more files to fetch.
2000-07-12 11:02:01 +00:00
des
59fdbdfe4d Rework the stats code to avoid code duplication.
Fix a bug where the stats code would print the expected size instead of the
number of bytes received.
Fix the reading code so it'll support partial reads.
2000-07-12 08:29:52 +00:00
des
179880d3bc Don't segfault if given an invalid URL (doh!)
Submitted by:		green
2000-07-09 10:14:22 +00:00
des
7369c6c3f5 Clarify the meaning of -m and -n (thanks to bde). 2000-07-08 09:34:53 +00:00
des
e682da63ec Straighten out the behvaiour of -m and -n (thanks to bde).
Check that stderr, not stdout, is a tty (thanks to green).
2000-07-08 09:34:33 +00:00
des
beabfa3564 Add MIT copyright 2000-07-05 12:04:31 +00:00
des
2d39aecea7 Note that the -h, -c and -f options are deprecated, and remove note that
incorrectly stated that they were not implemented.
Document the -d option.
2000-06-29 10:35:24 +00:00
des
d6a65cf637 Implement the -c option 2000-06-29 10:32:56 +00:00
des
f1b2cda30f Don't forget to delete the output file if the request fails.
Don't delete the output file if -r was specified.
2000-06-29 08:39:29 +00:00
des
b74e090bd4 New libfetch-based fetch. 2000-06-28 16:55:15 +00:00
jake
5e208b0c18 Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
jake
1d685644e0 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
cracauer
f1c5a02a22 Print a warning and exit with != 0 when at least one downloaded file
is shorter than previously announced by the server.

Tested by asami.

Approved by:	jkh
2000-03-08 13:02:11 +00:00
sheldonh
d39e57413d Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 12:20:22 +00:00
green
efa6f012d8 Add the -F option. This is for forcing restarts with -r by inhibiting
transmission of the If-Range HTTP header field.
1999-10-23 15:22:53 +00:00
peter
e4b04a2b21 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
green
ff7514b25d "transfered" -> "transferred"
Reviewed by:	dict(1)
1999-07-02 08:57:06 +00:00
green
5f698407ee This fixes the problem of cancelling an FTP transfer resulting in
a bogus error ("parsing URI".) I also fixed an inconsistency in
another fs_status.
1999-06-21 02:38:16 +00:00
jmg
932e1f939d make md5 checksums actually work instead of simply calculating the length
of an empty buffer...  the output file wasn't readable...  also warn that
we can't checksum on stdout and print out the base64 encoded version of the
md5 checksum...

Site to actually return md5 digest: web.golux.com
Verified that fetch was broken: Ken Coar <Ken.Coar@Golux.Com>
1999-05-18 19:37:37 +00:00
wollman
e95e96917b Restore \n at end of usage message.
Complained-about-by: charnier
1999-03-08 19:16:14 +00:00
alex
fb40f3faa8 Improve error message wording when attempting to link to a non-existent
file on the local host.

PR:		10042
Submitted by:	Chris Costello <phoenix@calldei.com>
1999-03-02 04:14:33 +00:00
wollman
34c6333130 Deal with broken Web sites which return 302 responses rather than 404
and an error document when the requested resource does not exist.  Grrr.

Requested by:	asami
1999-02-23 18:51:13 +00:00
fenner
c1aab95fad Remove the FTP_PASSIVE_MODE "fix"; libftpio handles this. 1999-02-05 01:01:17 +00:00
fenner
3921a7302d Warn about collapsing multiple slashes into 1 in ftp URL's.
Look at the FTP_PASSIVE_MODE environment variable like the man page says.

PR:		bin/9464
Submitted by:	John A. Shue <John.Shue@symmetron.com>

Add references to RFC's 1790, 959, 850.

PR:		doc/6564
1999-02-03 20:43:29 +00:00
fenner
9f60d2da79 Don't try to parse a colon in a URL as a port
(e.g. http://www.host.name/foo:bar)

PR:		bin/5072
Submitted by:	Takeshi WATANABE <watanabe@komadori.planet.kobe-u.ac.jp>
1999-02-03 20:24:53 +00:00
wollman
d725a6a0c4 Fix logic error in RFC 850 kluge. 1999-01-15 17:10:31 +00:00
wollman
afe0e80cf6 For RFC 850 dates received in HTTP responses, implement the century pivot
described in RFC 2068.  Include a reference to same in the manual page.
1999-01-15 16:56:22 +00:00
cracauer
5fed15f43e Add -s option, just report size of file that would be fetched.
Reviewed by:	-current list
1998-12-08 13:00:49 +00:00
des
c67faadd9a main.c:
Fix usage string. Fix getopt() string. Fix ordering of compatibility options.
fetch.1:
 Fix synopsis. Fix ordering of T and t options. Fix minor grammar nit.
1998-11-08 23:18:48 +00:00
fenner
b6a59fd85e If we know the content-length, only read that number of bytes from
the server.  There exists a broken server which sends a few extra
garbage bytes in response to HTTP/1.1 requests.
1998-10-26 02:39:21 +00:00
jkh
e41795b7ad Add -S flag; this is benign since fetch's behavior is unchanged if you
don't use it.  That's why I'm bringing it in during our "code slush"
Submitted by:	Stefan Esser <se@mi.uni-koeln.de>
1998-09-20 00:01:26 +00:00
des
3eb6c90d30 DTRT for file: URLs when output file is "-".
PR:		bin/7203
1998-09-17 00:15:15 +00:00
se
35ffb43797 Fix proxy authorization code:
- failed to use authorization parameters passed in the environment, if
  /dev/tty could not be opened (i.e. if running from cron)
- mixed use of /dev/tty and stdin for prompt and reading of the result
1998-07-12 09:07:36 +00:00
wollman
287838384b Fix my last change: the .Fx macro doesn't do anything useful without an
argument, so use `.Tn FreeBSD' instead.
1998-05-09 21:39:49 +00:00
wollman
c1b219a460 Documentation fix: delete references to T/TCP as they are not relevant
to the case in question.  (Said case being quite clearly defined by
the basic TCP specification, RFC 792.)
1998-05-09 20:50:37 +00:00
des
cb0e60513d Arrggghhhh... forgot to strip the / after outputting %2f 1998-05-09 08:56:07 +00:00
des
4da77110b7 Map a leading / in -c argument to %2f instead of dropping it silently.
PR:		bin/6558
1998-05-09 08:41:23 +00:00