]> granicus.if.org Git - curl/log
curl
7 years agovtls: encapsulate SSL backend-specific data
Johannes Schindelin [Fri, 28 Jul 2017 20:09:35 +0000 (22:09 +0200)]
vtls: encapsulate SSL backend-specific data

So far, all of the SSL backends' private data has been declared as
part of the ssl_connect_data struct, in one big #if .. #elif .. #endif
block.

This can only work as long as the SSL backend is a compile-time option,
something we want to change in the next commits.

Therefore, let's encapsulate the exact data needed by each SSL backend
into a private struct, and let's avoid bleeding any SSL backend-specific
information into urldata.h. This is also necessary to allow multiple SSL
backends to be compiled in at the same time, as e.g. OpenSSL's and
CyaSSL's headers cannot be included in the same .c file.

To avoid too many malloc() calls, we simply append the private structs
to the connectdata struct in allocate_conn().

This requires us to take extra care of alignment issues: struct fields
often need to be aligned on certain boundaries e.g. 32-bit values need to
be stored at addresses that divide evenly by 4 (= 32 bit / 8
bit-per-byte).

We do that by assuming that no SSL backend's private data contains any
fields that need to be aligned on boundaries larger than `long long`
(typically 64-bit) would need. Under this assumption, we simply add a
dummy field of type `long long` to the `struct connectdata` struct. This
field will never be accessed but acts as a placeholder for the four
instances of ssl_backend_data instead. the size of each ssl_backend_data
struct is stored in the SSL backend-specific metadata, to allow
allocate_conn() to know how much extra space to allocate, and how to
initialize the ssl[sockindex]->backend and proxy_ssl[sockindex]->backend
pointers.

This would appear to be a little complicated at first, but is really
necessary to encapsulate the private data of each SSL backend correctly.
And we need to encapsulate thusly if we ever want to allow selecting
CyaSSL and OpenSSL at runtime, as their headers cannot be included within
the same .c file (there are just too many conflicting definitions and
declarations for that).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: prepare the SSL backends for encapsulated private data
Johannes Schindelin [Wed, 21 Jun 2017 10:41:18 +0000 (12:41 +0200)]
vtls: prepare the SSL backends for encapsulated private data

At the moment, cURL's SSL backend needs to be configured at build time.
As such, it is totally okay for them to hard-code their backend-specific
data in the ssl_connect_data struct.

In preparation for making the SSL backend a runtime option, let's make
the access of said private data a bit more abstract so that it can be
adjusted later in an easy manner.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agourldata.h: move SSPI-specific #include to correct location
Johannes Schindelin [Sun, 30 Jul 2017 21:19:19 +0000 (23:19 +0200)]
urldata.h: move SSPI-specific #include to correct location

In 86b889485 (sasl_gssapi: Added GSS-API based Kerberos V5 variables,
2014-12-03), an SSPI-specific field was added to the kerberos5data
struct without moving the #include "curl_sspi.h" later in the same file.

This broke the build when SSPI was enabled, unless Secure Channel was
used as SSL backend, because it just so happens that Secure Channel also
requires "curl_sspi.h" to be #included.

In f4739f639 (urldata: include curl_sspi.h when Windows SSPI is enabled,
2017-02-21), this bug was fixed incorrectly: Instead of moving the
appropriate conditional #include, the Secure Channel-conditional part
was now also SSPI-conditional.

Fix this problem by moving the correct #include instead.

This is also required for an upcoming patch that moves all the Secure
Channel-specific stuff out of urldata.h and encapsulates it properly in
vtls/schannel.c instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agourldata.h: remove support for obsolete PolarSSL version
Johannes Schindelin [Fri, 28 Jul 2017 20:49:13 +0000 (22:49 +0200)]
urldata.h: remove support for obsolete PolarSSL version

Since 5017d5ada (polarssl: now require 1.3.0+, 2014-03-17), we require
a newer PolarSSL version. No need to keep code trying to support any
older version.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agogetinfo: access SSL internals via Curl_ssl
Johannes Schindelin [Fri, 23 Jun 2017 14:05:26 +0000 (16:05 +0200)]
getinfo: access SSL internals via Curl_ssl

In the ongoing endeavor to abstract out all SSL backend-specific
functionality, this is the next step: Instead of hard-coding how the
different SSL backends access their internal data in getinfo.c, let's
implement backend-specific functions to do that task.

This will also allow for switching SSL backends as a runtime option.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: move SSL backends' private constants out of their header files
Johannes Schindelin [Mon, 26 Jun 2017 15:05:49 +0000 (17:05 +0200)]
vtls: move SSL backends' private constants out of their header files

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agoaxtls: use Curl_none_* versions of init() and cleanup()
Johannes Schindelin [Tue, 20 Jun 2017 09:32:53 +0000 (11:32 +0200)]
axtls: use Curl_none_* versions of init() and cleanup()

There are convenient no-op versions of the init/cleanup functions now,
no need to define private ones for axTLS.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: remove obsolete declarations of SSL backend functionality
Johannes Schindelin [Fri, 23 Jun 2017 11:19:00 +0000 (13:19 +0200)]
vtls: remove obsolete declarations of SSL backend functionality

These functions are all available via the Curl_ssl struct now, no need
to declare them separately anymore.

As the global declarations are removed, the corresponding function
definitions are marked as file-local. The only two exceptions here are
Curl_mbedtls_shutdown() and Curl_polarssl_shutdown(): only the
declarations were removed, there are no function definitions to mark
file-local.

Please note that Curl_nss_force_init() is *still* declared globally, as
the only SSL backend-specific function, because it was introduced
specifically for the use case where cURL was compiled with
`--without-ssl --with-nss`. For details, see f3b77e561 (http_ntlm: add
support for NSS, 2010-06-27).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agoschannel: reorder functions topologically
Johannes Schindelin [Sun, 25 Jun 2017 10:44:26 +0000 (12:44 +0200)]
schannel: reorder functions topologically

The _shutdown() function calls the _session_free() function; While this
is not a problem now (because schannel.h declares both functions), a
patch looming in the immediate future with make all of these functions
file-local.

So let's just move the _session_free() function's definition before it
is called.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agoaxtls: reorder functions topologically
Johannes Schindelin [Sun, 25 Jun 2017 10:44:26 +0000 (12:44 +0200)]
axtls: reorder functions topologically

The connect_finish() function (like many other functions after it) calls
the Curl_axtls_close() function; While this is not a problem now
(because axtls.h declares the latter function), a patch looming in the
immediate future with make all of these functions file-local.

So let's just move the Curl_axtls_close() function's definition before
it is called.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: move the SUPPORT_HTTPS_PROXY flag into the Curl_ssl struct
Johannes Schindelin [Mon, 26 Jun 2017 16:05:38 +0000 (18:05 +0200)]
vtls: move the SUPPORT_HTTPS_PROXY flag into the Curl_ssl struct

That will allow us to choose the SSL backend at runtime.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: convert the have_curlssl_* constants to runtime flags
Johannes Schindelin [Tue, 20 Jun 2017 09:32:53 +0000 (11:32 +0200)]
vtls: convert the have_curlssl_* constants to runtime flags

The entire idea of introducing the Curl_ssl struct to describe SSL
backends is to prepare for choosing the SSL backend at runtime.

To that end, convert all the #ifdef have_curlssl_* style conditionals
to use bit flags instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: move sha256sum into the Curl_ssl struct
Johannes Schindelin [Thu, 22 Jun 2017 23:04:56 +0000 (01:04 +0200)]
vtls: move sha256sum into the Curl_ssl struct

The SHA-256 checksumming is also an SSL backend-specific function.
Let's include it in the struct declaring the functionality of SSL
backends.

In contrast to MD5, there is no fall-back code. To indicate this, the
respective entries are NULL for those backends that offer no support for
SHA-256 checksumming.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: move md5sum into the Curl_ssl struct
Johannes Schindelin [Thu, 22 Jun 2017 23:04:56 +0000 (01:04 +0200)]
vtls: move md5sum into the Curl_ssl struct

The MD5 summing is also an SSL backend-specific function. So let's
include it, offering the previous fall-back code as a separate function
now: Curl_none_md5sum(). To allow for that, the signature had to be
changed so that an error could be returned from the implementation
(Curl_none_md5sum() can run out of memory).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: use the Curl_ssl struct to access all SSL backends' functionality
Johannes Schindelin [Thu, 22 Jun 2017 22:22:47 +0000 (00:22 +0200)]
vtls: use the Curl_ssl struct to access all SSL backends' functionality

This is the first step to unify the SSL backend handling. Now all the
SSL backend-specific functionality is accessed via a global instance of
the Curl_ssl struct.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: declare Curl_ssl structs for every SSL backend
Johannes Schindelin [Thu, 22 Jun 2017 14:45:34 +0000 (16:45 +0200)]
vtls: declare Curl_ssl structs for every SSL backend

The idea of introducing the Curl_ssl struct was to unify how the SSL
backends are declared and called. To this end, we now provide an
instance of the Curl_ssl struct for each and every SSL backend.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: introduce a new struct for SSL backends
Johannes Schindelin [Thu, 22 Jun 2017 14:36:03 +0000 (16:36 +0200)]
vtls: introduce a new struct for SSL backends

This new struct is similar in nature to Curl_handler: it will define the
functions and capabilities of all the SSL backends (where Curl_handler
defines the functions and capabilities of protocol handlers).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: make sure every _sha256sum()'s first arg is const
Johannes Schindelin [Sun, 25 Jun 2017 11:06:54 +0000 (13:06 +0200)]
vtls: make sure every _sha256sum()'s first arg is const

This patch makes the signature of the _sha256sum() functions consistent
among the SSL backends, in preparation for unifying the way all SSL
backends are accessed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: make sure all _data_pending() functions return bool
Johannes Schindelin [Sun, 25 Jun 2017 11:06:54 +0000 (13:06 +0200)]
vtls: make sure all _data_pending() functions return bool

This patch makes the signature of the _data_pending() functions
consistent among the SSL backends, in preparation for unifying the way
all SSL backends are accessed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: make sure all _cleanup() functions return void
Johannes Schindelin [Sun, 25 Jun 2017 11:06:54 +0000 (13:06 +0200)]
vtls: make sure all _cleanup() functions return void

This patch makes the signature of the _cleanup() functions consistent
among the SSL backends, in preparation for unifying the way all SSL
backends are accessed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agovtls: use consistent signature for _random() implementations
Johannes Schindelin [Thu, 22 Jun 2017 21:48:03 +0000 (23:48 +0200)]
vtls: use consistent signature for _random() implementations

This will make the upcoming multissl backend much easier to implement.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agostrtooff: fix build for systems with long long but no strtoll option
Daniel Stenberg [Fri, 25 Aug 2017 09:09:46 +0000 (11:09 +0200)]
strtooff: fix build for systems with long long but no strtoll option

Closes #1829

Reported-by: Dan Fandrich
Bug: https://github.com/curl/curl/pull/1758#issuecomment-324861615

7 years agodarwinssl: handle long strings in TLS certs
Daniel Stenberg [Fri, 25 Aug 2017 14:56:03 +0000 (16:56 +0200)]
darwinssl: handle long strings in TLS certs

... as the previous fixed length 128 bytes buffer was sometimes too
small.

Fixes #1823
Closes #1831

Reported-by: Benjamin Sergeant
Assisted-by: Bill Pyne, Ray Satiro, Nick Zitzmann
7 years agosystem.h: include sys/poll.h for AIX
Daniel Stenberg [Fri, 25 Aug 2017 21:42:38 +0000 (23:42 +0200)]
system.h: include sys/poll.h for AIX

... to get the event/revent defines that might be used for the poll
struct.

Reported-by: Michael Smith
Fixes #1828
Closes #1833

7 years agotests: Make sure libtests & unittests call curl_global_cleanup()
Dan Fandrich [Sat, 26 Aug 2017 20:01:42 +0000 (22:01 +0200)]
tests: Make sure libtests & unittests call curl_global_cleanup()

These were missed in commit c468c27b.

7 years agowinbuild: fix embedded manifest option
theantigod [Sat, 26 Aug 2017 06:25:23 +0000 (02:25 -0400)]
winbuild: fix embedded manifest option

Embedded manifest option didn't work due to incorrect path.

Fixes https://github.com/curl/curl/issues/1832

7 years agofuzz/Makefile.am: remove curlbuild.h leftovers
Daniel Stenberg [Fri, 25 Aug 2017 09:01:07 +0000 (11:01 +0200)]
fuzz/Makefile.am: remove curlbuild.h leftovers

7 years agoexamples/threaded-ssl: mention that this is for openssl before 1.1
Daniel Stenberg [Fri, 25 Aug 2017 06:15:59 +0000 (08:15 +0200)]
examples/threaded-ssl: mention that this is for openssl before 1.1

7 years agoimap: use defined names for response codes
Daniel Stenberg [Thu, 24 Aug 2017 11:39:07 +0000 (13:39 +0200)]
imap: use defined names for response codes

When working on this code I found the previous setup a bit weird while
using proper defines increases readability.

Closes #1824

7 years agoCURLOPT_USERPWD.3: see also CURLOPT_PROXYUSERPWD
Daniel Stenberg [Thu, 24 Aug 2017 08:09:28 +0000 (10:09 +0200)]
CURLOPT_USERPWD.3: see also CURLOPT_PROXYUSERPWD

7 years agoimap: support PREAUTH
Daniel Stenberg [Tue, 22 Aug 2017 22:08:18 +0000 (00:08 +0200)]
imap: support PREAUTH

It is a defined possible greeting at server startup that means the
connection is already authenticated. See
https://tools.ietf.org/html/rfc3501#section-7.1.4

Test 846 added to verify.

Fixes #1818
Closes #1820

7 years agoconfig-tpf: define SIZEOF_LONG
Jay Satiro [Wed, 23 Aug 2017 07:17:10 +0000 (03:17 -0400)]
config-tpf: define SIZEOF_LONG

Recent changes that replaced CURL_SIZEOF_LONG in the source with
SIZEOF_LONG broke builds that use the premade configuration files and
don't have SIZEOF_LONG defined.

Bug: https://github.com/curl/curl/issues/1816

7 years agotest1453: Fixed <features>
Dan Fandrich [Wed, 23 Aug 2017 07:03:13 +0000 (09:03 +0200)]
test1453: Fixed <features>

7 years agoconfig-dos: add missing defines, SIZEOF_* and two others
Gisle Vanem [Tue, 22 Aug 2017 21:34:47 +0000 (23:34 +0200)]
config-dos: add missing defines, SIZEOF_* and two others

Bug: #1816

7 years agocurl: shorten and clean up CA cert verification error message
Daniel Stenberg [Tue, 22 Aug 2017 07:07:11 +0000 (09:07 +0200)]
curl: shorten and clean up CA cert verification error message

The previous message was just too long for ordinary people and it was
encouraging users to use `--insecure` a little too easy.

Based-on-work-by: Frank Denis
Closes #1810
Closes #1817

7 years agorequest-target.d: mention added in 7.55.0
Daniel Stenberg [Tue, 22 Aug 2017 12:48:33 +0000 (14:48 +0200)]
request-target.d: mention added in 7.55.0

7 years agotool_main: turn off MinGW CRT's globbing
Marcel Raad [Mon, 21 Aug 2017 19:35:46 +0000 (21:35 +0200)]
tool_main: turn off MinGW CRT's globbing

By default, the MinGW CRT globs command-line arguments. This prevents
getting a single asterisk into an argument as test 1299 does. Turn off
globbing by setting the global variable _CRT_glob to 0 for MinGW.

Fixes https://github.com/curl/curl/issues/1751
Closes https://github.com/curl/curl/pull/1813

7 years agomakefile.m32: add support for libidn2
Viktor Szakats [Tue, 22 Aug 2017 07:13:20 +0000 (07:13 +0000)]
makefile.m32: add support for libidn2

libidn was replaced with libidn2 last year in configure.
Caveat: libidn2 may depend on a list of further libs.
These can be manually specified via CURL_LDFLAG_EXTRAS.

Closes https://github.com/curl/curl/pull/1815

7 years agoconfig-win32: define SIZEOF_LONG
Viktor Szakats [Mon, 21 Aug 2017 22:14:33 +0000 (22:14 +0000)]
config-win32: define SIZEOF_LONG

Recent changes that replaced CURL_SIZEOF_LONG in the source with
SIZEOF_LONG broke builds that use the premade configuration files and
don't have SIZEOF_LONG defined.

Closes https://github.com/curl/curl/pull/1814

7 years agocmake: enable picky compiler options with clang and gcc
Daniel Stenberg [Thu, 17 Aug 2017 13:55:38 +0000 (15:55 +0200)]
cmake: enable picky compiler options with clang and gcc

closes #1799

7 years agocurl/system.h: fix build for hppa
Daniel Stenberg [Sun, 20 Aug 2017 19:11:48 +0000 (21:11 +0200)]
curl/system.h: fix build for hppa

Reported-by: John David Anglin
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=872502#10

7 years agotftp: fix memory leak on too long filename
Even Rouault [Sat, 19 Aug 2017 14:33:32 +0000 (16:33 +0200)]
tftp: fix memory leak on too long filename

Fixes

$ valgrind --leak-check=full ~/install-curl-git/bin/curl tftp://localhost/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz

==9752== Memcheck, a memory error detector
==9752== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==9752== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==9752== Command: /home/even/install-curl-git/bin/curl tftp://localhost/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
==9752==
curl: (71) TFTP file name too long

==9752==
==9752== HEAP SUMMARY:
==9752== 505 bytes in 1 blocks are definitely lost in loss record 11 of 11
==9752==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9752==    by 0x4E61CED: Curl_urldecode (in /home/even/install-curl-git/lib/libcurl.so.4.4.0)
==9752==    by 0x4E75868: tftp_state_machine (in /home/even/install-curl-git/lib/libcurl.so.4.4.0)
==9752==    by 0x4E761B6: tftp_do (in /home/even/install-curl-git/lib/libcurl.so.4.4.0)
==9752==    by 0x4E711B6: multi_runsingle (in /home/even/install-curl-git/lib/libcurl.so.4.4.0)
==9752==    by 0x4E71D00: curl_multi_perform (in /home/even/install-curl-git/lib/libcurl.so.4.4.0)
==9752==    by 0x4E6950D: curl_easy_perform (in /home/even/install-curl-git/lib/libcurl.so.4.4.0)
==9752==    by 0x40E0B7: operate_do (in /home/even/install-curl-git/bin/curl)
==9752==    by 0x40E849: operate (in /home/even/install-curl-git/bin/curl)
==9752==    by 0x402693: main (in /home/even/install-curl-git/bin/curl)

Fixes https://oss-fuzz.com/v2/testcase-detail/5232311106797568
Credit to OSS Fuzz

Closes #1808

7 years agoruntests: fixed case insensitive matching of keywords
Dan Fandrich [Sat, 19 Aug 2017 20:07:15 +0000 (22:07 +0200)]
runtests: fixed case insensitive matching of keywords

Commit 5c2aac71 didn't work in the case of mixed-case keywords given on
the command-line.

7 years agotests: Make sure libtests call curl_global_cleanup()
Dan Fandrich [Sat, 19 Aug 2017 19:27:38 +0000 (21:27 +0200)]
tests: Make sure libtests call curl_global_cleanup()

This ensures that global data allocations are freed so Valgrind stays
happy. This was a problem with at least PolarSSL and mbedTLS.

7 years agoRELEASE-NOTES: synced with 8baead425
Daniel Stenberg [Fri, 18 Aug 2017 21:30:40 +0000 (23:30 +0200)]
RELEASE-NOTES: synced with 8baead425

7 years agoscripts/contri*sh: use "git log --use-mailmap"
Daniel Stenberg [Fri, 18 Aug 2017 20:41:48 +0000 (22:41 +0200)]
scripts/contri*sh: use "git log --use-mailmap"

7 years agomailmap: de-duplify some git authors
Daniel Stenberg [Fri, 18 Aug 2017 15:49:20 +0000 (17:49 +0200)]
mailmap: de-duplify some git authors

7 years agohttp2_recv: return error better on fatal h2 errors
Daniel Stenberg [Fri, 18 Aug 2017 14:29:55 +0000 (16:29 +0200)]
http2_recv: return error better on fatal h2 errors

Ref #1012
Figured-out-by: Tatsuhiro Tsujikawa
7 years agoKNOWN_BUGS: HTTP test server 'connection-monitor' problems
Daniel Stenberg [Fri, 18 Aug 2017 14:04:55 +0000 (16:04 +0200)]
KNOWN_BUGS: HTTP test server 'connection-monitor' problems

Closes #868

7 years agocurl/system.h: check for __ppc__ as well
Daniel Stenberg [Thu, 17 Aug 2017 12:39:39 +0000 (14:39 +0200)]
curl/system.h: check for __ppc__ as well

... regression since issue #1774 (commit 10b3df10596a) since obviously
some older gcc doesn't know __powerpc__ while some newer doesn't know
__ppc__ ...

Fixes #1797
Closes #1798
Reported-by: Ryan Schmidt
7 years agohttp: Don't wait on CONNECT when there is no proxy
Jan Alexander Steffens (heftig) [Fri, 18 Aug 2017 08:43:02 +0000 (10:43 +0200)]
http: Don't wait on CONNECT when there is no proxy

Since curl 7.55.0, NetworkManager almost always failed its connectivity
check by timeout. I bisected this to 5113ad04 (http-proxy: do the HTTP
CONNECT process entirely non-blocking).

This patch replaces !Curl_connect_complete with Curl_connect_ongoing,
which returns false if the CONNECT state was left uninitialized and lets
the connection continue.

Closes #1803
Fixes #1804

Also-fixed-by: Gergely Nagy
7 years agometalink: adjust source code style
Johannes Schindelin [Fri, 18 Aug 2017 05:58:16 +0000 (07:58 +0200)]
metalink: adjust source code style

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agoCURL_SIZEOF_LONG: removed, use only SIZEOF_LONG
Daniel Stenberg [Wed, 16 Aug 2017 08:25:49 +0000 (10:25 +0200)]
CURL_SIZEOF_LONG: removed, use only SIZEOF_LONG

7 years agolib557: no longer use CURL_SIZEOF_* defines
Daniel Stenberg [Sat, 12 Aug 2017 13:54:06 +0000 (15:54 +0200)]
lib557: no longer use CURL_SIZEOF_* defines

7 years agoconfig-win32: define SIZEOF_CURL_OFF_T
Daniel Stenberg [Sat, 12 Aug 2017 13:54:06 +0000 (15:54 +0200)]
config-win32: define SIZEOF_CURL_OFF_T

7 years agocmake: sizeof curl_off_t, remove unused detections
Daniel Stenberg [Sat, 12 Aug 2017 13:54:06 +0000 (15:54 +0200)]
cmake: sizeof curl_off_t, remove unused detections

7 years agosystem.h: remove all CURL_SIZEOF_* defines
Daniel Stenberg [Sat, 12 Aug 2017 13:54:06 +0000 (15:54 +0200)]
system.h: remove all CURL_SIZEOF_* defines

... as they're not used externally and internally we check for the sizes
already in configure etc.

Closes #1767

7 years agoftp: fix CWD when doing multicwd then nocwd on same connection
Daniel Stenberg [Tue, 15 Aug 2017 16:48:04 +0000 (18:48 +0200)]
ftp: fix CWD when doing multicwd then nocwd on same connection

Fixes #1782
Closes #1787
Reported-by: Peter Lamare
7 years agoCURLOPT_SSH_COMPRESSION.3: enable with 1L
Daniel Stenberg [Thu, 17 Aug 2017 07:52:13 +0000 (09:52 +0200)]
CURLOPT_SSH_COMPRESSION.3: enable with 1L

(leaves other values reserved for the future)

7 years agocompressed-ssh.d: "Added: 7.56.0"
Daniel Stenberg [Thu, 17 Aug 2017 07:49:33 +0000 (09:49 +0200)]
compressed-ssh.d: "Added: 7.56.0"

7 years agocurl/system.h: checksrc compliance
Daniel Stenberg [Thu, 17 Aug 2017 07:38:41 +0000 (09:38 +0200)]
curl/system.h: checksrc compliance

7 years agossh: add the ability to enable compression (for SCP/SFTP)
Viktor Szakats [Sat, 5 Aug 2017 09:26:04 +0000 (09:26 +0000)]
ssh: add the ability to enable compression (for SCP/SFTP)

The required low-level logic was already available as part of
`libssh2` (via `LIBSSH2_FLAG_COMPRESS` `libssh2_session_flag()`[1]
option.)

This patch adds the new `libcurl` option `CURLOPT_SSH_COMPRESSION`
(boolean) and the new `curl` command-line option `--compressed-ssh`
to request this `libssh2` feature. To have compression enabled, it
is required that the SSH server supports a (zlib) compatible
compression method and that `libssh2` was built with `zlib` support
enabled.

[1] https://www.libssh2.org/libssh2_session_flag.html

Ref: https://github.com/curl/curl/issues/1732
Closes https://github.com/curl/curl/pull/1735

7 years agoexamples/ftpuploadresume: checksrc compliance
Jay Satiro [Wed, 16 Aug 2017 18:44:50 +0000 (14:44 -0400)]
examples/ftpuploadresume: checksrc compliance

7 years agohttp_proxy: fix build error for CURL_DOES_CONVERSIONS
Maksim Stsepanenka [Wed, 16 Aug 2017 15:33:33 +0000 (18:33 +0300)]
http_proxy: fix build error for CURL_DOES_CONVERSIONS

Closes https://github.com/curl/curl/pull/1793

7 years agoconfigure: check for __builtin_available() availability (#1788)
Nick Zitzmann [Wed, 16 Aug 2017 17:24:39 +0000 (12:24 -0500)]
configure: check for __builtin_available() availability (#1788)

This change does two things:
1. It un-breaks the build in Xcode 9.0. (Xcode 9.0 is currently
   failing trying to compile connectx() in lib/connect.c.)
2. It finally weak-links the connectx() function, and falls back on
   connect() when run on older operating systems.

7 years agotravis: add metalink to some osx builds
Daniel Stenberg [Wed, 16 Aug 2017 09:37:07 +0000 (11:37 +0200)]
travis: add metalink to some osx builds

Closes #1790

7 years agocoverage: Use two coveralls commands to get lib/vtls results
Max Dymond [Wed, 9 Aug 2017 12:34:41 +0000 (13:34 +0100)]
coverage: Use two coveralls commands to get lib/vtls results

closes #1747

7 years agodarwinssi: fix error: variable length array used
Daniel Stenberg [Wed, 16 Aug 2017 05:58:44 +0000 (07:58 +0200)]
darwinssi: fix error: variable length array used

7 years agom4/curl-compilers.m4: use proper quotes around string, not backticks
Daniel Stenberg [Tue, 15 Aug 2017 22:03:54 +0000 (00:03 +0200)]
m4/curl-compilers.m4: use proper quotes around string, not backticks

... when setting clang version to assume 3.7

Caused a lot of "integer expression expected" warnings by configure.

7 years agocmake: remove dead code for DISABLED_THREADSAFE
Benbuck Nason [Tue, 15 Aug 2017 15:25:36 +0000 (08:25 -0700)]
cmake: remove dead code for DISABLED_THREADSAFE

Closes #1786

7 years agocurl-confopts.m4: fix --disable-threaded-resolver
Jakub Zakrzewski [Tue, 15 Aug 2017 17:21:33 +0000 (13:21 -0400)]
curl-confopts.m4: fix --disable-threaded-resolver

Closes https://github.com/curl/curl/issues/1784

7 years agoprogress: Track total times following redirects
Ryan Winograd [Wed, 21 Jun 2017 17:15:46 +0000 (12:15 -0500)]
progress: Track total times following redirects

Update the progress timers `t_nslookup`, `t_connect`, `t_appconnect`,
`t_pretransfer`, and `t_starttransfer` to track the total times for
these activities when a redirect is followed. Previously, only the times
for the most recent request would be tracked.

Related changes:

  - Rename `Curl_pgrsResetTimesSizes` to `Curl_pgrsResetTransferSizes`
    now that the function only resets transfer sizes and no longer
    modifies any of the progress timers.

  - Add a bool to the `Progress` struct that is used to prevent
    double-counting `t_starttransfer` times.

Added test case 1399.

Fixes #522 and Known Bug 1.8
Closes #1602
Reported-by: joshhe on github
7 years agocmake: remove dead code for CURL_DISABLE_RTMP
Benbuck Nason [Tue, 15 Aug 2017 15:20:49 +0000 (08:20 -0700)]
cmake: remove dead code for CURL_DISABLE_RTMP

Closes #1785

7 years agozsh.pl: produce a working completion script again
Kamil Dudka [Mon, 14 Aug 2017 14:13:32 +0000 (16:13 +0200)]
zsh.pl: produce a working completion script again

Commit curl-7_54_0-118-g8b2f22e changed the output format of curl --help
to use <file> and <dir> instead of FILE and DIR, which caused zsh.pl to
produce a broken completion script:

% curl --<TAB>
_curl:10: no such file or directory: seconds

Closes #1779

7 years agocurlver: toward 7.56.0?
Daniel Stenberg [Tue, 15 Aug 2017 07:20:33 +0000 (09:20 +0200)]
curlver: toward 7.56.0?

7 years agoRELEASE-NOTES: synced with 91c46dc44
Daniel Stenberg [Tue, 15 Aug 2017 07:20:21 +0000 (09:20 +0200)]
RELEASE-NOTES: synced with 91c46dc44

7 years agotest1449: FTP download range with an too large size
Daniel Stenberg [Mon, 14 Aug 2017 21:33:23 +0000 (23:33 +0200)]
test1449: FTP download range with an too large size

7 years agostrtoofft: reduce integer overflow risks globally
Daniel Stenberg [Mon, 14 Aug 2017 21:33:23 +0000 (23:33 +0200)]
strtoofft: reduce integer overflow risks globally

... make sure we bail out on overflows.

Reported-by: Brian Carpenter
Closes #1758

7 years agotravis: build the examples too
Daniel Stenberg [Mon, 14 Aug 2017 12:05:08 +0000 (14:05 +0200)]
travis: build the examples too

to make sure they keep building warning-free

Closes #1777

7 years agoruntests: match keywords case insensitively
Daniel Stenberg [Mon, 14 Aug 2017 21:05:11 +0000 (23:05 +0200)]
runtests: match keywords case insensitively

7 years agoexamples/ftpuploadresume.c: use portable code
Daniel Stenberg [Mon, 14 Aug 2017 12:00:56 +0000 (14:00 +0200)]
examples/ftpuploadresume.c: use portable code

... converted from the MS specific _snscanf()

7 years agoRELEASE-NOTES/THANKS: curl 7.55.1 release time curl-7_55_1
Daniel Stenberg [Sun, 13 Aug 2017 16:22:06 +0000 (18:22 +0200)]
RELEASE-NOTES/THANKS: curl 7.55.1 release time

7 years agogitignore: ignore .xz now instead of .lzma
Daniel Stenberg [Sun, 13 Aug 2017 16:11:44 +0000 (18:11 +0200)]
gitignore: ignore .xz now instead of .lzma

7 years agocmake: Threads detection update. ref: #1702
Sergei Nikulov [Tue, 1 Aug 2017 17:40:29 +0000 (20:40 +0300)]
cmake: Threads detection update. ref: #1702

Closes #1719

7 years agoipv6_scope: support unique local addresses
Daniel Stenberg [Sun, 13 Aug 2017 15:51:52 +0000 (17:51 +0200)]
ipv6_scope: support unique local addresses

Fixes #1764
Closes #1773
Reported-by: James Slaughter
7 years agocurl/system.h: GCC doesn't define __ppc__ on PowerPC, uses __powerpc__
Alex Potapenko [Sun, 13 Aug 2017 12:11:12 +0000 (15:11 +0300)]
curl/system.h: GCC doesn't define __ppc__ on PowerPC, uses __powerpc__

Closes #1774

7 years agotest1448: verify redirect to IDN using URL
Daniel Stenberg [Sat, 12 Aug 2017 22:02:49 +0000 (00:02 +0200)]
test1448: verify redirect to IDN using URL

Closes #1772

7 years agoredirect: skip URL encoding for host names
Salah-Eddin Shaban [Sat, 12 Aug 2017 22:02:49 +0000 (00:02 +0200)]
redirect: skip URL encoding for host names

This fixes redirects to IDN URLs

Fixes #1441
Closes #1762
Reported by: David Lord

7 years agotest2032: mark as flaky (again)
Daniel Stenberg [Sat, 12 Aug 2017 22:00:39 +0000 (00:00 +0200)]
test2032: mark as flaky (again)

7 years agotravis: test cmake build on tarball too
Daniel Stenberg [Thu, 10 Aug 2017 11:27:17 +0000 (13:27 +0200)]
travis: test cmake build on tarball too

Could've prevented #1755

7 years agocmake: allow user to override CMAKE_DEBUG_POSTFIX
Simon Warta [Fri, 11 Aug 2017 12:52:43 +0000 (14:52 +0200)]
cmake: allow user to override CMAKE_DEBUG_POSTFIX

Closes #1763

7 years agoconnect-to.d: better language
Daniel Stenberg [Sat, 12 Aug 2017 15:36:12 +0000 (17:36 +0200)]
connect-to.d: better language

7 years agoconnect-to.d: clarified
Daniel Stenberg [Sat, 12 Aug 2017 15:32:33 +0000 (17:32 +0200)]
connect-to.d: clarified

7 years agobagder/Curl_tvdiff_us: fix the math
Daniel Stenberg [Sat, 12 Aug 2017 13:34:59 +0000 (15:34 +0200)]
bagder/Curl_tvdiff_us: fix the math

Regression since adef394ac5 (released in 7.55.0)

Reported-by: Han Qiao
Fixes #1769
Closes #1771

7 years agocurl/system.h: add Oracle Solaris Studio
Daniel Stenberg [Fri, 11 Aug 2017 21:40:27 +0000 (23:40 +0200)]
curl/system.h: add Oracle Solaris Studio

Fixes #1752

7 years agodocs: fix typo funtion -> function
Alessandro Ghedini [Sat, 12 Aug 2017 12:37:50 +0000 (13:37 +0100)]
docs: fix typo funtion -> function

Closes #1770

7 years agodocs: fix grammar in CURL_SSLVERSION_MAX_DEFAULT description
Alessandro Ghedini [Sat, 12 Aug 2017 12:36:24 +0000 (13:36 +0100)]
docs: fix grammar in CURL_SSLVERSION_MAX_DEFAULT description

7 years agodocs: fix typo stuct -> struct
Alessandro Ghedini [Sat, 12 Aug 2017 12:33:10 +0000 (13:33 +0100)]
docs: fix typo stuct -> struct

7 years agotest1447: require a curl with http support
Dan Fandrich [Sat, 12 Aug 2017 10:52:37 +0000 (12:52 +0200)]
test1447: require a curl with http support

7 years agocurl/system.h: support more architectures
Thomas Petazzoni [Fri, 11 Aug 2017 16:52:37 +0000 (18:52 +0200)]
curl/system.h: support more architectures

The long list of architectures in include/curl/system.h is annoying to
maintain, and needs to be extended for each and every architecture to
support.

Instead, let's rely on the __SIZEOF_LONG__ define of the gcc compiler
(we are in the GNUC condition anyway), which tells us if long is 4
bytes or 8 bytes.

This fixes the build of libcurl 7.55.0 on architectures such as
OpenRISC or ARC.

Closes #1766

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>