]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
14 months agoRELEASE-NOTES: synced curl-7_88_0
Daniel Stenberg [Wed, 15 Feb 2023 07:10:01 +0000 (08:10 +0100)] 
RELEASE-NOTES: synced

7.88.0 release

14 months agoTHANKS: added contributors from 7.88.0
Daniel Stenberg [Wed, 15 Feb 2023 07:10:01 +0000 (08:10 +0100)] 
THANKS: added contributors from 7.88.0

14 months agoopenssl: rename 'errcode_t' to 'sslerr_t'
Daniel Stenberg [Mon, 13 Feb 2023 20:05:05 +0000 (21:05 +0100)] 
openssl: rename 'errcode_t' to 'sslerr_t'

Turns out "/usr/include/et/com_err.h" typedefs this type (without proper
variable scoping).

comerr is the "common error description library" that apparently might be used
by krb5 code, which then makes this header get used in a curl build.

Reported-by: Bruno Henrique Batista Cruz da Silva
Fixed #10502
Closes #10500

14 months agoCONTRIBUTE: More formally specify the commit description
Dan Fandrich [Sat, 11 Feb 2023 19:05:42 +0000 (11:05 -0800)] 
CONTRIBUTE: More formally specify the commit description

This codifies what people have actually used in git commits over the
past 6 years. I've left off some lesser-used headers that appear to
duplicate others and tried to describe a consistent use for several
others that were used more arbitrarily.

This makes it easier for new committers to find out the kinds of things
we want to acknowledge, makes it easier to perform statistical analysis
on commits, and opens the possibility of performing lint checks on
descriptions before submission.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro
Closes #10478

14 months agoopenssl: test and fix for forward proxy handling (non-tunneling).
Stefan Eissing [Mon, 13 Feb 2023 15:15:20 +0000 (16:15 +0100)] 
openssl: test and fix for forward proxy handling (non-tunneling).

- adding pytest test_10 cases for proxy httpd setup tests
- fixing openssl bug in https: proxy hostname verification that
  used the hostname of the request and not the proxy name.

Closes #10498

14 months agocmdline-opts/Makefile: on error, do not leave a partial
Daniel Stenberg [Mon, 13 Feb 2023 14:34:54 +0000 (15:34 +0100)] 
cmdline-opts/Makefile: on error, do not leave a partial

And support 'make V=1' to show the full command line

Closes #10497

14 months agocurl.1: make help, version and manual sections "custom"
Daniel Stenberg [Mon, 13 Feb 2023 14:33:13 +0000 (15:33 +0100)] 
curl.1: make help, version and manual sections "custom"

Instead of using "multi: boolean", as these are slightly special as in
they do are not enable/disable ones.

Fixes #10490
Reported-by: u20221022 on github
Closes #10497

14 months agotests: add tests for HTTP/2 and HTTP/3 to verify the header API
Stefan Eissing [Mon, 13 Feb 2023 13:22:37 +0000 (14:22 +0100)] 
tests: add tests for HTTP/2 and HTTP/3 to verify the header API

Test 2403 and 2503 check "header_json" output and therefore use of
header-api

Closes #10495

14 months agoCI: update wolfssl / wolfssh to 5.5.4 / 1.4.12
Philip H [Mon, 13 Feb 2023 08:04:51 +0000 (09:04 +0100)] 
CI: update wolfssl / wolfssh to 5.5.4 / 1.4.12

Closes #10493

14 months agoKNOW_BUGS: cleanups with some changed to TODOs
Daniel Stenberg [Sun, 12 Feb 2023 17:07:08 +0000 (18:07 +0100)] 
KNOW_BUGS: cleanups with some changed to TODOs

- remove "Excessive HTTP/2 packets with TCP_NODELAY"

  This is not a bug. Rather room for improvement.

I believe these have been fixed:

- 17.4 Connection failures with parallel HTTP/2
- 17.5 HTTP/2 connections through HTTPS proxy frequently stall

- remove "FTPS needs session reuse"

That is still true, but curl should also do session reuse now.

- remove "ASCII FTP"

It is documented behavior, and not single user has asked for extended
functionality here the last decade or so.

- remove "Passive transfer tries only one IP address"

add as a TODO

- remove "DoH leaks memory after followlocation"

With a recipe on how to reproduce, this is pointless to keep around

- remove "DoH does not inherit all transfer options"

add it as a TODO

Closes #10487

14 months agoGHA: bump ngtcp2 workflow dependencies
Tatsuhiro Tsujikawa [Mon, 13 Feb 2023 12:40:30 +0000 (21:40 +0900)] 
GHA: bump ngtcp2 workflow dependencies

Closes #10494

14 months agocontent_encoding: do not reset stage counter for each header
Patrick Monnerat [Mon, 13 Feb 2023 07:33:09 +0000 (08:33 +0100)] 
content_encoding: do not reset stage counter for each header

Test 418 verifies

Closes #10492

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 Feb 2023 10:31:28 +0000 (11:31 +0100)] 
RELEASE-NOTES: synced

14 months agomulti: stop sending empty HTTP/3 UDP datagrams on Windows
Jay Satiro [Tue, 7 Feb 2023 08:14:34 +0000 (03:14 -0500)] 
multi: stop sending empty HTTP/3 UDP datagrams on Windows

- Limit the 0-sized send procedure that is used to reset a SOCKET's
  FD_WRITE to TCP sockets only.

Prior to this change the reset was used on UDP sockets as well, but
unlike TCP sockets a 0-sized send actually sends out a datagram.

Assisted-by: Marc Hörsken
Ref: https://github.com/curl/curl/pull/9203

Fixes https://github.com/curl/curl/issues/9086
Closes https://github.com/curl/curl/pull/10430

14 months agoh3: silence compiler warnings
Viktor Szakats [Sun, 12 Feb 2023 17:11:46 +0000 (17:11 +0000)] 
h3: silence compiler warnings

Reviewed-by: Daniel Stenberg
Fixes #10485
Closes #10486

14 months agosmb: return error on upload without size
Daniel Stenberg [Sun, 12 Feb 2023 12:24:08 +0000 (13:24 +0100)] 
smb: return error on upload without size

The protocol needs to know the size ahead of time, this is now a known
restriction and not a bug.

Also output a clearer error if the URL path does not contain proper
share.

Ref: #7896
Closes #10484

14 months agowindows: always use curl's basename() implementation
Viktor Szakats [Sun, 12 Feb 2023 12:52:59 +0000 (12:52 +0000)] 
windows: always use curl's basename() implementation

The `basename()` [1][2] implementation provided by mingw-w64 [3] makes
assumptions about input encoding and may break with non-ASCII strings.

`basename()` was auto-detected with CMake, autotools and since
68fa9bf3f5d7b4fcbb57619f70cb4aabb79a51f6 (2022-10-13), also in
`Makefile.mk` after syncing its behaviour with the mainline build
methods. A similar patch for curl-for-win broke official Windows
builds earlier, in release 7.83.1_4 (2022-06-15).

This patch forces all Windows builds to use curl's internal
`basename()` implementation to avoid such problems.

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html
[2]: https://www.man7.org/linux/man-pages/man3/basename.3.html
[3]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/basename.c

Reported-by: UnicornZhang on Github
Assisted-by: Cherish98 on Github
Reviewed-by: Daniel Stenberg
Fixes #10261
Closes #10475

14 months agoLinux CI: Bump rustls-ffi to v0.9.1
Philip H [Sat, 11 Feb 2023 16:30:26 +0000 (17:30 +0100)] 
Linux CI: Bump rustls-ffi to v0.9.1

Closes #10476

14 months agolibtest: build lib2305 with multibyte as well
Daniel Stenberg [Sat, 11 Feb 2023 22:16:46 +0000 (23:16 +0100)] 
libtest: build lib2305 with multibyte as well

Fixes a build regression.

Follow-up to 5a9a04d5567
Reported-by: Viktor Szakats
Ref: https://github.com/curl/curl/pull/10475#issuecomment-1426831800

Closes #10477

14 months agocmake: fix dev warning due to mismatched arg
Dmitry Atamanov [Fri, 10 Feb 2023 17:44:36 +0000 (22:44 +0500)] 
cmake: fix dev warning due to mismatched arg

The package name passed to find_package_handle_standard_args (BROTLI)
does not match the name of the calling package (Brotli). This can lead
to problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.

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

14 months agosetopt: Address undefined behaviour by checking for null
James Keast [Fri, 10 Feb 2023 19:24:15 +0000 (15:24 -0400)] 
setopt: Address undefined behaviour by checking for null

This addresses undefined behaviour found using clang's UBsan:

curl/lib/setopt.c:177:14: runtime error: applying non-zero offset 1 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior curl/lib/setopt.c:177:14 in

Closes #10472

14 months agorustls: improve error messages
Jacob Hoffman-Andrews [Fri, 10 Feb 2023 01:12:07 +0000 (17:12 -0800)] 
rustls: improve error messages

Changes numeric error codes into verbose error codes in two places.
Adds a prefix indicating that the error came from rustls, and in some
places which function it came from.

Adds special handling for RUSTLS_RESULT_UNEXPECTED_EOF, since the
default message of "Unexpected EOF" is insufficiently explanatory.

Closes #10463

14 months agoopenssl: remove dead code
Daniel Stenberg [Fri, 10 Feb 2023 22:27:15 +0000 (23:27 +0100)] 
openssl: remove dead code

Follow-up to e8b00fcd6a

Due to the new 'if(!nonblocking)' check on the block a level above,
there is no need to check for it again within the same conditional.

Detected by Coverity

Closes #10473

14 months agongtcp2: replace removed define and stop using removed function
Daniel Stenberg [Fri, 10 Feb 2023 23:06:13 +0000 (00:06 +0100)] 
ngtcp2: replace removed define and stop using removed function

They were removed upstream.

Reported-by: Karthikdasari0423 on github
Fixes #10469
Closes #10474

14 months agoscripts/delta: show percent of number of files changed since last tag
Daniel Stenberg [Fri, 10 Feb 2023 17:52:16 +0000 (18:52 +0100)] 
scripts/delta: show percent of number of files changed since last tag

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 10 Feb 2023 17:49:34 +0000 (18:49 +0100)] 
RELEASE-NOTES: synced

14 months agopytest: add a test case for PUSH related things.
Stefan Eissing [Thu, 9 Feb 2023 12:08:26 +0000 (13:08 +0100)] 
pytest: add a test case for PUSH related things.

- checking that "103 Early Hints" are visible in curl's header dump file

Closes #10452

14 months agoWEBSOCKET.md: typo
Gregory Panakkal [Fri, 10 Feb 2023 08:32:57 +0000 (14:02 +0530)] 
WEBSOCKET.md: typo

Fixing missing slash for ws protocol scheme

Closes #10464

14 months agovquic: stabilization and improvements
Stefan Eissing [Thu, 9 Feb 2023 09:49:04 +0000 (10:49 +0100)] 
vquic: stabilization and improvements

vquic stabilization
- udp send code shared between ngtcp2 and quiche
- quiche handling of data and events improved

ngtcp2 and pytest improvements
- fixes handling of "drain" situations, discovered in scorecard
  tests with the Caddy server.
- improvements in handling transfers that have already  data or
  are already closed to make an early return on recv

pytest
- adding caddy tests when available

scorecard improvemnts.
- using correct caddy port
- allowing tests for only httpd or caddy

Closes #10451

14 months agoLinux CI: update some dependecies to latest tag
Philip H [Thu, 9 Feb 2023 08:22:39 +0000 (09:22 +0100)] 
Linux CI: update some dependecies to latest tag

Closes #10458

14 months agotest2305: send 3 frames, 4097 bytes each, as one message
Daniel Stenberg [Wed, 8 Feb 2023 12:17:41 +0000 (13:17 +0100)] 
test2305: send 3 frames, 4097 bytes each, as one message

Receive them using a 256 bytes buffer in a loop.

14 months agows: fix recv of larger frames
Daniel Stenberg [Wed, 8 Feb 2023 13:24:49 +0000 (14:24 +0100)] 
ws: fix recv of larger frames

 + remove 'oleft' from the struct
 + deal with "overflow data" in a separate dynbuf

Reported-by: Mike Duglas
Fixes #10438
Closes #10447

14 months agocurl/websockets.h: extend the websocket frame struct
Daniel Stenberg [Wed, 8 Feb 2023 22:02:50 +0000 (23:02 +0100)] 
curl/websockets.h: extend the websocket frame struct

14 months agosws: fix typo, indentation add more ws logging
Daniel Stenberg [Wed, 8 Feb 2023 13:34:42 +0000 (14:34 +0100)] 
sws: fix typo, indentation add more ws logging

14 months agotest2304: remove stdout verification
Daniel Stenberg [Thu, 9 Feb 2023 18:38:56 +0000 (19:38 +0100)] 
test2304: remove stdout verification

This cripples the test somewhat but the check was bad since depending on
timing it could exit before the output was done, making the test flaky.

14 months agoCI: Add more labeler match patterns
Dan Fandrich [Mon, 30 Jan 2023 23:10:11 +0000 (15:10 -0800)] 
CI: Add more labeler match patterns

14 months agoCI: Retry failed downloads to reduce spurious failures
Dan Fandrich [Thu, 9 Feb 2023 20:06:12 +0000 (12:06 -0800)] 
CI: Retry failed downloads to reduce spurious failures

A temporary error with a remote server shouldn't cause a CI run to fail.
Also, put a cap on the time to download to fail faster on a misbehaving
server or connection and use HTTP compression where possible to reduce
download times.

14 months agono-clobber.d: only use long form options in man page text
Daniel Stenberg [Thu, 9 Feb 2023 22:09:36 +0000 (23:09 +0100)] 
no-clobber.d: only use long form options in man page text

... since they are expanded and the short-form gets mentioned
automatically so if the short form is mentioned as well, it gets
repeated.

Fixes #10461
Closes #10462
Reported-by: Dan Fandrich
14 months agoGHA: enable websockets in the torture job
Daniel Stenberg [Thu, 9 Feb 2023 07:35:29 +0000 (08:35 +0100)] 
GHA: enable websockets in the torture job

Closes #10448

14 months agoheader.d: add a header file example
Daniel Stenberg [Thu, 9 Feb 2023 13:23:14 +0000 (14:23 +0100)] 
header.d: add a header file example

Closes #10455

14 months agoHTTP/[23]: continue upload when state.drain is set
Stefan Eissing [Wed, 8 Feb 2023 09:26:58 +0000 (10:26 +0100)] 
HTTP/[23]: continue upload when state.drain is set

- as reported in #10433, HTTP/2 uploads may stall when a response is
  received before the upload is done. This happens when the
  data->state.drain is set for such a transfer, as the special handling
  in transfer.c from then on only cared about downloads.
- add continuation of uploads, if applicable, in this case.
- add pytest case test_07_12_upload_seq_large to reproduce this scenario
  (although, current nghttp2 implementation is using drain less often)

Reported-by: Lucas Pardue
Fixes #10433
Closes #10443

14 months agohttp2: minor buffer and error path fixes
Stefan Eissing [Wed, 8 Feb 2023 14:56:57 +0000 (15:56 +0100)] 
http2: minor buffer and error path fixes

- use memory buffer in full available size
- fail receive of reset/errored streams early

pytest:
- make test_05 error cases more reliable

Closes #10444

14 months agoopenldap: fix missing sasl symbols at build in specific configs
Federico Pellegrin [Wed, 8 Feb 2023 18:44:58 +0000 (19:44 +0100)] 
openldap: fix missing sasl symbols at build in specific configs

If curl is built with openldap support (USE_OPENLDAP=1) but does not
have also some other protocol (IMAP/SMTP/POP3) enabled that brings
in Curl_sasl_* functions, then the build will fail with undefined
references to various symbols:

ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_decode_mech'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_parse_url_auth_option'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_cleanup'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_can_authenticate'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_continue'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_start'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_init'

This was tracked down to these functions bein used in openldap.c but
defined in curl_sasl.c and then forward in two vauth/ files to have
a guard against a set of #define configurations that was now extended
to cover also this case.

Example configuration targeted that could reproduce the problem:

curl 7.87.1-DEV () libcurl/7.87.1-DEV .... OpenLDAP/2.6.3
Protocols: file ftp ftps http https ldap ldaps

Closes #10445

14 months agows: use %Ou for outputting curl_off_t with info()
Daniel Stenberg [Wed, 8 Feb 2023 07:39:08 +0000 (08:39 +0100)] 
ws: use %Ou for outputting curl_off_t with info()

Reported-by: Mike Duglas
Fixes #10439
Closes #10441

14 months agocurl_setup: Disable by default recv-before-send in Windows
Jay Satiro [Fri, 3 Feb 2023 08:11:49 +0000 (03:11 -0500)] 
curl_setup: Disable by default recv-before-send in Windows

Prior to this change a workaround for Windows to recv before every send
was enabled by default. The way it works is a recv is called before
every send and saves the received data, in case send fails because in
Windows apparently that can wipe out the socket's internal received
data buffer.

This feature has led to several bugs because the way libcurl operates
it waits on a socket to read or to write, and may not at all times
check for buffered receive data.

Two recent significant bugs this workaround caused:
- Broken Schannel TLS 1.3 connections (#9431)
- HTTP/2 arbitrary hangs (#10253)

The actual code remains though it is disabled by default. Though future
changes to connection filter buffering could improve the situation IMO
it's just not tenable to manage this workaround.

Ref: https://github.com/curl/curl/issues/657
Ref: https://github.com/curl/curl/pull/668
Ref: https://github.com/curl/curl/pull/720

Ref: https://github.com/curl/curl/issues/9431
Ref: https://github.com/curl/curl/issues/10253

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

14 months agohttp2: aggregate small SETTINGS/PRIO/WIN_UPDATE frames
Stefan Eissing [Wed, 8 Feb 2023 09:37:36 +0000 (10:37 +0100)] 
http2: aggregate small SETTINGS/PRIO/WIN_UPDATE frames

add a small buffer to nghttp2 session sending in order to aggregate
small SETTINGS/PRIO/WIN_UPDATE frames that nghttp2 "writes" to the
callback individually.

Ref: #10389
Closes #10432

14 months agoopenssl: store the CA after first send (ClientHello)
Stefan Eissing [Wed, 8 Feb 2023 09:39:03 +0000 (10:39 +0100)] 
openssl: store the CA after first send (ClientHello)

move Curl_ssl_setup_x509_store() call after the first send (ClientHello)
this gives time to parse CA anchors while waiting on the server reply

Ref: #10389
Closes #10432

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 8 Feb 2023 08:31:29 +0000 (09:31 +0100)] 
RELEASE-NOTES: synced

14 months agowolfssl: remove deprecated post-quantum algorithms
Anthony Hu [Tue, 7 Feb 2023 22:47:50 +0000 (17:47 -0500)] 
wolfssl: remove deprecated post-quantum algorithms

Closes #10440

14 months agomisc: fix spelling
John Bampton [Tue, 7 Feb 2023 21:50:36 +0000 (07:50 +1000)] 
misc: fix spelling

Closes #10437

14 months agoman pages: call the custom user pointer 'clientp' consistently
Daniel Stenberg [Tue, 7 Feb 2023 14:58:17 +0000 (15:58 +0100)] 
man pages: call the custom user pointer 'clientp' consistently

The variable had a few different names. Now try to use 'clientp'
consistently for all man pages using a custom pointer set by the
application.

Reported-by: Gerrit Renker
Fixes #10434
Closes #10435

14 months agovtls: infof using %.*s needs to provide the length as int
Daniel Stenberg [Tue, 7 Feb 2023 15:09:12 +0000 (16:09 +0100)] 
vtls: infof using %.*s needs to provide the length as int

Fixes a Coverity warning.

Closes #10436

14 months agovrls: addressing issues reported by coverity
Stefan Eissing [Tue, 7 Feb 2023 08:34:49 +0000 (09:34 +0100)] 
vrls: addressing issues reported by coverity

I believe the code was secure before this, but limiting the accepted
name length to what is used in the structures should help Coverity's
analysis.

Closes #10431

14 months agotool_operate: move the 'updated' variable
Daniel Stenberg [Tue, 7 Feb 2023 11:15:26 +0000 (12:15 +0100)] 
tool_operate: move the 'updated' variable

This was already done by Dan Fandrich in the previous PR but somehow I
lost that fixup.

Follow-up to 349c5391f2121e

14 months agotool_operate: Fix error codes during DOS filename sanitize
Dan Fandrich [Mon, 6 Feb 2023 18:40:59 +0000 (10:40 -0800)] 
tool_operate: Fix error codes during DOS filename sanitize

It would return CURLE_URL_MALFORMAT in an OOM condition.

Closes #10414

14 months agotool_operate: Fix error codes on bad URL & OOM
Dan Fandrich [Sun, 5 Feb 2023 00:05:35 +0000 (16:05 -0800)] 
tool_operate: Fix error codes on bad URL & OOM

curl would erroneously report CURLE_OUT_OF_MEMORY in some cases instead
of CURLE_URL_MALFORMAT. In other cases, it would erroneously return
CURLE_URL_MALFORMAT instead of CURLE_OUT_OF_MEMORY.  Add a test case to
test the former condition.

Fixes #10130
Closes #10414

14 months agosetopt: use >, not >=, when checking if uarg is larger than uint-max
Daniel Stenberg [Mon, 6 Feb 2023 16:37:52 +0000 (17:37 +0100)] 
setopt: use >, not >=, when checking if uarg is larger than uint-max

Closes #10421

14 months agovtls: fix failf() format argument type for %.*s handling
Daniel Stenberg [Mon, 6 Feb 2023 16:50:09 +0000 (17:50 +0100)] 
vtls: fix failf() format argument type for %.*s handling

Reported by Coverity

Closes #10422

14 months agoopenssl: fix "Improper use of negative value"
Daniel Stenberg [Mon, 6 Feb 2023 16:52:44 +0000 (17:52 +0100)] 
openssl: fix "Improper use of negative value"

By getting the socket first and returning error in case of bad socket.

Detected by Coverity.

Closes #10423

14 months agopackages: Remove Android.mk from makefile
Dan Fandrich [Mon, 6 Feb 2023 22:02:06 +0000 (14:02 -0800)] 
packages: Remove Android.mk from makefile

This was missed in commit #44141512

Ref: #10418

14 months agocurl_ws_send.3: clarify how to send multi-frame messages
Daniel Stenberg [Mon, 6 Feb 2023 10:24:03 +0000 (11:24 +0100)] 
curl_ws_send.3: clarify how to send multi-frame messages

14 months agows: fix multiframe send handling
Mike Duglas [Mon, 6 Feb 2023 09:34:46 +0000 (10:34 +0100)] 
ws: fix multiframe send handling

Fixes #10413
Closes #10420

14 months agounit2600: make sure numerical curl_easy_setopt sets long
Daniel Stenberg [Mon, 6 Feb 2023 08:52:33 +0000 (09:52 +0100)] 
unit2600: make sure numerical curl_easy_setopt sets long

Follow-up to 671158242db3203

Reported-by: Marcel Raad
Fixes #10410
Closes #10419

14 months agoGHA: move Slackware test into matrix
andy5995 [Sat, 4 Feb 2023 05:50:33 +0000 (23:50 -0600)] 
GHA: move Slackware test into matrix

Closes #10412

14 months agourlapi: fix part of conditional expression is always true: qlen
Pronyushkin Petr [Fri, 3 Feb 2023 06:35:15 +0000 (11:35 +0500)] 
urlapi: fix part of conditional expression is always true: qlen

Closes #10408

14 months agourl: fix part of conditional expression is always true
Pronyushkin Petr [Fri, 3 Feb 2023 06:26:30 +0000 (11:26 +0500)] 
url: fix part of conditional expression is always true

Closes #10407

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 6 Feb 2023 07:35:03 +0000 (08:35 +0100)] 
RELEASE-NOTES: synced

14 months agoGHA/macos.yml: bump to gcc-12
Philip H [Sun, 5 Feb 2023 10:53:19 +0000 (11:53 +0100)] 
GHA/macos.yml: bump to gcc-12

Closes #10415

14 months agopackages: remove Android, update README
Daniel Stenberg [Sun, 5 Feb 2023 22:29:49 +0000 (23:29 +0100)] 
packages: remove Android, update README

- Nobody builds curl for Android using this anymore
- Refreshed the README and converted to markdown

Reported-by: John Porter
Fixes #10416
Closes #10418

14 months agofopen: remove unnecessary assignment
Kvarec Lezki [Thu, 2 Feb 2023 11:16:01 +0000 (16:16 +0500)] 
fopen: remove unnecessary assignment

[CWE-1164] V1048: The '* tempname' variable was assigned the same value.

Ref: https://pvs-studio.com/en/docs/warnings/v1048/

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

14 months agolibtest: add a sleep macro for Windows
Gisle Vanem [Fri, 13 Jan 2023 13:51:55 +0000 (14:51 +0100)] 
libtest: add a sleep macro for Windows

.. because sleep() is used in some libtests.

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

15 months agohttp_aws_sigv4: remove typecasts from HMAC_SHA256 macro
Kvarec Lezki [Thu, 2 Feb 2023 11:56:01 +0000 (16:56 +0500)] 
http_aws_sigv4: remove typecasts from HMAC_SHA256 macro

V220: Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize.

https://pvs-studio.com/en/docs/warnings/v220/

Closes #10400

15 months agomailmap: Thomas1664 on github
Daniel Stenberg [Fri, 3 Feb 2023 09:04:34 +0000 (10:04 +0100)] 
mailmap: Thomas1664 on github

15 months agoCURLOPT_WRITEFUNCTION.3: fix memory leak in example
Thomas1664 [Wed, 1 Feb 2023 12:59:25 +0000 (13:59 +0100)] 
CURLOPT_WRITEFUNCTION.3: fix memory leak in example

Closes #10390

15 months agodoh: ifdef IPv6 code
Kvarec Lezki [Thu, 2 Feb 2023 11:07:51 +0000 (16:07 +0500)] 
doh: ifdef IPv6 code

For disabled IPv6 a condition (conn->ip_version != CURL_IPRESOLVE_V4) is
always false. https://pvs-studio.com/en/docs/warnings/v560/

Closes #10397

15 months agourlapi: remove pathlen assignment
Daniel Stenberg [Thu, 2 Feb 2023 19:56:34 +0000 (20:56 +0100)] 
urlapi: remove pathlen assignment

"Value stored to 'pathlen' is never read"

Follow-up to 804d5293f89

Reported-by: Kvarec Lezki
Closes #10405

15 months agohttp: fix "part of conditional expression is always false"
Kvarec Lezki [Thu, 2 Feb 2023 11:37:42 +0000 (16:37 +0500)] 
http: fix "part of conditional expression is always false"

[CWE-570] V560: A part of conditional expression is always false: conn->bits.authneg.
[CWE-570] V560: A part of conditional expression is always false: conn->handler->protocol & (0 | 0).

https://pvs-studio.com/en/docs/warnings/v560/

Closes #10399

15 months agourlapi: skip the extra dedotdot alloc if no dot in path
Daniel Stenberg [Thu, 2 Feb 2023 10:15:47 +0000 (11:15 +0100)] 
urlapi: skip the extra dedotdot alloc if no dot in path

Saves an allocation for many/most URLs.

Updates test 1395 accordingly

Closes #10403

15 months agoconnections: introduce http/3 happy eyeballs
Stefan Eissing [Wed, 1 Feb 2023 16:13:12 +0000 (17:13 +0100)] 
connections: introduce http/3 happy eyeballs

New cfilter HTTP-CONNECT for h3/h2/http1.1 eyeballing.
- filter is installed when `--http3` in the tool is used (or
  the equivalent CURLOPT_ done in the library)
- starts a QUIC/HTTP/3 connect right away. Should that not
  succeed after 100ms (subject to change), a parallel attempt
  is started for HTTP/2 and HTTP/1.1 via TCP
- both attempts are subject to IPv6/IPv4 eyeballing, same
  as happens for other connections
- tie timeout to the ip-version HAPPY_EYEBALLS_TIMEOUT
- use a `soft` timeout at half the value. When the soft timeout
  expires, the HTTPS-CONNECT filter checks if the QUIC filter
  has received any data from the server. If not, it will start
  the HTTP/2 attempt.

HTTP/3(ngtcp2) improvements.
- setting call_data in all cfilter calls similar to http/2 and vtls filters
  for use in callback where no stream data is available.
- returning CURLE_PARTIAL_FILE for prematurely terminated transfers
- enabling pytest test_05 for h3
- shifting functionality to "connect" UDP sockets from ngtcp2
  implementation into the udp socket cfilter. Because unconnected
  UDP sockets are weird. For example they error when adding to a
  pollset.

HTTP/3(quiche) improvements.
- fixed upload bug in quiche implementation, now passes 251 and pytest
- error codes on stream RESET
- improved debug logs
- handling of DRAIN during connect
- limiting pending event queue

HTTP/2 cfilter improvements.
- use LOG_CF macros for dynamic logging in debug build
- fix CURLcode on RST streams to be CURLE_PARTIAL_FILE
- enable pytest test_05 for h2
- fix upload pytests and improve parallel transfer performance.

GOAWAY handling for ngtcp2/quiche
- during connect, when the remote server refuses to accept new connections
  and closes immediately (so the local conn goes into DRAIN phase), the
  connection is torn down and a another attempt is made after a short grace
  period.
  This is the behaviour observed with nghttpx when we tell it to  shut
  down gracefully. Tested in pytest test_03_02.

TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
  copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
  and connection related things based on the negotiated protocol (or lack thereof).

- new tests/tests-httpd/scorecard.py for testing h3/h2 protocol implementation.
  Invoke:
    python3 tests/tests-httpd/scorecard.py --help
  for usage.

Improvements on gathering connect statistics and socket access.
- new CF_CTRL_CONN_REPORT_STATS cfilter control for having cfilters
  report connection statistics. This is triggered when the connection
  has completely connected.
- new void Curl_pgrsTimeWas(..) method to report a timer update with
  a timestamp of when it happend. This allows for updating timers
  "later", e.g. a connect statistic after full connectivity has been
  reached.
- in case of HTTP eyeballing, the previous changes will update
  statistics only from the filter chain that "won" the eyeballing.
- new cfilter query CF_QUERY_SOCKET for retrieving the socket used
  by a filter chain.
  Added methods Curl_conn_cf_get_socket() and Curl_conn_get_socket()
  for convenient use of this query.
- Change VTLS backend to query their sub-filters for the socket when
  checks during the handshake are made.

HTTP/3 documentation on how https eyeballing works.

TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
  copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
  and connection related things based on the negotiated protocol (or lack thereof).

Scorecard with Caddy.
- configure can be run with `--with-test-caddy=path` to specify which caddy to use for testing
- tests/tests-httpd/scorecard.py now measures download speeds with caddy

pytest improvements
- adding Makfile to clean gen dir
- adding nghttpx rundir creation on start
- checking httpd version 2.4.55 for test_05 cases where it is needed. Skipping with message if too old.
- catch exception when checking for caddy existance on system.

Closes #10349

15 months agoCODEOWNERS: remove the peeps mentioned as CI owners
Daniel Stenberg [Wed, 1 Feb 2023 08:20:09 +0000 (09:20 +0100)] 
CODEOWNERS: remove the peeps mentioned as CI owners

These owners do not have the bandwidth/energy to do the reviews which
makes PRs stall and this ownership claim flawed. We can bring people
back when the situation is different.

Follow-up to c04c78ac87c4d46737934345a

Closes #10386

15 months agowrite-out.d: add 'since version' to %{header_json} documentation
Martin D'Aloia [Thu, 2 Feb 2023 01:27:23 +0000 (22:27 -0300)] 
write-out.d: add 'since version' to %{header_json} documentation

The documentation of `%{header_json}` missed to mention since which
version this variable for `--write-out` is present.

Based on commit https://github.com/curl/curl/commit/4133a69f2daa476bb
we can determine from the tags were this commit is present that the
first version to include it was `7.83.0`.
This could be also checked with:
`git tag --contains 4133a69f2daa476bb6d902687f1dd6660ea9c3c5`

Closes #10395

15 months agourlapi: avoid Curl_dyn_addf() for hex outputs
Daniel Stenberg [Tue, 31 Jan 2023 23:17:28 +0000 (00:17 +0100)] 
urlapi: avoid Curl_dyn_addf() for hex outputs

Inspired by the recent fixes to escape.c, we should avoid calling
Curl_dyn_addf() in loops, perhaps in particular when adding something so
simple as %HH codes - for performance reasons. This change makes the
same thing for the URL parser's two URL-encoding loops.

Closes #10384

15 months agourlapi: skip path checks if path is just "/"
Daniel Stenberg [Wed, 1 Feb 2023 07:26:08 +0000 (08:26 +0100)] 
urlapi: skip path checks if path is just "/"

As a miniscule optimization, treat a path of the length 1 as the same as
non-existing, as it can only be a single leading slash, and that's what
we do for no paths as well.

Closes #10385

15 months agoGHA/macos: use Xcode_14.0.1 for cmake builds
Philip H [Tue, 31 Jan 2023 14:57:41 +0000 (15:57 +0100)] 
GHA/macos: use Xcode_14.0.1 for cmake builds

Fixes #10356
Closes #10381

15 months agotls: fixes for wolfssl + openssl combo builds
Viktor Szakats [Wed, 1 Feb 2023 09:44:57 +0000 (09:44 +0000)] 
tls: fixes for wolfssl + openssl combo builds

1. Add `USE_WOLFSSL` to the TLS backend priority list in
   `lib/curl_ntlm_core.c`.

2. Fix `lib/curl_ntlm_core.h` to respect TLS backend priority, bringing
   it in sync with the above list and `lib/curl_ntlm_core.c` itself.

Reported-by: Mark Roszko
   Ref: https://github.com/curl/curl/issues/10321

3. Allow enabling both wolfSSL and OpenSSL at the same time in
   `lib/Makefile.mk` bringing this in line with cmake/autotools builds.
   Update logic to select the crypto-specific lib for `ngtcp2`, which
   supports a single TLS backend at the same time.

Closes #10322

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 1 Feb 2023 07:08:07 +0000 (08:08 +0100)] 
RELEASE-NOTES: synced

15 months agodocs/INSTALL: document how to use multiple TLS backends
Daniel Stenberg [Tue, 31 Jan 2023 22:29:23 +0000 (23:29 +0100)] 
docs/INSTALL: document how to use multiple TLS backends

And document how OpenSSL forks and wolfSSL cannot be used at the same
time.

Reported-by: Mark Roszko
Fixes #10321
Closes #10382

15 months agocookies: fp is always not NULL
Kvarec Lezki [Wed, 1 Feb 2023 06:00:03 +0000 (11:00 +0500)] 
cookies: fp is always not NULL

Closes #10383

15 months agoescape: use table lookup when adding %-codes to output
Daniel Stenberg [Tue, 31 Jan 2023 11:34:08 +0000 (12:34 +0100)] 
escape: use table lookup when adding %-codes to output

On my dev host, this code runs 7.8 times faster.

Closes #10377

15 months agounit2600: avoid error: ‘TEST_CASES’ defined but not used
Daniel Stenberg [Tue, 31 Jan 2023 13:41:15 +0000 (14:41 +0100)] 
unit2600: avoid error: ‘TEST_CASES’ defined but not used

Follow-up to d55de24dce9d51

Closes #10379

15 months agoescape: hex decode with a lookup-table
Daniel Stenberg [Tue, 31 Jan 2023 08:36:07 +0000 (09:36 +0100)] 
escape: hex decode with a lookup-table

Makes the decoding 2.8 times faster in my tests.

Closes #10376

15 months agocf-socket: fix build error wo TCP_FASTOPEN_CONNECT
Daniel Stenberg [Tue, 31 Jan 2023 12:48:30 +0000 (13:48 +0100)] 
cf-socket: fix build error wo TCP_FASTOPEN_CONNECT

Follow-up to 5651a36d1a

Closes #10378

Reviewed-by: Stefan Eissing
15 months agoCI: add pytest github workflow to CI test/tests-httpd on a HTTP/3 setup
Stefan Eissing [Wed, 18 Jan 2023 10:11:41 +0000 (11:11 +0100)] 
CI: add pytest github workflow to CI test/tests-httpd on a HTTP/3 setup

Closes #10317

15 months agoconnect: fix strategy testing for attempts, timeouts and happy-eyeball
Stefan Eissing [Tue, 17 Jan 2023 14:58:49 +0000 (15:58 +0100)] 
connect: fix strategy testing for attempts, timeouts and happy-eyeball

- add test2600 as a unit test that triggers various connect conditions
  and monitors behaviour, available in a debug build only.

- this exposed edge cases in connect.c that have been fixed

Closes #10312

15 months agocf-socket: improvements in socket I/O handling
Stefan Eissing [Mon, 30 Jan 2023 15:03:00 +0000 (16:03 +0100)] 
cf-socket: improvements in socket I/O handling

- Curl_write_plain/Curl_read_plain have been eliminated. Last code use
  now uses Curl_conn_send/recv so that requests use conn->send/revc
  callbacks which defaults to cfilters use.
- Curl_recv_plain/Curl_send_plain have been internalized in cf-socket.c.
- USE_RECV_BEFORE_SEND_WORKAROUND (active on Windows) has been moved
  into cf-socket.c. The pre_recv buffer is held at the socket filter
  context.  `postponed_data` structures have been removed from
  `connectdata`.
- the hanger in HTTP/2 request handling was a result of read buffering
  on all sends and the multi handling is not prepared for this. The
  following happens:

   - multi preforms on a HTTP/2 easy handle
   - h2 reads and processes data
   - this leads to a send of h2 data
   - which receives and buffers before the send
   - h2 returns
   - multi selects on the socket, but no data arrives (its in the buffer already)
   the workaround now receives data in a loop as long as there is something in
   the buffer. The real fix would be for multi to change, so that `data_pending`
   is evaluated before deciding to wait on the socket.

io_buffer, optional, in cf-socket.c, http/2 sets state.drain if lower
filter have pending data.

This io_buffer is only available/used when the
-DUSE_RECV_BEFORE_SEND_WORKAROUND is active, e.g. on Windows
configurations. It also maintains the original checks on protocol
handler being HTTP and conn->send/recv not being replaced.

The HTTP/2 (nghttp2) cfilter now sets data->state.drain when it finds
out that the "lower" filter chain has still pending data at the end of
its IO operation. This prevents the processing from becoming stalled.

Closes #10280

15 months agoopenssl: only use CA_BLOB if verifying peer
Daniel Stenberg [Sun, 29 Jan 2023 10:32:33 +0000 (11:32 +0100)] 
openssl: only use CA_BLOB if verifying peer

Reported-by: Paul Groke
Bug: https://curl.se/mail/lib-2023-01/0070.html
Fixes #10351
Closes #10359

15 months agocurl_free.3: fix return type of `curl_free`
Thomas1664 on github [Mon, 30 Jan 2023 22:51:32 +0000 (23:51 +0100)] 
curl_free.3: fix return type of `curl_free`

Fixes #10373
Closes #10374

15 months agozuul: stop using this CI service
Daniel Stenberg [Mon, 30 Jan 2023 10:38:50 +0000 (11:38 +0100)] 
zuul: stop using this CI service

The important jobs have already transitioned. The remaining ones we can
skip for now.

Closes #10368

15 months agocopyright: remove "m4/ax_compile_check_sizeof.m4" from skips
Daniel Stenberg [Mon, 30 Jan 2023 10:47:07 +0000 (11:47 +0100)] 
copyright: remove "m4/ax_compile_check_sizeof.m4" from skips

and report if skipped files do not exist.

Follow-up to 9e11c2791fb960758 which removed the file.

Closes #10369

15 months agows: unstick connect-only shutdown
Daniel Stenberg [Mon, 30 Jan 2023 08:35:39 +0000 (09:35 +0100)] 
ws: unstick connect-only shutdown

As this mode uses blocking sockets, it must set them back to
non-blocking in disconnect to avoid the risk of getting stuck.

Closes #10366