summaryrefslogtreecommitdiff
path: root/lib/libfetch
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Support SNI in libfetchBryan Drewery2013-11-191-0/+9
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SNI is Server Name Indentification which is a protocol for TLS that indicates the host that is being connected to at the start of the handshake. It allows to use Virtual Hosts on HTTPS. Submitted by: sbz Submitted by: Michael Gmelin <freebsd@grem.de> [1] PR: kern/183583 [1] Reviewed by: des Approved by: bapt MFC after: 1 week Notes: svn path=/head/; revision=258347
* | | | Even though it doesn't really make sense in the context of a CONNECTDag-Erling Smørgrav2013-08-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request, RFC 2616 14.23 mandates the presence of the Host: header in all HTTP 1.1 requests. PR: kern/181445 Submitted by: Kimo <kimor79@yahoo.com> MFC after: 3 days Notes: svn path=/head/; revision=254650
* | | | Include an Accept header in requests.Dag-Erling Smørgrav2013-07-302-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: kern/180917 MFC after: 1 week Notes: svn path=/head/; revision=253805
* | | | Implement certificate verification, and many other SSL-relatedDag-Erling Smørgrav2013-07-264-16/+632
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imrovements; complete details in the PR. PR: kern/175514 Submitted by: Michael Gmelin <freebsd@grem.de> MFC after: 1 week Notes: svn path=/head/; revision=253680
* | | | Use the correct request syntax for proxied (tunneled) HTTPS requests.Dag-Erling Smørgrav2013-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: bin/180666 MFC after: 3 days Notes: svn path=/head/; revision=253514
* | | | Fix -Wunsequenced warning.Tim Kientzle2013-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: dt71@gmx.com Notes: svn path=/head/; revision=252375
* | | | Use the CONNECT method to proxy HTTPS connections through HTTP proxies.Dag-Erling Smørgrav2013-04-121-8/+13
| |_|/ |/| | | | | | | | | | | | | | | | | | | | PR: bin/80176 Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com> Notes: svn path=/head/; revision=249431
* | | Fix weird indentation.Dag-Erling Smørgrav2012-11-161-4/+4
| |/ |/| | | | | Notes: svn path=/head/; revision=243149
* | Implement HTTP 305 redirect handling.Eitan Adler2012-10-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | PR: 172452 Submitted by: gcooper Reviewed by: des Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241841
* | Don't deny non-temporary redirects if the -A option is set (perEitan Adler2012-10-222-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the man page) [0] While here add support for draft-reschke-http-status-308-07 PR: 172451 [0] Submitted by: gcooper [0] Reviewed by: des Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241840
* | Be a bit more lenient in the maximum number of redirects allowed.Eitan Adler2012-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | Chrome and Firefox have a limit of 20. IE has a limit of 8. Reviewed by: des Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=241839
* | Use libmd if and only if OpenSSL is not available.Dag-Erling Smørgrav2012-09-142-2/+10
| | | | | | | | | | | | | | | | PR: bin/171402 MFC after: 3 days Notes: svn path=/head/; revision=240496
* | Adding missing return statements during error conditions.Eitan Adler2012-09-141-2/+8
| | | | | | | | | | | | | | | | | | | | | | PR: kern/171187 Submitted by: Mark Johnston <markjdb@gmail.com> Reviewed by: des Approved by: cperciva MFC after: 2 weeks Notes: svn path=/head/; revision=240495
* | Merge OpenSSL 1.0.1c.Jung-uk Kim2012-07-121-1/+1
|/ | | | | | | Approved by: benl (maintainer) Notes: svn path=/head/; revision=238405
* libfetch: Avoid SIGPIPE on network connections.Jilles Tjoelker2012-05-281-0/+2
| | | | | | | | | | | | | | | To avoid unexpected process termination from SIGPIPE when writing to a closed network connection, enable SO_NOSIGPIPE on all network connections. The POSIX standard MSG_NOSIGNAL is not used since it requires modifying all send calls to add this flag. This is particularly nasty for SSL connections. Reviewed by: des Tested by: bapt MFC after: 5 days Notes: svn path=/head/; revision=236193
* Don't reuse credentials if redirected to a different host.Dag-Erling Smørgrav2012-04-301-1/+3
| | | | | | | | Submitted by: Niels Heinen <heinenn@google.com> MFC after: 3 weeks Notes: svn path=/head/; revision=234838
* Since the socket is non-blocking, it is necessary to use select(2) evenDag-Erling Smørgrav2012-04-301-17/+13
| | | | | | | | | | | | when there is no timeout, because read(2) will return immediately if there is no data waiting in the TCP buffer, causing fetch_read() to busy-loop on slow connections. MFC after: 3 weeks Noticed by: Yanhui Shen <shen.elf@gmail.com> Notes: svn path=/head/; revision=234837
* Support percent-encoded user and passwordEd Maste2012-04-111-6/+45
| | | | | | | | | | | | RFC 1738 specifies that any ":", "@", or "/" within a user name or password in a URL is percent-encoded, to avoid ambiguity with the use of those characters as URL component separators. Reviewed by: rstone@ MFC after: 1 month Notes: svn path=/head/; revision=234138
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-1/+1
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* Fix two nits in previous commit pointed out by pjd@.Dag-Erling Smørgrav2012-01-231-2/+1
| | | | | | | MFC after: 3 weeks Notes: svn path=/head/; revision=230478
* Fix two issues related to the use of SIGINFO in fetch(1) to displayDag-Erling Smørgrav2012-01-183-7/+75
| | | | | | | | | | | | | | | | progress information. The first is that fetch_read() (used in the HTTP code but not the FTP code) can enter an infinite loop if it has previously been interrupted by a signal. The second is that when it is interrupted, fetch_read() will discard any data it may have read up to that point. Luckily, both bugs are extremely timing-sensitive and therefore difficult to trigger. PR: bin/153240 Submitted by: Mark <markjdb@gmail.com> MFC after: 3 weeks Notes: svn path=/head/; revision=230307
* latin1 -> utf8Dag-Erling Smørgrav2011-10-198-9/+9
| | | | Notes: svn path=/head/; revision=226537
* Update copyright dates and strip my middle name.Dag-Erling Smørgrav2011-09-278-8/+8
| | | | Notes: svn path=/head/; revision=225814
* Bump date.Dag-Erling Smørgrav2011-09-271-1/+1
| | | | Notes: svn path=/head/; revision=225813
* Think first, commit second.Dag-Erling Smørgrav2011-09-272-8/+19
| | | | | | | | | 1. Allow the caller to select active mode. 2. Fix the envar logic so it *always* overrides the caller's flags. 3. Document the change from active to passive. Notes: svn path=/head/; revision=225812
* Long overdue: make passive mode the default for ftp.Dag-Erling Smørgrav2011-09-271-2/+2
| | | | Notes: svn path=/head/; revision=225810
* Mark all socket and file descriptors close-on-exec.Dag-Erling Smørgrav2011-05-132-0/+4
| | | | | | | | PR: bin/151866 MFC after: 3 weeks Notes: svn path=/head/; revision=221830
* Builds cleanly at the default WARNS level (WARNS=6).Dag-Erling Smørgrav2011-05-121-1/+0
| | | | Notes: svn path=/head/; revision=221823
* Increase WARNS to 4.Dag-Erling Smørgrav2011-05-123-3/+3
| | | | Notes: svn path=/head/; revision=221822
* Mechanical whitespace cleanup.Dag-Erling Smørgrav2011-05-121-100/+100
| | | | Notes: svn path=/head/; revision=221821
* Increase WARNS to 3.Dag-Erling Smørgrav2011-05-122-2/+2
| | | | Notes: svn path=/head/; revision=221820
* Fix a bug related to connection caching which could cause a crash afterDag-Erling Smørgrav2011-01-171-0/+1
| | | | | | | | | | | a STAT command. PR: kern/153748 (different patch) Submitted by: Mark Johnston <markjdb@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=217505
* Move variable declarations into the conditional block where they areEd Maste2010-10-241-1/+1
| | | | | | | | | | used, to fix warning if WITH_SSL is not set. Submitted by: Sean Bruno MFC after: 1 week Notes: svn path=/head/; revision=214256
* Redo fetch_read() using non-blocking sockets. This is necessary toDag-Erling Smørgrav2010-07-281-20/+89
| | | | | | | | | | | | avoid a hang in the SSL case if the server sends a close notification before we are done reading. In the non-SSL case, it can provide a minor (but probably not noticeable) performance improvement for small transfers. MFC after: 3 weeks Notes: svn path=/head/; revision=210568
* Fix a couple of embarrassing mistakes in the previous commit.Dag-Erling Smørgrav2010-07-281-2/+2
| | | | | | | Submitted by: Dimitry Andric <dimitry@andric.com> Notes: svn path=/head/; revision=210563
* If the A flag is supplied, http_request() will attempt the request onlyDag-Erling Smørgrav2010-07-011-2/+4
| | | | | | | | | | | | | | once, even if authentication is required, instead of retrying with the proper credentials. Fix this by bumping the countdown if the origin or proxy server requests authentication so that the initial unauthenticated request does not count as an attempt. PR: 148087 Submitted by: Tom Evans <tevans.uk@googlemail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=209632
* Document HTTP digest authentication support.Dag-Erling Smørgrav2010-01-261-8/+14
| | | | | | | | | Mention some prominent past contributors: Hajimu Umemoto (ipv6), Henry Whincup (https), Jukka Ukkonen (if-modified-since) and Jean-François Dockes (digest auth) Notes: svn path=/head/; revision=203028
* Add missing DPADD and fix whitespace.Dag-Erling Smørgrav2010-01-191-2/+3
| | | | | | | Submitted by: ru Notes: svn path=/head/; revision=202623
* Add HTTP digest authentication.Dag-Erling Smørgrav2010-01-192-67/+819
| | | | | | | | Submitted by: Jean-Francois Dockes <jf@dockes.org> Forgotten by: des (repeatedly) Notes: svn path=/head/; revision=202613
* Fix a socket leak in ftp_request() after that a connection is established.Attilio Rao2009-11-251-3/+9
| | | | | | | | | | Submitted by: Sandvine Incorporated Reviewed by: des, emaste Sponsored by: Sandvine Incorporated MFC: 1 week Notes: svn path=/head/; revision=199801
* PR: 139751Fabien Thomas2009-10-211-1/+1
| | | | | | | | | Approved by: des Obtained from: Xavier Heiny <xavier.heiny@netasq.com> MFC after: 3 weeks Notes: svn path=/head/; revision=198339
* Bump the version of all non-symbol-versioned shared libraries inKen Smith2009-07-191-1/+1
| | | | | | | | | | | preparation for 8.0-RELEASE. Add the previous version of those libraries to ObsoleteFiles.inc and bump __FreeBSD_Version. Reviewed by: kib Approved by: re (rwatson) Notes: svn path=/head/; revision=195767
* 1. Update fetch to consistently return 1 on error, as the man page states,Murray Stokely2008-12-171-8/+0
| | | | | | | | | | | | | rather than usually returning 1 but in a few instances using a sysexits(3) return value. 2. Remove a few unused variables from libfetch. PR: docs/122470 (1, only) Reviewed by: des Notes: svn path=/head/; revision=186241
* Add support for HTTP 1.1 If-Modified-Since behavior.Murray Stokely2008-12-153-4/+50
| | | | | | | | | | | | | | | | | fetch(1) accepts a new argument -i <file> that if specified will cause the file to be downloaded only if it is more recent than the mtime of <file>. libfetch(3) accepts the mtime in the url structure and a flag to indicate when this behavior is desired. PR: bin/87841 Submitted by: Jukka A. Ukkonen <jau@iki.fi> (partially) Reviewed by: des, ru MFC after: 3 weeks Notes: svn path=/head/; revision=186124
* Don't fail mistakenly with -r when we already have the whole file.Ruslan Ermilov2008-10-241-0/+1
| | | | | | | Reviewed by: des Notes: svn path=/head/; revision=184222
* Fix one-byte buffer overflow: NUL gets written to the buffer, but isn'tColin Percival2008-04-151-1/+1
| | | | | | | | | | | | | | counted in the width specification in scanf. This is not a security problem, since this function is only used to parse a user's configuration file. Submitted by: Joerg Sonnenberger Obtained from: dragonflybsd MFC after: 1 week Notes: svn path=/head/; revision=178234
* s/wait/delta/ to avoid namespace collision.Dag-Erling Smørgrav2008-03-201-16/+16
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=177447
* Use memcpy(3) instead of the BSD-specific bcopy(3).Dag-Erling Smørgrav2008-02-083-6/+6
| | | | | | | | Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de> MFC after: 2 weeks Notes: svn path=/head/; revision=176105
* s/MAXPATHLEN/PATH_MAX/ to reflect five-year old change to the code :)Dag-Erling Smørgrav2008-02-081-1/+1
| | | | | | | | Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de> MFC after: 2 weeks Notes: svn path=/head/; revision=176104
* Add necessary cast for tolower() argument.Dag-Erling Smørgrav2008-02-061-2/+3
| | | | | | | | Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de> MFC after: 1 week Notes: svn path=/head/; revision=176036