Commit Graph

155 Commits

Author SHA1 Message Date
markm
72f8b8d824 Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
ru
4f5036d451 Document fetch(1) reaction to SIGINFO.
PR:		docs/33640
Submitted by:	Maxim Konovalov <maxim@macomnet.ru>
Approved by:	des
2002-01-16 16:16:08 +00:00
des
3a2b55af92 Set fetchDebug if v_level is 3 or more.
PR:		bin/32615
MFC after:	1 week
2001-12-09 15:07:26 +00:00
iedowse
86518d657b Remove an extraneous argument to fprintf that -Wformat noticed.
Reviewed by:	des
2001-11-10 18:39:54 +00:00
des
f0e2818632 Remove a debugging warnx() that got committed by mistake. 2001-11-03 01:31:46 +00:00
des
d7a57efb17 Don't print running stats unless we're the foreground process.
PR:		30764
2001-09-23 22:03:39 +00:00
mike
3d38b78b79 Add a cast to silence a warning (error because of WARNS=2) on Alpha.
Discussed with:	des
2001-09-10 17:23:57 +00:00
des
2630abf91a If the local file does not exist, or is a regular file, and we're not trying
to resume a transfer, download the requested document into a temporary file
which we later rename.  This avoids leaving half-completed files around in
case of a crash (it'll still leave a half-completed file, but with a  hope-
fully non-conflicting name), and should reduce the need for human inter-
vention on ports-building machines.

The temporary file name for "foo/bar" is constructed by invoking mkstemps()
with the pattern "foo/.fetch.XXXXXX.bar"

Requested by:	obrien
2001-09-08 15:17:15 +00:00
des
4d9f4e2975 Remove a blank line that snuck in with the previous commit.
Set the default timeout to 120 seconds instead of 0 (no timeout).
2001-08-18 10:48:55 +00:00
des
306c98edee Add some comments. 2001-08-17 22:22:45 +00:00
se
419e681e95 Include value of command line argument that causes an error message or
warning in said message, since fetch may be run from a makefile or script
which does not print the command line.

Approved by:	des
2001-07-28 21:34:56 +00:00
des
85ee8808e1 If we're writing to stdout, we don't care about the size.
Submitted by:	wollman
2001-07-17 21:23:43 +00:00
des
87537951b0 WARNS cleanup + remove an unused macro and an unused function argument. 2001-07-17 21:22:32 +00:00
dd
7d1013753f Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
des
51ccda8fba Fix an embarassing if-test-reversal bug that broke scheme guessing. 2001-07-08 15:17:26 +00:00
des
04588de456 Don't try to print a completion percentage for zero-size files.
PR:		27780
Submitted by:	Craig Leres <leres@ee.lbl.gov>
2001-06-01 10:24:58 +00:00
des
1402399936 Damn. Fix typo in previous commit. 2001-05-27 10:46:19 +00:00
des
73faef10d6 When running on a tty, install an authentication callback. 2001-05-26 19:51:05 +00:00
des
99c8ac8fb9 Bring the usage message in synch with reality.
PR:		bin/26160
2001-03-28 21:01:07 +00:00
des
c101e91820 Now that libfetch uses the high port range by default, add a -U option to
make it use the low (default) port range instead.
2001-03-24 00:32:11 +00:00
des
8e7ac80ae9 If SIGINFO is received during the transfer, print a status line similar
to the summary shown at the end of the transfer.

Some days, I really hate Unix...

Suggested by:	cracauer
2001-03-07 05:33:50 +00:00
des
22209af026 Fix a formatting bug (MFC candidate) 2001-03-07 03:22:11 +00:00
ru
b1c3961564 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
des
b7afd3dc3e Warn if the size of the remote file isn't known.
If the -R option was specified, don't truncate the local file even if its
mtime is incorrect.

PR:		bin/23719
2000-12-22 18:23:19 +00:00
des
f175c57a2d If the URL did not specify a scheme, try to guess it from the host name. 2000-12-13 11:26:27 +00:00
des
a94571c76c If the transfer timed out, but we don't know how large the file is supposed
to be, assume it was truncated.
2000-11-30 10:08:22 +00:00
kris
f21fc5fe10 Format string auditing 2000-11-27 07:35:53 +00:00
ru
cff3f1a066 mdoc(7) police: do not split author names in the AUTHORS section. 2000-11-22 09:35:58 +00:00
ru
046cd06ea5 Spell the des's name correctly. 2000-11-14 13:19:26 +00:00
des
aa4611ef3c Understand the difference between an empty file and a non-existent file.
This has been sitting in my tree for ages...
2000-10-19 21:05:59 +00:00
des
bd95be8bfe Don't try to set the mtime of the output file if it's not a regular file.
Pointed out by:	cwt
2000-09-02 09:48:34 +00:00
des
0907123718 Don't unlink the target file if it's not a regular file. 2000-08-31 11:24:15 +00:00
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