]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agocopyright.pl: cease doing year verifications
Daniel Stenberg [Sat, 28 Jan 2023 10:22:35 +0000 (11:22 +0100)] 
copyright.pl: cease doing year verifications

As we have (mostly) removed the copyright year ranges.

Reported-by: Ryan Schmidt
Fixes #10345
Closes #10352

2 years agoCI: Work around a labeler bug that removes labels
Dan Fandrich [Sun, 29 Jan 2023 03:48:02 +0000 (19:48 -0800)] 
CI: Work around a labeler bug that removes labels

2 years agowrite-out.d: clarify Windows % symbol escaping
Jay Satiro [Mon, 23 Jan 2023 08:44:16 +0000 (03:44 -0500)] 
write-out.d: clarify Windows % symbol escaping

- Clarify that in Windows batch files the % must be escaped as %%, and
  at the command prompt it cannot be escaped which could lead to
  incorrect expansion.

Prior to this change the doc implied % must be escaped as %% in win32
always.

---

Examples showing how a write-out argument is received by curl:

If curl --write-out "%{http_code}" is executed in a batch file:
{http_code}

If curl --write-out "%%{http_code}" is executed in a batch file:
%{http_code}

If curl --write-out "%{http_code}" is executed from the command prompt:
%{http_code}

If curl --write-out "%%{http_code}" is executed from the command prompt:
%%{http_code}

At the command prompt something like "%{speed_download}%{http_code}"
would first be parsed by the command interpreter as %{speed_download}%
and would be expanded as environment variable {speed_download} if it
existed, though that's highly unlikely since Windows environment names
don't use braces.

---

Reported-by: Muhammad Hussein Ammari
Ref: https://github.com/bagder/everything-curl/pull/279

Fixes https://github.com/curl/curl/issues/10323
Closes https://github.com/curl/curl/pull/10337

2 years agoconnect: Fix build when not ENABLE_IPV6
Ryan Schmidt [Thu, 26 Jan 2023 01:30:23 +0000 (19:30 -0600)] 
connect: Fix build when not ENABLE_IPV6

Check for ENABLE_IPV6 before accessing AF_INET6. Fixes build failure
introduced in 1c5d8ac.

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

2 years agocf-socket: Fix build when not HAVE_GETPEERNAME
Ryan Schmidt [Thu, 26 Jan 2023 01:05:02 +0000 (19:05 -0600)] 
cf-socket: Fix build when not HAVE_GETPEERNAME

Remove remaining references to conn and sockfd, which were removed from
the function signature when conninfo_remote was renamed to
conn_set_primary_ip in 6a8d7ef.

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

2 years agovtls: Manage current easy handle in nested cfilter calls
Stefan Eissing [Mon, 23 Jan 2023 10:41:23 +0000 (11:41 +0100)] 
vtls: Manage current easy handle in nested cfilter calls

The previous implementation cleared `data` so the outer invocation lost
its data, which could lead to a crash.

Bug: https://github.com/curl/curl/issues/10336
Reported-by: Fujii Hironori
Closes https://github.com/curl/curl/pull/10340

2 years agoCI: Add even more paths to the labeler config (#10326)
Dan Fandrich [Thu, 26 Jan 2023 02:06:11 +0000 (18:06 -0800)] 
CI: Add even more paths to the labeler config (#10326)

2 years agoscripts: Fix Appveyor job detection in cijobs.pl
Dan Fandrich [Wed, 25 Jan 2023 23:30:59 +0000 (15:30 -0800)] 
scripts: Fix Appveyor job detection in cijobs.pl

The reorganization in #9769 broke the script. This should probably be
rewritten to use a YAML parser for better upward compatibility.

2 years agoCI: Add a few more paths to the labeler config (#10326)
Dan Fandrich [Wed, 25 Jan 2023 23:02:36 +0000 (15:02 -0800)] 
CI: Add a few more paths to the labeler config (#10326)

2 years agoCI: Switch the labeler event to pull_request_target
Dan Fandrich [Wed, 25 Jan 2023 18:42:17 +0000 (10:42 -0800)] 
CI: Switch the labeler event to pull_request_target

Otherwise, the action won't work on PRs from forked repositories
(#10326).

2 years agocmake: delete redundant macro definition `SECURITY_WIN32`
Viktor Szakats [Wed, 25 Jan 2023 11:55:57 +0000 (11:55 +0000)] 
cmake: delete redundant macro definition `SECURITY_WIN32`

Stop explicitly defining `SECURITY_WIN32` in CMake builds.

No other build systems define this macro, because it's unconditionally
defined in `lib/curl_sspi.h` already. This is the only curl source using
the `sspi.h` and `security.h` Win32 headers, and no other Win32 headers
need this macro.

Reviewed-by: Jay Satiro
Closes #10341

2 years agowinbuild: document that arm64 is supported
Fredrik [Sun, 22 Jan 2023 16:59:03 +0000 (17:59 +0100)] 
winbuild: document that arm64 is supported

Building an arm64 version works flawlessly with the VS arm64 toolset.

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

2 years agoopenssl: don't log raw record headers
Cherish98 [Sun, 15 Jan 2023 18:15:23 +0000 (18:15 +0000)] 
openssl: don't log raw record headers

- Skip content type SSL3_RT_HEADER in verbose TLS output.

This commit prevents bogus and misleading verbose TLS header messages as
discussed in #10299.

Assisted-by: Peter Wu
Closes https://github.com/curl/curl/pull/10299

2 years agocmake: use list APPEND syntax for CMAKE_REQUIRED_DEFINITIONS
Marc Aldorasi [Mon, 9 Jan 2023 21:38:28 +0000 (16:38 -0500)] 
cmake: use list APPEND syntax for CMAKE_REQUIRED_DEFINITIONS

- Use list() instead of set() for CMAKE_REQUIRED_DEFINITIONS list since
  the former is clearer.

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

2 years agoCI: Add a workflow to automatically label pull requests
Dan Fandrich [Fri, 20 Jan 2023 19:35:48 +0000 (11:35 -0800)] 
CI: Add a workflow to automatically label pull requests

The labeler language is quite restrictive right now so labels are added
quite conservatively, meaning that many PRs won't get labels when it's
"obvious" they should. It will still save some manual work on those
that it can label.

2 years agosystem.h: assume OS400 is always built with ILEC compiler
Jay Satiro [Fri, 20 Jan 2023 23:37:44 +0000 (18:37 -0500)] 
system.h: assume OS400 is always built with ILEC compiler

Prior to this change the OS400 types were only defined when __ILEC400__.
That symbol is only defined by IBM's C compiler and not their C++
compiler, which led to missing types when users on OS400 would compile a
C++ application that included curl.

The IBM C and C++ compilers are the only native compilers on the
platform.

Assisted-by: Jon Rumsey
Reported-by: John Sherrill
Fixes https://github.com/curl/curl/issues/10305
Closes https://github.com/curl/curl/pull/10329

2 years agocmake: Remove deprecated symbols check
xgladius [Tue, 17 Jan 2023 18:08:10 +0000 (12:08 -0600)] 
cmake: Remove deprecated symbols check

curl stopped use of CMAKE_USE_ as a prefix for its own build symbols in
2021 and added a check, meant to last 1 year, to fatally error on those
symbols. This commit removes that check.

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

2 years agodocs: POSTFIELDSIZE must be set to -1 with read function
Dan Fandrich [Tue, 17 Jan 2023 22:21:07 +0000 (14:21 -0800)] 
docs: POSTFIELDSIZE must be set to -1 with read function

Reported-by: RanBarLavie on github
Closes #10313

2 years agovtls: fix hostname handling in filters
Stefan Eissing [Tue, 17 Jan 2023 10:21:29 +0000 (11:21 +0100)] 
vtls: fix hostname handling in filters

- Copy the hostname and dispname to ssl_connect_data.

Use a copy instead of referencing the `connectdata` instance since this
may get free'ed on connection reuse.

Reported-by: Stefan Talpalaru
Reported-by: sergio-nsk@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/10273
Fixes https://github.com/curl/curl/issues/10309

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

2 years agolib: fix typos
Sergey Bronnikov [Mon, 16 Jan 2023 16:49:57 +0000 (19:49 +0300)] 
lib: fix typos

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

2 years agocurl_version_info.3: fix typo
Sergey Bronnikov [Mon, 16 Jan 2023 16:42:03 +0000 (19:42 +0300)] 
curl_version_info.3: fix typo

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

2 years agoopenssl: Don't ignore CA paths when using Windows CA store (redux)
Jay Satiro [Thu, 5 Jan 2023 23:32:27 +0000 (18:32 -0500)] 
openssl: Don't ignore CA paths when using Windows CA store (redux)

.. and remove 'experimental' designation from CURLSSLOPT_NATIVE_CA.

This commit restores the behavior of CURLSSLOPT_NATIVE_CA so that it
does not override CURLOPT_CAINFO / CURLOPT_CAPATH, or the hardcoded
default locations. Instead the native Windows CA store can be used at
the same time.

---

This behavior was originally added over two years ago in abbc5d60
(#5585) but then 83393b1a (#7892) broke it over a year ago, I assume
inadvertently.

The CURLSSLOPT_NATIVE_CA feature was marked experimental and likely
rarely used.

Ref: https://github.com/curl/curl/pull/5585
Ref: https://github.com/curl/curl/pull/7892
Ref: https://curl.se/mail/lib-2023-01/0019.html

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

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 13 Jan 2023 15:25:02 +0000 (16:25 +0100)] 
RELEASE-NOTES: synced

2 years agows: fix autoping handling
Daniel Stenberg [Fri, 13 Jan 2023 12:34:18 +0000 (13:34 +0100)] 
ws: fix autoping handling

Reported-by: Alexey Savchuk
Fixes #10289
Closes #10294

2 years agocurl_log: avoid printf() format checking with mingw
Daniel Stenberg [Fri, 13 Jan 2023 09:58:54 +0000 (10:58 +0100)] 
curl_log: avoid printf() format checking with mingw

Since it does not seem to like %zu and more

Follow-up to db91dbbf2

Fixes #10291
Closes #10292

2 years agotool_getparam: fix compiler warning when !HAVE_WRITABLE_ARGV
Daniel Stenberg [Thu, 12 Jan 2023 22:06:15 +0000 (23:06 +0100)] 
tool_getparam: fix compiler warning when !HAVE_WRITABLE_ARGV

Follow-up to 2ed0e1f70ee176edf3d2

Closes #10286

2 years agoopenssl: make the BIO_METHOD a local variable in the connection filter
Stefan Eissing [Thu, 12 Jan 2023 15:43:35 +0000 (16:43 +0100)] 
openssl: make the BIO_METHOD a local variable in the connection filter

This avoids UAF issues when `curl_global_cleanup()` is called before all
transfers have been completely handled. Unfortunately this seems to be a
more common pattern than we like.

Closes #10285

2 years agocurl: output warning at --verbose output for debug-enabled version
Daniel Stenberg [Wed, 11 Jan 2023 13:15:26 +0000 (14:15 +0100)] 
curl: output warning at --verbose output for debug-enabled version

+ a libcurl warning in the debug output

Assisted-by: Jay Satiro
Ref: https://curl.se/mail/lib-2023-01/0039.html
Closes #10278

2 years agosrc: add --http3-only 10264/head
Daniel Stenberg [Mon, 9 Jan 2023 14:00:34 +0000 (15:00 +0100)] 
src: add --http3-only

Warning: --http3 and --http3-only are subject to change again (or be
removed) before HTTP/3 support goes non-experimental.

Closes #10264

2 years agocurl.h: add CURL_HTTP_VERSION_3ONLY
Daniel Stenberg [Mon, 9 Jan 2023 13:59:27 +0000 (14:59 +0100)] 
curl.h: add CURL_HTTP_VERSION_3ONLY

As the previous CURL_HTTP_VERSION_3 option gets a slightly altered meaning.

Closes #10264

2 years agoconnect: fix access of pointer before NULL check
Daniel Stenberg [Thu, 12 Jan 2023 13:38:21 +0000 (14:38 +0100)] 
connect: fix access of pointer before NULL check

Detected by Coverity CID 1518992

Closes #10284

2 years agoeasyoptions: Fix header printing in generation script
Daniel Gustafsson [Wed, 11 Jan 2023 10:35:08 +0000 (11:35 +0100)] 
easyoptions: Fix header printing in generation script

The optiontable.pl script prints the header comment when generating
easyoptions.c, but it wasn't escaping all characters which jumbled the
curl ascii logo.  Fix by escaping.

Cloes #10275

2 years agotool_getparam: fix hiding of command line secrets
Harry Sintonen [Wed, 11 Jan 2023 10:39:33 +0000 (11:39 +0100)] 
tool_getparam: fix hiding of command line secrets

Closes #10276

2 years agotests: document the cfilter debug logging options
Stefan Eissing [Thu, 12 Jan 2023 09:46:21 +0000 (10:46 +0100)] 
tests: document the cfilter debug logging options

Closes #10283

2 years agocurl_log: for failf/infof and debug logging implementations
Stefan Eissing [Wed, 11 Jan 2023 09:30:42 +0000 (10:30 +0100)] 
curl_log: for failf/infof and debug logging implementations

 - new functions and macros for cfilter debugging
 - set CURL_DEBUG with names of cfilters where debug logging should be
   enabled
 - use GNUC __attribute__ to enable printf format checks during compile

Closes #10271

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 10 Jan 2023 12:54:29 +0000 (13:54 +0100)] 
RELEASE-NOTES: synced

2 years agomsh3: update to v0.6
Nick Banks [Sun, 8 Jan 2023 15:23:21 +0000 (15:23 +0000)] 
msh3: update to v0.6

Closes #10192

2 years agongtcp2: add CURLOPT_SSL_CTX_FUNCTION support for openssl+wolfssl
Stefan Eissing [Thu, 5 Jan 2023 16:01:42 +0000 (17:01 +0100)] 
ngtcp2: add CURLOPT_SSL_CTX_FUNCTION support for openssl+wolfssl

Using common method for SSL_CTX initialization of verfiy peer and CA
settings. This also provides X509_STORE sharing to become available for
ngtcp2+openssl HTTP/3.

Reported-by: violetlige on github
Fixes #10222
Closes #10239

2 years agocf-socket: make infof() call use %zu for size_t output
Daniel Stenberg [Tue, 10 Jan 2023 09:08:47 +0000 (10:08 +0100)] 
cf-socket: make infof() call use %zu for size_t output

Detected by Coverity CID 1518986 and CID 1518984

Closes #10268

2 years agoos400: fixes to make-lib.sh and initscript.sh
jonrumsey [Mon, 9 Jan 2023 13:22:36 +0000 (13:22 +0000)] 
os400: fixes to make-lib.sh and initscript.sh

Adjust how exports list is generated from header files to account for
declarations across multiple lines and CURL_DEPRECATED(...) tags.

Update initscript.sh

Specify qadrt_use_inline to prevent unistd.h in ASCII runtime defining
close(a) -> close_a(a)

Fixes #10266
Closes #10267

2 years agotests-httpd: basic infra to run curl against an apache httpd plus nghttpx for h3
Stefan Eissing [Mon, 9 Jan 2023 15:58:10 +0000 (16:58 +0100)] 
tests-httpd: basic infra to run curl against an apache httpd plus nghttpx for h3

- adding '--with-test-httpd=<path>' to configure non-standard apache2
  install
- python env and base classes for running httpd
- basic tests for connectivity with h1/h2/h3
- adding test cases for truncated responses in http versions.
- adding goaway test for HTTP/3.
- adding "stuttering" tests with parallel downloads in chunks with
  varying delays between chunks.

- adding a curltest module to the httpd server, adding GOAWAY test.
    - mod_curltest now installs 2 handlers
      - 'echo': writing as response body what came as request body
      - 'tweak': with query parameters to tweak response behaviour
- marked known fails as skip for now

Closes #10175

2 years agoquic: improve connect error message, debugging info, fix false connect report
Stefan Eissing [Fri, 6 Jan 2023 11:33:34 +0000 (12:33 +0100)] 
quic: improve connect error message, debugging info, fix false connect report

- ECONNECTREFUSED has not its own fail message in quic filters
- Debug logging in connect eyballing improved
- Fix bug in ngtcp2/quiche that could lead to false success reporting.

Reported-by: Divy Le Ray
Fixes #10245
Closes #10248

2 years agoquiche: fix build without any HTTP/2 implementation
Stefan Eissing [Mon, 9 Jan 2023 08:23:03 +0000 (09:23 +0100)] 
quiche: fix build without any HTTP/2 implementation

Fixes #10260
Closes #10263

2 years ago.github/workflows/linux.yml: add a quiche CI job
Daniel Stenberg [Thu, 5 Jan 2023 17:47:38 +0000 (18:47 +0100)] 
.github/workflows/linux.yml: add a quiche CI job

Move over from zuul

Closes #10241

2 years agocurl.h: allow up to 10M buffer size
Daniel Stenberg [Sat, 7 Jan 2023 15:03:40 +0000 (16:03 +0100)] 
curl.h: allow up to 10M buffer size

Bump the limit from 512K. There might be reasons for applications using
h3 to set larger buffers and there is no strong reason for curl to have
a very small maximum.

Ref: https://curl.se/mail/lib-2023-01/0026.html

Closes #10256

2 years agoGHA: use designated ngtcp2 and its dependencies versions
Tatsuhiro Tsujikawa [Sun, 8 Jan 2023 06:58:54 +0000 (15:58 +0900)] 
GHA: use designated ngtcp2 and its dependencies versions

Designate ngtcp2 and its dependency versions so that the CI build does
not fail without our control.

Closes #10257

2 years agodocs/cmdline-opts/hsts.d: explain hsts more
Daniel Stenberg [Sun, 8 Jan 2023 09:29:18 +0000 (10:29 +0100)] 
docs/cmdline-opts/hsts.d: explain hsts more

Closes #10258

2 years agomsh3: run again in its cfilter
Stefan Eissing [Mon, 2 Jan 2023 13:08:16 +0000 (14:08 +0100)] 
msh3: run again in its cfilter

- test 2500, single GET works
- test 2501, single POST stalls
- test 2502, multiple, sequential GETs each use a new connection since
  MsH3ConnectionGetState(qconn) no longer reports CONNECTED after one
  GET.

Closes #10204

2 years agosendf: fix build for Linux TCP fastopen
Jay Satiro [Fri, 6 Jan 2023 19:00:59 +0000 (14:00 -0500)] 
sendf: fix build for Linux TCP fastopen

- Fix the remote addr struct dereference.

- Include cf-socket.h in urldata.h.

Follow-up to 6a8d7ef9 which changed conn->ipaddr (Curl_addrinfo* )
member to conn->remote_addr (Curl_sockaddr_ex *) several days ago.

Reported-by: Stephan Guilloux
Fixes https://github.com/curl/curl/issues/10249
Closes https://github.com/curl/curl/pull/10250

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 7 Jan 2023 22:09:28 +0000 (23:09 +0100)] 
RELEASE-NOTES: synced

2 years agosetopt: move the SHA256 opt within #ifdef libssh2
Daniel Stenberg [Sat, 7 Jan 2023 14:49:03 +0000 (15:49 +0100)] 
setopt: move the SHA256 opt within #ifdef libssh2

Because only the libssh2 backend not supports it and thus this should
return error if this option is used other backends.

Reported-by: Harry Sintonen
Closes #10255

2 years agonss: implement data_pending method
Patrick Monnerat [Thu, 5 Jan 2023 03:22:14 +0000 (04:22 +0100)] 
nss: implement data_pending method

NSS currently uses the default Curl_none_data_pending() method which
always returns false, causing TLS buffered input data to be missed.

The current commit implements the nss_data_pending() method that properly
monitors the presence of available TLS data.

Ref:#10077

Closes #10225

2 years agoCURLOPT_HEADERDATA.3: warn DLL users must set write function
Jay Satiro [Thu, 5 Jan 2023 07:14:53 +0000 (02:14 -0500)] 
CURLOPT_HEADERDATA.3: warn DLL users must set write function

- Warn that in Windows if libcurl is running from a DLL and if
  CURLOPT_HEADERDATA is set then CURLOPT_WRITEFUNCTION or
  CURLOPT_HEADERFUNCTION must be set as well, otherwise the user may
  experience crashes.

We already have a similar warning in CURLOPT_WRITEDATA. Basically, in
Windows libcurl could crash writing a FILE pointer that was created by
a different C runtime. In Windows each DLL that is part of a program may
or may not have its own C runtime.

Ref: https://github.com/curl/curl/issues/10231

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

2 years agox509asn1: fix compile errors and warnings
jonrumsey [Thu, 5 Jan 2023 15:26:50 +0000 (15:26 +0000)] 
x509asn1: fix compile errors and warnings

Various small issues when built for GSKit

Closes #10238

2 years agoruntests: fix detection of TLS backends
Patrick Monnerat [Thu, 5 Jan 2023 16:26:50 +0000 (17:26 +0100)] 
runtests: fix detection of TLS backends

Built-in TLS backends are detected at test time by scanning for their
names in the version string line returned by the cli tool: as this line
may also list the libssh configuration that mentions its own backend,
the curl backend may be wrongly determined.

In example, if the version line contains "libssh/0.10.4/openssl/zlib",
OpenSSL is detected as a curl-configured backend even if not.

This fix requires the backend names to appear as full words preceded by
spacing in the version line to be recognized as curl TLS backends.

Closes #10236

2 years agoGHA: add job on Slackware 15.0
andy5995 [Wed, 4 Jan 2023 23:33:52 +0000 (17:33 -0600)] 
GHA: add job on Slackware 15.0

Closes #10230

2 years agotest363: make even smaller writes to loop more
Daniel Stenberg [Thu, 5 Jan 2023 12:35:53 +0000 (13:35 +0100)] 
test363: make even smaller writes to loop more

2 years agohttp_proxy: do not assign data->req.p.http use local copy
Daniel Stenberg [Thu, 5 Jan 2023 08:38:11 +0000 (09:38 +0100)] 
http_proxy: do not assign data->req.p.http use local copy

Avoid the tricky reusing of the data->req.p.http pointer for http proxy
tunneling.

Fixes #10194
Closes #10234

2 years agoquic: rename vquic implementations, fix for quiche build.
Stefan Eissing [Thu, 5 Jan 2023 18:23:21 +0000 (19:23 +0100)] 
quic: rename vquic implementations, fix for quiche build.

- quiche in debug mode did not build, fixed.
- moved all vquic implementation files to prefix curl_* to avoid
  the potential mixups between provided .h files and our own.
- quich passes test 2500 and 2502. 2501, the POST, fail with
  the body being rejected. Quich bug?

Closes #10242

2 years agosectransp: fix for incomplete read/writes
Stefan Eissing [Thu, 5 Jan 2023 10:13:17 +0000 (11:13 +0100)] 
sectransp: fix for incomplete read/writes

SecureTransport expects result code errSSLWouldBlock when the requested
length could not be sent/recieved in full. The previous code returned
noErr, which let SecureTransport to believe that the IO had terminated
prematurely.

Fixes #10227
Closes #10235

2 years agoGHA: Hacktoberfest CI: Update deprecated 'set-output' command
andy5995 [Wed, 4 Jan 2023 06:32:02 +0000 (00:32 -0600)] 
GHA: Hacktoberfest CI: Update deprecated 'set-output' command

Closes #10221

2 years agoscripts: set file mode +x on all perl and shell scripts
Jay Satiro [Tue, 3 Jan 2023 22:35:24 +0000 (17:35 -0500)] 
scripts: set file mode +x on all perl and shell scripts

- Set all scripts +x, ie 644 => 755.

Prior to this change some scripts were not executable and therefore
could not be called directly.

~~~
git ls-files -s \*.{sh,pl,py} | grep -v 100755
~~~

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

2 years agotool_operate: fix headerfile writing
Stefan Eissing [Wed, 4 Jan 2023 13:37:52 +0000 (14:37 +0100)] 
tool_operate: fix headerfile writing

Do not rely on the first transfer started to be the first to get a
response (remember -Z). All transfers now write the headefile (-D) in
append mode, making sure that the order of transfer responses does not
lead to overwrites of previous data.

Closes #10224

2 years agomisc: reduce struct and struct field sizes
Daniel Stenberg [Sun, 1 Jan 2023 10:26:22 +0000 (11:26 +0100)] 
misc: reduce struct and struct field sizes

- by using BIT() instead of bool
- imap: shrink struct
- ftp: make state 'unsigned char'
- ftp: sort ftp_conn struct entries on size
- urldata: use smaller fields for SSL version info storage
- pop3: reduce the pop3_conn struct size
- smtp: reduce the size of the smtp structs

Closes #10186

2 years agonoproxy: support for space-separated names is deprecated
Daniel Stenberg [Tue, 3 Jan 2023 13:58:37 +0000 (14:58 +0100)] 
noproxy: support for space-separated names is deprecated

To be removed in July 2024.

Assisted-by: Michael Osipov
Fixes #10209
Closes #10215

2 years agolib: fix typos in comments which repeat a word
Andrei Rybak [Wed, 4 Jan 2023 00:13:52 +0000 (01:13 +0100)] 
lib: fix typos in comments which repeat a word

Remove erroneously duplicated words in code comments of files
`lib.connect.c` and `lib/url.c`.

Closes #10220

2 years agocmake: set SOVERSION also for macOS 10406/head
Radek Brich [Tue, 3 Jan 2023 13:31:57 +0000 (14:31 +0100)] 
cmake: set SOVERSION also for macOS

Closes #10214

2 years agohttp2: fix compiler warning due to uninitialized variable
Jay Satiro [Tue, 3 Jan 2023 22:15:26 +0000 (17:15 -0500)] 
http2: fix compiler warning due to uninitialized variable

Prior to this change http2_cfilter_add could return an uninitialized
cfilter pointer in an OOM condition. In this case though, the pointer
is discarded and not dereferenced so there was no risk of a crash.

2 years agocf-socket: keep sockaddr local in the socket filters
Stefan Eissing [Tue, 3 Jan 2023 12:13:37 +0000 (13:13 +0100)] 
cf-socket: keep sockaddr local in the socket filters

- copy `struct Curl_addrinfo` on filter setup into context
- remove `struct Curl_addrinfoi *` with `struct Curl_sockaddr_ex *` in
  connectdata that is set and NULLed by the socket filter
- this means we have no reference to the resolver info in connectdata or
  its filters
- trigger the CF_CTRL_CONN_INFO_UPDATE event when the complete filter
  chain reaches connected status
- update easy handle connection information on CF_CTRL_DATA_SETUP event.

Closes #10213

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 3 Jan 2023 08:34:54 +0000 (09:34 +0100)] 
RELEASE-NOTES: synced

2 years agoruntests: consider warnings fatal and error on them
Daniel Stenberg [Mon, 2 Jan 2023 16:47:30 +0000 (17:47 +0100)] 
runtests: consider warnings fatal and error on them

To help us detect and fix warnings in this script easier and faster.

Assisted-by: Jakob Hirsch
Ref: #10206
Closes #10208

2 years agocopyright: update all copyright lines and remove year ranges
Daniel Stenberg [Mon, 2 Jan 2023 12:51:48 +0000 (13:51 +0100)] 
copyright: update all copyright lines and remove year ranges

- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205

2 years agodocs/DEPRECATE.md: deprecate gskit
Daniel Stenberg [Mon, 2 Jan 2023 10:43:51 +0000 (11:43 +0100)] 
docs/DEPRECATE.md: deprecate gskit

Ref: #10163

- This is a niche TLS library, only running on some IBM systems
- no regular curl contributors use this backend
- no CI builds use or verify this backend
- gskit, or the curl adaption for it, lacks many modern TLS features
  making it an inferior solution
- build breakages in this code take weeks or more to get detected
- fixing gskit code is mostly done "flying blind"

Closes #10201

2 years agoRevert "x509asn1: avoid freeing unallocated pointers"
Daniel Stenberg [Mon, 2 Jan 2023 15:42:55 +0000 (16:42 +0100)] 
Revert "x509asn1: avoid freeing unallocated pointers"

This reverts commit 6b19247e794cfdf4ec63c5880d8f4f5485f653ab.

Fixes #10163
Closes #10207

2 years agongtcp2: fix the build without 'sendmsg'
Daniel Stenberg [Mon, 2 Jan 2023 22:22:27 +0000 (23:22 +0100)] 
ngtcp2: fix the build without 'sendmsg'

Follow-up from 71b7e0161032

Closes #10210

2 years agocmake: check for sendmsg
Daniel Stenberg [Mon, 2 Jan 2023 22:25:15 +0000 (23:25 +0100)] 
cmake: check for sendmsg

Used by ngtcp2

Closes #10211

2 years agoruntest.pl: add expected fourth return value
Timmy Schierling [Mon, 2 Jan 2023 13:06:28 +0000 (14:06 +0100)] 
runtest.pl: add expected fourth return value

Fixes warning in autobild log: "Use of uninitialized value $HTTP2TLSPORT
in substitution iterator at /tests/runtests.pl line 3516"

Closes #10206

2 years agohttp2: when using printf %.*s, the length arg must be 'int'
Daniel Stenberg [Mon, 2 Jan 2023 11:53:45 +0000 (12:53 +0100)] 
http2: when using printf %.*s, the length arg must be 'int'

Detected by Coverity CID 1518341

Closes #10203

2 years agocfilters: check for NULL before using pointer
Daniel Stenberg [Mon, 2 Jan 2023 11:48:56 +0000 (12:48 +0100)] 
cfilters: check for NULL before using pointer

Detected by Coverity CID 1518343

Closes #10202

2 years agohttp2: in connisdead check, attach the connection before reading
Daniel Stenberg [Mon, 2 Jan 2023 09:10:29 +0000 (10:10 +0100)] 
http2: in connisdead check, attach the connection before reading

Otherwise data->conn is NULL and things go wrong.

This problem caused occastional failures in test 359, 1700 and more
depending on timing and the alignment of various planets.

Assisted-by: Stefan Eissing
Closes #10199

2 years agoLinux CI: update some dependecies to latest tag
Philip H [Sun, 1 Jan 2023 22:33:18 +0000 (23:33 +0100)] 
Linux CI: update some dependecies to latest tag

Closes #10195

2 years agoc-hyper: move down the Accept-Encoding header generation
Daniel Stenberg [Mon, 2 Jan 2023 10:02:07 +0000 (11:02 +0100)] 
c-hyper: move down the Accept-Encoding header generation

To match the internal HTTP request header order so that test 1277 works
again.

Closes #10200

2 years agorelease-notes.pl: check fixes/closes lines better
Daniel Stenberg [Mon, 2 Jan 2023 10:31:29 +0000 (11:31 +0100)] 
release-notes.pl: check fixes/closes lines better

To better skip lines that just happen to mention those words at the
start of a line without being instructions.

2 years agotest1560: use a UTF8-using locale when run
Daniel Stenberg [Sun, 1 Jan 2023 22:37:10 +0000 (23:37 +0100)] 
test1560: use a UTF8-using locale when run

There are odd cases that don't use UTF8 and then the IDN handling goes
wrong.

Reported-by: Marcel Raad
Fixes #10193
Closes #10196

2 years agocf-socket: fix build regression
Daniel Stenberg [Sun, 1 Jan 2023 15:32:13 +0000 (16:32 +0100)] 
cf-socket: fix build regression

Reported-by: Stephan Guilloux
Fixes #10190
Closes #10191

2 years agoexamples: remove the curlgtk.c example
Daniel Stenberg [Sun, 1 Jan 2023 23:28:18 +0000 (00:28 +0100)] 
examples: remove the curlgtk.c example

- it does not add a lot of value
- we do not test-build it to verify because of its dependencies
- unclear for what GTK versions it works or not

Reported-by: odek86 on github
Fixes #10197
Closes #10198

2 years agodocs: add link to GitHub Discussions
andy5995 [Wed, 28 Dec 2022 00:18:15 +0000 (18:18 -0600)] 
docs: add link to GitHub Discussions

Closes #10171

2 years agoGHA: ignore changes to md files for most workflows
andy5995 [Wed, 28 Dec 2022 14:57:36 +0000 (08:57 -0600)] 
GHA: ignore changes to md files for most workflows

Closes #10176

2 years agohttp: decode transfer encoding first
Josh Brobst [Sat, 31 Dec 2022 19:41:44 +0000 (14:41 -0500)] 
http: decode transfer encoding first

The unencoding stack is added to as Transfer-Encoding and
Content-Encoding fields are encountered with no distinction between the
two, meaning the stack will be incorrect if, e.g., the message has both
fields and a non-chunked Transfer-Encoding comes first. This commit
fixes this by ordering the stack with transfer encodings first.

Reviewed-by: Patrick Monnerat
Closes #10187

2 years agocurl.h: mark CURLSSLBACKEND_MESALINK as deprecated
Daniel Stenberg [Sun, 1 Jan 2023 11:05:08 +0000 (12:05 +0100)] 
curl.h: mark CURLSSLBACKEND_MESALINK as deprecated

Follow-up since 223f26c28a340b36

Deprecated since 7.82.0

Closes #10189

2 years agocurl_global_sslset.3: clarify the openssl situation
Daniel Stenberg [Sun, 1 Jan 2023 10:51:20 +0000 (11:51 +0100)] 
curl_global_sslset.3: clarify the openssl situation

and add rustls

Closes #10188

2 years agohttp: add additional condition for including stdint.h
Cameron Blomquist [Sat, 31 Dec 2022 14:40:51 +0000 (09:40 -0500)] 
http: add additional condition for including stdint.h

stdint.h was only included in http.h when ENABLE_QUIC was defined, but
symbols from stdint.h are also used when USE_NGHTTP2 is defined. This
causes build errors when USE_NGHTTP2 is defined but ENABLE_QUIC is not.

Closes #10185

2 years agourldata: cease storing TLS auth type
Daniel Stenberg [Fri, 30 Dec 2022 14:04:57 +0000 (15:04 +0100)] 
urldata: cease storing TLS auth type

The only TLS auth type libcurl ever supported is SRP and that is the
default type. Since nobody ever sets any other type, there is no point
in wasting space to store the set type and code to check the type.

If TLS auth is used, SRP is now implied.

Closes #10181

2 years agovtls: use ALPN HTTP/1.0 when HTTP/1.0 is used
Daniel Stenberg [Fri, 30 Dec 2022 16:37:11 +0000 (17:37 +0100)] 
vtls: use ALPN HTTP/1.0 when HTTP/1.0 is used

Previously libcurl would use the HTTP/1.1 ALPN id even when the
application specified HTTP/1.0.

Reported-by: William Tang
Ref: #10183

2 years agolib670: make test.h the first include
Marcel Raad [Fri, 30 Dec 2022 13:50:15 +0000 (14:50 +0100)] 
lib670: make test.h the first include

As in all other lib tests. This avoids a macro redefinition warning for
`_FILE_OFFSET_BITS` visible in the autobuilds.

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

2 years agolib: connect/h2/h3 refactor
Stefan Eissing [Fri, 30 Dec 2022 08:14:55 +0000 (09:14 +0100)] 
lib: connect/h2/h3 refactor

Refactoring of connection setup and happy eyeballing. Move
nghttp2. ngtcp2, quiche and msh3 into connection filters.

 - eyeballing cfilter that uses sub-filters for performing parallel connects
 - socket cfilter for all transport types, including QUIC
 - QUIC implementations in cfilter, can now participate in eyeballing
 - connection setup is more dynamic in order to adapt to what filter did
   really connect.  Relevant to see if a SSL filter needs to be added or
   if SSL has already been provided
 - HTTP/3 test cases similar to HTTP/2
 - multiuse of parallel transfers for HTTP/3, tested for ngtcp2 and quiche

 - Fix for data attach/detach in VTLS filters that could lead to crashes
   during parallel transfers.
 - Eliminating setup() methods in cfilters, no longer needed.
 - Improving Curl_conn_is_alive() to replace Curl_connalive() and
   integrated ssl alive checks into cfilter.
 - Adding CF_CNTRL_CONN_INFO_UPDATE to tell filters to update
   connection into and persist it at the easy handle.

 - Several more cfilter related cleanups and moves:
   - stream_weigth and dependency info is now wrapped in struct
     Curl_data_priority
   - Curl_data_priority members depend is available in HTTP2|HTTP3
   - Curl_data_priority members depend on NGHTTP2 support
   - handling init/reset/cleanup of priority part of url.c
   - data->state.priority same struct, but shallow copy for compares only

 - PROTOPT_STREAM has been removed
   - Curl_conn_is_mulitplex() now available to check on capability

 - Adding query method to connection filters.
   - ngtcp2+quiche: implementing query for max concurrent transfers.

 - Adding is_alive and keep_alive cfilter methods. Adding DATA_SETUP event.
   - setting keepalive timestamp on connect
   - DATA_SETUP is called after the connection has been completely
     setup (but may not connected yet) to allow filters to initialize
     data members they use.

 - there is no socket to be had with msh3, it is unclear how select
   shall work

 - manual test via "curl --http3 https://curl.se" fail with "empty
   reply from server".

 - Various socket/conn related cleanups:
   - Curl_socket is now Curl_socket_open and in cf-socket.c
   - Curl_closesocket is now Curl_socket_close and in cf-socket.c
   - Curl_ssl_use has been replaced with Cur_conn_is_ssl
   - Curl_conn_tcp_accepted_set has been split into
     Curl_conn_tcp_listen_set and Curl_conn_tcp_accepted_set
     with a clearer purpose

Closes #10141

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 30 Dec 2022 15:06:03 +0000 (16:06 +0100)] 
RELEASE-NOTES: synced

2 years agodocs/libcurl/curl_getdate.3: minor whitespace edit
Daniel Stenberg [Fri, 30 Dec 2022 11:58:14 +0000 (12:58 +0100)] 
docs/libcurl/curl_getdate.3: minor whitespace edit

To avoid a fccp quirk that made it render wrongly on the website

2 years agotransfer: break the read loop when RECV is cleared
Daniel Stenberg [Wed, 28 Dec 2022 10:08:44 +0000 (11:08 +0100)] 
transfer: break the read loop when RECV is cleared

When the RECV bit is cleared because the response reading for this
transfer is complete, the read loop should be stopped. data_pending()
can otherwise still return TRUE and another read would be attempted.

Reported-by: Hide Ishikawa
Fixes #10172
Closes #10174

2 years agomultihandle: turn bool struct fields into bits
Daniel Stenberg [Thu, 29 Dec 2022 16:43:36 +0000 (17:43 +0100)] 
multihandle: turn bool struct fields into bits

Closes #10179