summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/ftp.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright years.des2004-09-211-1/+1
|
* Don't close a FILE * which we know is bogus.des2003-08-291-1/+0
|
* Some servers respond to RETR in active mode with 125 (connection alreadydes2003-08-191-1/+1
| | | | | | | | open) rather than 150 (opening connection). There's no reason why we shouldn't accept that. PR: misc/42172 MFC in: 3 days
* The flags passed in to _ftp_get_proxy may be nullmtm2003-03-191-1/+1
| | | | Approved by: des, markm (mentor)(implicit)
* Don't parse the proxy URL unless we're actually going to use it. No realdes2003-03-111-5/+10
| | | | functional difference, but debugging output will be less confusing.
* style(9): add parentheses to sizeof even when not strictly required.des2003-01-281-6/+6
| | | | MFC after: 3 days
* Hook in the .netrc code + don't use pointers as if they were booleans.des2003-01-221-4/+6
|
* The FTP connection caching needs a better interface -- connections arenjl2002-10-251-0/+4
| | | | | | | | | | | | | closed through _fetch_close() which is the only one who knows the connection REALLY was closed (since ref -> 0). However, FTP keeps its own local cached_connection and checks if it is valid by comparing it to NULL. This is bogus since it may have been freed elsewhere by _fetch_close(). This change checks if we are closing the cached_connection and the ref is 1 (soon to be 0). If so, set cached_connection to NULL so we don't accidentally reuse it. The REAL fix should be to move connection caching to the common.c level (_fetch_* functions) and NULL the cache(s) in _fetch_close(). Then all layers could benefit from caching.
* When recycling a cached connection, increment the reference count so thattjr2002-10-201-1/+1
| | | | | the heap block does not get freed and reused. This should fix the pkg_add -r crashes that have been happening for months.
* Make _fetch_connect() always set the error code.fenner2002-09-171-3/+2
| | | | Tell ftp that _fetch_connect() always sets the error code (http already knew)
* Cope with 2292bis-01 getaddrinfo (no NI_WITHSCOPEID, always attachume2002-07-021-0/+1
| | | | | | | scope identifier). Approved by: des MFC after: 3 weeks
* Add a reference count to struct fetchconn so we don't prematurely close anddes2002-06-111-1/+1
| | | | free a cached FTP connection.
* Wrap everything in struct connection, and enforce timeouts everywheredes2002-06-051-15/+17
| | | | | (except for DNS operations). Always use funopen() for HTTP, to support both timeouts and SSL.
* First step towards SSL support: wrap connections in a 'struct connection'des2002-06-051-92/+89
| | | | | | | | | | which contains the socket descriptor, the input buffer and (yet unused) SSL state variables. This has the neat side effect of greatly improving reentrance (though we're not *quite* there yet) and opening the door to HTTP connection caching. This commit is inspired by email conversations with and patches from Henry Whincup <henry@techiebod.com> last fall.
* Modernize my email addressphk2002-03-251-1/+1
|
* Reindent, and add parentheses to return statements. Some functions indes2002-02-051-689/+694
| | | | | ftp.c and http.c now have exceedingly long lines due to deep nesting; this will be corrected by reorganizing the code in a later revision.
* Mark uploads as O_WRONLY, not O_RDONLY.des2002-01-201-2/+6
| | | | | PR: misc/34043 MFC after: 2 weeks
* Remove VT100 escapes from debugging messages now that they're enabled bydes2002-01-011-3/+2
| | | | | | | default. PR: 32988 MFC after: 3 days
* Reorganize to reduce code duplication.des2001-12-041-64/+32
|
* Tons of type, style and warning fixes that have been rotting in my tree fordes2001-10-181-29/+29
| | | | | ages - some of which wouldn't be necessary if gcc wasn't broken or TPTB were willing to do something (-fno-builtin) about it.
* Add __FBSDID()s to libfetchdillon2001-09-301-2/+3
|
* Handle snprintf() returning < 0 (not just -1)brian2001-08-201-1/+1
| | | | MFC after: 2 weeks
* Handle snrintf overflows.brian2001-08-201-0/+2
| | | | Spotted by: bde
* Handle snprintf() returning -1.brian2001-08-201-1/+2
| | | | MFC after: 2 weeks
* Don't call _ftp_closefn() upon EOF in _ftp_readfn(); just return 0. Thisdes2001-06-111-1/+1
| | | | fixes a bug in pkg_add(1) (which nobody noticed because of another bug).
* Add rudimentary support for an authentication callback function.des2001-05-261-41/+45
|
* Plug memory leak.des2001-05-261-6/+3
| | | | PR: 27506
* Apply 'const' liberally.archie2001-04-241-17/+19
| | | | Fix some other minor glitches.
* If the server's reply to the SIZE command is unparseable, reset us->sizedes2001-04-071-0/+1
| | | | to -1 so the caller will know it's invalid. This is an MFC candidate.
* Use high port range by default, and replace the 'h' option with an 'l' optiondes2001-03-241-4/+4
| | | | that forces the ftp code to use the low (default) port range instead.
* Don't remember an EINTR, since the caller may want to restart the call.des2001-03-071-2/+4
|
* Support lower-case versions of the proxy environment variables.des2001-03-071-2/+3
| | | | PR: bin/25494
* Use "anonymous" rather than "ftp" as login name for anonymous ftp.des2001-01-081-3/+2
| | | | | | Rather than have a separate (misnamed) FTP_ANONYMOUS_PASSWORD constant, use FTP_ANONYMOUS_USER (i.e. "anonymous") to construct the anonymous ftp password if getlogin() fails.
* Check the FTP_LOGIN environment variable before falling back ondes2000-12-221-0/+2
| | | | FTP_ANONYMOUS_USER.
* Somewhere along the line, I misunderstood the whole FTP_PASSIVE_MODE debatedes2000-12-061-1/+1
| | | | | | | and had libfetch selecting passive mode even when FTP_PASSIVE_MODE was not set at all, which is really quite surprising unless you know about it. So change it to the agreed default behaviour of selecting passive mode if FTP_PASSIVE_MODE is set, but not "no".
* Fix old-style proxy specs: default to FTP if FTP_PROXY was set; only defaultdes2000-11-271-2/+6
| | | | to HTTP if HTTP_PROXY was used instead.
* Don't go haywire if the server closes the connection in the middle of ades2000-11-221-1/+1
| | | | multiline response (proper fix this time).
* Revert previous commit, it was somewhat hasty.des2000-11-221-5/+1
|
* Don't go haywire if the server closes the connection during a multilinedes2000-11-221-1/+5
| | | | response.
* Use the documented (and historical) defaults. Centralize the decision logicdes2000-11-101-17/+4
| | | | | | in order to avoid this bug in the future. Submitted by: se
* Use CHECK_FLAGdes2000-10-291-11/+11
|
* Stricter error checking in the I/O functions.des2000-10-291-1/+25
|
* Fix this my way. David had absolutely no call overriding MAINTAINER withoutdes2000-10-281-3/+3
| | | | even giving me 24 hours to read his mail and find the bug.
* Repeat after me, "check to see that a pointer isn't NULL beforeobrien2000-10-281-3/+3
| | | | dereferenceing it". This fixes ``pkg_add -r''.
* MFS: don't expect result code until you close the data connectiondes2000-10-271-3/+3
|
* Use funopen() instead of fdopen(). This fixes three problems:des2000-10-221-4/+118
| | | | | | | | | | | | | | - ftpTimeout was not honored when reading actual data, as opposed to talking protocol - connection caching was broken because _ftp_cached_connect() would see the result of the transfer instead of the result of the NOOP. - if the RETR succeeded, but an error occurred later (as can happen when talking to a proxy), the error would not be detected. There still remains to register an atexit(3) callback to close the cached connection gracefully instead of just dropping it on the floor.
* Argh! Fix passive mode selection (again)des2000-10-171-2/+3
|
* Use the right user namedes2000-10-131-3/+3
|
* Rework proxy handling so that proxies can be specified as URLs.des2000-10-121-74/+91
| | | | As a side effect, remove a lot of duplicate and now redundant code.
* Grok 125 replies to passive RETR. This fixes an interoperability bug withdes2000-08-211-1/+2
| | | | | | Microsoft FTP Service. Reported by: asmodai, eivind
OpenPOWER on IntegriCloud