]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agodocs: document that curl_url_cleanup(NULL) is a safe no-op
Emanuele Torre [Fri, 19 May 2023 01:34:07 +0000 (03:34 +0200)] 
docs: document that curl_url_cleanup(NULL) is a safe no-op

This has always been the case, but it was not documented.

The paragraph was copied verbatim from curl_easy_cleanup.3

Closes #11150

2 years agoselect: avoid returning an error on EINTR from select() or poll()
Antoine Pitrou [Thu, 18 May 2023 19:39:05 +0000 (21:39 +0200)] 
select: avoid returning an error on EINTR from select() or poll()

This was already done for the poll() and select() calls
made directly from Curl_poll(), but was missed in
Curl_wait_ms(), which is called when there are no fds
to wait on.

Fixes #11135
Closes #11143

2 years agovquic.c: make recvfrom_packets static, avoid compiler warning
Daniel Stenberg [Thu, 18 May 2023 23:02:28 +0000 (01:02 +0200)] 
vquic.c: make recvfrom_packets static, avoid compiler warning

warning: no previous prototype for 'recvfrom_packets'

Reported-by: Keitagit-kun on github
Fixes #11146
Closes #11148

2 years agourlapi: allow numerical parts in the host name
Daniel Stenberg [Wed, 17 May 2023 22:31:17 +0000 (00:31 +0200)] 
urlapi: allow numerical parts in the host name

It can only be an IPv4 address if all parts are all digits and no more than
four parts, otherwise it is a host name. Even slightly wrong IPv4 will now be
passed through as a host name.

Regression from 17a15d88467 shipped in 8.1.0

Extended test 1560 accordingly.

Reported-by: Pavel Kalyugin
Fixes #11129
Closes #11131

2 years agohttp2: double http request parser max line length
Emilio Cobos Álvarez [Thu, 18 May 2023 16:22:57 +0000 (18:22 +0200)] 
http2: double http request parser max line length

This works around #11138, by doubling the limit, and should be a
relatively safe fix.

Ideally the buffer would grow as needed and there would be no need for a
limit? But that might be follow-up material.

Fixes #11138
Closes #11139

2 years agoconfigure: fix --help alignment
Emanuele Torre [Thu, 18 May 2023 19:16:56 +0000 (21:16 +0200)] 
configure: fix --help alignment

AC_ARG_ENABLE seems to only trim off whitespace from the start and end
of its help-string argument, while prepending two spaces of indentation
to all lines.

This means that the two spaces of indentation between the --enable-rtsp
and the --disable-rtsp line were not removed causing ./configure --help
to print:

  Optional Features:
    [...]
    --enable-rtsp           Enable RTSP support
      --disable-rtsp          Disable RTSP support

I removed the indentation to fix the issue, now it prints:

  Optional Features:
    [...]
    --enable-rtsp           Enable RTSP support
    --disable-rtsp          Disable RTSP support

The --enable-hsts and --disable-hsts lines had the same problems, and
have been fixed too.

Closes #11142

2 years agocmake: repair cross compiling
Deal(一线灵) [Wed, 17 May 2023 17:21:48 +0000 (01:21 +0800)] 
cmake: repair cross compiling

It cannot *run* code for testing purposes when cross-compiling.

Closes #11130

2 years agoconfigure: generate a script to run the compiler
Daniel Stenberg [Tue, 16 May 2023 14:51:14 +0000 (16:51 +0200)] 
configure: generate a script to run the compiler

in the CURL_RUN_IFELSE macro, with LD_LIBRARY_PATH set to the value of
the configure invoke, and not the value that might be used later,
intended for the execution of the output the compiler ouputs.

For example when the compiler uses the same library (like libz) that
configure checks for.

Reported-by: Jonas Bülow
Fixes #11114
Closes #11120

2 years agocf-socket: completely remove the disabled USE_RECV_BEFORE_SEND_WORKAROUND
Stefan Eissing [Tue, 16 May 2023 08:24:07 +0000 (10:24 +0200)] 
cf-socket: completely remove the disabled USE_RECV_BEFORE_SEND_WORKAROUND

Closes #11118

2 years agourlapi: respect CURLU_ALLOW_SPACE and CURLU_NO_AUTHORITY for redirects
Emanuele Torre [Thu, 18 May 2023 08:48:19 +0000 (10:48 +0200)] 
urlapi: respect CURLU_ALLOW_SPACE and CURLU_NO_AUTHORITY for redirects

curl_url_set(uh, CURLUPART_URL, redirurl, flags)  was not respecing
CURLU_ALLOW_SPACE and CURLU_NO_AUTHORITY in the host part of redirurl
when redirecting to an absolute URL.

Closes #11136

2 years agohostip: move easy_lock.h include above curl_memory.h
Colin Cross [Thu, 18 May 2023 17:54:09 +0000 (10:54 -0700)] 
hostip: move easy_lock.h include above curl_memory.h

Similar to #9561, move easy_lock.h above curl_memory.h to fix building
against musl libc.

Closes #11140

2 years agocurl_easy_getinfo: clarify on return data types
Hind Montassif [Wed, 17 May 2023 12:17:06 +0000 (14:17 +0200)] 
curl_easy_getinfo: clarify on return data types

Closes #11126

2 years agochecksrc: disallow spaces before labels
Emanuele Torre [Thu, 18 May 2023 04:54:18 +0000 (06:54 +0200)] 
checksrc: disallow spaces before labels

Out of 415 labels throughout the code base, 86 of those labels were
not at the start of the line. Which means labels always at the start of
the line is the favoured style overall with 329 instances.

Out of the 86 labels not at the start of the line:
* 75 were indented with the same indentation level of the following line
* 8 were indented with exactly one space
* 2 were indented with one fewer indentation level then the following
  line
* 1 was indented with the indentation level of the following line minus
  three space (probably unintentional)

Co-Authored-By: Viktor Szakats
Closes #11134

2 years agocookie: update the comment on cookie length and size limits
Daniel Stenberg [Wed, 17 May 2023 14:12:48 +0000 (16:12 +0200)] 
cookie: update the comment on cookie length and size limits

To refer to the proper cookie RFC and the upcoming RFC refresh.

Closes #11127

2 years agourl: provide better error message when URLs fail to parse
Daniel Stenberg [Thu, 18 May 2023 12:27:01 +0000 (14:27 +0200)] 
url: provide better error message when URLs fail to parse

By providing the URL API error message into the error message.

Ref: #11129
Closes #11137

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 18 May 2023 11:45:54 +0000 (13:45 +0200)] 
RELEASE-NOTES: synced

bumped to 8.1.1

2 years agoos400: update chkstrings.c
jonrumsey [Wed, 17 May 2023 19:59:06 +0000 (20:59 +0100)] 
os400: update chkstrings.c

Compensate changes for recent changes to urldata.h to reclassify
STRING_AWS_SIGV4.

Fixes #11132
Closes #11133

2 years agoRELEASE-NOTES: synced curl-8_1_0
Daniel Stenberg [Wed, 17 May 2023 06:05:04 +0000 (08:05 +0200)] 
RELEASE-NOTES: synced

2 years agoTHANKS: contributors from the 8.1.0 release
Daniel Stenberg [Wed, 17 May 2023 06:05:04 +0000 (08:05 +0200)] 
THANKS: contributors from the 8.1.0 release

2 years agohostip: include easy_lock.h before using GLOBAL_INIT_IS_THREADSAFE
Daniel Stenberg [Tue, 16 May 2023 21:40:42 +0000 (23:40 +0200)] 
hostip: include easy_lock.h before using GLOBAL_INIT_IS_THREADSAFE

Since that header file is the only place that define can be defined.

Reported-by: Marc Deslauriers
Follow-up to 13718030ad4b3209

Closes #11121

2 years agoaws-sigv4.d: fix region identifier in example
Thomas Taylor [Mon, 15 May 2023 19:51:59 +0000 (15:51 -0400)] 
aws-sigv4.d: fix region identifier in example

Closes #11117

2 years agomlc_config.json: remove this linkcheck CI job config file
Philip H [Mon, 15 May 2023 10:44:50 +0000 (12:44 +0200)] 
mlc_config.json: remove this linkcheck CI job config file

Closes #11113

2 years agossh: Add support for libssh2 read timeout
Daniel Silverstone [Wed, 26 Apr 2023 08:44:57 +0000 (09:44 +0100)] 
ssh: Add support for libssh2 read timeout

Hook the new (1.11.0 or newer) libssh2 support for setting a read timeout
into the SERVER_RESPONSE_TIMEOUT option.  With this done, clients can use
the standard curl response timeout setting to also control the time that
libssh2 will wait for packets from a slow server.  This is necessary to
enable use of very slow SFTP servers.

Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Closes #10965

2 years agoGIT-INFO: add --with-openssl
Osama Albahrani [Sun, 14 May 2023 03:09:48 +0000 (23:09 -0400)] 
GIT-INFO: add --with-openssl

Closes #11110

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 13 May 2023 19:03:59 +0000 (21:03 +0200)] 
RELEASE-NOTES: synced

2 years agomd(4|5): don't use deprecated iOS functions
Marcel Raad [Thu, 11 May 2023 07:23:13 +0000 (09:23 +0200)] 
md(4|5): don't use deprecated iOS functions

They are marked as deprecated in iOS 13.0, which might result in
warnings-as-errors.

Also, use `*_MIN_REQUIRED` instead of `*_MIN_ALLOWED`, which seems to
be what's currently used.

Bug: https://github.com/curl/curl/issues/11098
Closes https://github.com/curl/curl/pull/11102

2 years agomd4: only build when used
Marcel Raad [Thu, 11 May 2023 07:06:33 +0000 (09:06 +0200)] 
md4: only build when used

Its only usage in curl_ntlm_core.c is guarded by `USE_CURL_NTLM_CORE`,
so let's use this here too.

Ref: https://github.com/curl/curl/issues/11098
Closes https://github.com/curl/curl/pull/11102

2 years agowrite-out.d: Use response_code in example
Vítor Galvão [Fri, 12 May 2023 18:16:50 +0000 (19:16 +0100)] 
write-out.d: Use response_code in example

Closes #11107

2 years agourl: fix null dispname for --connect-to option
Shohei Maeda [Fri, 12 May 2023 12:06:26 +0000 (21:06 +0900)] 
url: fix null dispname for --connect-to option

Closes #11106

2 years agotest2306: verify getting a second response with folded headers
Daniel Stenberg [Fri, 12 May 2023 10:41:09 +0000 (12:41 +0200)] 
test2306: verify getting a second response with folded headers

Reproduces the isue #11101 and verifies the fix.

Verifies a17b2a503f

2 years agoheaders: clear (possibly) lingering pointer in init
Daniel Stenberg [Thu, 11 May 2023 07:56:51 +0000 (09:56 +0200)] 
headers: clear (possibly) lingering pointer in init

The "prevhead" pointer is used for the headers storage but was not
cleared correctly in init, which made it possible to act up when a
handle is reused.

Reported-by: Steve Herrell
Fixes #11101
Closes #11103

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 12 May 2023 15:30:51 +0000 (17:30 +0200)] 
RELEASE-NOTES: synced

2 years agongtcp2: use 0.15.0
Daniel Stenberg [Fri, 12 May 2023 10:51:58 +0000 (12:51 +0200)] 
ngtcp2: use 0.15.0

- nghttp3 0.11.0
- nghttp2 1.53.0

Adapt to new API calls

Closes #11031

2 years agoopenssl: fix indent
Jay Satiro [Wed, 10 May 2023 18:03:30 +0000 (14:03 -0400)] 
openssl: fix indent

2 years agoCURLOPT_DNS_CACHE_TIMEOUT.3: fix spelling
Daniel Stenberg [Tue, 9 May 2023 17:13:19 +0000 (19:13 +0200)] 
CURLOPT_DNS_CACHE_TIMEOUT.3: fix spelling

Follow-up to 9ed7d56e044f5aa1b29

Closes #11096

2 years agohostip: use time_t for storing oldest DNS entry
Daniel Stenberg [Tue, 9 May 2023 08:01:52 +0000 (10:01 +0200)] 
hostip: use time_t for storing oldest DNS entry

Theoretically, the oldest time could overflow an int. In practice that
won't happen, but let's do this to please analyzers.

Follow-up to 9ed7d56e044f5aa1b2928ccde6245d0

Pointed out by Coverity.
Closes #11094

2 years agohttp: free the url before storing a new copy
Daniel Stenberg [Tue, 9 May 2023 06:31:11 +0000 (08:31 +0200)] 
http: free the url before storing a new copy

To avoid a memory-leak.

Reported-by: Hiroki Kurosawa
Closes #11093

2 years agocompressed.d: clarify the words on "not notifying headers"
Daniel Stenberg [Tue, 9 May 2023 06:28:47 +0000 (08:28 +0200)] 
compressed.d: clarify the words on "not notifying headers"

Reported-by: Dylan Anthony
Fixes #11091
Closes #11092

2 years agolibssh2: free fingerprint better
Daniel Stenberg [Mon, 8 May 2023 12:33:54 +0000 (14:33 +0200)] 
libssh2: free fingerprint better

Reported-by: Wei Chong Tan
Closes #11088

2 years agoCURLOPT_IPRESOLVE.3: clarify that this for host names, not IP addresses
Daniel Stenberg [Mon, 8 May 2023 12:28:38 +0000 (14:28 +0200)] 
CURLOPT_IPRESOLVE.3: clarify that this for host names, not IP addresses

Reported-by: Harry Sintonen
Closes #11087

2 years agohostip: enforce a maximum DNS cache size independent of timeout value
Daniel Stenberg [Mon, 8 May 2023 09:11:36 +0000 (11:11 +0200)] 
hostip: enforce a maximum DNS cache size independent of timeout value

To reduce the damage an application can cause if using -1 or other
ridiculous timeout values and letting the cache live long times.

The maximum number of entries in the DNS cache is now totally
arbitrarily and hard-coded set to 29999.

Closes #11084

2 years agohostip: store dns timeout as 'int'
Daniel Stenberg [Mon, 8 May 2023 08:40:47 +0000 (10:40 +0200)] 
hostip: store dns timeout as 'int'

... because it set and held as an 'int' elsewhere and can never be
larger.

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 8 May 2023 12:41:11 +0000 (14:41 +0200)] 
RELEASE-NOTES: synced

2 years agotool_operate: refuse (--data or --form) and --continue-at combo
Daniel Stenberg [Sun, 7 May 2023 22:14:33 +0000 (00:14 +0200)] 
tool_operate: refuse (--data or --form) and --continue-at combo

libcurl assumes that a --continue-at resumption is done to continue an
upload using the read callback and neither --data nor --form use
that and thus won't do what the user wants. Whatever the user wants
with this strange combination.

Add test 426 to verify.

Reported-by: Smackd0wn on github
Fixes #11081
Closes #11083

2 years agotransfer: refuse POSTFIELDS + RESUME_FROM combo
Daniel Stenberg [Sun, 7 May 2023 22:12:25 +0000 (00:12 +0200)] 
transfer: refuse POSTFIELDS + RESUME_FROM combo

The code assumes that such a resume is wanting to continue an upload
using the read callback, and since POSTFIELDS is done without callback
libcurl will just misbehave.

This combo will make the transfer fail with CURLE_BAD_FUNCTION_ARGUMENT
with an explanation in the error message.

Reported-by: Smackd0wn on github
Fixes #11081
Closes #11083

2 years agoipv4.d/ipv6.d: they are "mutex", not "boolean"
Daniel Stenberg [Mon, 8 May 2023 10:01:09 +0000 (12:01 +0200)] 
ipv4.d/ipv6.d: they are "mutex", not "boolean"

... which for example means they do not have --no-* versions.

Reported-by: Harry Sintonen
Fixes #11085
Closes #11086

2 years agodocs/SECURITY-ADVISORY.md: how to write a curl security advisory
Daniel Stenberg [Sun, 7 May 2023 16:33:57 +0000 (18:33 +0200)] 
docs/SECURITY-ADVISORY.md: how to write a curl security advisory

Closes #11080

2 years agoMANUAL.md: add dict example for looking up a single definition
nobedee on github [Fri, 5 May 2023 20:29:16 +0000 (16:29 -0400)] 
MANUAL.md: add dict example for looking up a single definition

Closes #11077

2 years agoruntests: fix -c option when run with valgrind
Dan Fandrich [Fri, 5 May 2023 04:18:36 +0000 (21:18 -0700)] 
runtests: fix -c option when run with valgrind

The curl binary argument wasn't being quoted properly. This seems to
have broken at some point after quoting was added in commit 606b29fe.

Reported-by: Daniel Stenberg
Ref: #11073
Fixes #11074
Closes #11076

2 years agoruntests: support creating more than one runner process
Dan Fandrich [Tue, 2 May 2023 21:36:17 +0000 (14:36 -0700)] 
runtests: support creating more than one runner process

The controller currently only creates and uses one, but more are now
possible.

Ref: #10818

2 years agoruntests: spawn a new process for the test runner
Dan Fandrich [Sun, 30 Apr 2023 05:11:25 +0000 (22:11 -0700)] 
runtests: spawn a new process for the test runner

When the -j option is given, a new process is spawned in which the test
programs are run and from which test servers are started. Only one
process can be started at once, but this is sufficient to test that the
infrastructure can isolate those functions in a new task. There should
be no visible difference between the two modes at the moment.

Ref: #10818
Closes #11064

2 years agoruntests: turn singletest() into a state machine
Dan Fandrich [Sat, 29 Apr 2023 03:49:28 +0000 (20:49 -0700)] 
runtests: turn singletest() into a state machine

This allows it to run in a non-blocking manner.

Ref: #10818

2 years agoruntests: change runner interface to be asynchronous
Dan Fandrich [Wed, 26 Apr 2023 01:03:54 +0000 (18:03 -0700)] 
runtests: change runner interface to be asynchronous

Program arguments are marshalled and then written to the end of a pipe
which is later read from and the arguments unmarshalled before the
desired function is called normally.  The function return values are
then marshalled and written into another pipe when is later read from
and unmarshalled before being returned to the caller.

The implementation is currently blocking but can be made non-blocking
without any changes to the API.  This allows calling multiple runners
without blocking in the future.

Ref: #10818

2 years agoruntests: call citest_finishtest in singletest
Dan Fandrich [Fri, 28 Apr 2023 19:52:07 +0000 (12:52 -0700)] 
runtests: call citest_finishtest in singletest

This is where citest_starttest is called.

Ref: #10818

2 years agoruntests: add a runner initialization function
Dan Fandrich [Thu, 27 Apr 2023 21:08:41 +0000 (14:08 -0700)] 
runtests: add a runner initialization function

This sets up the runner environment to start running tests.

Ref: #10818

2 years agoruntests: remove directory from server filename variables
Dan Fandrich [Thu, 27 Apr 2023 18:04:13 +0000 (11:04 -0700)] 
runtests: remove directory from server filename variables

There will soon be multiple log directories so the paths will no longer
be static in runtests.pl. Also, get rid of $SERVER2IN which was not
used.

Ref: #10818

2 years agoruntests: reduce package exports after refactoring
Dan Fandrich [Thu, 27 Apr 2023 17:02:32 +0000 (10:02 -0700)] 
runtests: reduce package exports after refactoring

Some recent refactoring made these export no longer necessary. Also,
stop displaying the Unix socket paths at startup since there will soon
be many of them and they're not that interesting.

Ref: #10818

2 years agoruntests: use a function to obtain $LOGDIR for a test
Dan Fandrich [Thu, 27 Apr 2023 06:01:35 +0000 (23:01 -0700)] 
runtests: use a function to obtain $LOGDIR for a test

This will no longer be static soon.

Ref: #10818

2 years agotool_cb_hdr: Fix 'Location:' formatting for early VTE terminals
Jay Satiro [Wed, 3 May 2023 18:48:04 +0000 (14:48 -0400)] 
tool_cb_hdr: Fix 'Location:' formatting for early VTE terminals

- Disable hyperlink formatting for the 'Location:' header value in VTE
  0.48.1 and earlier, since it is buggy in some of those versions.

Prior to this change those terminals may show the location header value
as gibberish or show it twice.

Ref: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#backward-compatibility

Fixes https://github.com/curl/curl/issues/10428
Closes https://github.com/curl/curl/pull/11071

2 years agoquiche: disable pacing while pacing is not actually performed
François Michel [Wed, 3 May 2023 10:13:40 +0000 (12:13 +0200)] 
quiche: disable pacing while pacing is not actually performed

Closes #11068

2 years agoeasy_cleanup: require a "good" handle to act
Daniel Stenberg [Tue, 2 May 2023 08:25:58 +0000 (10:25 +0200)] 
easy_cleanup: require a "good" handle to act

By insisting that the passed in handle is "good" (the magic number is
intact), this can limit the potential damage if a bad pointer is passed
in. Like when this function is called twice on the same handle pointer.

Ref: #10964
Closes #11061

2 years agoamiga: Fix CA certificate paths for AmiSSL and MorphOS
Andreas Falkenhahn [Sun, 30 Apr 2023 21:54:00 +0000 (23:54 +0200)] 
amiga: Fix CA certificate paths for AmiSSL and MorphOS

AmiSSL stores certificates in `AmiSSL:Certs` and MorphOS stores them in
`MOSSYS:Data/SSL/curl-ca-bundle.crt`.

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

2 years agohttp2: (void)-mark when we explicitly ignore the return code
Daniel Stenberg [Sat, 29 Apr 2023 15:49:12 +0000 (17:49 +0200)] 
http2: (void)-mark when we explicitly ignore the return code

When h2_progress_egress() is called. Pointed out by Coverity.

Closes #11057

2 years agochecksrc: find bad indentation in conditions without open brace
Daniel Stenberg [Fri, 28 Apr 2023 16:07:33 +0000 (18:07 +0200)] 
checksrc: find bad indentation in conditions without open brace

If the previous line starts with if/while/for AND ends with a closed
parenthesis and there's an equal number of open and closed parentheses
on that line, verify that this line is indented $indent more steps, if
not a cpp line.

Also adjust the fall-out from this fix.

Closes #11054

2 years agoCI: Set minimal permissions on workflow ngtcp2-quictls.yml
Diogo Teles Sant'Anna [Fri, 28 Apr 2023 14:58:14 +0000 (11:58 -0300)] 
CI: Set minimal permissions on workflow ngtcp2-quictls.yml

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
Closes #11055

2 years agoCI: use another glob syntax for matching files on Appveyor
Dan Fandrich [Fri, 28 Apr 2023 17:28:06 +0000 (10:28 -0700)] 
CI: use another glob syntax for matching files on Appveyor

The previous globbing syntax was not matching files recursively in
directories, so try appending a /* to more closely match the examples at
https://www.appveyor.com/docs/how-to/filtering-commits/

2 years agomulti: add multi-ignore logic to multi_socket_action
Daniel Stenberg [Thu, 27 Apr 2023 14:27:55 +0000 (16:27 +0200)] 
multi: add multi-ignore logic to multi_socket_action

The multi-ignore logic that was previously applied to
curl_multi_perform() (#10750) is here applied to the loop within
curl_multi_socket_action() to make it use the same optimization: most
handles have the same signal-ignore option state so this drastically
reduces the number of ignore/unignore calls per libcurl function invoke.

Follow-up to bc90308328afb8

Closes #11045

2 years agohttp2: do flow window accounting for cancelled streams
Stefan Eissing [Fri, 28 Apr 2023 09:27:25 +0000 (11:27 +0200)] 
http2: do flow window accounting for cancelled streams

- nghttp2 does not free connection level window flow for
  aborted streams
- when closing transfers, make sure that any buffered
  response data is "given back" to the flow control window
- add tests test_02_22 and test_02_23 to reproduce

Closes #11052

2 years agopingpong: fix compiler warning "assigning an enum to unsigned char"
Stefan Eissing [Fri, 28 Apr 2023 07:24:24 +0000 (09:24 +0200)] 
pingpong: fix compiler warning "assigning an enum to unsigned char"

Closes #11050

2 years agoconfigure: fix detection of apxs (for httpd)
Daniel Stenberg [Fri, 28 Apr 2023 08:01:01 +0000 (10:01 +0200)] 
configure: fix detection of apxs (for httpd)

The condition check was turned the wrong way around!

Closes #11051

2 years agoci: `-Wno-vla` no longer necessary
Viktor Szakats [Thu, 27 Apr 2023 17:48:21 +0000 (17:48 +0000)] 
ci: `-Wno-vla` no longer necessary

We handle this issue in the source now.

Follow-up to b725fe1944b45406676ea3aff333ae3085a848d9

Reviewed-by: Marcel Raad
Reviewed-by: Daniel Stenberg
Closes #11048

2 years agotests/http: make curl_setup.h the first include
Marcel Raad [Thu, 27 Apr 2023 16:54:20 +0000 (18:54 +0200)] 
tests/http: make curl_setup.h the first include

This is required for the macros there to take effect for system
libraries. Specifically, including the system libraries first led to
warnings about `_FILE_OFFSET_BITS` being redefined in curl_config.h on
the Solaris autobuilds for ws-data.c and ws-pingpong.c.
Also make the curl includes come first for the other source files here
for consistency.

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

2 years agochecksrc: check for spaces before the colon of switch labels
Emanuele Torre [Thu, 27 Apr 2023 17:01:28 +0000 (19:01 +0200)] 
checksrc: check for spaces before the colon of switch labels

Closes #11047

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 27 Apr 2023 16:03:44 +0000 (18:03 +0200)] 
RELEASE-NOTES: synced

2 years agolibssh: tell it to use SFTP non-blocking
Daniel Stenberg [Thu, 27 Apr 2023 09:17:26 +0000 (11:17 +0200)] 
libssh: tell it to use SFTP non-blocking

Reported-by: Andreas Huebner
Fixes #11020
Closes #11039

2 years agohttp2: enlarge the connection window
Stefan Eissing [Thu, 27 Apr 2023 13:18:22 +0000 (15:18 +0200)] 
http2: enlarge the connection window

- fixes stalled connections

- Make the connection window large enough, so that there is
  some room left should 99/100 streams be PAUSED by the application

Reported-by: Paweł Wegner
Fixes #10988
Closes #11043

2 years agochecksrc: fix SPACEBEFOREPAREN for conditions starting with "*"
Daniel Stenberg [Thu, 27 Apr 2023 14:29:45 +0000 (16:29 +0200)] 
checksrc: fix SPACEBEFOREPAREN for conditions starting with "*"

The open paren check wants to warn for spaces before open parenthesis
for if/while/for but also for any function call. In order to avoid
catching function pointer declarations, the logic allows a space if the
first character after the open parenthesis is an asterisk.

I also spotted what we did not include "switch" in the check but we should.

This check is a little lame, but we reduce this problem by not allowing
that space for if/while/for/switch.

Reported-by: Emanuele Torre
Closes #11044

2 years agodocs: minor polish
Daniel Stenberg [Thu, 27 Apr 2023 09:31:36 +0000 (11:31 +0200)] 
docs: minor polish

- "an HTTP*" (not "a")
- remove a few contractions
- remove a spurious "a"
- reduce use of "I" in texts

Closes #11040

2 years agows: fix CONT opcode check
Daniel Stenberg [Thu, 27 Apr 2023 07:30:55 +0000 (09:30 +0200)] 
ws: fix CONT opcode check

Detected by Coverity. Follow-up to 930c00c259

Closes #11037

2 years agoCI: switch the awslc builds to build out-of-tree
Dan Fandrich [Thu, 27 Apr 2023 05:10:40 +0000 (22:10 -0700)] 
CI: switch the awslc builds to build out-of-tree

This is a common configuration that should be tested to avoid
regressions. The awsls cmake build was already out-of-tree so the
automake build now joins it.

Ref: #11006

2 years agotests/http: fix out-of-tree builds
Dan Fandrich [Thu, 27 Apr 2023 05:01:23 +0000 (22:01 -0700)] 
tests/http: fix out-of-tree builds

Add both lib/ directories (src & build) to the search path so
curl_setup.h and its dependencies can be found.

Followup-to acd82c8b

Ref: #11006
Closes #11036

2 years agourlapi: make internal function start with Curl_
Daniel Stenberg [Wed, 26 Apr 2023 21:27:04 +0000 (23:27 +0200)] 
urlapi: make internal function start with Curl_

Curl_url_set_authority() it is.

Follow-up to acd82c8bfd

Closes #11035

2 years agocf-socket: turn off IPV6_V6ONLY on Windows if it is supported
YX Hao [Sat, 15 Apr 2023 15:08:40 +0000 (23:08 +0800)] 
cf-socket: turn off IPV6_V6ONLY on Windows if it is supported

IPV6_V6ONLY refs:
https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses
https://github.com/golang/go/blob/master/src/net/ipsock_posix.go
https://en.wikipedia.org/wiki/Unix-like
https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options

default value refs:
https://datatracker.ietf.org/doc/html/rfc3493#section-5.3
https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables

Closes #10975

2 years agourldata: shrink *select_bits int => unsigned char
Daniel Stenberg [Tue, 25 Apr 2023 16:04:46 +0000 (18:04 +0200)] 
urldata: shrink *select_bits int => unsigned char

- dselect_bits
- cselect_bits

... are using less than 8 bits. Changed types and moved them towards
the end of the structs to fit better.

Closes #11025

2 years agotests/http: more tests with specific clients
Stefan Eissing [Wed, 26 Apr 2023 10:38:22 +0000 (12:38 +0200)] 
tests/http: more tests with specific clients

- Makefile support for building test specific clients in tests/http/clients
- auto-make of clients when invoking pytest
- added test_09_02 for server PUSH_PROMISEs using clients/h2-serverpush
- added test_02_21 for lib based downloads and pausing/unpausing transfers

curl url parser:
- added internal method `curl_url_set_authority()` for setting the
  authority part of a url (used for PUSH_PROMISE)

http2:
- made logging of PUSH_PROMISE handling nicer

Placing python test requirements in requirements.txt files
- separate files to base test suite and http tests since use
  and module lists differ
- using the files in the gh workflows

websocket test cases, fixes for we and bufq
- bufq: account for spare chunks in space calculation
- bufq: reset chunks that are skipped empty
- ws: correctly encode frames with 126 bytes payload
- ws: update frame meta information on first call of collect
  callback that fills user buffer
- test client ws-data: some test/reporting improvements

Closes #11006

2 years agolibssh2: fix crash in keyboard callback
Jay Satiro [Tue, 25 Apr 2023 19:31:33 +0000 (15:31 -0400)] 
libssh2: fix crash in keyboard callback

- Always set the libssh2 'abstract' user-pointer to the libcurl easy
  handle associated with the ssh session, so it is always passed to the
  ssh keyboard callback.

Prior to this change and since 8b5f100 (precedes curl 8.0.0), if libcurl
was built without CURL_DEBUG then it could crash during the ssh auth
phase due to a null dereference in the ssh keyboard callback.

Reported-by: Andreas Falkenhahn
Fixes https://github.com/curl/curl/pull/11024
Closes https://github.com/curl/curl/pull/11026

2 years agodocs: clarify that more backends have HTTPS proxy support
Daniel Stenberg [Wed, 26 Apr 2023 13:39:03 +0000 (15:39 +0200)] 
docs: clarify that more backends have HTTPS proxy support

Closes #11033

2 years agoKNOWN_BUGS: remove two not-bugs
Daniel Stenberg [Wed, 26 Apr 2023 12:24:31 +0000 (14:24 +0200)] 
KNOWN_BUGS: remove two not-bugs

- 11.7 signal-based resolver timeouts

Not considered a bug anymore but just implementation details. People
should avoid using timeouts with the synchronous name resolver.

- 11.16 libcurl uses renames instead of locking for atomic operations

Not a bug, just a description of how it works

Closes #11032

2 years agohostip: add locks around use of global buffer for alarm()
Harry Sintonen [Tue, 25 Apr 2023 07:22:26 +0000 (09:22 +0200)] 
hostip: add locks around use of global buffer for alarm()

When building with the sync name resolver and timeout ability we now
require thread-safety to be present to enable it.

Closes #11030

2 years agocurl_path: bring back support for SFTP path ending in /~
Daniel Stenberg [Tue, 25 Apr 2023 11:06:01 +0000 (13:06 +0200)] 
curl_path: bring back support for SFTP path ending in /~

libcurl used to do a directory listing for this case (even though the
documentation says a URL needs to end in a slash for this), but
4e2b52b5f7a3 modified the behavior.

This change brings back a directory listing for SFTP paths that are
specified exactly as /~ in the URL.

Reported-by: Pavel Mayorov
Fixes #11001
Closes #11023

2 years agodocs/libcurl/curl_*escape.3: rename "url" argument to "input"/"string"
Emanuele Torre [Wed, 26 Apr 2023 06:17:57 +0000 (08:17 +0200)] 
docs/libcurl/curl_*escape.3: rename "url" argument to "input"/"string"

Also reword the DESCRIPTION section to mention "input"/"string" argument
in bold.

Closes #11027

2 years agodocs/libcurl: minor cleanups
Emanuele Torre [Tue, 25 Apr 2023 23:55:29 +0000 (01:55 +0200)] 
docs/libcurl: minor cleanups

I was reading curl_unescape(3) and I noticed that there was an extra
space after the open parenthesis in the SYNOPSIS; I removed the extra
space.

I also ran a few  grep -r  commands to find and remove extra spaces
after '(' in other files, and to find and replace uses of `T*' instead
of `T *'. Some of the instances of `T*` where unnecessary casts that I
removed.

I also fixed a comment that was misaligned in CURLMOPT_SOCKETFUNCTION.3.

And I fixed some formatting inconsistencies: in curl_unescape(3), all
function parameter were mentioned with bold text except length, that was
mentioned as 'length'; and, in curl_easy_unescape(3), all parameters
were mentioned in bold text except url that was italicised. Now they are
all mentioned in bold.
Documentation is not very consistent in how function parameter are
formatted: many pages italicise them, and others display them in bold
text; but I think it makes sense to at least be consistent with
formatting within the same page.

Closes #11027

2 years agoman pages: simplify the .TH sections
Daniel Stenberg [Wed, 26 Apr 2023 06:58:35 +0000 (08:58 +0200)] 
man pages: simplify the .TH sections

- remove the version numbers
- simplify the texts

The date and version number will be put there for releases when maketgz
runs the updatemanpages.pl script.

Closes #11029

2 years agohostcheck: fix host name wildcard checking
Daniel Stenberg [Mon, 24 Apr 2023 19:07:02 +0000 (21:07 +0200)] 
hostcheck: fix host name wildcard checking

The leftmost "label" of the host name can now only match against single
'*'. Like the browsers have worked for a long time.

- extended unit test 1397 for this
- move some SOURCE variables from unit/Makefile.am to unit/Makefile.inc

Reported-by: Hiroki Kurosawa
Closes #11018

2 years agosmbserver: remove temporary files before exit
Dan Fandrich [Mon, 17 Apr 2023 21:28:11 +0000 (14:28 -0700)] 
smbserver: remove temporary files before exit

Each execution of test 1451 would leave a file in /tmp before. Since
Windows can't delete a file while it's open, all the temporary file
names are stored and deleted on exit.

Closes #10990

2 years agoWebsocket en-/decoding
Stefan Eissing [Tue, 18 Apr 2023 13:02:34 +0000 (15:02 +0200)] 
Websocket en-/decoding

- state is fully kept at connection, since curl_ws_send() and
  curl_ws_rec() have lifetime beyond usual transfers
- no more limit on frame sizes

Reported-by: simplerobot on github
Fixes #10962
Closes #10999

2 years agourldata: copy CURLOPT_AWS_SIGV4 value on handle duplication
Patrick Monnerat [Tue, 25 Apr 2023 10:22:55 +0000 (12:22 +0200)] 
urldata: copy CURLOPT_AWS_SIGV4 value on handle duplication

Prior to this change STRING_AWS_SIGV4 (CURLOPT_AWS_SIGV4) was wrongly
marked as binary data that could not be duplicated.

Without this fix, this option's value is not copied upon calling
curl_easy_duphandle().

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

2 years agohttp3: expire unpaused transfers in all HTTP/3 backends
Stefan Eissing [Mon, 24 Apr 2023 11:28:12 +0000 (13:28 +0200)] 
http3: expire unpaused transfers in all HTTP/3 backends

Closes #11005

2 years agohttp2: always EXPIRE_RUN_NOW unpaused http/2 transfers
Stefan Eissing [Mon, 24 Apr 2023 10:50:44 +0000 (12:50 +0200)] 
http2: always EXPIRE_RUN_NOW unpaused http/2 transfers

- just increasing the http/2 flow window does not necessarily
  make a server send new data. It may already have exhausted
  the window before

Closes #11005

2 years agohttp2: pass `stream` to http2_handle_stream_close to avoid NULL checks
Stefan Eissing [Fri, 21 Apr 2023 10:19:22 +0000 (12:19 +0200)] 
http2: pass `stream` to http2_handle_stream_close to avoid NULL checks

Closes #11005