summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
Commit message (Collapse)AuthorAgeFilesLines
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.bdrewery2015-11-251-1/+0
| | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division
* Use fopen()'s newfangled "e" flag instead of explicit fcntl() calls.des2015-10-161-5/+3
| | | | | | PR: 199801 Submitted by: Jukka Ukkonen <jau@iki.fi> MFC after: 1 week
* Fix two bugs in HTTPS tunnelling:des2015-10-161-4/+32
| | | | | | | | | | - If the proxy returns a non-200 result, set the error code accordingly so the caller / user gets a somewhat meaningful error message. - Consume and discard any HTTP response header following the result line. PR: 194483 Tested by: Fabian Keil <fk@fabiankeil.de> MFC after: 1 week
* Fix non-POSIX-compliant use of getaddrinfo in libfetchgrembo2015-09-251-1/+2
| | | | | | | | Submitted by: Boris Kolpackov <boris@codesynthesis.com> Reviewed by: bapt Approved by: bapt MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3724
* Remove unused variable to silence clang warning.araujo2015-07-041-4/+1
| | | | | Differential Revision: D2683 Reviewed by: rodrigc, bapt
* new dependssjg2015-06-161-1/+0
|
* Fix the following clang 3.7.0 warnings in lib/libfetch/http.c:dim2015-06-131-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D2673
* Add META_MODE support.sjg2015-06-131-0/+28
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-273-13/+5
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-192-14/+24
| |\
| * \ Merge head from 7/28sjg2014-08-196-26/+77
| |\ \
| * | | Updated dependenciessjg2014-05-161-0/+2
| | | |
| * | | Merge from headsjg2014-05-081-1/+1
| |\ \ \
| * \ \ \ Merge headsjg2014-04-273-134/+85
| |\ \ \ \
| * \ \ \ \ Merge from headsjg2013-09-055-28/+666
| |\ \ \ \ \
| * | | | | | Updated dependenciessjg2013-03-111-0/+1
| | | | | | |
| * | | | | | Updated dependenciessjg2013-02-161-2/+0
| | | | | | |
| * | | | | | Sync with HEAD.obrien2013-02-081-4/+4
| |\ \ \ \ \ \
| * | | | | | | Updated/new Makefile.dependsjg2012-11-081-0/+5
| | | | | | | |
| | | | | | | |
| | \ \ \ \ \ \
| *-. \ \ \ \ \ \ Sync from headsjg2012-11-045-8/+37
| |\ \ \ \ \ \ \ \
| * | | | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+22
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | | | | Remove defunct SSLv2 support from fetch(1) and fetch(3).jkim2015-03-252-9/+3
| | | | | | | | |
* | | | | | | | | Convert libraries to use LIBADDbapt2014-11-251-4/+2
| |_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | While here reduce a bit overlinking
* | | | | | | | As pointed out by several people, r273114 was incorrect: it unconditionallydes2014-10-152-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disabled everything except TLS 1.0. Replace it with a more carefully wrought patch: - Switch the default for SSLv3 from on to off - Add environment variables to control TLS 1.1 and 1.2 - In verbose mode, report which version is used - Update the man page to reflect these changes. MFC after: 1 week
* | | | | | | | Drop support for SSLv3.des2014-10-151-1/+1
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | MFC after: 1 week
* | | | | | | Add a comment to explain the EAGAIN is only there for POSIX compliancebapt2014-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resquested by: kib Reviewed by: des
* | | | | | | Support EAGAIN in fetch_writevbapt2014-07-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: des Approved by: des
* | | | | | | Use Mt macro to properly format mailto links (patch from Franco Fichtner ↵bapt2014-06-111-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <franco@lastsummer.de> for Dragonfly) Reviewed by: des Approved by: des Obtained from: Dragonfly MFC after: 1 week
* | | | | | | Add support for arbitrary http requestsbapt2014-06-053-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Alex Hornung <alex@alexhornung.com> Reviewed by: des Obtained from: Dragonfly MFC after: 3 week
* | | | | | | Remove unnecessary semicolonsbapt2014-06-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Sascha Wildner <saw@online.de> for Dragonfly Reviewed by: des Obtained from: Dragonfly MFC after: 1 week
* | | | | | | Use NULL instead of 0bapt2014-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Sascha Wildner <saw@online.de> for Dragonfly Reviewed by: des Obtained from: Dragonfly MFC after: 1 week
* | | | | | | If HTTP_USER_AGENT is defined but empty, don't send User-Agent at all.des2014-06-052-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 184507 Submitted by: jbeich@tormail.org (with modifications) MFC after: 1 week
* | | | | | | Look for root certificates in /usr/local/etc/ssl before /etc/ssl.des2014-05-171-2/+8
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | MFH: 1 week
* | | | | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | from the latter.
* | | | | Support Last-Modified behind proxies which return UTC instead of GMT.bdrewery2014-03-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standard states that GMT must be used, but that UTC is equivalent. Still parse UTC as otherwise this causes problems for pkg(8). It will refetch the repository every time 'pkg update' or other remote operations are used behind these proxies. RFC2616: "All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal Time)."" Approved by: bapt (mentor) Reviewed by: des, peter Sponsored by: EMC / Isilon Storage Division MFC after: 1 week
* | | | | Bump copyright datesdes2014-01-303-3/+3
| | | | |
* | | | | r261230 broke the cases where the amount of data to be read is notdes2014-01-292-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | known in advance, or where the caller doesn't care and just keeps reading until it hits EOF. In fetch_read(): the socket is non-blocking, so read() will return 0 on EOF, and -1 (errno == EAGAIN) when the connection is still open but there is no data waiting. In the first case, we should immediately return 0. The EINTR case was also broken, although not in a way that matters. In fetch_writev(): use timersub() and timercmp() as in fetch_read(). In http_fillbuf(): set errno to a sensible value when an invalid chunk header is encountered. In http_readfn(): as in fetch_read(), a zero return from down the stack indicates EOF, not an error. Furthermore, when io->error is EINTR, clear it (but no errno) before returning so the caller can retry after dealing with the interrupt. MFC after: 3 days
* | | | | Solve http buffering issues and hangs once and for all (hopefully!) bydes2014-01-283-121/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simply not trying to return exactly what the caller asked for - just return whatever we got and let the caller be the judge of whether it was enough. If an error occurs or the connection times out after we already received some data, return a short read, under the assumption that the next call will fail or time out before we read anything. As it turns out, none of the code that calls fetch_read() assumes an all-or-nothing result anyway, except for a couple of lines where we read the CR LF at the end of a hunk in HTTP hunked encoding, so the changes outside of fetch_read() and http_readfn() are minimal. While there, replace select(2) with poll(2). MFC after: 3 days
* | | | | Fix format string.des2014-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Jörg Sonnenberger <joerg@NetBSD.org> MFC after: 1 week
* | | | | Fix build with GCCbdrewery2013-11-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL_set_tlsext_host_name(3) internally does not modify the host buffer pased to it. So it is safe to DECONST the struct url* here. Reported by: gjb Approved by: bapt (implicit) MFC after: 1 week X-MFC-With: r258347
* | | | | Support SNI in libfetchbdrewery2013-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
* | | | 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-302-3/+18
| | | | | | | | | | | | | | | | | | | | PR: kern/180917 MFC after: 1 week
* | | | Implement certificate verification, and many other SSL-relateddes2013-07-264-16/+632
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Fix -Wunsequenced warning.kientzle2013-06-291-1/+1
| | | | | | | | | | | | | | | | Submitted by: dt71@gmx.com
* | | | 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
OpenPOWER on IntegriCloud