summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/http.c
Commit message (Collapse)AuthorAgeFilesLines
* Apply 'const' liberally.archie2001-04-241-20/+20
| | | | Fix some other minor glitches.
* Support lower-case versions of the proxy environment variables.des2001-03-071-1/+2
| | | | PR: bin/25494
* Use the documented (and historical) defaults. Centralize the decision logicdes2000-11-101-20/+3
| | | | | | in order to avoid this bug in the future. Submitted by: se
* Use CHECK_FLAGdes2000-10-291-6/+6
|
* Rework proxy handling so that proxies can be specified as URLs.des2000-10-121-132/+65
| | | | As a side effect, remove a lot of duplicate and now redundant code.
* Work around buggy servers such as NCSA httpd which send an incompletedes2000-09-241-9/+18
| | | | HTTP-Version on the Status-Line (see RFC2616 sections 3.1 and 6.1).
* Fix signedness bogon.des2000-08-021-7/+6
|
* Centralize the default port finding code.des2000-07-251-16/+23
| | | | | Work around YA Apache bug: don't send port in Host: header if it's the default port.
* Ignore environment variables that are set but empty.des2000-07-211-40/+81
| | | | | | | | | | | | Sort out the size / length confusion. Always try to report the *real* file size in the url_stat structure, no matter how much of it is actually being sent, and try to detect inconsistencies between sizes. Rearrange the request loop to avoid having to add meaningless code just to silence compiler warnings. Switch to a more sensible and consistent interface for the _http_parse*() functions.
* Don't try to skip to the requested offset if the server returns more datades2000-07-191-8/+10
| | | | | | than requested. Instead, inform the caller of the real offset by modifying the offset field in the original struct url, and let him decide how to handle the situation.
* Introduce fetchXGet*(), which combine the functionalities of fetchGet*() anddes2000-07-171-7/+21
| | | | | | fetchStat*(). In most cases, either fetchGet*() or fetchXGet*() is a wrapper around the other; in all cases, calling fetchGet*() is identical to calling fetchXGet*() with the second argument set to NULL.
* Don't forget to set file descriptor to -1 after closing it, since the codedes2000-07-171-1/+1
| | | | | | | outside the loop inspects it to determine whether or not we succeeded in retrieving the requested document. This fixes a bug where fetchGetHTTP() would return a FILE with an invalid file descriptor if it hit the redirect limit without locating the requested document.
* #ifdef DEBUG -> #ifndef NDEBUGdes2000-07-161-2/+2
| | | | Pointed out by: ache
* Reinsert the MIT copyright, which applies to the base64 code and wasdes2000-07-161-0/+32
| | | | left out by accident during the rewrite.
* Fix a bug (misplaced continue) that caused redirects to fail. Lots of codedes2000-07-131-16/+29
| | | | | | | | moved around, but the acutal functional changes are small. Add support for site-internal redirects (where the Location: header gives a path instead of an absolute URI) Pointed out by: kuriyama
* Extensive rewrite of the HTTP code. The new code is significantly cleaner anddes2000-07-121-446/+685
| | | | | | | | more robust, and somewhat more efficient. It also handles authorization and redirects properly, and supports timeouts like the FTP code. Many thanks to Umemoto-san for his assistance with IPv6 support, both here and in other parts of libfetch.
* Rework the authorization code.des2000-07-111-78/+83
| | | | | | Only send absolute URI if connected to a proxy, since Apache doesn't always understand absolute URIs. Clean up some of the debugging output.
* Fix basic authentication, and add proxy authentication.des2000-07-081-19/+45
| | | | Submitted by: se
* Don't incorrectly report a protocol error when we get a 302 and redirectsdes2000-06-211-2/+5
| | | | are disabled.
* Hackish support for 302 redirect.des2000-05-261-24/+59
|
* IPv6 support.ume2000-05-201-6/+39
|
* Better handling of some boundary conditions.des2000-05-191-0/+2
| | | | Submitted by: ume
* Make HTTP_PROXY work for FTP.ume2000-05-151-5/+13
| | | | | Reported by: Ben Smithurst <ben@scientia.demon.co.uk> Reviewed by: des
* Remove unused 'verbose'.des2000-05-151-6/+6
| | | | Initialize the struct url_stat at the beginning of fetchStatHTTP().
* Reorganize some of the http code and split it into more functions.des2000-05-111-59/+150
| | | | | | Implement fetchStatHTTP(). Unbungle struct url, and add fetchFreeURL(). Document it.
* Implement restartdes2000-05-071-1/+32
|
* Use sizeof more consistently.des2000-05-071-11/+41
| | | | Outline sanity checking of server port spec.
* Patches I've had lying around for several months:des2000-01-071-4/+5
| | | | | | | * Add the 'h' ftp flag (allocate local port in high range) * Add the 'd' flag (use direct connection even if proxy is defined) * Make sure flags != NULL before calling strchr(). * Minor changes to some comments.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Implement and document file list retrieval.des1998-12-211-1/+11
|
* Don't specify a language to compile_et.des1998-12-181-3/+3
| | | | Rename fetchConnect to _fetch_connect since it's internal.
* Remove unused header files. Fix a few shadowing bugs. Improve error reporting.des1998-12-161-23/+9
|
* Add verbose flag, and support functions.des1998-12-161-5/+12
| | | | | | | | | Brucify the Makefile. Differentiate atime and mtime in fetch*Stat(). Fix a few pointer bugs. Tweak some error messages. Don't #include sys/param.h and stdio.h in fetch.h. Document that sys/param.h and stdio.h must be #included before fetch.h.
* Second of a series of cleanups to libfetch.des1998-11-061-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the following features: a) the fetchStat*() functions, which return meta-information for a document, such as size, modification time, etc. b) the use of the com_err(3) facilities to report errors. It also fixes a bunch of style bugs and a few logic bugs and somewhat improves the man page. Changed files, in alphabetical order: Makefile: Don't generate macros in {ftp,http}err.c. Generate category fields for the error message lists. Compile the error table. Install fetch_err.h along with fetch.h. common.c: Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the error code in the _netdb_seterr() macro. Add categories to the _netdb_errlist table. Report errors through the Common Error library. common.h: Add the DEBUG macros. Add prototype for fetchConnect(). Remove the prototype for _fetch_errstring(), which is local to common.c Add a categroy field to struct fetcherr, and define constants for error categories. Define macros for _{url,netdb,ftp,http}_seterr(). errors.et: (new file) List error categories. fetch.3: Document the fetchStat*() functions. Move the "unimplemented functionality" comments from NOTES to BUGS. Document that applications which use libfetch must also use libcom_err, and list existing error codes. Undocument fetchLastErr{Code,String}. Remove the (empty) DIAGNOSTICS section. Mention Eugene Skepner in the AUTHORS section. fetch.c: Move the DEBUG macros to common.c Add fetchStat() and fetchStatURL(). Generate error messages for URL parser errors, and fix a minor bug in the parser. Use 'struct url' instead of 'url_t'. Remove fetchLastErr{Code,String}. fetch.h: Use 'struct url' instead of 'url_t', and remove the typedef. Define struct url_stat (used by fetchStat()). Add prototypes for fetchStat*(). Remove the declarations for fetchLastErr{Code,String}. Include fetch_err.h. fetch_err.et: (new file) Error table for libfetch. file.c: Add fetchStatFile(). Use 'struct url' instead of 'url_t'. ftp.c: Add fetchStatFTP(). Use 'struct url' instead of 'url_t'. Don't use fetchLastErrCode. ftp.errors: Add categories to all error messages. http.c: Add fetchStatHTTP(). Use 'struct url' instead of 'url_t'. Don't use fetchLastErr{Code,Text}. http.errors: Add categories to all error messages. Prompted by: jkh and Eugene Skepner Numerous sugestions from: Garett Wollman and Eugene Skepner
* First of a series of cleanups to libfetch. Changed files, indes1998-11-051-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alphabetical order: Makefile: Add common.c to SRCS. Make debugging easier by making 'CFLAGS += -DNDEBUG' conditional on DEBUG Don't declare struct {ftp,http}err in {ftp,http}err.c; use struct fetcherr instead. README: Remove the todo list, which is out of date anyway. common.c: (new file) Gather utility functions in this file. Merge the error reporting functions intp _fetch_errstring(), _fetch_seterr() and _fetch_syserr(). Set fetchLastErrCode and fetchLastErrText appropriately when fetchConnect fails. common.h: (new file) Gather internal prototypes and structures in this files. fetch.3: Undocument fetchFreeURL(). Document a few more known bugs. Document fetchLastErrCode and fetchLastErrText. fetch.c: Add descriptive comments to all functions that lacked them. Move fetchConnect() to common.c. Obviate the need for fetchFreeURL(), and remove it. fetch.h: Modify struct url_t so the document part is at the end. ftp.c: Remove code that is duplicated elsewhere. http.c: Remove code that is duplicated elsewhere. Prompted by: jkh
* Commit a bunch of patches that have been accumulating:des1998-08-171-3/+3
| | | | | | | | | | - Fix the README to reflect the new status of the ftp code. - Change tons of 'if (xxx < 0)' to 'if (xxx == -1)' - Add two new interface functions - Fix the Makefile so it actually works (yay!) Now the manpage is lagging even further behind... :( Next on the todo list is to clean up the http code.
* Base64 code (and the MIT copyright) moved to http.cdes1998-07-121-13/+161
| | | | | FTP STORe and APPEnd added. FTP proxy support added (untested).
* Too many changes to list. Basically, FTP is nearly there and errordes1998-07-111-33/+19
| | | | reporting is kinda sorted out. Now HTTP needs to catch up...
* Imported libfetch into the tree. It compiles, but there's still somedes1998-07-091-0/+338
work to do. I especially need help with the man page.
OpenPOWER on IntegriCloud