summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/http.c
Commit message (Collapse)AuthorAgeFilesLines
* MFH (r295536): fix double-free error when SSL connection failsdes2016-02-171-1/+0
| | | | | | PR: 206774 Submitted by: Christian Heckendorf <heckendorfc@gmail.com> Approved by: re (glebius)
* MFH (r280630): remove all traces of SSLv2 supportdes2016-01-161-13/+46
| | | | | | | | | | | MFH (r285141): remove unused variable MFH (r288217): correctly check return value from getaddrinfo(3) MFH (r289419): fix bugs in HTTPS tunnelling MFH (r289420): use fopen()'s "e" mode instead of fcntl for close-on-exec MFH (r291453, r291461): use .netrc for http servers and proxies MFH (r292330, r292332): reset bufpos to 0 after refilling in chunked mode PR: 194483 199801 193740 204771
* MFC r284346:dim2015-06-201-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following clang 3.7.0 warnings in lib/libfetch/http.c: lib/libfetch/http.c:1628:26: error: address of array 'purl->user' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.user = purl->user ? ~~~~~~^~~~ ~ lib/libfetch/http.c:1630:30: error: address of array 'purl->pwd' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.password = purl->pwd? ~~~~~~^~~~ lib/libfetch/http.c:1657:25: error: address of array 'url->user' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.user = url->user ? ~~~~~^~~~ ~ lib/libfetch/http.c:1659:29: error: address of array 'url->pwd' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.password = url->pwd ? ~~~~~^~~ ~ lib/libfetch/http.c:1669:25: error: address of array 'url->user' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.user = url->user ? ~~~~~^~~~ ~ lib/libfetch/http.c:1671:29: error: address of array 'url->pwd' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.password = url->pwd ? ~~~~~^~~ ~ Since url->user and url->pwd are arrays, they can never be NULL, so the checks can be removed. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D2673
* MFH (r267127): don't send User-Agent if HTTP_USER_AGENT is emptydes2014-08-241-4/+9
|
* MFC: r267131, r267132, r267133, r268493, r268671bapt2014-07-201-8/+38
| | | | | | | | | | Use NULL instead of 0 (Patch by Sascha Wildner <saw at online.de> for Dragonfly) Remove unnecessary semicolons (Patch by Sascha Wildner <saw at online.de> for Dragonfly) Add support for arbitrary http requests [1] Support EAGAIN in fetch_writev Submitted by: Alex Hornung <alex at alexhornung.com> [1] Reviewed by: des
* MFC r263021:bdrewery2014-03-191-0/+6
| | | | Support Last-Modified behind proxies which return UTC instead of GMT.
* MFH (r260904): fix format stringdes2014-02-271-24/+22
| | | | | MFH (r261230, r261263): fix buffering issues MFH (r261284): bump copyright
* Even though it doesn't really make sense in the context of a CONNECTdes2013-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
* Include an Accept header in requests.des2013-07-301-1/+7
| | | | | PR: kern/180917 MFC after: 1 week
* Implement certificate verification, and many other SSL-relateddes2013-07-261-1/+1
| | | | | | | | imrovements; complete details in the PR. PR: kern/175514 Submitted by: Michael Gmelin <freebsd@grem.de> MFC after: 1 week
* Use the correct request syntax for proxied (tunneled) HTTPS requests.des2013-07-211-1/+1
| | | | | PR: bin/180666 MFC after: 3 days
* Use the CONNECT method to proxy HTTPS connections through HTTP proxies.des2013-04-121-8/+13
| | | | | PR: bin/80176 Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
* Fix weird indentation.des2012-11-161-4/+4
|
* Implement HTTP 305 redirect handling.eadler2012-10-221-1/+5
| | | | | | | | PR: 172452 Submitted by: gcooper Reviewed by: des Approved by: cperciva MFC after: 1 week
* Don't deny non-temporary redirects if the -A option is set (pereadler2012-10-221-2/+12
| | | | | | | | | | | | 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
* Be a bit more lenient in the maximum number of redirects allowed.eadler2012-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
* Use libmd if and only if OpenSSL is not available.des2012-09-141-0/+8
| | | | | PR: bin/171402 MFC after: 3 days
* Don't reuse credentials if redirected to a different host.des2012-04-301-1/+3
| | | | | Submitted by: Niels Heinen <heinenn@google.com> MFC after: 3 weeks
* Fix two issues related to the use of SIGINFO in fetch(1) to displaydes2012-01-181-5/+12
| | | | | | | | | | | | | 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
* latin1 -> utf8des2011-10-191-1/+1
|
* Update copyright dates and strip my middle name.des2011-09-271-1/+1
|
* Increase WARNS to 4.des2011-05-121-1/+1
|
* Mechanical whitespace cleanup.des2011-05-121-100/+100
|
* Increase WARNS to 3.des2011-05-121-1/+1
|
* Fix a couple of embarrassing mistakes in the previous commit.des2010-07-281-2/+2
| | | | Submitted by: Dimitry Andric <dimitry@andric.com>
* If the A flag is supplied, http_request() will attempt the request onlydes2010-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
* Add HTTP digest authentication.des2010-01-191-66/+816
| | | | | Submitted by: Jean-Francois Dockes <jf@dockes.org> Forgotten by: des (repeatedly)
* Add support for HTTP 1.1 If-Modified-Since behavior.murray2008-12-151-3/+25
| | | | | | | | | | | | | | 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
* Don't fail mistakenly with -r when we already have the whole file.ru2008-10-241-0/+1
| | | | Reviewed by: des
* Use memcpy(3) instead of the BSD-specific bcopy(3).des2008-02-081-1/+1
| | | | | Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de> MFC after: 2 weeks
* Add necessary cast for tolower() argument.des2008-02-061-2/+3
| | | | | Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de> MFC after: 1 week
* As several people pointed out, I did all the ctype casts the wrongdes2007-12-191-13/+15
| | | | | | | way (not for the first time...) Noticed by: bde, ru ++ MFC after: 1 week
* Add support for the NO_PROXY / no_proxy environment variable as used bydes2007-12-181-3/+5
| | | | | | | | | lynx, curl etc. Note that this patch differs significantly from that in the PR, as the submitter refined it after submitting the PR. PR: 110388 Submitted by: Alexander Pohoyda <alexander.pohoyda@gmx.net> MFC after: 3 weeks
* Old patch I had lying around: correctly cast the argument to is*().des2007-12-181-12/+13
| | | | | | IWBNI gcc could warn about this the way it warns about printf() abuse. MFC after: 1 week
* Clean up namespace violations.des2007-12-141-97/+97
| | | | MFC after: 1 week
* Handle temporary redirects (HTTP status code 307)des2007-05-081-0/+2
| | | | | | PR: kern/112515 Submitted by: Ryan C. Gordon <icculus@icculus.org> MFC after: 3 weeks
* Ignore HTTP_PROXY if it is defined but empty. This was already handleddes2005-08-241-1/+1
| | | | | | | | | | correctly in the case of FTP_PROXY, because an empty FTP_PROXY has a specific meaning ("don't use any proxy at all for ftp, even if HTTP_PROXY is defined"), while an empty HTTP_PROXY has no meaning at all. PR: bin/85185 Submitted by: Conall O'Brien <conallob=freebsd@maths.tcd.ie> MFC after: 2 weeks
* Set the TCP_NODELAY socket option and clear TCP_NOPUSH in order to flushkbyanc2005-03-021-2/+15
| | | | | | | | any pending HTTP request rather than calling shutdown(2) with SHUT_WR. This makes libfetch (and thus fetch(1)) work again with Squid proxies configured to not allow half-closed connections. Reported by: Pawel Worach (pawel.worach AT telia DOT com)
* Set TCP_NOPUSH on HTTP requests, reducing the number of round-tripskbyanc2005-02-161-1/+9
| | | | | | necessary to establish each connection. MFC after: 2 weeks
* Update copyright years.des2004-09-211-1/+1
|
* Don't forget to allocate space for the terminating NUL when converting todes2004-08-071-1/+1
| | | | | | | | base 64. PR: misc/70022 Submitted by: Herve Masson <herve-bsdbt@mindstep.com> MFC after: 3 days
* Slight tweak to previous commit: don't forget to call _http_seterr() ifdes2004-02-111-0/+1
| | | | we get a genuine 416 reply.
* When restarting a transfer that has already completed, the server willdes2004-02-111-9/+41
| | | | | | | reply with a 416 error code (requested range not satisfiable) because we ask it to start at the end of the file. Handle this gracefully by considering a 416 reply a success if the requested offset exactly matches the length of the file and the requested length is zero.
* Re-wrap some comments.des2004-02-111-6/+7
|
* Don't dereference flags if NULL (see http.c rev 1.87)des2003-03-291-1/+1
|
* Don't parse the proxy URL unless we're actually going to use it. No realdes2003-03-111-3/+6
| | | | functional difference, but debugging output will be less confusing.
* style(9): add parentheses to sizeof even when not strictly required.des2003-01-281-2/+2
| | | | MFC after: 3 days
* A negative offset means "get it all".des2003-01-221-2/+2
|
* Implement and document support for an HTTP_REFERER environment variable.des2002-11-281-12/+21
| | | | | | | PR: 28171 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> Approved by: re (bmah) MFC after: 1 week
* Use __func__ and break a long line.des2002-10-301-5/+4
|
OpenPOWER on IntegriCloud