Commit Graph

22784 Commits

Author SHA1 Message Date
Orgad Shaneh 9f78b05443
connect.c: remove executable bit on file
Closes #2071
2017-11-12 10:51:46 +01:00
hsiao yi dab7debe2a
README.md: fixed layout
Closes #2069
2017-11-12 00:07:38 +01:00
Daniel Stenberg aa7668b948
setopt: split out curl_easy_setopt() to its own file
... to make url.c smaller.

Closes #1944
2017-11-10 23:08:20 +01:00
John Starks 2e850dafa5 cmake: Add missing setmode check
Ensure HAVE_SETMODE is set to 1 on OSes that have setmode. Without this,
curl will corrupt binary files when writing them to stdout on Windows.

Closes https://github.com/curl/curl/pull/2067
2017-11-10 15:38:23 -05:00
Daniel Stenberg 3619ee5feb
curl_share_setopt: va_end was not called if conncache errors
CID 984459, detected by Coverity
2017-11-10 15:02:11 +01:00
John Starks 2671f5f7cf cmake: Correctly include curl.rc in Windows builds (#2064)
Update CMakeLists.txt to add curl.rc to the correct list.
2017-11-10 13:58:10 +03:00
Daniel Stenberg f405133ad5
RELEASE-NOTES: synced with 32828cc4f 2017-11-09 23:19:45 +01:00
Luca Boccassi 32828cc4fb
--interface: add support for Linux VRF
The --interface command (CURLOPT_INTERFACE option) already uses
SO_BINDTODEVICE on Linux, but it tries to parse it as an interface or IP
address first, which fails in case the user passes a VRF.

Try to use the socket option immediately and parse it as a fallback
instead.  Update the documentation to mention this feature, and that it
requires the binary to be ran by root or with CAP_NET_RAW capabilities
for this to work.

Closes #2024
2017-11-09 13:20:11 +01:00
Daniel Stenberg b78dce2526
curl_share_setopt.3: document CURL_LOCK_DATA_CONNECT
Closes #2043
2017-11-09 11:08:18 +01:00
Daniel Stenberg 3d1280866a
examples: add shared-connection-cache 2017-11-09 11:07:44 +01:00
Daniel Stenberg edd1f45c9f
test1554: verify connection cache sharing 2017-11-09 11:07:44 +01:00
Daniel Stenberg 67c55a26d5
share: add support for sharing the connection cache 2017-11-09 11:07:44 +01:00
Daniel Stenberg e871ab56ed
imap: deal with commands case insensitively
As documented in RFC 3501 section 9:
https://tools.ietf.org/html/rfc3501#section-9

Closes #2061
2017-11-09 10:36:47 +01:00
Daniel Stenberg 6b12beb25a
connect: store IPv6 connection status after valid connection
... previously it would store it already in the happy eyeballs stage
which could lead to the IPv6 bit being set for an IPv4 connection,
leading to curl not wanting to do EPSV=>PASV for FTP transfers.

Closes #2053
2017-11-09 07:59:04 +01:00
Daniel Stenberg 63b8fbbbc0
curl_multi_fdset.3: emphasize curl_multi_timeout
... even when there's no socket to wait for, the timeout can still be
very short.
2017-11-09 07:52:19 +01:00
Jay Satiro fa64b0fc4b content_encoding: fix inflate_stream for no bytes available
- Don't call zlib's inflate() when avail_in stream bytes is 0.

This is a follow up to the parent commit 19e66e5. Prior to that change
libcurl's inflate_stream could call zlib's inflate even when no bytes
were available, causing inflate to return Z_BUF_ERROR, and then
inflate_stream would treat that as a hard error and return
CURLE_BAD_CONTENT_ENCODING.

According to the zlib FAQ, Z_BUF_ERROR is not fatal.

This bug would happen randomly since packet sizes are arbitrary. A test
of 10,000 transfers had 55 fail (ie 0.55%).

Ref: https://zlib.net/zlib_faq.html#faq05

Closes https://github.com/curl/curl/pull/2060
2017-11-09 01:36:50 -05:00
Patrick Monnerat 19e66e5362 content_encoding: do not write 0 length data 2017-11-07 02:38:34 +01:00
Daniel Stenberg 6e6bf60357
fnmatch: remove dead code
There was a duplicate check for backslashes in the setcharset()
function.

Coverity CID 1420611
2017-11-06 09:01:53 +01:00
Daniel Stenberg cbb22cb76d
url: remove unncessary NULL-check
Since 'conn' won't be NULL in there and we also access the pointer in
there without the check.

Coverity CID 1420610
2017-11-06 08:23:11 +01:00
Viktor Szakats 3962a3cfcb src/Makefile.m32: fix typo in brotli lib customization
Ref cc1f443609
2017-11-06 01:05:52 +00:00
Viktor Szakats cc1f443609 Makefile.m32: allow to customize brotli libs
It adds the ability to link against static brotli libs.

Also fix brotli include path.
2017-11-05 23:02:05 +00:00
Patrick Monnerat c675c40295 travis: add a job with brotli enabled 2017-11-05 15:38:17 +01:00
Viktor Szakats 609aa62f53 Makefile.m32: add brotli support 2017-11-05 15:32:43 +01:00
Patrick Monnerat 11bf1796cd HTTP: implement Brotli content encoding
This uses the brotli external library (https://github.com/google/brotli).
Brotli becomes a feature: additional curl_version_info() bit and
structure fields are provided for it and CURLVERSION_NOW bumped.

Tests 314 and 315 check Brotli content unencoding with correct and
erroneous data.

Some tests are updated to accomodate with the now configuration dependent
parameters of the Accept-Encoding header.
2017-11-05 15:28:16 +01:00
Patrick Monnerat dbcced8e32 HTTP: support multiple Content-Encodings
This is implemented as an output streaming stack of unencoders, the last
calling the client write procedure.

New test 230 checks this feature.

Bug: https://github.com/curl/curl/pull/2002
Reported-By: Daniel Bankhead
2017-11-05 15:09:48 +01:00
Jay Satiro 462f3cac34 url: remove arg value check from CURLOPT_SSH_AUTH_TYPES
Since CURLSSH_AUTH_ANY (aka CURLSSH_AUTH_DEFAULT) is ~0 an arg value
check on this option is incorrect; we have to accept any value.

Prior to this change since f121575 (7.56.1+) CURLOPT_SSH_AUTH_TYPES
erroneously rejected CURLSSH_AUTH_ANY with CURLE_BAD_FUNCTION_ARGUMENT.

Bug: https://github.com/curl/curl/commit/f121575#commitcomment-25347120
2017-11-04 18:36:07 -04:00
Daniel Stenberg 685ef13057 ntlm: avoid malloc(0) for zero length passwords
It triggers an assert() when built with memdebug since malloc(0) may
return NULL *or* a valid pointer.

Detected by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4054

Assisted-by: Max Dymond
Closes #2054
2017-11-04 22:22:49 +01:00
Daniel Stenberg d2146c598a RELEASE-NOTES: synced with ee8016b3d 2017-11-04 22:03:18 +01:00
Daniel Stenberg ee8016b3de curl: speed up handling of many URLs
By properly keeping track of the last entry in the list of URLs/uploads
to handle, curl now avoids many meaningless traverses of the list which
speeds up many-URL handling *MASSIVELY* (several magnitudes on 100K
URLs).

Added test 1291, to verify that it doesn't take ages - but we don't have
any detection of "too slow" command in the test suite.

Reported-by: arainchik on github
Fixes #1959
Closes #2052
2017-11-04 20:56:26 +01:00
Daniel Stenberg 90abb74ff0 curl: pass through [] in URLs instead of calling globbing error
Assisted-by: Per Lundberg
Fixes #2044
Closes #2046
Closes #2048
2017-11-04 10:23:27 +01:00
Daniel Stenberg 921bf1de52 CURLOPT_INFILESIZE: accept -1
Regression since f121575

Reported-by: Petr Voytsik
Fixes #2047
2017-11-03 14:40:19 +01:00
Jay Satiro b51e0742b9 url: fix CURLOPT_DNS_CACHE_TIMEOUT arg value check to allow -1
Prior to this change since f121575 (7.56.1+) CURLOPT_DNS_CACHE_TIMEOUT
erroneously rejected -1 with CURLE_BAD_FUNCTION_ARGUMENT.
2017-11-02 00:30:28 -04:00
Dan Fandrich 544bfdebea http2: Fixed OOM handling in upgrade request
This caused the torture tests on test 1800 to fail.
2017-11-01 14:37:01 +01:00
Dan Fandrich 591f5d18cf tests: Fixed torture tests on tests 556 and 650
Test cleanup after OOM wasn't being consistently performed.
2017-11-01 14:37:01 +01:00
Daniel Stenberg 25cb41d35d CURLOPT_MAXREDIRS: allow -1 as a value
... which is valid according to documentation. Regression since
f121575c0b.

Verified now in test 501.

Reported-by: cbartl on github
Fixes #2038
Closes #2039
2017-11-01 11:56:19 +01:00
Daniel Stenberg cda89c8b58 include: remove conncache.h inclusion from where its not needed 2017-11-01 10:06:32 +01:00
Jay Satiro b8bd6dc110 url: fix CURLOPT_POSTFIELDSIZE arg value check to allow -1
.. also add same arg value check to CURLOPT_POSTFIELDSIZE_LARGE.

Prior to this change since f121575 (7.56.1+) CURLOPT_POSTFIELDSIZE
erroneously rejected -1 value with CURLE_BAD_FUNCTION_ARGUMENT.

Bug: https://curl.haxx.se/mail/lib-2017-11/0000.html
Reported-by: Andrew Lambert
2017-11-01 02:11:30 -04:00
Daniel Stenberg fa394c8c2e cookie: avoid NULL dereference
... when expiring old cookies.

Reported-by: Pavel Gushchin
Fixes #2032
Closes #2035
2017-10-31 09:16:03 +01:00
Marcel Raad 52d9a11c1c
memdebug: use send/recv signature for curl_dosend/curl_dorecv
This avoids build errors and warnings caused by implicit casts.

Closes https://github.com/curl/curl/pull/2031
2017-10-30 21:27:59 +01:00
Juro Bystricky 6089aa53e4 mkhelp.pl: support reproducible build
Do not generate line with the current date, such as:

* Generation time: Tue Oct-24 18:01:41 2017

This will improve reproducibility. The generated string is only
part of a comment, so there should be no adverse consequences.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>

closes #2026
2017-10-30 19:27:49 +01:00
Dan Fandrich 89116e3422 runtests.pl: Fixed typo in message 2017-10-30 16:56:42 +01:00
Daniel Stenberg a7b99d58a8 curlx: the timeval functions are no longer provided as curlx_*
Pointed-out-by: Dmitri Tikhonov
Bug: #2034
2017-10-30 16:41:44 +01:00
Daniel Stenberg f2003295a0 select: update comments
s/curlx_tvnow/Curl_now
2017-10-30 16:40:28 +01:00
Daniel Stenberg 647f9aea68 INTERNALS: remove curlx_tv* functions no longer provided 2017-10-30 15:30:01 +01:00
Dmitri Tikhonov d531f33ba2 timeval: use mach time on MacOS
If clock_gettime() is not supported, use mach_absolute_time() on MacOS.

closes #2033
2017-10-30 15:27:46 +01:00
Patrick Monnerat e240a546a7 cli tool: improve ";type=" handling in -F option arguments 2017-10-29 16:23:06 +01:00
Patrick Monnerat f82f952d2f cli tool: in -F option arg, comma is a delimiter for files only
Also upgrade test 1133 to cover this case and clarify man page about
form data quoting.

Bug: https://github.com/curl/curl/issues/2022
Reported-By: omau on github
2017-10-29 16:23:06 +01:00
Daniel Stenberg 7ee59512f8
timeleft: made two more users of Curl_timeleft use timediff_t 2017-10-29 13:13:23 +01:00
Jakub Zakrzewski 1cb4f5d6e8 cmake: Export libcurl and curl targets to use by other cmake projects
The config files define curl and libcurl targets as imported targets
CURL::curl and CURL::libcurl. For backward compatibility with CMake-
provided find-module the CURL_INCLUDE_DIRS and CURL_LIBRARIES are
also set.

Closes #1879
2017-10-28 17:22:47 +02:00
Daniel Stenberg 58a9e770e3
RELEASE-NOTES: synced with f20cbac97 2017-10-28 16:49:27 +02:00