aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/fetch/http.c
Commit message (Collapse)AuthorAgeFilesLines
* New libfetch-based fetch.Dag-Erling Smørgrav2000-06-281-1846/+0
| | | | Notes: svn path=/head/; revision=62216
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-2/+2
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-2/+2
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Print a warning and exit with != 0 when at least one downloaded fileMartin Cracauer2000-03-081-1/+6
| | | | | | | | | | | is shorter than previously announced by the server. Tested by asami. Approved by: jkh Notes: svn path=/head/; revision=57824
* Add the -F option. This is for forcing restarts with -r by inhibitingBrian Feldman1999-10-231-3/+5
| | | | | | | transmission of the If-Range HTTP header field. Notes: svn path=/head/; revision=52444
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* This fixes the problem of cancelling an FTP transfer resulting inBrian Feldman1999-06-211-2/+2
| | | | | | | | a bogus error ("parsing URI".) I also fixed an inconsistency in another fs_status. Notes: svn path=/head/; revision=48060
* make md5 checksums actually work instead of simply calculating the lengthJohn-Mark Gurney1999-05-181-3/+7
| | | | | | | | | | | | 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> Notes: svn path=/head/; revision=47303
* Deal with broken Web sites which return 302 responses rather than 404Garrett Wollman1999-02-231-6/+17
| | | | | | | | | and an error document when the requested resource does not exist. Grrr. Requested by: asami Notes: svn path=/head/; revision=44240
* Don't try to parse a colon in a URL as a portBill Fenner1999-02-031-2/+2
| | | | | | | | | | (e.g. http://www.host.name/foo:bar) PR: bin/5072 Submitted by: Takeshi WATANABE <watanabe@komadori.planet.kobe-u.ac.jp> Notes: svn path=/head/; revision=43568
* Fix logic error in RFC 850 kluge.Garrett Wollman1999-01-151-3/+4
| | | | Notes: svn path=/head/; revision=42703
* For RFC 850 dates received in HTTP responses, implement the century pivotGarrett Wollman1999-01-151-1/+17
| | | | | | | described in RFC 2068. Include a reference to same in the manual page. Notes: svn path=/head/; revision=42702
* Add -s option, just report size of file that would be fetched.Martin Cracauer1998-12-081-2/+38
| | | | | | | Reviewed by: -current list Notes: svn path=/head/; revision=41600
* If we know the content-length, only read that number of bytes fromBill Fenner1998-10-261-2/+13
| | | | | | | | the server. There exists a broken server which sends a few extra garbage bytes in response to HTTP/1.1 requests. Notes: svn path=/head/; revision=40656
* Add -S flag; this is benign since fetch's behavior is unchanged if youJordan K. Hubbard1998-09-201-2/+15
| | | | | | | | 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> Notes: svn path=/head/; revision=39497
* Fix proxy authorization code:Stefan Eßer1998-07-121-8/+8
| | | | | | | | | - 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 Notes: svn path=/head/; revision=37579
* Documentation fix: delete references to T/TCP as they are not relevantGarrett Wollman1998-05-091-6/+9
| | | | | | | | to the case in question. (Said case being quite clearly defined by the basic TCP specification, RFC 792.) Notes: svn path=/head/; revision=35900
* gcc wants to see long long variables passed to %q printf formats, soJohn Birrell1998-02-201-3/+3
| | | | | | | cast to that instead of quad_t. Notes: svn path=/head/; revision=33654
* Suggest using "-b" or "-t" if the connection is reset (typical symptomBill Fenner1997-11-221-1/+5
| | | | | | | of broken TCP stack). Notes: svn path=/head/; revision=31341
* Add missing arguments detected by "-Wformat".John Polstra1997-11-181-3/+4
| | | | Notes: svn path=/head/; revision=31210
* Change diags to see what part of url actually parsed, seeAndrey A. Chernov1997-11-011-4/+4
| | | | | | | previous change about #? parms Notes: svn path=/head/; revision=30879
* Don't search for ':' port in ?# params partAndrey A. Chernov1997-10-311-8/+20
| | | | | | | Require to correctly parse http://...cgi?http://... Notes: svn path=/head/; revision=30876
* fetch(3) doesn't get asctime(3) format, wrong length assumedMartin Cracauer1997-09-281-2/+2
| | | | | | | | | PR: bin/4625 Submitted by: "Timo J. Rinne" <tri@pooh.tky.hut.fi> Obtained from:bin/4625 Notes: svn path=/head/; revision=29934
* Add -t option which turns T/TCP off as workaround for some broken serversAndrey A. Chernov1997-08-051-1/+15
| | | | | | | Submitted by: Marc Slemko <marcs@znep.com> Notes: svn path=/head/; revision=27921
* Work around a brokenness in the HTTP spec by generating the Host headerGarrett Wollman1997-07-261-2/+2
| | | | | | | | | | | 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> Notes: svn path=/head/; revision=27712
* Fix the error message for when mirroring and restarting are rejectedGarrett Wollman1997-07-261-11/+15
| | | | | | | | | 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. Notes: svn path=/head/; revision=27709
* Implement HTTP 1.1's ``chunked'' Transfer-Encoding (ick). This hasn'tGarrett Wollman1997-07-261-22/+126
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=27708
* Provide a new `-b' flag to work around some broken HTTP/TCP implementationsGarrett Wollman1997-07-251-3/+3
| | | | | | | that can't deal with a half-closed connection. Notes: svn path=/head/; revision=27679
* fix restarting http transfers and understanding response from server.John-Mark Gurney1997-03-061-4/+4
| | | | | | | | | | | | Slight modification of patch by wollman. Closes PR#2870 Reviewed by: wollman Submitted by: Marc Slemko <marcs@znep.com> Notes: svn path=/head/; revision=23453
* Fix FTP_PROXY to use user@host[@port] for FTP proxy and eliminateBill Fenner1997-03-051-34/+78
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=23414
* Fix remote request for HTTP proxies. Should close PR#2670.Garrett Wollman1997-02-111-3/+13
| | | | Notes: svn path=/head/; revision=22573
* Some bug-fixes, clean-ups, and one new feature:Garrett Wollman1997-02-051-19/+367
| | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=22307
* Some fixes for HTTP:Garrett Wollman1997-01-311-25/+252
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=22167
* Here is my long-threatened revamping of fetch. Jean-Marc probably won'tGarrett Wollman1997-01-301-0/+976
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. Notes: svn path=/head/; revision=22133