Commit Graph

78 Commits

Author SHA1 Message Date
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
fenner
868ea92b09 Describe absolute paths in FTP URL's. This patch has been sitting
around uncommitted for 2 months =(
1998-05-09 07:33:09 +00:00
charnier
1bf317d31f .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq. 1998-03-23 07:48:45 +00:00
jb
e64aa99822 gcc wants to see long long variables passed to %q printf formats, so
cast to that instead of quad_t.
1998-02-20 05:11:42 +00:00
jb
2d3aee6972 time() needs a pointer to a time_t, but tv_sec in a timeval is a
long (yuk). So give time() what it wants and let the compiler
promote the variable when it is assigned to tv_sec.
1998-02-20 05:08:53 +00:00
fenner
04902d08a9 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
ad44a62f51 Add missing arguments detected by "-Wformat". 1997-11-18 03:27:34 +00:00
obrien
ce431fd607 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
304cd52b4b If "-l" is given, make sure the target of the link exist. 1997-11-08 22:15:55 +00:00
ache
7a0821ea7a Change diags to see what part of url actually parsed, see
previous change about #? parms
1997-11-01 05:47:41 +00:00
ache
f249ff21ac Don't search for ':' port in ?# params part
Require to correctly parse http://...cgi?http://...
1997-10-31 23:33:44 +00:00
fenner
032d9c5b1c 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
436b2cf479 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
5a7651ffaa 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
581db96bb2 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
b9a27a90fd 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
13f06b7aa6 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
0d18d3b697 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
915fbc4961 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
de97e076f0 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
90063a69e4 One newline should be enough. 1997-07-02 06:28:32 +00:00
charnier
19b19c011e Do not use argv[0] in usage(). 1997-07-01 06:37:34 +00:00
ache
836a9a2c0c Now understand password in ftp:// URLs 1997-05-31 14:45:41 +00:00
jmg
57423bcf8b 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
5ef14f66ec 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
d6216751dd 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
1910eaf544 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
b2a6a2a9b9 These man page will appear in 2.2, not 3.0. 1997-02-22 23:43:32 +00:00
peter
aef78d145b Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
jmg
0ac90c32e5 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
b3056941e0 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
539309d191 Fix remote request for HTTP proxies. Should close PR#2670. 1997-02-11 20:46:06 +00:00
wollman
567ebbfbc5 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
4dab0898c3 Fix off-by-one error in proxy host:port parser.
Submitted by:	fenner
1997-02-07 17:55:01 +00:00
wollman
b5ba29e405 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
baba602eab 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
aa9c48db2f 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
db3e7bcc95 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
aef403ae97 Handle timeouts in a slightly less baroque way. 1997-01-17 12:52:12 +00:00
wosch
ab0d7e7c60 Sort cross references. 1997-01-15 23:25:55 +00:00
jkh
9c0cd3f9df 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
dee149421b 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
673e5cc681 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
48379168d3 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
ce6ad7180c bin/1933: don't print negative % for huge files (80Mb) 1996-10-31 14:24:35 +00:00
adam
b884fe3de7 old host:/filename syntax was broken
implement /filename syntax for completeness
1996-10-24 00:15:44 +00:00