Commit Graph

69 Commits

Author SHA1 Message Date
fenner
91940416f2 Suggest using "-b" or "-t" if the connection is reset (typical symptom
of broken TCP stack).
1997-11-22 01:00:42 +00:00
jdp
5e61620bb6 Add missing arguments detected by "-Wformat". 1997-11-18 03:27:34 +00:00
obrien
88e48b4b98 style-police got me. :-)
Also fixed some "didn't make the most sense" problems.

Submitted by:	bde
1997-11-12 04:39:33 +00:00
obrien
00ef31d9b5 If "-l" is given, make sure the target of the link exist. 1997-11-08 22:15:55 +00:00
ache
79136b2cb8 Change diags to see what part of url actually parsed, see
previous change about #? parms
1997-11-01 05:47:41 +00:00
ache
387b4eb4a3 Don't search for ':' port in ?# params part
Require to correctly parse http://...cgi?http://...
1997-10-31 23:33:44 +00:00
fenner
fd51ab9ae1 Interpret multiple slashes as a single slash in ftp: URL's. This
is contrary to RFC1738, which specifies that empty elements between
slashes really mean to send a CWD command with an empty argument.
Most FTP servers consider this an error, so strict RFC compliance
is advisable in this case.
1997-10-08 18:43:53 +00:00
fenner
59cc2d4033 Use the RFC1738 interpretation of ftp: URL's, i.e. CWD to each
slash-seperated element of the URL and then RETR the last element.

PR:		bin/4670
Reviewed by:	wollman
1997-10-06 01:09:56 +00:00
cracauer
ce03b01dce fetch(3) doesn't get asctime(3) format, wrong length assumed
PR:		bin/4625
Submitted by:	"Timo J. Rinne" <tri@pooh.tky.hut.fi>
Obtained from:bin/4625
1997-09-28 11:25:59 +00:00
asami
89548edf3a Be consistent with other utilities in spelling "Kbytes". (Actually,
there even was one of them about ten lines above in the same file.)

Reminded by:	joerg's commit to usr.bin/ftp/ftp.c rev 1.9
1997-08-19 01:57:53 +00:00
ache
fbd1e32f91 Add -t option which turns T/TCP off as workaround for some broken servers
Submitted by: Marc Slemko <marcs@znep.com>
1997-08-05 20:18:39 +00:00
wollman
4f60b2e680 Work around a brokenness in the HTTP spec by generating the Host header
for ftp: URLs as well.  This can't possibly be done in the general case,
but since we only claim to support http and ftp, we'll adhere to the
bogus requirement (RFC 2068, s. 14.25) anyway...  >sigh<

Submitted by: =?iso-8859-1?Q?=C5ge_R=F8bekk?= <aagero@aage.priv.no>
1997-07-26 20:18:43 +00:00
wollman
183f1f7031 Fix the error message for when mirroring and restarting are rejected
due to the output not being a regular file.  Also split the error message
in any error case here to be on two lines to lessen the likelihood of it
being too long to fit on just one.
1997-07-26 20:00:05 +00:00
wollman
989de48b81 Implement HTTP 1.1's ``chunked'' Transfer-Encoding (ick). This hasn't
been extensively tested, but I now can successfully retrieve
<http://www.apache.org/index.html>, so I guess that's a victory of some
sort.

Also move the initialization of ``autherror'' to hopefully eliminate
the reported loop involving authentication.  Still need to implement
MD5 digest authentication.
1997-07-26 19:25:56 +00:00
wollman
021417e0de Provide a new `-b' flag to work around some broken HTTP/TCP implementations
that can't deal with a half-closed connection.
1997-07-25 19:35:44 +00:00
charnier
3f6defdfaa One newline should be enough. 1997-07-02 06:28:32 +00:00
charnier
cce3170ff8 Do not use argv[0] in usage(). 1997-07-01 06:37:34 +00:00
ache
4f8081d1a7 Now understand password in ftp:// URLs 1997-05-31 14:45:41 +00:00
jmg
000a4351d9 fix a bug in processing of FTP_TIMEOUT environment variable.
Closes PR#2947

Submitted-by: Peter Childs <pjchilds@imforei.apana.org.au>
1997-03-11 15:13:28 +00:00
jmg
66af2c92cc fix restarting http transfers and understanding response from server.
Slight modification of patch by wollman.

Closes PR#2870

Reviewed by:	wollman
Submitted by:	Marc Slemko <marcs@znep.com>
1997-03-06 20:01:32 +00:00
jmg
189d91654b fix a couple problems with fetch:
. don't try to interpet a colon in the pathname as a port number
	. don't report an errno message when one don't exist
1997-03-06 10:01:54 +00:00
fenner
d0ff874c89 Fix FTP_PROXY to use user@host[@port] for FTP proxy and eliminate
undocumented FTP_PROXY_USER
Make FTP file errors contian hostname and path.
Pass the FTP port to libftp.
Partially un-HTMLify error messages returned from server
Handle "HTTP NNN" instead of "HTTP/V.vv NNN" response sent by
	pre-HTTP/1.0 servers

Reviewed by:		wollman
1997-03-05 18:57:16 +00:00
wosch
374ff5ff08 These man page will appear in 2.2, not 3.0. 1997-02-22 23:43:32 +00:00
peter
f390c26dd9 Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
jmg
dfdb961559 Fix fetch so that all status information is sent to stderr, prevents
corruption of file being recieved to stdout.

Submitted-by: Kent Vander Velden <graphix@iastate.edu>

Closes PR#2739
1997-02-17 04:11:47 +00:00
jmg
5a03931ab5 Modified the display() function to recognize when the output it going to a
file.  When it is don't do the percentage update, but still display the file
size and rate.

Closes PR#2725

Reviewed by:	wollman
1997-02-14 19:08:18 +00:00
wollman
062bd92d8c Fix remote request for HTTP proxies. Should close PR#2670. 1997-02-11 20:46:06 +00:00
wollman
e189308068 Fix PR#2700: report correct transmission speed, and restart transfers
from the restart point, not the end of the file (blush!).

Submitted by:	John-Mark Gurney <jmg@nike.efn.org>
1997-02-10 18:49:42 +00:00
wollman
1b0b9bef8d Fix off-by-one error in proxy host:port parser.
Submitted by:	fenner
1997-02-07 17:55:01 +00:00
wollman
37ca85c089 Some bug-fixes, clean-ups, and one new feature:
- Fix the bug with URIs of the form ftp://host/filename.
- Fix some more string-termination bugs in util.c.
- Use safe_malloc() rather than testing the return value of
  regular malloc() in 15 places.
- Implement HTTP authentication, for both servers and proxies.
  Currently only ``basic'' authentication is supported; This Is A Bug
  (but less of one tjhan nmot supporting any authentication).

I think there is only one more feature which is required for full
HTTP/1.1 support, which is Transfer-Encoding: chunked; this should
not be toohard, but it isn't very important, either.
1997-02-05 19:59:18 +00:00
bde
ee7d1d310f Null-terminate the string in percent_decode() so that we don't depend on
malloc() returning zeroed storage or dump core while starting up.

Found-by:	/etc/malloc.conf ->AJ
1997-02-02 09:16:37 +00:00
wollman
827e39354a Some fixes for HTTP:
1) Implement redirects (or try to, at least).
2) Implement automatic retry after 503 errors when Retry-After is given.
3) Implement a -a flag to enable both of these behaviors.
4) Recognize Transfer-Encoding headers and emit a warning that the file
  is likely to be damaged.
5) Bug fix: only write the amount of data we read.
6) Actually document some of these.
7) Fix the usage message to display flags in semi-alphabetical order.
1997-01-31 19:55:51 +00:00
wollman
444cbb04ee Here is my long-threatened revamping of fetch. Jean-Marc probably won't
recognize it any more.  This makes the following significant changes:

- The main body of the program doesn't know a thing about URIs,
  HTTP, or FTP.  This makes it possible to easily plug in other
  protocols.  (The next revision will probably be able to dynamically
  add new recognizers.)

- There are no longer arbitrary timeouts for the protocols.  If you want
  to set one for yourself, use the environment variables.

- FTP proxies are now supported (if I implemented it right).

- The HTTP implementation is much more complete, and can now do restarts,
  preserve modtimes, and mrun in mirror mode.  It's not yet up to 1.1,
  but it's getting there.

- Transaction TCP is now used for sending HTTP requests.  The HTTP/1.1 syntax
  for requesting that the connection be closed after one request is
  implemented.

In all of this, I have doubtless broken somebody.  Please test it and tell me
about the bugs.
1997-01-30 21:43:44 +00:00
jkh
b917141478 Handle timeouts in a slightly less baroque way. 1997-01-17 12:52:12 +00:00
wosch
4bcfb053ec Sort cross references. 1997-01-15 23:25:55 +00:00
jkh
808a36ef65 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
ache
7a2c703c2b Report net connection error via hstrerror(h_errno) now instead of
simple fact that can't connect
1996-11-14 07:36:26 +00:00
ache
c9c621c36a Change to new ftpLogin interface
Now clearly say: Not logged in
instead of old: Broken pipe
(note it was original reason for all my libftpio changes)
1996-11-14 07:06:25 +00:00
peter
fb2d026372 Cosmetic bugfix. fetch was modifying it's argv[] strings in place, which
caused ps(1) to show strange things..
1996-11-10 14:46:50 +00:00
phk
7c5a2b76a6 bin/1933: don't print negative % for huge files (80Mb) 1996-10-31 14:24:35 +00:00
adam
f3ebc6792c old host:/filename syntax was broken
implement /filename syntax for completeness
1996-10-24 00:15:44 +00:00
jmz
6772418485 The -h flag implies ftp = 1. 1996-10-06 00:44:24 +00:00
wosch
89dea7c61d add missing comma(s) in .Xr macros 1996-09-23 22:24:39 +00:00
peter
43f6021163 Attempt to untangle the timeout code a bit, also make the default ftp
and http timeouts the same, since when using a http proxy to do ftp
transfers, the http timeout was being used for what is coming in via
ftp.
1996-09-19 18:07:24 +00:00
peter
ae3b6a683b Make fetch 64-bit safe, corresponding to libftpio changes.
Submitted by: Jason Thorpe <thorpej@nas.nasa.gov>, PR#1641
1996-09-19 17:31:34 +00:00
jkh
ccd8fb4fad Remove the code which has restart looking at the modtime. That's just
moronic!  We don't care about the time in restart mode, only the size.
It's *mirror* mode which cares about modtimes.
1996-09-10 19:49:41 +00:00
jkh
2ae01aec12 Allow proper ftp verbosity with a new -v flag. 1996-08-31 22:03:05 +00:00
jkh
7b0b861fef Don't make -l warn when it's not used, so we can potentially set it
all the time if we want to use "link" behavior for file URLs (and not
have fetch whine at us when they're not).
1996-08-23 06:21:17 +00:00
mpp
b4aab8b6f6 Use the .Fx macro where appropriate. 1996-08-23 00:57:08 +00:00
jkh
e9dba4b462 Print the correct thing when interrupted by a signal. 1996-08-22 23:25:24 +00:00