]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 years agombedtls: add support for cert and key blob options
Laurent Dufresne [Mon, 31 May 2021 18:52:05 +0000 (20:52 +0200)] 
mbedtls: add support for cert and key blob options

CURLOPT_SSLCERT_BLOB and CURLOPT_SSLKEY_BLOB weren't usable with
mbedtls backend, so the support was added.

Closes #7157

4 years agocmake: try well-known send/recv signature for Apple
Gregor Jasny [Mon, 31 May 2021 19:36:37 +0000 (21:36 +0200)] 
cmake: try well-known send/recv signature for Apple

The CMake `try_compile` command is especially slow for
the Xcode generator. With this patch applied it first tests
for the currently used (and Open Group specified) send/recv
signature. In case this fails testing falls-back to the
permutations.

speed-up:

```
time cmake .. -GNinja -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DCMAKE_USE_LIBSSH2=OFF
before: 11.64s user 11.09s system 55% cpu 40.754 total
after:   7.84s user 6.57s  system 51% cpu 28.074 total
```

```
time cmake .. -GXcode -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DCMAKE_USE_LIBSSH2=OFF
before: 217.07s user 104.15s system 60% cpu 8:51.79 total
after:  108.76s user  51.80s system 58% cpu 4:32.58 total
```

Closes #7158

4 years agohttp2: init recvbuf struct for pushed streams
Daniel Stenberg [Mon, 31 May 2021 13:30:31 +0000 (15:30 +0200)] 
http2: init recvbuf struct for pushed streams

Debug builds would warn that these structs were not initialized properly
for pushed streams.

Ref: #7148
Closes #7153

4 years agoCurl_ssl_getsessionid: fail if no session cache exists
Daniel Stenberg [Mon, 31 May 2021 13:29:03 +0000 (15:29 +0200)] 
Curl_ssl_getsessionid: fail if no session cache exists

This function might get called for an easy handle for which the session
cache hasn't been setup. It now just returns a "miss" in that case.

Reported-by: Christoph M. Becker
Fixes #7148
Closes #7153

4 years agoGOVERNANCE: add 'user', 'committer' and 'contributor'
Daniel Stenberg [Mon, 31 May 2021 07:38:12 +0000 (09:38 +0200)] 
GOVERNANCE: add 'user', 'committer' and 'contributor'

As those are commonly used terms in the project.

Closes #7151

4 years agoURL-SYNTAX.md: document the new 'localhost' treatment
Daniel Stenberg [Mon, 31 May 2021 06:33:44 +0000 (08:33 +0200)] 
URL-SYNTAX.md: document the new 'localhost' treatment

4 years agohostip: make 'localhost' return fixed values
Daniel Stenberg [Mon, 31 May 2021 06:33:44 +0000 (08:33 +0200)] 
hostip: make 'localhost' return fixed values

Resolving the case insensitive host name 'localhost' now returns the
addresses 127.0.0.1 and (if IPv6 is enabled) ::1 without using any
resolver.

This removes the risk that users accidentally resolves 'localhost' to
something else. By making sure 'localhost' is always local, we can
assume a "secure context" for such transfers (for cookies etc).

Closes #7039

4 years agodocs: fix typos
Daniel Gustafsson [Mon, 31 May 2021 10:47:15 +0000 (12:47 +0200)] 
docs: fix typos

4 years agohsts: ignore numberical IP address hosts
Daniel Stenberg [Sat, 29 May 2021 21:57:58 +0000 (23:57 +0200)] 
hsts: ignore numberical IP address hosts

Also, use a single function library-wide for detecting if a given hostname is
a numerical IP address.

Reported-by: Harry Sintonen
Fixes #7146
Closes #7149

4 years agotest178: adjust for hyper
Daniel Stenberg [Fri, 28 May 2021 21:46:03 +0000 (23:46 +0200)] 
test178: adjust for hyper

Hyper returns the same error for wrong HTTP version as for negative
content-length. Test 178 verifies that negative content-length is
rejected but the hyper backend will return a different error for it (and
without any helpful message telling why the message was bad). It will
also not return any headers at all for the response, not even the ones
that arrived before the error.

Closes #7147

4 years agoHYPER: remove mentions of deprecated development branch
Daniel Stenberg [Fri, 28 May 2021 21:06:19 +0000 (23:06 +0200)] 
HYPER: remove mentions of deprecated development branch

4 years agoc-hyper: handle NULL from hyper_buf_copy()
Daniel Stenberg [Fri, 28 May 2021 10:31:55 +0000 (12:31 +0200)] 
c-hyper: handle NULL from hyper_buf_copy()

Closes #7143

4 years agoHSTS: not experimental anymore
Daniel Stenberg [Fri, 28 May 2021 10:34:07 +0000 (12:34 +0200)] 
HSTS: not experimental anymore

4 years agoINSTALL: use correct extension for CURL-DISABLE.md
Douglas R. Reno [Thu, 27 May 2021 17:22:42 +0000 (12:22 -0500)] 
INSTALL: use correct extension for CURL-DISABLE.md

In INSTALL.MD, it's currently set to CURL-DISABLE-md instead of
CURL-DISABLE.md. This generates a 404 on the cURL website as well as
when viewing the docs through Github.

Closes #7142

4 years agotravis: run tests 1 - 153 with hyper
Daniel Stenberg [Thu, 27 May 2021 14:54:04 +0000 (16:54 +0200)] 
travis: run tests 1 - 153 with hyper

4 years agoc-hyper: convert HYPERE_INVALID_PEER_MESSAGE to CURLE_UNSUPPORTED_PROTOCOL
Daniel Stenberg [Thu, 27 May 2021 15:04:05 +0000 (17:04 +0200)] 
c-hyper: convert HYPERE_INVALID_PEER_MESSAGE to CURLE_UNSUPPORTED_PROTOCOL

Makes test 129 work (HTTP/1.2 response).

Closes #7141

4 years agohttp_proxy: deal with non-200 CONNECT response with Hyper
Daniel Stenberg [Thu, 27 May 2021 14:50:24 +0000 (16:50 +0200)] 
http_proxy: deal with non-200 CONNECT response with Hyper

Makes test 94 and 95 work

Closes #7141

4 years agoc-hyper: clear NTLM auth buffer when request is issued
Daniel Stenberg [Thu, 27 May 2021 08:19:50 +0000 (10:19 +0200)] 
c-hyper: clear NTLM auth buffer when request is issued

To prevent previous ones to get reused on subsequent requests. Matches
how the built-in HTTP code works. Makes test 90 to 93 work.

Add test 90 to 93 in travis.

Closes #7139

4 years agoschannel: set ALPN length correctly for HTTP/2
Joel Depooter [Thu, 27 May 2021 01:33:34 +0000 (18:33 -0700)] 
schannel: set ALPN length correctly for HTTP/2

In a3268eca792f1 this code was changed to use the ALPN_H2 constant
instead of the NGHTTP2_PROTO_ALPN constant. However, these constants are
not the same. The nghttp2 constant included the length of the string,
like this: "\x2h2". The ALPN_H2 constant is just "h2". Therefore we need
to re-add the length of the string to the ALPN buffer.

Closes #7138

4 years agotravis: run tests 1-89 in the hyper build
Daniel Stenberg [Wed, 26 May 2021 21:27:49 +0000 (23:27 +0200)] 
travis: run tests 1-89 in the hyper build

Closes #7137

4 years agoRevert "c-hyper: handle body on HYPER_TASK_EMPTY"
Daniel Stenberg [Wed, 26 May 2021 21:09:44 +0000 (23:09 +0200)] 
Revert "c-hyper: handle body on HYPER_TASK_EMPTY"

This reverts commit c3eefa95c31f55657f0af422e8268d738f689066.

Reported-by: Kevin Burke
Fixes #7122
Closes #7136

4 years agoccsidcurl: fix the compile errors
jonrumsey [Wed, 26 May 2021 16:03:32 +0000 (17:03 +0100)] 
ccsidcurl: fix the compile errors

Looks like the declaration of cpp shoule be const char ** and return
null if convert_version_info_string fails.

Fixes #7134
Closes #7135

4 years agodocs: use --max-redirs instead of --max-redir
Viktor Szakats [Wed, 26 May 2021 02:55:18 +0000 (02:55 +0000)] 
docs: use --max-redirs instead of --max-redir

For consistency.

Closes #7130

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 26 May 2021 12:47:35 +0000 (14:47 +0200)] 
RELEASE-NOTES: synced

... and bump to 7.77.1

4 years agotravis: add bearssl build
Michael Forney [Wed, 26 May 2021 07:16:19 +0000 (00:16 -0700)] 
travis: add bearssl build

Closes #7133

4 years agobearssl: explicitly initialize all fields of Curl_ssl
Michael Forney [Wed, 26 May 2021 07:43:46 +0000 (00:43 -0700)] 
bearssl: explicitly initialize all fields of Curl_ssl

Also, add comments like the other vtls backends.

Closes #7133

4 years agobearssl: remove incorrect const on variable that is modified
Michael Forney [Wed, 26 May 2021 06:42:07 +0000 (23:42 -0700)] 
bearssl: remove incorrect const on variable that is modified

hostname may be set to NULL later on in this function if it is an
IP address.

Closes #7133

4 years agoRELEASE-NOTES: synced curl-7_77_0
Daniel Stenberg [Mon, 24 May 2021 11:24:37 +0000 (13:24 +0200)] 
RELEASE-NOTES: synced

4 years agoTHANKS: added contributors from 7.77.0 cycle
Daniel Stenberg [Mon, 24 May 2021 11:26:17 +0000 (13:26 +0200)] 
THANKS: added contributors from 7.77.0 cycle

4 years agocopyright: update copyright year ranges to 2021
Daniel Stenberg [Thu, 20 May 2021 21:24:38 +0000 (23:24 +0200)] 
copyright: update copyright year ranges to 2021

4 years agohostip: fix broken macOS/CMake/GCC builds
Radek Zajic [Tue, 25 May 2021 20:19:05 +0000 (22:19 +0200)] 
hostip: fix broken macOS/CMake/GCC builds

Follow-up to 31f631a142d855f06

Fixes #7128
Closes #7129

4 years agoTODO: netrc caching and sharing
Daniel Stenberg [Tue, 25 May 2021 15:45:26 +0000 (17:45 +0200)] 
TODO: netrc caching and sharing

URL: https://curl.se/mail/archive-2021-05/0018.html

4 years agosetopt: streamline ssl option code
Orgad Shaneh [Mon, 24 May 2021 18:57:45 +0000 (21:57 +0300)] 
setopt: streamline ssl option code

Make it use the same style as the code next to it

Closes #7123

4 years agolib/hostip6.c: make NAT64 address synthesis on macOS work
Radek Zajic [Mon, 24 May 2021 14:38:40 +0000 (16:38 +0200)] 
lib/hostip6.c: make NAT64 address synthesis on macOS work

Closes #7121

4 years agosectransp: fix EXC_BAD_ACCESS caused by uninitialized buffer
ejanchivdorj [Tue, 25 May 2021 06:38:17 +0000 (23:38 -0700)] 
sectransp: fix EXC_BAD_ACCESS caused by uninitialized buffer

When the SecCertificateCopyCommonName function fails, it leaves
common_name in a invalid state so CFStringCompare uses the invalid
result, causing EXC_BAD_ACCESS.

The fix is to check the return value of the function before using the
name.

Closes #7126

4 years agoCMake: add CURL_ENABLE_EXPORT_TARGET option
PaweÅ‚ Wegner [Fri, 14 May 2021 10:36:12 +0000 (12:36 +0200)] 
CMake: add CURL_ENABLE_EXPORT_TARGET option

install(EXPORT ...) causes trouble when embedding curl dependencies
which don't provide install(EXPORT ...) targets (e.g libressl and
nghttp2) with cmake's add_subdirectory.

Reviewed-by: Jakub Zakrzewski
Closes #7060

4 years agoquiche: update for network path aware API
Alessandro Ghedini [Mon, 24 May 2021 12:20:36 +0000 (13:20 +0100)] 
quiche: update for network path aware API

Latest version of quiche requires the application to pass the peer
address of received packets, and it provides the address for outgoing
packets back.

Closes #7120

4 years agorustls: switch read_tls and write_tls to callbacks
Jacob Hoffman-Andrews [Sat, 15 May 2021 01:45:49 +0000 (18:45 -0700)] 
rustls: switch read_tls and write_tls to callbacks

And update to 0.6.0, including a rename from session to connection for
many fields.

Closes #7071

4 years agosectransp: fix 7f4a9a9b2a49 commit about missing comma
Koichi Shiraishi [Mon, 24 May 2021 11:26:44 +0000 (20:26 +0900)] 
sectransp: fix 7f4a9a9b2a49 commit about missing comma

Follow-up to 7f4a9a9b2a495

Closes #7119

4 years agoopenssl: associate/detach the transfer from connection
Harry Sintonen [Wed, 5 May 2021 11:42:26 +0000 (13:42 +0200)] 
openssl: associate/detach the transfer from connection

CVE-2021-22901

Bug: https://curl.se/docs/CVE-2021-22901.html

4 years agotelnet: check sscanf() for correct number of matches
Harry Sintonen [Fri, 7 May 2021 11:09:57 +0000 (13:09 +0200)] 
telnet: check sscanf() for correct number of matches

CVE-2021-22898

Bug: https://curl.se/docs/CVE-2021-22898.html

4 years agoschannel: don't use static to store selected ciphers
Daniel Stenberg [Fri, 23 Apr 2021 08:54:10 +0000 (10:54 +0200)] 
schannel: don't use static to store selected ciphers

CVE-2021-22897

Bug: https://curl.se/docs/CVE-2021-22897.html

4 years agodocs/tests: remove freenode references
Daniel Stenberg [Sun, 23 May 2021 22:21:00 +0000 (00:21 +0200)] 
docs/tests: remove freenode references

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 22 May 2021 22:15:53 +0000 (00:15 +0200)] 
RELEASE-NOTES: synced

4 years agoNSS: make colons, commas and spaces valid separators in cipher list
Sergey Markelov [Fri, 21 May 2021 23:44:15 +0000 (16:44 -0700)] 
NSS: make colons, commas and spaces valid separators in cipher list

Fixes #7110
Closes #7115

4 years agocurl: include libmetalink version in --version output
Daniel Stenberg [Fri, 21 May 2021 13:39:30 +0000 (15:39 +0200)] 
curl: include libmetalink version in --version output

Closes #7112

4 years agocmake: Use multithreaded compilation on VS 2008+
Matias N. Goldberg [Thu, 20 May 2021 18:11:57 +0000 (15:11 -0300)] 
cmake: Use multithreaded compilation on VS 2008+

Multithreaded compilation has been supported since at least VS 2005 and
been robustly stable since at least VS 2008

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

4 years agocmake: fix two invokes result in different curl_config.h
Matias N. Goldberg [Thu, 20 May 2021 00:23:01 +0000 (21:23 -0300)] 
cmake: fix two invokes result in different curl_config.h

Fixes #7100
Closes #7101

Reviewed-by: Jakub Zakrzewski
Signed-off-by: Matias N. Goldberg <dark_sylinc@yahoo.com.ar>
4 years agocmake: detect CURL_SA_FAMILY_T
Peng-Yu Chen [Thu, 20 May 2021 10:11:42 +0000 (11:11 +0100)] 
cmake: detect CURL_SA_FAMILY_T

Fixes #7049
Closes #7065

4 years agoCURLOPT_IPRESOLVE: preventing wrong IP version from being used
Lucas Clemente Vella [Sat, 24 Apr 2021 19:04:53 +0000 (20:04 +0100)] 
CURLOPT_IPRESOLVE: preventing wrong IP version from being used

In some situations, it was possible that a transfer was setup to
use an specific IP version, but due do DNS caching or connection
reuse, it ended up using a different IP version from requested.

This commit changes the effect of CURLOPT_IPRESOLVE from simply
restricting address resolution to preventing the wrong connection
type being used, when choosing a connection from the pool, and
to restricting what addresses could be used when establishing
a new connection.

It is important that all addresses versions are resolved, even if
not used in that transfer in particular, because the result is
cached, and could be useful for a different transfer with a
different CURLOPT_IPRESOLVE setting.

Closes #6853

4 years agoAmigaOS: add functions definitions for SHA256
Oliver Urbann [Thu, 20 May 2021 08:34:43 +0000 (10:34 +0200)] 
AmigaOS: add functions definitions for SHA256

AmiSSL replaces many functions with macros. Curl requires pointer
to some of these functions. Thus, we have to encapsulate these macros:
SHA256_Init, SHA256_Update, SHA256_Final, X509_INFO_free.

Bug: https://github.com/jens-maus/amissl/issues/15
Co-authored-by: Daniel Stenberg <daniel@haxx.se>
Closes #7099

4 years agotest2100: make it run with and require IPv6
Daniel Stenberg [Mon, 17 May 2021 12:29:19 +0000 (14:29 +0200)] 
test2100: make it run with and require IPv6

Closes #7083

4 years agotests/getpart: generate output URL encoded for better diffs
Daniel Stenberg [Wed, 19 May 2021 07:37:01 +0000 (09:37 +0200)] 
tests/getpart: generate output URL encoded for better diffs

Closes #7083

4 years agodocs/TheArtOfHttpScripting: fix markdown links
Ryan Beck-Buysse [Wed, 19 May 2021 00:56:31 +0000 (19:56 -0500)] 
docs/TheArtOfHttpScripting: fix markdown links

extra parens cause the links to be incorrectly formatted
and inconsistent with the rest of the document.

Signed-off-by: Ryan Beck-Buysse <rbuysse@gmail.com>
Closes #7097

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 18 May 2021 22:50:14 +0000 (00:50 +0200)] 
RELEASE-NOTES: synced

4 years agodocs: replace dots with dashes in markdown enums
Emil Engler [Tue, 18 May 2021 16:55:55 +0000 (18:55 +0200)] 
docs: replace dots with dashes in markdown enums

We use dashes instead of dots nearly everywhere except for those few
cases. This commit addresses this issues and brings more coherency into
it.

Closes #7093

4 years agodocs: improve INTERNALS.md regarding getsock cb
Emil Engler [Tue, 18 May 2021 16:35:23 +0000 (18:35 +0200)] 
docs: improve INTERNALS.md regarding getsock cb

This adds the I/O prefix to indicate that those "actions" are kind-of
related to those found in select(2) or poll(2) (reading/writing).

It also adds a note where the prototypes of those functions can be found
in the source code.

Closes #7092

4 years agodocs: document attach in INTERNALS.md
Emil Engler [Tue, 18 May 2021 16:05:54 +0000 (18:05 +0200)] 
docs: document attach in INTERNALS.md

The new field in the Curl_handler struct still lacks documentation. This
adds it it from the information extracted from lib/urldata.h:797

Closes #7091

4 years agoconfig: remove now-unused macros
Marc Aldorasi [Tue, 18 May 2021 17:35:00 +0000 (13:35 -0400)] 
config: remove now-unused macros

Closes #7094

4 years agohostip.h: remove declaration of unimplemented function
Marc Aldorasi [Tue, 18 May 2021 17:19:08 +0000 (13:19 -0400)] 
hostip.h: remove declaration of unimplemented function

Closes #7094

4 years agoh3: add 'attach' callback to protocol handlers
Daniel Stenberg [Tue, 18 May 2021 14:21:08 +0000 (16:21 +0200)] 
h3: add 'attach' callback to protocol handlers

Follow-up to 0c55fbab45be

Reviewed-by: Emil Engler
Closes #7090

4 years agowolfssl: remove SSLv3 support leftovers
Daniel Stenberg [Tue, 18 May 2021 08:05:36 +0000 (10:05 +0200)] 
wolfssl: remove SSLv3 support leftovers

Closes #7088

4 years agocurl-wolfssl.m4: without custom include path, assume /usr/include
Daniel Stenberg [Tue, 18 May 2021 07:55:02 +0000 (09:55 +0200)] 
curl-wolfssl.m4: without custom include path, assume /usr/include

... so that we can point out the root of the OpenSSL emulation headers.
Previously this used the '$includedir' variable which is wrong since
that defaults to the dir where the current configure invoke will install
the built libcurl headers: /usr/local by default.

Fixes #7085
Reported-by: Joel Jakobsson
Closes #7087

4 years agodata_pending: check only SECONDARY socket for FTP(S) transfers
Joel Depooter [Fri, 14 May 2021 21:44:07 +0000 (14:44 -0700)] 
data_pending: check only SECONDARY socket for FTP(S) transfers

Check the FIRST for all other protocols.

This fixes a timeout in an ftps download. The server sends a TLS
close_notify message in the same packet as the file data. The
close_notify seems to not be handled in the schannel_recv function, so
libcurl is not aware that the server has closed the connection. Thus
libcurl ends up waiting for action on the socket until a timeout is
reached. With the secondary socket check added to the data_pending
function, the close_notify is properly handled, and the ftps transfer
terminates as expected.

Fixes #7068
Closes #7069

4 years agogithub: inhibit deprecated declarations for clang on macOS
Daniel Stenberg [Mon, 17 May 2021 11:20:54 +0000 (13:20 +0200)] 
github: inhibit deprecated declarations for clang on macOS

... as they otherwise cause ldap build errors in the CI.

Fixes #7081
Closes #7082

4 years agoconn: add 'attach' to protocol handler, make libssh2 use it
Daniel Stenberg [Mon, 17 May 2021 06:54:00 +0000 (08:54 +0200)] 
conn: add 'attach' to protocol handler, make libssh2 use it

The libssh2 backend has SSH session associated with the connection but
the callback context is the easy handle, so when a connection gets
attached to a transfer, the protocol handler now allows for a custom
function to get used to set things up correctly.

Reported-by: Michael O'Farrell
Fixes #6898
Closes #7078

4 years agohttp2: make sure pause is done on HTTP
Daniel Stenberg [Mon, 17 May 2021 07:05:39 +0000 (09:05 +0200)] 
http2: make sure pause is done on HTTP

Since the function is called for any protocol, we can't assume that the
HTTP struct is there without first making sure it is HTTP.

Reported-by: Denis Goleshchikhin
Fixes #7079
Closes #7080

4 years agodocs: cookies from HTTP headers need domain set
Daniel Stenberg [Sun, 16 May 2021 21:38:35 +0000 (23:38 +0200)] 
docs: cookies from HTTP headers need domain set

... or the cookies won't get sent. Push users to using the "Netscape"
format instead, which curl uses when saving a cookie "jar".

Reported-by: Martin Dorey
Reviewed-by: Daniel Gustafsson
Fixes #6723
Closes #7077

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 16 May 2021 21:25:25 +0000 (23:25 +0200)] 
RELEASE-NOTES: synced

4 years agogithub: add a workflow with libssh2 on macOS using cmake
Daniel Stenberg [Tue, 11 May 2021 12:37:37 +0000 (14:37 +0200)] 
github: add a workflow with libssh2 on macOS using cmake

Closes #7047

4 years agosws: allow HTTP requests up to 2MB in size
Daniel Stenberg [Sat, 15 May 2021 21:59:29 +0000 (23:59 +0200)] 
sws: allow HTTP requests up to 2MB in size

To allow tests with slightly larger payloads. Like #7071 ...

Closes #7075

4 years agoCI/azure: increase verbosity and fix outdated task names
Marc Hoersken [Sat, 15 May 2021 18:55:42 +0000 (20:55 +0200)] 
CI/azure: increase verbosity and fix outdated task names

Closes #7063

4 years agoCI/cirrus: add shared and static Windows release builds
Marc Hoersken [Sat, 15 May 2021 18:54:57 +0000 (20:54 +0200)] 
CI/cirrus: add shared and static Windows release builds

Azure Pipelines is currently being used for debug builds,
let's also run some non-debug (release) Windows builds and
make use of previously underutilized Cirrus CI for that.

Reviewed-by: Marcel Raad
Closes #6991

4 years agoCURLOPT_CAPATH.3: defaults to a path, not NULL
Daniel Stenberg [Fri, 14 May 2021 15:08:19 +0000 (17:08 +0200)] 
CURLOPT_CAPATH.3: defaults to a path, not NULL

Reported-by: Andrew Barnert
Closes #7062

4 years agoc-hyper: handle body on HYPER_TASK_EMPTY
Jacob Hoffman-Andrews [Sat, 15 May 2021 03:52:17 +0000 (20:52 -0700)] 
c-hyper: handle body on HYPER_TASK_EMPTY

Some of the time, we get a HYPER_TASK_EMPTY response before the status
line, headers, and body have been read. Previously, that would cause us
to poll again, leading to a 1 second timeout.

The HYPER_TASK_EMPTY docs say:

   The value of this task is null (does not imply an error).

So, if we receive a HYPER_TASK_EMPTY, continue on with processing the
response.

Reported-by: Kevin Burke
Fixes #7064
Closes #7070

4 years agotool_getparam: fix comment typo in tool_getparam.c
Ikko Ashimine [Sat, 15 May 2021 16:43:07 +0000 (01:43 +0900)] 
tool_getparam: fix comment typo in tool_getparam.c

enfore -> enforce

Closes #7074

4 years agomem-include-scan.pl: require a non-word letter before memory funcs
Daniel Stenberg [Fri, 14 May 2021 21:11:00 +0000 (23:11 +0200)] 
mem-include-scan.pl: require a non-word letter before memory funcs

... so that ldap_memfree() for example doesn't match the scan for free.

Closes #7061

4 years agoversion: free the openldap info correctly
Daniel Stenberg [Fri, 14 May 2021 14:22:28 +0000 (16:22 +0200)] 
version: free the openldap info correctly

... to avoid memory leaks.

Follow-up to: bf0feae7768d9
Closes #7061

4 years agodupset: remove totally off comment
Daniel Stenberg [Fri, 14 May 2021 22:36:05 +0000 (00:36 +0200)] 
dupset: remove totally off comment

Closes #7067

4 years agoconfigure: if asked for, fail if ldap is not found
Daniel Stenberg [Wed, 12 May 2021 09:15:51 +0000 (11:15 +0200)] 
configure: if asked for, fail if ldap is not found

Reported-by: Jakub Zakrzewski
Fixes #7053
Closes #7055

4 years agoversion: add OpenLDAP version in the output
Daniel Stenberg [Wed, 12 May 2021 09:09:12 +0000 (11:09 +0200)] 
version: add OpenLDAP version in the output

Assisted-by: Howard Chu
Closes #7054

4 years agoschannel: Ensure the security context request flags are always set
Joel Depooter [Wed, 12 May 2021 02:45:59 +0000 (19:45 -0700)] 
schannel: Ensure the security context request flags are always set

As of commit 54e7475, these flags would only be set when using a new
credential handle. When re-using an existing credential handle, the
flags would not be set.

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

4 years agotests: Fix some tag matching issues in a number of tests
Dan Fandrich [Wed, 12 May 2021 08:15:31 +0000 (01:15 -0700)] 
tests: Fix some tag matching issues in a number of tests

4 years agosasl: use 'unsigned short' to store mechanism
Daniel Stenberg [Tue, 11 May 2021 09:11:40 +0000 (11:11 +0200)] 
sasl: use 'unsigned short' to store mechanism

... saves a few bytes of struct size in memory and it only uses
10 bits anyway.

Closes #7045

4 years agohostip: remove the debug code for LocalHost
Daniel Stenberg [Tue, 11 May 2021 07:49:31 +0000 (09:49 +0200)] 
hostip: remove the debug code for LocalHost

The Curl_resolv() had special code (when built in debug mode) for when
resolving the host name "LocalHost" (using that exact casing). It would
then get the host name from the --interface option instead.

This development-only feature was not used by anything (anymore) and we
have the --resolve feature if we want to play similar tricks properly
going forward.

Closes #7044

4 years agoprogress: reset limit_size variables at transfer start
Daniel Stenberg [Tue, 11 May 2021 07:09:11 +0000 (09:09 +0200)] 
progress: reset limit_size variables at transfer start

Otherwise the old value would linger from a previous use and would mess
up the network speed cap logic.

Reported-by: Ymir1711 on github
Fixes #7042
Closes #7043

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 11 May 2021 07:00:57 +0000 (09:00 +0200)] 
RELEASE-NOTES: synced

4 years agocookies: use CURLcode for cookie_output reporting
Daniel Gustafsson [Mon, 15 Mar 2021 02:08:31 +0000 (03:08 +0100)] 
cookies: use CURLcode for cookie_output reporting

Writing the cookie file has multiple error conditions, and was using an
int with magic numbers to report the different error (which in turn were
disregarded anyways). This moves reporting to use a CURLcode value.

Lightly-touched-by: Daniel Stenberg
Closes #7037
Closes #6749

4 years agocookies: make use of string duplication function
Daniel Gustafsson [Fri, 12 Mar 2021 16:36:08 +0000 (17:36 +0100)] 
cookies: make use of string duplication function

strstore() is defined as a strdup which ensures to free the target
pointer before duping the source char * into it. Make use of it in
two more cases where it can simplify the code.

4 years agocookies: refactor comments
Daniel Gustafsson [Fri, 12 Mar 2021 16:20:28 +0000 (17:20 +0100)] 
cookies: refactor comments

Comments in the cookie code were a bit all over the place in terms of
style and wording. This takes a stab at cleaning them up by keeping to
a single style and overall shape. Some comments are moved a little and
some removed alltogether due to being redundant. No functional changes
have been made,

4 years agohttp2: skip immediate parsing of payload following protocol switch
Peng-Yu Chen [Mon, 10 May 2021 22:05:36 +0000 (23:05 +0100)] 
http2: skip immediate parsing of payload following protocol switch

This is considered not harmful as a following http2_recv shall be
called very soon.

This is considered helpful in the specific situation where some
servers (e.g. nghttpx v1.43.0) may fulfill stream 1 immediately
following the return of HTTP status 101, other than waiting for
the client-side connection preface to arrive.

Fixes #7036
Closes #7040

4 years agohttp2: use nghttp2_session_upgrade2 instead of nghttp2_session_upgrade
Peng-Yu Chen [Mon, 10 May 2021 22:50:27 +0000 (23:50 +0100)] 
http2: use nghttp2_session_upgrade2 instead of nghttp2_session_upgrade

Following the upstream deprecation of nghttp2_session_upgrade.

Also provides further checks for requests with the HEAD method.

Closes #7041

4 years agoprogress/trspeed: use a local convenient pointer to beautify code
Daniel Stenberg [Sat, 8 May 2021 11:14:42 +0000 (13:14 +0200)] 
progress/trspeed: use a local convenient pointer to beautify code

The function becomes easier to read and understand with less repetition.

4 years agotrspeed: use long double for transfer speed calculation
Daniel Stenberg [Sat, 8 May 2021 11:10:06 +0000 (13:10 +0200)] 
trspeed: use long double for transfer speed calculation

4 years agoprogress: move transfer speed calc into function
Daniel Stenberg [Sat, 8 May 2021 10:28:38 +0000 (12:28 +0200)] 
progress: move transfer speed calc into function

This silences two scan-build-11 warnings: "The result of the '/'
expression is undefined"

Bug: https://curl.se/mail/lib-2021-05/0022.html
Closes #7035

4 years agoopenssl: remove unneeded cast for CertOpenSystemStore()
Cameron Cawley [Thu, 6 May 2021 16:50:31 +0000 (17:50 +0100)] 
openssl: remove unneeded cast for CertOpenSystemStore()

Closes #7025

4 years agotravis: disable the libssh build
Daniel Stenberg [Sat, 8 May 2021 09:10:22 +0000 (11:10 +0200)] 
travis: disable the libssh build

It can't run on focal and causes warnings on bionic. Since the focal
failure started rather suddenly a while ago, we can suspect it might be
temporary.

Added "bring back the build" to the TODO document.

Fixes #7011
Closes #7012

4 years agohttp: use calculated offsets inst of integer literals for header parsing
Peng-Yu Chen [Fri, 7 May 2021 23:35:45 +0000 (00:35 +0100)] 
http: use calculated offsets inst of integer literals for header parsing

Assumed to be a minor coding style improvement with no behavior change.

A modern compiler is expected to have the calculation optimized during
compilation. It may be deemed okay even if that's not the case, since
the added overhead is considered very low.

Closes #7032

4 years agoGIT-INFO: suggest using autoreconf instead of buildconf
Peng-Yu Chen [Sat, 8 May 2021 01:20:29 +0000 (02:20 +0100)] 
GIT-INFO: suggest using autoreconf instead of buildconf

Follow-up to 85868537d

Closes #7033

4 years agohttp: deal with partial CONNECT sends
Daniel Stenberg [Thu, 6 May 2021 11:04:03 +0000 (13:04 +0200)] 
http: deal with partial CONNECT sends

Also added 'CURL_SMALLSENDS' to make Curl_write() send short packets,
which helped verifying this even more.

Add test 363 to verify.

Reported-by: ustcqidi on github
Fixes #6950
Closes #7024