aboutsummaryrefslogtreecommitdiff
path: root/lib/libfetch
Commit message (Collapse)AuthorAgeFilesLines
* Fix buildworld after r291453, similar to r284346: url->user and url->pwdDimitry Andric2015-11-291-4/+2
| | | | | | | | | | are arrays, so they can never be NULL. Reported by: many Pointy hat to: des Notes: svn path=/head/; revision=291461
* Use .netrc for HTTP sites and proxies, not just FTP.Dag-Erling Smørgrav2015-11-292-3/+11
| | | | | | | | | PR: 193740 Submitted by: TEUBEL György <tgyurci@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=291453
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.Bryan Drewery2015-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 Notes: svn path=/head/; revision=291307
* Use fopen()'s newfangled "e" flag instead of explicit fcntl() calls.Dag-Erling Smørgrav2015-10-161-5/+3
| | | | | | | | | PR: 199801 Submitted by: Jukka Ukkonen <jau@iki.fi> MFC after: 1 week Notes: svn path=/head/; revision=289420
* Fix two bugs in HTTPS tunnelling:Dag-Erling Smørgrav2015-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 Notes: svn path=/head/; revision=289419
* Fix non-POSIX-compliant use of getaddrinfo in libfetchMichael Gmelin2015-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 Notes: svn path=/head/; revision=288217
* Remove unused variable to silence clang warning.Marcelo Araujo2015-07-041-4/+1
| | | | | | | | Differential Revision: D2683 Reviewed by: rodrigc, bapt Notes: svn path=/head/; revision=285141
* new dependsSimon J. Gerraty2015-06-161-1/+0
| | | | Notes: svn path=/head/; revision=284481
* Fix the following clang 3.7.0 warnings in lib/libfetch/http.c:Dimitry Andric2015-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 Notes: svn path=/head/; revision=284346
* Add META_MODE support.Simon J. Gerraty2015-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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-273-13/+5
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-192-14/+24
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-196-26/+77
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ \ \ Merge headSimon J. Gerraty2014-04-273-134/+85
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265006
| * \ \ \ \ Merge from headSimon J. Gerraty2013-09-055-28/+666
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | | | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | | | Sync with HEAD.David E. O'Brien2013-02-081-4/+4
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * | | | | | | Updated/new Makefile.dependSimon J. Gerraty2012-11-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242788
| * | | | | | | Sync from headSimon J. Gerraty2012-11-045-8/+37
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | | | | Remove defunct SSLv2 support from fetch(1) and fetch(3).Jung-uk Kim2015-03-252-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=280630
* | | | | | | | | Convert libraries to use LIBADDBaptiste Daroussin2014-11-251-4/+2
| |_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While here reduce a bit overlinking Notes: svn path=/head/; revision=275024
* | | | | | | | As pointed out by several people, r273114 was incorrect: it unconditionallyDag-Erling Smørgrav2014-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 Notes: svn path=/head/; revision=273124
* | | | | | | | Drop support for SSLv3.Dag-Erling Smørgrav2014-10-151-1/+1
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=273114
* | | | | | | Add a comment to explain the EAGAIN is only there for POSIX complianceBaptiste Daroussin2014-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resquested by: kib Reviewed by: des Notes: svn path=/head/; revision=268671
* | | | | | | Support EAGAIN in fetch_writevBaptiste Daroussin2014-07-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: des Approved by: des Notes: svn path=/head/; revision=268493
* | | | | | | Use Mt macro to properly format mailto links (patch from Franco Fichtner ↵Baptiste Daroussin2014-06-111-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <franco@lastsummer.de> for Dragonfly) Reviewed by: des Approved by: des Obtained from: Dragonfly MFC after: 1 week Notes: svn path=/head/; revision=267371
* | | | | | | Add support for arbitrary http requestsBaptiste Daroussin2014-06-053-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Alex Hornung <alex@alexhornung.com> Reviewed by: des Obtained from: Dragonfly MFC after: 3 week Notes: svn path=/head/; revision=267133
* | | | | | | Remove unnecessary semicolonsBaptiste Daroussin2014-06-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Sascha Wildner <saw@online.de> for Dragonfly Reviewed by: des Obtained from: Dragonfly MFC after: 1 week Notes: svn path=/head/; revision=267132
* | | | | | | Use NULL instead of 0Baptiste Daroussin2014-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Sascha Wildner <saw@online.de> for Dragonfly Reviewed by: des Obtained from: Dragonfly MFC after: 1 week Notes: svn path=/head/; revision=267131
* | | | | | | If HTTP_USER_AGENT is defined but empty, don't send User-Agent at all.Dag-Erling Smørgrav2014-06-052-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 184507 Submitted by: jbeich@tormail.org (with modifications) MFC after: 1 week Notes: svn path=/head/; revision=267127
* | | | | | | Look for root certificates in /usr/local/etc/ssl before /etc/ssl.Dag-Erling Smørgrav2014-05-171-2/+8
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFH: 1 week Notes: svn path=/head/; revision=266291
* | | | | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* | | | | Support Last-Modified behind proxies which return UTC instead of GMT.Bryan Drewery2014-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 Notes: svn path=/head/; revision=263021
* | | | | Bump copyright datesDag-Erling Smørgrav2014-01-303-3/+3
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=261284
* | | | | r261230 broke the cases where the amount of data to be read is notDag-Erling Smørgrav2014-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 Notes: svn path=/head/; revision=261263
* | | | | Solve http buffering issues and hangs once and for all (hopefully!) byDag-Erling Smørgrav2014-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 Notes: svn path=/head/; revision=261230
* | | | | Fix format string.Dag-Erling Smørgrav2014-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Jörg Sonnenberger <joerg@NetBSD.org> MFC after: 1 week Notes: svn path=/head/; revision=260904
* | | | | Fix build with GCCBryan Drewery2013-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 Notes: svn path=/head/; revision=258349
* | | | | 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