]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agocurl_ctype: convert to macros-only
Daniel Stenberg [Mon, 5 Sep 2022 10:15:21 +0000 (12:15 +0200)] 
curl_ctype: convert to macros-only

This no longer provide functions, only macros. Runs faster and produces
smaller output.

The biggest precaution this change brings:

DO NOT use post/pre-increments when passing arguments to the macros.

Closes #9429

2 years agomisc: ISSPACE() => ISBLANK()
Daniel Stenberg [Mon, 5 Sep 2022 21:21:15 +0000 (23:21 +0200)] 
misc: ISSPACE() => ISBLANK()

Instances of ISSPACE() use that should rather use ISBLANK(). I think
somewhat carelessly used because it sounds as if it checks for space or
whitespace, but also includes %0a to %0d.

For parsing purposes, we should only accept what we must and not be
overly liberal. It leads to surprises and surprises lead to bad things.

Closes #9432

2 years agoctype: remove all use of <ctype.h>, use our own versions
Daniel Stenberg [Mon, 5 Sep 2022 22:17:36 +0000 (00:17 +0200)] 
ctype: remove all use of <ctype.h>, use our own versions

Except in the test servers.

Closes #9433

2 years agocmake: skip superfluous hex2dec conversion using math expr
Marc Hoersken [Thu, 1 Sep 2022 17:50:29 +0000 (19:50 +0200)] 
cmake: skip superfluous hex2dec conversion using math expr

CMake seems to be able to compare two hex values just fine.
Also make sure CURL_TARGET_WINDOWS_VERSION is respected.

Assisted-by: Marcel Raad
Reviewed-by: Viktor Szakats
Reported-by: Keitagit-kun on github
Follow up to #9312
Fixes #9406
Closes #9411

2 years agocurl_easy_pause.3: unpausing is as fast as possible
Daniel Stenberg [Mon, 5 Sep 2022 13:52:28 +0000 (15:52 +0200)] 
curl_easy_pause.3: unpausing is as fast as possible

Reported-by: ssdbest on github
Fixes #9410
Closes #9430

2 years agoCURLOPT_DNS_INTERFACE.3: mention it works for almost all protocols
Daniel Stenberg [Mon, 5 Sep 2022 05:43:54 +0000 (07:43 +0200)] 
CURLOPT_DNS_INTERFACE.3: mention it works for almost all protocols

Except file.

Reported-by: ProceduralMan on github
Fixes #9427
Closes #9428

2 years agoNPN: remove support for and use of
Daniel Stenberg [Thu, 1 Sep 2022 07:23:22 +0000 (09:23 +0200)] 
NPN: remove support for and use of

Next Protocol Negotiation is a TLS extension that was created and used
for agreeing to use the SPDY protocol (the precursor to HTTP/2) for
HTTPS. In the early days of HTTP/2, before the spec was finalized and
shipped, the protocol could be enabled using this extension with some
servers.

curl supports the NPN extension with some TLS backends since then, with
a command line option `--npn` and in libcurl with
`CURLOPT_SSL_ENABLE_NPN`.

HTTP/2 proper is made to use the ALPN (Application-Layer Protocol
Negotiation) extension and the NPN extension has no purposes
anymore. The HTTP/2 spec was published in May 2015.

Today, use of NPN in the wild should be extremely rare and most likely
totally extinct. Chrome removed NPN support in Chrome 51, shipped in
June 2016. Removed in Firefox 53, April 2017.

Closes #9307

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 4 Sep 2022 21:13:34 +0000 (23:13 +0200)] 
RELEASE-NOTES: synced

and bump the tentative next release version to 7.85.1

2 years agoconfigure: fail if '--without-ssl' + explicit parameter for an ssl lib
Samuel Henrique [Thu, 1 Sep 2022 21:32:49 +0000 (22:32 +0100)] 
configure: fail if '--without-ssl' + explicit parameter for an ssl lib

A side effect of a previous change to configure (576e507c78bdd2ec88)
exposed a non-critical issue that can happen if configure is called with
both '--without-ssl' and some parameter setting the use of a ssl library
(e.g. --with-gnutls). The configure script would end up assuming this is
a MultiSSL build, due to the way the case statement is written.

I have changed the order of the variables in the string concatenation
for the case statement and also tweaked the options so that
--without-ssl never turns the build into a MultiSSL one and also clearly
stating that there are conflicting parameters if the user sets it like
described above.

Closes #9414

2 years agotests/certs/scripts: insert standard curl source headers
Daniel Stenberg [Fri, 2 Sep 2022 12:24:25 +0000 (14:24 +0200)] 
tests/certs/scripts: insert standard curl source headers

... including the SPDX-License-Identifier.

These omissions were not detected by the RUEUSE CI job nor the copyright.pl
scanners because we have a general wildcard in .reuse/dep5 for
"tests/certs/*".

Reported-by: Samuel Henrique
Fixes #9417
Closes #9420

2 years agodocs: remove mentions of deprecated '--without-openssl' config parameter
Samuel Henrique [Thu, 1 Sep 2022 21:39:34 +0000 (22:39 +0100)] 
docs: remove mentions of deprecated '--without-openssl' config parameter

Closes #9415

2 years agomanpages: Fix spelling of "allows to" -> "allows one to"
Samuel Henrique [Fri, 2 Sep 2022 11:36:43 +0000 (12:36 +0100)] 
manpages: Fix spelling of "allows to" -> "allows one to"

 References:
 https://salsa.debian.org/lintian/lintian/-/blob/master/tags/t/typo-in-manual-page.tag
 https://english.stackexchange.com/questions/60271/grammatical-complements-for-allow/60285#60285

Closes #9419

2 years agoCURLOPT_WILDCARDMATCH.3: Fix backslash escaping under single quotes
Samuel Henrique [Fri, 2 Sep 2022 11:02:02 +0000 (12:02 +0100)] 
CURLOPT_WILDCARDMATCH.3: Fix backslash escaping under single quotes

 Lintian (on Debian) has been complaining about this for a while but
 I didn't bother initially as the groff parser that we use is not
 affected by this.

 But I have now noticed that the online manpage is affected by it:
 https://curl.se/libcurl/c/CURLOPT_WILDCARDMATCH.html

 (I'm using double quotes for quoting-only down below)

 The section that should be parsed as "'\'" ends up being parsed as
 "'´".

 This is due to roffit not parsing "'\\'" correctly, which is fine
 as the "correct" way of writing "'\'" is "'\e'" instead.

 Note that this fix is not enough to fix the online manpage at
 curl's website, as roffit seems to parse it wrongly either way.

 My intent is to at least fix the manpage so that roffit can
 be changed to parse "'\e'" correctly (although I suggest making
 roffit parse both ways correctly, since that's what groff does).

 More details at:
 https://bugs.debian.org/966803
 https://salsa.debian.org/lintian/lintian/-/blob/930b18e4b28b7540253f458ef42a884cca7965c3/tags/a/acute-accent-in-manual-page.tag

Closes #9418

2 years agotool_operate: reduce errorbuffer allocs
Daniel Stenberg [Tue, 30 Aug 2022 14:44:12 +0000 (16:44 +0200)] 
tool_operate: reduce errorbuffer allocs

- parallel transfers: only alloc and keep errorbuffers in memory for
  actual "live" transfers and not for the ones in the pending queue

- serial transfers: reuse the same fixed buffer for all transfers, not
  allocated at all.

Closes #9394

2 years agomisc: spelling fixes
Viktor Szakats [Wed, 31 Aug 2022 14:31:01 +0000 (14:31 +0000)] 
misc: spelling fixes

Found using codespell 2.2.1.

Also delete the redundant protocol designator from an archive.org URL.

Reviewed-by: Daniel Stenberg
Closes #9403

2 years agotool_progress: remove 'Qd' from the parallel progress bar
Daniel Stenberg [Wed, 31 Aug 2022 13:57:46 +0000 (15:57 +0200)] 
tool_progress: remove 'Qd' from the parallel progress bar

The "queued" value is no longer showing anything useful to the user. It
is an internal number of transfers waiting at that moment.

Closes #9389

2 years agotool_operate: prevent over-queuing in parallel mode
Daniel Stenberg [Wed, 31 Aug 2022 13:57:46 +0000 (15:57 +0200)] 
tool_operate: prevent over-queuing in parallel mode

When doing a huge amount of parallel transfers, we must not add them to
the per_transfer list frivolously since they all use memory after all.
This was previous done without really considering millions or billions
of transfers. Massive parallelism would use a lot of memory for no good
purpose.

The queue is now limited to twice the paralleism number.

This makes the 'Qd' value in the parallel progress meter mostly useless
for users, but works for now for us as a debug display.

Reported-by: justchen1369 on github
Fixes #8933
Closes #9389

2 years agocmake: fix original MinGW builds
Viktor Szakats [Wed, 31 Aug 2022 11:57:24 +0000 (11:57 +0000)] 
cmake: fix original MinGW builds

1. Re-enable `HAVE_GETADDRINFO` detection on Windows

   Commit d08ee3c83d6bd416aef62ff844c98e47c4682429 (in 2013) added logic
   that automatically assumed `getaddrinfo()` to be present for builds
   with IPv6 enabled. As it turns out, certain toolchains (e.g. original
   MinGW) by default target older Windows versions, and thus do not
   support `getaddrinfo()` out of the box. The issue was masked for
   a while by CMake builds forcing a newer Windows version, but that
   logic got deleted in commit 8ba22ffb2030ed91312fc8634e29516cdf0a9761.
   Since then, some CI builds started failing due to IPv6 enabled,
   `HAVE_GETADDRINFO` set, but `getaddrinfo()` in fact missing.

   It also turns out that IPv6 works without `getaddrinfo()` since commit
   67a08dca27a6a07b36c7f97252e284ca957ff1a5 (from 2019, via #4662). So,
   to resolve all this, we can now revert the initial commit, thus
   restoring `getaddrinfo()` detection and support IPv6 regardless of its
   outcome.

Reported-by: Daniel Stenberg
2. Omit `bcrypt` with original MinGW

   Original (aka legacy/old) MinGW versions do not support `bcrypt`
   (introduced with Vista). We already have logic to handle that in
   `lib/rand.c` and autotools builds, where we do not call the
   unsupported API and do not link `bcrypt`, respectively, when using
   original MinGW.

   This patch ports that logic to CMake, fixing the link error:
   `c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lbcrypt`

   Ref: https://ci.appveyor.com/project/curlorg/curl/builds/44624888/job/40vle84cn4vle7s0#L508
   Regression since 76172511e7adcf720f4c77bd91f49278300ec97e

Fixes #9214
Fixes #9393
Fixes #9395
Closes #9396

2 years agoRELEASE-NOTES: synced curl-7_85_0
Daniel Stenberg [Wed, 31 Aug 2022 06:09:21 +0000 (08:09 +0200)] 
RELEASE-NOTES: synced

curl 7.85.0 release

2 years agoTHANKS: add contributors from the 7.85.0 release
Daniel Stenberg [Wed, 31 Aug 2022 06:09:21 +0000 (08:09 +0200)] 
THANKS: add contributors from the 7.85.0 release

2 years agogetparam: correctly clean args
Daniel Stenberg [Tue, 30 Aug 2022 21:40:19 +0000 (23:40 +0200)] 
getparam: correctly clean args

Follow-up to bf7e887b2442783ab52

The previous fix for #9128 was incomplete and caused #9397.

Fixes #9397
Closes #9399

2 years agozuul: remove the clang-tidy job
Daniel Stenberg [Tue, 30 Aug 2022 11:24:28 +0000 (13:24 +0200)] 
zuul: remove the clang-tidy job

Turns out we don't see the warnings, but the warnings right now are
plain ridiculous and unhelpful so we can just as well just kill this
job.

Closes #9390

2 years agocmake: set feature PSL if present
Daniel Stenberg [Tue, 30 Aug 2022 11:57:19 +0000 (13:57 +0200)] 
cmake: set feature PSL if present

... make test 1014 pass when libpsl is used.

Closes #9391

2 years agolib530: simplify realloc failure exit path
Daniel Stenberg [Tue, 30 Aug 2022 11:46:03 +0000 (13:46 +0200)] 
lib530: simplify realloc failure exit path

To make code analyzers happier

Closes #9392

2 years agotests: add tests for netrc login/password combinations
Orgad Shaneh [Fri, 5 Aug 2022 13:50:34 +0000 (16:50 +0300)] 
tests: add tests for netrc login/password combinations

Covers the following PRs:

- #9066
- #9247
- #9248

Closes #9256

2 years agourl: really use the user provided in the url when netrc entry exists
Orgad Shaneh [Wed, 3 Aug 2022 16:13:07 +0000 (19:13 +0300)] 
url: really use the user provided in the url when netrc entry exists

If the user is specified as part of the URL, and the same user exists
in .netrc, Authorization header was not sent at all.

The user and password fields were assigned in conn->user and password
but the user was not assigned to data->state.aptr, which is the field
that is used in output_auth_headers and friends.

Fix by assigning the user also to aptr.

Amends commit d1237ac906ae7e3cd7a22c3a2d3a135a97edfbf5.

Fixes #9243

2 years agonetrc: Use the password from lines without login
Orgad Shaneh [Thu, 4 Aug 2022 20:41:26 +0000 (23:41 +0300)] 
netrc: Use the password from lines without login

If netrc entry has password with empty login, use it for any username.

Example:
.netrc:
machine example.com password 123456

curl -vn http://user@example.com/

Fix it by initializing state_our_login to TRUE, and reset it only when
finding an entry with the same host and different login.

Closes #9248

2 years agourl: treat missing usernames in netrc as empty
Jay Satiro [Wed, 29 Jun 2022 07:43:56 +0000 (03:43 -0400)] 
url: treat missing usernames in netrc as empty

- If, after parsing netrc, there is a password with no username then
  set a blank username.

This used to be the case prior to 7d600ad (precedes 7.82). Note
parseurlandfillconn already does the same thing for URLs.

Reported-by: Raivis <standsed@users.noreply.github.com>
Testing-by: Domen Kožar
Fixes https://github.com/curl/curl/issues/8653
Closes #9334
Closes #9066

2 years agotest8: verify that "ctrl-byte cookies" are ignored
Daniel Stenberg [Sun, 28 Aug 2022 22:09:17 +0000 (00:09 +0200)] 
test8: verify that "ctrl-byte cookies" are ignored

2 years agocookie: reject cookies with "control bytes"
Daniel Stenberg [Sun, 28 Aug 2022 22:09:17 +0000 (00:09 +0200)] 
cookie: reject cookies with "control bytes"

Rejects 0x01 - 0x1f (except 0x09) plus 0x7f

Reported-by: Axel Chong
Bug: https://curl.se/docs/CVE-2022-35252.html

CVE-2022-35252

Closes #9381

2 years agolibssh: ignore deprecation warnings
Daniel Stenberg [Mon, 29 Aug 2022 07:17:54 +0000 (09:17 +0200)] 
libssh: ignore deprecation warnings

libssh 0.10.0 marks all SCP functions as "deprecated" which causes
compiler warnings and errors in our CI jobs and elsewhere. Ignore
deprecation warnings if 0.10.0 or later is found in the build.

If they actually remove the functions at a later point, then someone can
deal with that pain and functionality break then.

Fixes #9382
Closes #9383

2 years agoRevert "schannel: when importing PFX, disable key persistence"
Daniel Stenberg [Mon, 29 Aug 2022 06:16:16 +0000 (08:16 +0200)] 
Revert "schannel: when importing PFX, disable key persistence"

This reverts commit 70d010d285315e5f1cad6bdb4953e167b069b692.

Due to further reports in #9300 that indicate this commit might
introduce problems.

2 years agomulti: use larger dns hash table for multi interface
Daniel Stenberg [Sat, 27 Aug 2022 12:48:13 +0000 (14:48 +0200)] 
multi: use larger dns hash table for multi interface

Have curl_multi_init() use a much larger DNS hash table than used for
the easy interface to scale and perform better when used with _many_
host names.

curl_share_init() sets an in-between size.

Inspired-by: Ivan Tsybulin
See #9340
Closes #9376

2 years agoCI/runtests.pl: add param for dedicated curl to talk to APIs
Marc Hoersken [Wed, 24 Aug 2022 19:46:25 +0000 (21:46 +0200)] 
CI/runtests.pl: add param for dedicated curl to talk to APIs

This should make it possible to also report test failures
if our freshly build curl binary is not fully functional.

Reviewed-by: Daniel Stenberg
Closes #9360

2 years agoopenssl: add cert path in error message
Jacob Tolar [Mon, 22 Aug 2022 22:20:16 +0000 (17:20 -0500)] 
openssl: add cert path in error message

Closes #9349

2 years agocert.d: clarify that escape character works for file paths
Jacob Tolar [Mon, 22 Aug 2022 22:18:59 +0000 (17:18 -0500)] 
cert.d: clarify that escape character works for file paths

Closes #9349

2 years agogha: move over ngtcp2-gnutls CI job from zuul
Daniel Stenberg [Wed, 17 Aug 2022 12:07:44 +0000 (14:07 +0200)] 
gha: move over ngtcp2-gnutls CI job from zuul

Closes #9331

2 years agocmake: add detection of threadsafe feature
Marc Hoersken [Sun, 14 Aug 2022 19:05:40 +0000 (19:05 +0000)] 
cmake: add detection of threadsafe feature

Avoids failing test 1014 by replicating configure checks
for HAVE_ATOMIC and _WIN32_WINNT with custom CMake tests.

Reviewed-by: Marcel Raad
Follow up to #8680
Closes #9312

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 26 Aug 2022 14:23:20 +0000 (16:23 +0200)] 
RELEASE-NOTES: synced

2 years agoCI/azure: align torture shallowness with GHA
Marc Hoersken [Thu, 25 Aug 2022 21:52:34 +0000 (23:52 +0200)] 
CI/azure: align torture shallowness with GHA

There 25 is used with FTP tests skipped, and 20 for FTP tests.
This should make torture tests stay within the 60min timeout.

Reviewed-by: Daniel Stenberg
Closes #9371

2 years agomulti_wait: fix and improve Curl_poll error handling on Windows
Marc Hoersken [Thu, 25 Aug 2022 22:06:34 +0000 (00:06 +0200)] 
multi_wait: fix and improve Curl_poll error handling on Windows

First check for errors and return CURLM_UNRECOVERABLE_POLL
before moving forward and waiting on socket readiness events.

Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Reported-by: Daniel Stenberg
Ref: #9361

Follow up to #8961
Closes #9372

2 years agomulti_wait: fix skipping to populate revents for extra_fds
Marc Hoersken [Mon, 25 Jul 2022 20:29:27 +0000 (22:29 +0200)] 
multi_wait: fix skipping to populate revents for extra_fds

On Windows revents was not populated for extra_fds if
multi_wait had to wait due to the Curl_poll pre-check
not signalling any readiness. This commit fixes that.

Reviewed-by: Marcel Raad
Reviewed-by: Jay Satiro
Closes #9361

2 years agoCI/appveyor: disable TLS in msys2-native autotools builds
Marc Hoersken [Thu, 25 Aug 2022 19:20:43 +0000 (21:20 +0200)] 
CI/appveyor: disable TLS in msys2-native autotools builds

Schannel cannot be used from msys2-native Linux-emulated builds.

Reviewed-by: Marcel Raad
Reviewed-by: Daniel Stenberg
Follow up to #9367
Closes #9370

2 years agotests: fix http2 tests to use CRLF headers
Jay Satiro [Thu, 25 Aug 2022 07:46:42 +0000 (03:46 -0400)] 
tests: fix http2 tests to use CRLF headers

Prior to this change some tests that rely on nghttpx proxy did not use
CRLF headers everywhere. A recent change in nghttp2, which updated its
version of llhttp (HTTP parser), requires curl's HTTP/1.1 test server to
use CRLF headers.

Ref: https://github.com/nghttp2/nghttp2/commit/9d389e8

Fixes https://github.com/curl/curl/issues/9364
Closes https://github.com/curl/curl/pull/9365

2 years agomulti: use a pipe instead of a socketpair on apple platforms
rcombs [Thu, 25 Aug 2022 13:55:36 +0000 (08:55 -0500)] 
multi: use a pipe instead of a socketpair on apple platforms

Sockets may be shut down by the kernel when the app is moved to the
background, but pipes are not.

Removed from KNOWN_BUGS

Fixes #6132
Closes #9368

2 years agolibssh2: provide symlink name in SFTP dir listing
Somnath Kundu [Thu, 25 Aug 2022 14:55:09 +0000 (20:25 +0530)] 
libssh2: provide symlink name in SFTP dir listing

When reading the symbolic link name for a file, we need to add the file
name to base path name.

Closes #9369

2 years agoconfigure: if asked to use TLS, fail if no TLS lib was detected
Daniel Stenberg [Thu, 25 Aug 2022 15:29:48 +0000 (17:29 +0200)] 
configure: if asked to use TLS, fail if no TLS lib was detected

Previously the configure script would just warn about this fact and
continue with TLS disabled build which is not always helpful. TLS should
be explicitly disabled if that is what the user wants.

Closes #9367

2 years agoschannel: when importing PFX, disable key persistence
Dustin Howett [Thu, 25 Aug 2022 00:20:43 +0000 (19:20 -0500)] 
schannel: when importing PFX, disable key persistence

By default, the PFXImportCertStore API persists the key in the user's
key store (as though the certificate was being imported for permanent,
ongoing use.)

The documentation specifies that keys that are not to be persisted
should be imported with the flag `PKCS12_NO_PERSIST_KEY`.
NOTE: this flag is only supported on versions of Windows newer than XP
and Server 2003.

Fixes #9300
Closes #9363

2 years agounit1303: four tests should have TRUE for 'connecting'
Daniel Stenberg [Tue, 23 Aug 2022 13:47:27 +0000 (15:47 +0200)] 
unit1303: four tests should have TRUE for 'connecting'

To match the comments.

Reported-by: Wu Zheng
See #9355
Closes #9356

2 years agoCURLOPT_BUFFERSIZE.3: add upload buffersize to see also
Daniel Stenberg [Tue, 23 Aug 2022 12:15:45 +0000 (14:15 +0200)] 
CURLOPT_BUFFERSIZE.3: add upload buffersize to see also

Closes #9354

2 years agoHTTP3.md: add missing autoreconf command for building with wolfssl
Fabian Fischer [Tue, 23 Aug 2022 11:54:27 +0000 (13:54 +0200)] 
HTTP3.md: add missing autoreconf command for building with wolfssl

Closes #9353

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 23 Aug 2022 11:48:35 +0000 (13:48 +0200)] 
RELEASE-NOTES: synced

2 years agomulti: have curl_multi_remove_handle close CONNECT_ONLY transfer
Daniel Stenberg [Mon, 22 Aug 2022 08:56:42 +0000 (10:56 +0200)] 
multi: have curl_multi_remove_handle close CONNECT_ONLY transfer

Ẃhen it has been used in the multi interface, it is otherwise left in
the connection cache, can't be reused and nothing will close them since
the easy handle loses the association with the multi handle and thus the
connection cache - until the multi handle is closed or it gets pruned
because the cache is full.

Reported-by: Dominik Thalhammer
Fixes #9335
Closes #9342

2 years agodocs/cmdline-opts: remove \& escapes from all .d files
Daniel Stenberg [Tue, 23 Aug 2022 11:42:49 +0000 (13:42 +0200)] 
docs/cmdline-opts: remove \& escapes from all .d files

gen.pl escapes them itself now

2 years agodocs/cmdline-opts/gen.pl: encode leading single and double quotes
Daniel Stenberg [Tue, 23 Aug 2022 11:42:42 +0000 (13:42 +0200)] 
docs/cmdline-opts/gen.pl: encode leading single and double quotes

As "(aq" and "(dq" to prevent them from implying a meaning in the nroff
output. This removes the need for using \& escapes in the .d files'
description parts.

Closes #9352

2 years agotests/server/sockfilt.c: avoid race condition without a mutex
Marc Hoersken [Thu, 16 Jun 2022 20:30:23 +0000 (22:30 +0200)] 
tests/server/sockfilt.c: avoid race condition without a mutex

Avoid loosing any triggered handles by first aborting and joining
the waiting threads before evaluating the individual signal state.

This removes the race condition and therefore need for a mutex.

Closes #9023

2 years agourl: output the maximum when rejecting a url
Emil Engler [Wed, 17 Aug 2022 07:57:44 +0000 (09:57 +0200)] 
url: output the maximum when rejecting a url

This commit changes the failf message to output the maximum length, when
curl refuses to process a URL because it is too long.

See: #9317
Closes: #9327
2 years agoconfigure: fix broken m4 syntax in TLS options
Chris Paulson-Ellis [Fri, 19 Aug 2022 17:58:40 +0000 (18:58 +0100)] 
configure: fix broken m4 syntax in TLS options

Commit b589696f added lines to some shell within AC_ARG_WITH macros, but
inadvertently failed to move the final closing ).

Quote the script section using braces.

So, if these problems have been around for a while, how did I find them?
Only because I did a configure including these options:

    $ ./configure --with-openssl --without-rustls
      SSL:              enabled (OpenSSL)

Closes #9344

2 years agotests/data/CMakeLists: remove making the 'show' makefile target 9337/head
Daniel Stenberg [Thu, 18 Aug 2022 09:40:11 +0000 (11:40 +0200)] 
tests/data/CMakeLists: remove making the 'show' makefile target

It is not used by runtests since 3c0f462

Closes #9333

2 years agotests/data/Makefile: remove 'filecheck' target
Daniel Stenberg [Thu, 18 Aug 2022 07:09:45 +0000 (09:09 +0200)] 
tests/data/Makefile: remove 'filecheck' target

No practical use anymore since 3c0f4622cdfd6

Closes #9332

2 years agolibssh2: make atime/mtime date overflow return error
Daniel Stenberg [Wed, 17 Aug 2022 08:51:42 +0000 (10:51 +0200)] 
libssh2: make atime/mtime date overflow return error

Closes #9328

2 years agolibssh: make atime/mtime date overflow return error
Daniel Stenberg [Wed, 17 Aug 2022 08:51:07 +0000 (10:51 +0200)] 
libssh: make atime/mtime date overflow return error

Closes #9328

2 years agoexamples/curlx.c: remove
Daniel Stenberg [Wed, 17 Aug 2022 22:00:12 +0000 (00:00 +0200)] 
examples/curlx.c: remove

This example is a bit convoluted to use as an example, combined with the
special license for it makes it unsuitable.

Closes #9330

2 years agocurl.h: include <sys/select.h> on SunOS
Tobias Nygren [Wed, 17 Aug 2022 10:03:41 +0000 (12:03 +0200)] 
curl.h: include <sys/select.h> on SunOS

It is needed for fd_set to be visible to downstream consumers that use
<curl/multi.h>. Header is known to exist at least as far back as Solaris
2.6.

Closes #9329

2 years agoDEPRECATE.md: push the NSS deprecation date forward one year to 2023
Daniel Stenberg [Wed, 17 Aug 2022 08:06:11 +0000 (10:06 +0200)] 
DEPRECATE.md: push the NSS deprecation date forward one year to 2023

URL: https://curl.se/mail/lib-2022-08/0016.html

2 years agolibssh2: setting atime or mtime >32bit on 4-bytes-long systems
Daniel Stenberg [Tue, 16 Aug 2022 14:29:15 +0000 (16:29 +0200)] 
libssh2: setting atime or mtime >32bit on 4-bytes-long systems

Since the libssh2 API uses 'long' to store the timestamp, it cannot
transfer >32bit times on Windows and 32bit architecture builds.

Avoid nasty surprises by instead not setting such time.

Spotted by Coverity

Closes #9325

2 years agolibssh: setting atime or mtime > 32bit is now just skipped
Daniel Stenberg [Tue, 16 Aug 2022 14:22:51 +0000 (16:22 +0200)] 
libssh: setting atime or mtime > 32bit is now just skipped

The libssh API used caps the time to an unsigned 32bit variable. Avoid
nasty surprises by instead not setting such time.

Spotted by Coverity.

Closes #9324

2 years agoKNOWN_BUGS: Windows Unicode builds use homedir in current locale
Jay Satiro [Sat, 13 Aug 2022 07:47:12 +0000 (03:47 -0400)] 
KNOWN_BUGS: Windows Unicode builds use homedir in current locale

Bug: https://github.com/curl/curl/pull/7252
Reported-by: dEajL3kA@users.noreply.github.com
Ref: https://github.com/curl/curl/pull/7281

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

2 years agotest399: switch it to use a config file instead
Daniel Stenberg [Tue, 16 Aug 2022 12:01:29 +0000 (14:01 +0200)] 
test399: switch it to use a config file instead

... as using a 65535 bytes host name in a URL does not fit on the
command line on some systems - like Windows.

Reported-by: Marcel Raad
Fixes #9321
Closes #9322

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 16 Aug 2022 07:46:33 +0000 (09:46 +0200)] 
RELEASE-NOTES: synced

2 years agoasyn-ares: make a single alloc out of hostname + async data
Daniel Stenberg [Mon, 15 Aug 2022 14:49:44 +0000 (16:49 +0200)] 
asyn-ares: make a single alloc out of hostname + async data

This saves one alloc per name resolve and simplifies the exit path.

Closes #9310

2 years agoCurl_close: call Curl_resolver_cancel to avoid memory-leak
Daniel Stenberg [Mon, 15 Aug 2022 14:36:33 +0000 (16:36 +0200)] 
Curl_close: call Curl_resolver_cancel to avoid memory-leak

There might be a pending (c-ares) resolve that isn't free'd up yet.

Closes #9310

2 years agoasyn-thread: fix socket leak on OOM
Daniel Stenberg [Sun, 14 Aug 2022 21:52:12 +0000 (23:52 +0200)] 
asyn-thread: fix socket leak on OOM

Closes #9310

2 years agoGHA: mv CI torture test from Zuul
Daniel Stenberg [Sat, 13 Aug 2022 21:59:51 +0000 (23:59 +0200)] 
GHA: mv CI torture test from Zuul

Closes #9310

2 years agongtcp2-wolfssl.yml: add GHA to build ngtcp2 + wolfSSL
Daniel Stenberg [Mon, 15 Aug 2022 07:40:35 +0000 (09:40 +0200)] 
ngtcp2-wolfssl.yml: add GHA to build ngtcp2 + wolfSSL

Closes #9318

2 years agotest399: verify check of too long host name
Daniel Stenberg [Mon, 15 Aug 2022 08:05:19 +0000 (10:05 +0200)] 
test399: verify check of too long host name

2 years agourl: reject URLs with hostnames longer than 65535 bytes
Daniel Stenberg [Mon, 15 Aug 2022 07:17:24 +0000 (09:17 +0200)] 
url: reject URLs with hostnames longer than 65535 bytes

It *probably* causes other problems too since DNS can't resolve such
long names, but the SNI field in TLS is limited to 16 bits length.

Closes #9317

2 years agocurl_multi_perform.3: minor language fix
Daniel Stenberg [Mon, 15 Aug 2022 06:59:30 +0000 (08:59 +0200)] 
curl_multi_perform.3: minor language fix

Closes #9316

2 years agongtcp2: fix picky compiler warnings with wolfSSL for QUIC
Daniel Stenberg [Mon, 15 Aug 2022 06:53:11 +0000 (08:53 +0200)] 
ngtcp2: fix picky compiler warnings with wolfSSL for QUIC

Follow-up to 8a13be227eede2

Closes #9315

2 years agongtcp2: remove leftover variable
Daniel Stenberg [Mon, 15 Aug 2022 06:20:49 +0000 (08:20 +0200)] 
ngtcp2: remove leftover variable

Mistake leftover from my edit before push.

Follow-up from 8a13be227eede2601c2b3b
Reported-by: Viktor Szakats
Bug: https://github.com/curl/curl/pull/9290#issuecomment-1214569167

2 years agoMakefile.m32: allow -nghttp3/-ngtcp2 without -ssl [ci skip]
Viktor Szakats [Mon, 15 Aug 2022 02:49:59 +0000 (02:49 +0000)] 
Makefile.m32: allow -nghttp3/-ngtcp2 without -ssl [ci skip]

Before this patch `-nghttp3`/`-ngtcp2` had an effect only when `-ssl`
was also enabled. `-ssl` meaning OpenSSL (and its forks). After
8a13be227eede2601c2b3b1c63e08b3dc9b35dd5 nghttp3/ngtcp2 can also be
used together with wolfSSL. This patch adds the ability to enable
`-nghttp3`/`-ngtcp2` independently from `-ssl` (OpenSSL), allowing to
use it with wolfSSL or other, future TLS backends.

Before this patch, it was fine to enable `-nghttp3`/`-ngtcp2`
unconditionally. After this patch, this is no longer the case, and now
it's the user's responsibility to enable `-nghttp3`/`-ngtcp2` only
together with a compatible TLS backend.

When using a TLS backend other than OpenSSL, the TLS-specific ngtcp2
library must be configured manually, e.g.:
  `export CURL_LDFLAG_EXTRAS=-lngtcp2_crypto_wolfssl`

(or via `NGTCP2_LIBS`)

Closes #9314

2 years agoquic: add support via wolfSSL
Stefan Eissing [Wed, 10 Aug 2022 08:06:52 +0000 (10:06 +0200)] 
quic: add support via wolfSSL

- based on ngtcp2 PR https://github.com/ngtcp2/ngtcp2/pull/505
- configure adapted to build against ngtcp2 wolfssl crypto lib
- quic code added for creation of WOLFSSL* instances

Closes #9290

2 years agomemdebug: add annotation attributes
David Carlier [Sat, 13 Aug 2022 14:17:12 +0000 (15:17 +0100)] 
memdebug: add annotation attributes

memory debug tracking annotates whether the returned pointer does not
`alias`, hints where the size required is, for Windows to be better
debugged via Visual Studio.

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

2 years agoGHA: move libressl CI from zuul to GitHub
Daniel Stenberg [Sat, 13 Aug 2022 21:53:56 +0000 (23:53 +0200)] 
GHA: move libressl CI from zuul to GitHub

Closes #9309

2 years agoKNOWN_BUGS: FTPS directory listing hangs on Windows with Schannel
Daniel Stenberg [Fri, 12 Aug 2022 22:32:12 +0000 (00:32 +0200)] 
KNOWN_BUGS: FTPS directory listing hangs on Windows with Schannel

Closes #9161

2 years agoKNOWN_BUGS: CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel
Daniel Stenberg [Fri, 12 Aug 2022 22:27:57 +0000 (00:27 +0200)] 
KNOWN_BUGS: CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel

Closes #8741

2 years agoKNOWN_BUGS: libssh blocking and infinite loop problem
Daniel Stenberg [Fri, 12 Aug 2022 22:25:31 +0000 (00:25 +0200)] 
KNOWN_BUGS: libssh blocking and infinite loop problem

Closes #8632

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 12 Aug 2022 22:22:25 +0000 (00:22 +0200)] 
RELEASE-NOTES: synced

2 years agomsh3: fix the QUIC disconnect function
Daniel Stenberg [Fri, 12 Aug 2022 12:22:03 +0000 (14:22 +0200)] 
msh3: fix the QUIC disconnect function

And free request related memory better in 'done'. Fixes a memory-leak.

Reported-by: Gisle Vanem
Fixes #8915
Closes #9304

2 years agoconnect: close the happy eyeballs loser connection when using QUIC
Daniel Stenberg [Fri, 12 Aug 2022 12:20:52 +0000 (14:20 +0200)] 
connect: close the happy eyeballs loser connection when using QUIC

Reviewed-by: Nick Banks
Closes #9303

2 years agorefactor: split resolve_server() into functions
Emil Engler [Mon, 8 Aug 2022 21:58:20 +0000 (23:58 +0200)] 
refactor: split resolve_server() into functions

This commit splits the branch-heavy resolve_server() function into
various sub-functions, in order to reduce the amount of nested
if/else-statements.

Beside this, it also removes many else-sequences, by returning in the
previous if-statement.

Closes #9283

2 years agoschannel: re-indent to use curl style better
Daniel Stenberg [Fri, 12 Aug 2022 08:48:29 +0000 (10:48 +0200)] 
schannel: re-indent to use curl style better

Only white space changes

Closes #9301

2 years agodocs/cmdline-opts: fix example and categories for --form-escape
Emanuele Torre [Fri, 12 Aug 2022 03:18:10 +0000 (05:18 +0200)] 
docs/cmdline-opts: fix example and categories for --form-escape

The example was missing a "--form" argument
I also replaced "--form" with "-F" to shorten the line a bit since it
was already very long.

And I also moved --form-escape from the "post" category to the "upload"
category (this is what I originally wanted to fix, before also noticing
the mistake in the example).

Closes #9298

2 years agoHTTP3.md: update to msh3 v0.4.0
Nick Banks [Thu, 11 Aug 2022 14:25:52 +0000 (10:25 -0400)] 
HTTP3.md: update to msh3 v0.4.0

Closes #9297

2 years agohostip: resolve *.localhost to 127.0.0.1/::1
Daniel Stenberg [Thu, 11 Aug 2022 09:32:22 +0000 (11:32 +0200)] 
hostip: resolve *.localhost to 127.0.0.1/::1

Following the footsteps of other clients like Firefox/Chrome.  RFC 6761
says clients SHOULD do this.

Add test 389 to verify.

Reported-by: TheKnarf on github
Fixes #9192
Closes #9296

2 years agoKNOWN_BUGS: long paths are not fully supported on Windows
Jay Satiro [Wed, 10 Aug 2022 07:23:25 +0000 (03:23 -0400)] 
KNOWN_BUGS: long paths are not fully supported on Windows

Bug: https://github.com/curl/curl/issues/8361
Reported-by: Gisle Vanem
Closes https://github.com/curl/curl/pull/9288

2 years agoconfig: remove the check for and use of SIZEOF_SHORT
Daniel Stenberg [Thu, 11 Aug 2022 07:07:06 +0000 (09:07 +0200)] 
config: remove the check for and use of SIZEOF_SHORT

shorts are 2 bytes on all platforms curl runs and have ever run on.

Closes #9291

2 years agoconfigure: introduce CURL_SIZEOF
Daniel Stenberg [Thu, 11 Aug 2022 07:07:02 +0000 (09:07 +0200)] 
configure: introduce CURL_SIZEOF

This is a rewrite of the previously used GPLv3+exception licensed
file. With this change, there is no more reference to GPL so we can
remove that from LICENSES/.

Ref: #9220
Closes #9291

2 years agohyper: customize test1274 to how hyper unfolds headers
Sean McArthur [Thu, 28 Jul 2022 01:15:22 +0000 (18:15 -0700)] 
hyper: customize test1274 to how hyper unfolds headers

Closes #9217

2 years agocurl-config: quote directories with potential space
Orgad Shaneh [Fri, 5 Aug 2022 09:46:32 +0000 (12:46 +0300)] 
curl-config: quote directories with potential space

On Windows (at least with CMake), the default prefix is
C:/Program Files (x86)/CURL.

Closes #9253