]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
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

2 years agoh2/h3: replace `state.drain` counter with `state.dselect_bits`
Stefan Eissing [Fri, 21 Apr 2023 10:04:46 +0000 (12:04 +0200)] 
h2/h3: replace `state.drain` counter with `state.dselect_bits`

- `drain` was used by http/2 and http/3 implementations to indicate
  that the transfer requires send/recv independant from its socket
  poll state. Intended as a counter, it was used as bool flag only.
- a similar mechanism exists on `connectdata->cselect_bits` where
  specific protocols can indicate something similar, only for the
  whole connection.
- `cselect_bits` are cleard in transfer.c on use and, importantly,
  also set when the transfer loop expended its `maxloops` tries.
  `drain` was not cleared by transfer and the http2/3 implementations
  had to take care of that.
- `dselect_bits` is cleared *and* set by the transfer loop. http2/3
  does no longer clear it, only set when new events happen.

This change unifies the handling of socket poll overrides, extending
`cselect_bits` by a easy handle specific value and a common treatment in
transfers.

Closes #11005

2 years agosocketpair: verify with a random value
Daniel Stenberg [Mon, 24 Apr 2023 12:14:11 +0000 (14:14 +0200)] 
socketpair: verify with a random value

... instead of using the curl time struct, since it would use a few
uninitialized bytes and the sanitizers would complain. This is a neater
approach I think.

Reported-by: Boris Kuschel
Fixes #10993
Closes #11015

2 years agoHTTP3: document the ngtcp2/nghttp3 versions to use for building curl
Stefan Eissing [Tue, 25 Apr 2023 10:05:54 +0000 (12:05 +0200)] 
HTTP3: document the ngtcp2/nghttp3 versions to use for building curl

- refs #11011 to clarify this for people building curl themselves

Closes #11019

2 years agolib: unify the upload/method handling
Daniel Stenberg [Tue, 25 Apr 2023 06:28:01 +0000 (08:28 +0200)] 
lib: unify the upload/method handling

By making sure we set state.upload based on the set.method value and not
independently as set.upload, we reduce confusion and mixup risks, both
internally and externally.

Closes #11017

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 25 Apr 2023 07:49:41 +0000 (09:49 +0200)] 
RELEASE-NOTES: synced

2 years agoCI: don't run CI jobs if only another CI was changed
Dan Fandrich [Mon, 24 Apr 2023 23:34:26 +0000 (16:34 -0700)] 
CI: don't run CI jobs if only another CI was changed

A few paths were missed in the last commit, as well as a job added since
then.

Followup-to 395b9175

2 years agoCI: adjust labeler match patterns
Dan Fandrich [Wed, 12 Apr 2023 16:39:45 +0000 (09:39 -0700)] 
CI: adjust labeler match patterns

2 years agoruntests: support buffering log messages in runner & servers 11016/head
Dan Fandrich [Fri, 21 Apr 2023 21:07:31 +0000 (14:07 -0700)] 
runtests: support buffering log messages in runner & servers

Log messages generated with logmsg can now be buffered and returned from
the runner as a return value.  This will be needed with parallel testing
to allow all messages for one test to be displayed together instead of
interspersed with messages of multiple tests. Buffering can be disabled
by setting a logging callback function with setlogfunc, which is
currently being done to preserve existing logging behaviour for now.

Some additional output is generated in verbose and debugprotocol modes,
which don't always use logmsg. These modes also impact some servers
which generate extra messages. No attempt is made to buffer everything
if these modes are enabled.

Ref: #10818
Closes #11016

2 years agoruntests: more consistently use logmsg in server control code
Dan Fandrich [Fri, 21 Apr 2023 23:21:04 +0000 (16:21 -0700)] 
runtests: more consistently use logmsg in server control code

Also, display an error when sshversioninfo returns one.

Ref: #10818

2 years agoruntests: create runner functions for clearlocks and stopservers
Dan Fandrich [Fri, 21 Apr 2023 22:00:00 +0000 (15:00 -0700)] 
runtests: create runner functions for clearlocks and stopservers

runtests.pl now uses runner for all server actions beyond the initial
variable configuration.

Ref: #10818

2 years agoruntests: tightened servers package exports
Dan Fandrich [Fri, 21 Apr 2023 21:07:06 +0000 (14:07 -0700)] 
runtests: tightened servers package exports

The defaults are intended for runtests.pl, whereas runner.pm needs to
explicitly specify them.

2 years agoruntests: display logs on server failure in singletest()
Dan Fandrich [Fri, 21 Apr 2023 19:40:11 +0000 (12:40 -0700)] 
runtests: display logs on server failure in singletest()

This is closer to the place where logs are displayed on test failure.
Also, only display these logs if -p is given, which is the same flag
that controls display of test failure logs. Some server log files
need to be deleted later so that they stay around long enough to be
displayed on failure.

Ref: #10818

2 years agoruntests: turn a print into a logmsg
Dan Fandrich [Fri, 21 Apr 2023 19:04:21 +0000 (12:04 -0700)] 
runtests: turn a print into a logmsg

Also enable another couple of useful messages in verbose mode.

Ref: #10818

2 years agohttp: store the password in the correct variable
Daniel Stenberg [Wed, 19 Apr 2023 06:23:19 +0000 (08:23 +0200)] 
http: store the password in the correct variable

Typo from fc2f1e547a4a, detected by Coverity (because there's dead code
due to this).

Closes #11002

2 years agoHTTP3/quiche: terminate h1 response header when no body is sent
Stefan Eissing [Thu, 20 Apr 2023 09:59:52 +0000 (11:59 +0200)] 
HTTP3/quiche: terminate h1 response header when no body is sent

- fixes a failure in test2501 where a response without body was missing
  the final empty line

Closes #11003

2 years agoruntests: move showdiff into runtests.pl
Dan Fandrich [Fri, 21 Apr 2023 18:10:22 +0000 (11:10 -0700)] 
runtests: move showdiff into runtests.pl

It's not used anywhere else.

2 years agodevtest: add a new script for testing the test harness
Dan Fandrich [Wed, 19 Apr 2023 17:30:01 +0000 (10:30 -0700)] 
devtest: add a new script for testing the test harness

This is currently useful for starting a test server on its own without
an associated test, which can be used for interactive curl testing or
for validating parts of the test harness itself. More commands can be
added to perform additional functions in the future.

Ref: #10818
Closes #11008

2 years agoruntests: refactor the main test loop into two
Dan Fandrich [Fri, 21 Apr 2023 00:41:31 +0000 (17:41 -0700)] 
runtests: refactor the main test loop into two

The test loop now has an initial loop that first runs through all
possible tests to build a set of those to attempt on this run based on
features and keywords and only then goes through that new list to run
them.  This actually makes it three loops through all tests cases, as
there is an existing loop that gathers possible test numbers from the
test files on disk.

This has two minor effects on the output: all the tests that will be
skipped are displayed at the start (instead of being interspersed with
other tests) and the -l option no longer shows a count of tests at the
end or a (misleading) statement that tests have run successfully. The
skipped tests are also omitted from the test results sent to AppVeyor
and Azure in CI builds.

Another effect is a reduction in the amount of work considered part of
the "Test definition reading and preparation time" reported with -r
making those figures slightly lower than before.

Ref: #10818

2 years agoruntests: track only the current test timings in runner.pm
Dan Fandrich [Wed, 19 Apr 2023 05:03:55 +0000 (22:03 -0700)] 
runtests: track only the current test timings in runner.pm

This avoids passing these data through through global variables, which
soon won't be possible.

Ref: #10818

2 years agoruntests: skip test preprocessing when doing -l
Dan Fandrich [Tue, 18 Apr 2023 21:15:09 +0000 (14:15 -0700)] 
runtests: skip test preprocessing when doing -l

This speeds up the output tremendously by avoiding unnecessary work.

2 years agoruntests: simplify value returned regarding use of valgrind
Dan Fandrich [Tue, 18 Apr 2023 20:53:30 +0000 (13:53 -0700)] 
runtests: simplify value returned regarding use of valgrind

As a side effect this will now also show in verbose mode that valgrind
is being skipped on tests that explicitly disable it, such as 600.

Ref: #10818

2 years agoruntests: fix quoting in Appveyor and Azure test integration 11010/head
Dan Fandrich [Sat, 22 Apr 2023 18:25:10 +0000 (11:25 -0700)] 
runtests: fix quoting in Appveyor and Azure test integration

Test 1442's name was not quoted correctly so wasn't registered in
Appveyor and it had the wrong name in Azure. The JSON string quotes were
also invalid, even though both servers happened to accept it regardless.

Closes #11010

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 19 Apr 2023 06:12:57 +0000 (08:12 +0200)] 
RELEASE-NOTES: synced

2 years agoruntests: spread out the port numbers used by servers
Dan Fandrich [Tue, 18 Apr 2023 15:47:25 +0000 (08:47 -0700)] 
runtests: spread out the port numbers used by servers

The server ports are chosen randomly for each server, but the random
ranges chosen were inconsistently-sized and overlapping. Now, they are
spread out more so at least the first random port chosen for each server
is guaranteed to not also be chosen by another server. The starting port
numbers are also raised to put them in the Ephemeral Port range—not the
range defined by RFC 6335 but the one used by Linux, which starts lower
and gives us more room to work with.

Reported-by: Daniel Stenberg
2 years agoruntests: fix problems on <killserver> failure
Dan Fandrich [Tue, 18 Apr 2023 04:31:38 +0000 (21:31 -0700)] 
runtests: fix problems on <killserver> failure

The verify time must be set in this case, like all cases. An error
message needs to be displayed as well.

2 years agoruntests: fix perl warning when <tool> is wrong
Dan Fandrich [Tue, 18 Apr 2023 04:10:55 +0000 (21:10 -0700)] 
runtests: fix perl warning when <tool> is wrong

2 years agoruntests: don't try to stop stunnel before trying again
Dan Fandrich [Mon, 17 Apr 2023 23:57:17 +0000 (16:57 -0700)] 
runtests: don't try to stop stunnel before trying again

Calling stopserver() before retrying stunnel due to an error would stop
the dependent server (such as HTTP) meaning stunnel would have nothing
to talk to when it came up. Don't try to force a stop when it didn't
actually start.  Also, don't mark the server as bad for future use when
it starts up on a retry.

Reported-by: eaglegai at github
Tested-by: eaglegai at github
Fixes #10976

2 years agoruntests: don't accidentally randomly choose the same port
Dan Fandrich [Mon, 17 Apr 2023 23:52:53 +0000 (16:52 -0700)] 
runtests: don't accidentally randomly choose the same port

If a server couldn't be started on a port, a new one is randomly chosen
and the server is tried again. Avoid accidentally using a
randomly-chosen 0 port offset by adding 1 to the random number.

Found-by: Daniel Stenberg
2 years agoruntests: don't attempt to use a port we know is in use
Dan Fandrich [Mon, 17 Apr 2023 23:44:09 +0000 (16:44 -0700)] 
runtests: don't attempt to use a port we know is in use

This reduces the startup time when there is a known conflict on the
random port chosen for a server.  This was already done for stunnel, but
now it's done for all servers.

2 years agohttp-server: fix server name in a log message
Dan Fandrich [Mon, 17 Apr 2023 21:58:20 +0000 (14:58 -0700)] 
http-server: fix server name in a log message

This changed when the file was renamed in commit cbf57176

2 years agoruntests: refactor into more packages
Dan Fandrich [Sat, 15 Apr 2023 00:22:05 +0000 (17:22 -0700)] 
runtests: refactor into more packages

testutil.pm now contains a few miscellaneous functions that are used in
several places but have no better place to live.  subvariables moves to
servers.pm since most variables that it substitutes relate to servers,
so this is the most appropriate place. Rename a few functions for better
naming consistency.

Ref: #10818
Closes #10995

2 years agoruntests: call timestampskippedevents() in singletest
Dan Fandrich [Fri, 14 Apr 2023 23:25:54 +0000 (16:25 -0700)] 
runtests: call timestampskippedevents() in singletest

..rather than by the runner

2 years agoruntests: assume a newer Valgrind by default
Dan Fandrich [Fri, 14 Apr 2023 23:11:58 +0000 (16:11 -0700)] 
runtests: assume a newer Valgrind by default

The tests for an older Valgrind version should probably just be deleted,
given that they're testing for an 18-year-old version.

2 years agoruntests: refactor test runner code into runner.pm
Dan Fandrich [Thu, 13 Apr 2023 22:33:38 +0000 (15:33 -0700)] 
runtests: refactor test runner code into runner.pm

This is code that is directly responsible for running a single test.
This will eventually run in a separate process as part of the parallel
testing project.

Ref: #10818

2 years agoruntests: skip unneeded work if test won't be running
Dan Fandrich [Thu, 13 Apr 2023 19:23:49 +0000 (12:23 -0700)] 
runtests: skip unneeded work if test won't be running

This speeds up tests by avoiding unnecessary processing.

Ref: #10818

2 years agoruntests: factor out singletest_postcheck
Dan Fandrich [Thu, 13 Apr 2023 18:58:41 +0000 (11:58 -0700)] 
runtests: factor out singletest_postcheck

This will eventually need to be part of the test runner.

Ref: #10818

2 years agotest303: kill server after test
Dan Fandrich [Sun, 16 Apr 2023 05:07:14 +0000 (22:07 -0700)] 
test303: kill server after test

Otherwise, an HTTP test closely following this one with a tight time
constraint (e.g. 672) could fail because the test server stays sitting
with the wait command for a while.

2 years agoOS400: provide ILE/RPG usage examples
Patrick Monnerat [Tue, 18 Apr 2023 01:04:32 +0000 (03:04 +0200)] 
OS400: provide ILE/RPG usage examples

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

2 years agoOS400: improve vararg emulation
Patrick Monnerat [Tue, 18 Apr 2023 00:04:00 +0000 (02:04 +0200)] 
OS400: improve vararg emulation

- Use V7R4 RPG procedure overloading to improve vararg emulation.

From OS400 V7R4 and above, ILE/RPG implements a limited procedure
overloading feature that can be used to improve curl's typed
implementation of varargs procedures. This commit applies it to
curl_easy_setopt(), curl_multi_setopt(), curl_share_setopt() and
curl_easy_getinfo().

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

2 years agoOS400: fix and complete ILE/RPG binding
Patrick Monnerat [Mon, 17 Apr 2023 23:48:45 +0000 (01:48 +0200)] 
OS400: fix and complete ILE/RPG binding

- Fix wrong definitions of CURL_ZERO_TERNINATED, curl_mime_data() and
  curl_mime_data_ccsid().

- Add recent definitions, in particular blob, header API and WebSockets
  API.

- Support for CURLVERSION_ELEVENTH.

- New functions for EBCDIC support.

Reflect these changes in README.OS400.

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

2 years agoOS400: implement EBCDIC support for recent features
Patrick Monnerat [Tue, 18 Apr 2023 14:34:04 +0000 (16:34 +0200)] 
OS400: implement EBCDIC support for recent features

- Support CURLVERSION_ELEVENTH.

- New function curl_url_strerror_ccsid().

- curl_easy_setopt_ccsid() supports blobs and 3 recent string options.

- New function curl_easy_header_ccsid().

- New generic latin1<-->ccsid conversion functions curl_from_ccsid() and
  curl_to_ccsid() for user convenience.

- README.OS400 updated accordingly.

- Removed a leftover QsoSSL support identifier.

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

2 years agoOS400: rework build scripts
Patrick Monnerat [Tue, 18 Apr 2023 14:27:35 +0000 (16:27 +0200)] 
OS400: rework build scripts

- Rename shell function "system" to "CLcommand" to avoid confusion with
  built-in command.

- Reformat scripts. Fix some indentations. Avoid lines > 80 characters
  where possible.

- Support ASCII runtime development files in a user-defined directory
  path.

- FIX SONAME detection.

- Drop form API test program compilation (does not exist anymore).

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

2 years agotests/sshserver.pl: Define AddressFamily earlier
Sevan Janiyan [Sun, 16 Apr 2023 22:21:21 +0000 (23:21 +0100)] 
tests/sshserver.pl: Define AddressFamily earlier

As the comment states "Address family must be specified before ListenAddress", otherwise the tests fail to run
`"failed starting SSH server" 52 times (582, 583, 600, 601, 602, 603, 604, 605, 606 and 43 more)`

Closes #10983

2 years agoquiche: Enable IDLE egress handling
Stefan Eissing [Tue, 18 Apr 2023 13:11:45 +0000 (15:11 +0200)] 
quiche: Enable IDLE egress handling

Follow-up to 544abeea which added the handling but wrongly left it
commented out.

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

2 years agodocs/examples/protofeats.c: Outputs all protocols and features
Daniel Stenberg [Mon, 17 Apr 2023 21:40:22 +0000 (23:40 +0200)] 
docs/examples/protofeats.c: Outputs all protocols and features

Showing off one way to get to char pointer arrays of info returned by
curl_version_info()

Closes #10991

2 years agotests/keywords.pl: remove
Daniel Stenberg [Mon, 17 Apr 2023 16:25:44 +0000 (18:25 +0200)] 
tests/keywords.pl: remove

This script does not work since the introduction of the test
preprocessing. If we need this functionality, it probably needs to be
moved into the runtests tool or similar.

Reported-by: Dan Fandrich
Fixes #10895
Closes #10987

2 years agohttp2: support HTTP/2 to forward proxies, non-tunneling
Stefan Eissing [Fri, 14 Apr 2023 09:38:14 +0000 (11:38 +0200)] 
http2: support HTTP/2 to forward proxies, non-tunneling

- with `--proxy-http2` allow h2 ALPN negotiation to
  forward proxies
- applies to http: requests against a https: proxy only,
  as https: requests will auto-tunnel
- adding a HTTP/1 request parser in http1.c
- removed h2h3.c
- using new request parser in nghttp2 and all h3 backends
- adding test 2603 for request parser
- adding h2 proxy test cases to test_10_*

scorecard.py: request scoring accidentally always run curl
with '-v'. Removed that, expect double numbers.

labeller: added http1.* and h2-proxy sources to detection

Closes #10967

2 years agocurl_easy_unescape.3: rename the argument
Daniel Stenberg [Sun, 16 Apr 2023 15:04:39 +0000 (17:04 +0200)] 
curl_easy_unescape.3: rename the argument

and highlight it appropriately in the text.

Closes #10979

2 years agoautotools: sync up clang picky warnings with cmake
Viktor Szakats [Mon, 17 Apr 2023 11:35:56 +0000 (11:35 +0000)] 
autotools: sync up clang picky warnings with cmake

Bringing missing options over from CMake.

Move around existing `-Wno-pointer-bool-conversion` option to come
_after_ `-Wconversion`.

Reviewed-by: Marcel Raad
Closes #10974

2 years agotests/libtest/lib1900.c: remove
Daniel Stenberg [Mon, 17 Apr 2023 10:45:14 +0000 (12:45 +0200)] 
tests/libtest/lib1900.c: remove

This file was left behind when the rest of the test was previously removed.

Follow-up to e50a877df74f

2 years agosrc/tool_operhlp.c: fix value stored to 'uerr' is never read
Daniel Stenberg [Sun, 16 Apr 2023 21:01:18 +0000 (23:01 +0200)] 
src/tool_operhlp.c: fix value stored to 'uerr' is never read

Ref: https://github.com/curl/curl/pull/10974#issuecomment-1510461343
Reported-by: Viktor Szakats
Closes #10982