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

2 years agocmake: speed up and extend picky clang/gcc options
Viktor Szakats [Sun, 16 Apr 2023 22:28:25 +0000 (22:28 +0000)] 
cmake: speed up and extend picky clang/gcc options

Extend existing picky compiler options with ones missing compared to
autotools builds. Also sync options between clang and gcc.

Redesign the way we enable these options to avoid the slow option
detection almost completely.

This reduces the number of detections from 35 to zero for clang and
3 for gcc, even after adding a bunch of new options.

clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required.

Also show enabled picky options.

Ref: https://github.com/libssh2/libssh2/pull/952

Reviewed-by: Daniel Stenberg
Closes #10973

2 years agonbtlm: use semicolons instead of commas for (void) args
Andreas Falkenhahn [Sun, 16 Apr 2023 13:37:59 +0000 (15:37 +0200)] 
nbtlm: use semicolons instead of commas for (void) args

Closes #10978

2 years agomulti: free up more data earleier in DONE
Daniel Stenberg [Sat, 15 Apr 2023 19:11:36 +0000 (21:11 +0200)] 
multi: free up more data earleier in DONE

Before checking for more users of the connection and possibly bailing
out.

Fixes #10971
Reported-by: Paweł Wegner
Closes #10972

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 15 Apr 2023 09:09:38 +0000 (11:09 +0200)] 
RELEASE-NOTES: synced

2 years agocurl: do NOT append file name to path for upload when there's a query
Daniel Stenberg [Fri, 14 Apr 2023 21:46:51 +0000 (23:46 +0200)] 
curl: do NOT append file name to path for upload when there's a query

Added test 425 to verify.

Reported-by: Dirk Rosenkranz
Bug: https://curl.se/mail/archive-2023-04/0008.html
Closes #10969

2 years agolibcurl-thread.3: improved name resolver wording
Daniel Stenberg [Fri, 14 Apr 2023 09:34:55 +0000 (11:34 +0200)] 
libcurl-thread.3: improved name resolver wording

And make better .SH sections

Closes #10966

2 years agoCURLOPT_PROXY_SSL_VERIFYPEER.3: fix minor grammar mistake
Colman Mbuya [Fri, 14 Apr 2023 13:36:40 +0000 (15:36 +0200)] 
CURLOPT_PROXY_SSL_VERIFYPEER.3: fix minor grammar mistake

Closes #10968

2 years agocurl: add --proxy-http2
Daniel Stenberg [Tue, 11 Apr 2023 09:20:12 +0000 (11:20 +0200)] 
curl: add --proxy-http2

For trying HTTP/2 with an HTTPS proxy.

Closes #10926

2 years agoKNOWN_BUGS: remove fixed or outdated issues, move non-bugs
Daniel Stenberg [Thu, 13 Apr 2023 16:15:31 +0000 (18:15 +0200)] 
KNOWN_BUGS: remove fixed or outdated issues, move non-bugs

- remove h3 issues believed to be fixed

- make the flaky CI issue be generic and not Windows specific

- "TLS session cache does not work with TFO" now documented

  This is now a documented restriction and not a bug. TFO in general is
  rarely used and has other problems, making it a low-priotity thing to
  work on.

- remove "Renegotiate from server may cause hang for OpenSSL backend"

  This is an OpenSSL issue, not a curl one. Even if it taints curl.

- rm "make distclean loops forever"

- rm "configure finding libs in wrong directory"

  Added a section to docs/INSTALL.md about it.

- "A shared connection cache is not thread-safe"

  Moved over to TODO and expanded for other sharing improvements we
  could do

- rm "CURLOPT_OPENSOCKETPAIRFUNCTION is missing"

- rm "Blocking socket operations in non-blocking API"

  Already listed as a TODO

- rm "curl compiled on OSX 10.13 failed to run on OSX 10.10"

  Water under the bridge. No one cares about this anymore.

- rm "build on Linux links libcurl to libdl"

  Verified to not be true (anymore).

- rm "libpsl is not supported"

  The cmake build supports it since cafb356e19cda22

Closes #10963

2 years agourl: fix PVS nits
Daniel Stenberg [Thu, 13 Apr 2023 11:52:08 +0000 (13:52 +0200)] 
url: fix PVS nits

- expression 'hostptr' is always true
- a part of conditional expression is always true: proxypasswd
- expression 'proxyuser' is always true
- avoid multiple Curl_now() calls in allocate_conn

Ref: #10929
Closes #10959

2 years agobufq: simplify since expression is always true
Daniel Stenberg [Thu, 13 Apr 2023 11:43:18 +0000 (13:43 +0200)] 
bufq: simplify since expression is always true

The check for 'len' is already done so it will remain true until
updated. Pointed out by PVS.

Ref: #10929
Closes #10958

2 years agohash: fix assigning same value
Daniel Stenberg [Thu, 13 Apr 2023 11:06:55 +0000 (13:06 +0200)] 
hash: fix assigning same value

Pointed out by PVS

Ref: #10929
Closes #10956

2 years agocookie: address PVS nits
Daniel Stenberg [Thu, 13 Apr 2023 10:59:24 +0000 (12:59 +0200)] 
cookie: address PVS nits

- avoid assigning the same value again
- remove superfluous check of co->domain
- reduce variable scope for namep/valuep

Ref: #10929
Closes #10954

2 years agocf-socket: Disable socket receive buffer by default
Stefan Eissing [Thu, 13 Apr 2023 15:46:52 +0000 (17:46 +0200)] 
cf-socket: Disable socket receive buffer by default

- Disable socket receive buffer unless USE_RECV_BEFORE_SEND_WORKAROUND
  is in place.

While we would like to use the receive buffer, we have stalls in
parallel transfers where not all buffered data is consumed and no socket
events happen.

Note USE_RECV_BEFORE_SEND_WORKAROUND is a Windows sockets workaround
that has been disabled by default since b4b6e4f1, due to other bugs.

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

2 years agocf-h2-proxy: fix processing ingress to stop too early
Stefan Eissing [Thu, 13 Apr 2023 10:04:27 +0000 (12:04 +0200)] 
cf-h2-proxy: fix processing ingress to stop too early

- progress ingress stopped too early, causing data
  from the underlying filters to not be processed and
  report that no tunnel data was available
- this lead to "hangers" where no socket activity was
  seen but data rested in buffers

Closes #10952

2 years agohttp3: check stream_ctx more thoroughly in all backends
Stefan Eissing [Thu, 13 Apr 2023 09:03:50 +0000 (11:03 +0200)] 
http3: check stream_ctx more thoroughly in all backends

- callbacks and filter methods might be invoked at unexpected
  times, e.g. when the transfer's stream_ctx has not been initialized
  yet or, more likely, has already been taken down.
- check for existance of stream_ctx in such places and return
  an error or silently succeed the call.

Closes #10951

2 years agoftp: fix 'portsock' variable was assigned the same value
Daniel Stenberg [Thu, 13 Apr 2023 11:02:54 +0000 (13:02 +0200)] 
ftp: fix 'portsock' variable was assigned the same value

Pointed out by PVS

Ref: #10929
Closes #10955

2 years agoftp: remove dead code
Daniel Stenberg [Thu, 13 Apr 2023 11:33:52 +0000 (13:33 +0200)] 
ftp: remove dead code

This condition can never be true here since it is handled already 28
lines above.

Pointed out by PVS.

Ref: #10929
Closes #10957

2 years agocf-h1-proxy: skip an extra NULL assign
Daniel Stenberg [Thu, 13 Apr 2023 10:50:04 +0000 (12:50 +0200)] 
cf-h1-proxy: skip an extra NULL assign

and use Curl_safefree() once to save another NULL assign. Found by PVS.

Ref. #10929
Closes #10953

2 years agoGHA: suppress git clone output
Philip H [Thu, 13 Apr 2023 07:45:54 +0000 (09:45 +0200)] 
GHA: suppress git clone output

Follow-up: https://github.com/curl/curl/commit/8203aa6ed405ec832d2c62f18dfda293f89a23f9

Closes #10949

2 years agocf-socket: remove dead code discovered by PVS
Stefan Eissing [Thu, 13 Apr 2023 11:52:42 +0000 (13:52 +0200)] 
cf-socket: remove dead code discovered by PVS

Closes #10960

2 years agohttp: skip a double NULL assign
Daniel Stenberg [Thu, 13 Apr 2023 08:04:04 +0000 (10:04 +0200)] 
http: skip a double NULL assign

and also use a local variable to shorten the long names and increase
readability in the function. Pointed out by PVS.

Ref: #10929
Closes #10950

2 years agomime: skip NULL assigns after Curl_safefree()
Daniel Stenberg [Thu, 13 Apr 2023 07:43:31 +0000 (09:43 +0200)] 
mime: skip NULL assigns after Curl_safefree()

Pointed out by PVS.

Ref: #10929
Closes #10947

2 years agortsp: skip NULL assigns after Curl_safefree()
Daniel Stenberg [Thu, 13 Apr 2023 07:36:57 +0000 (09:36 +0200)] 
rtsp: skip NULL assigns after Curl_safefree()

... since this is a macro that assigns NULL itself. Pointed out by PVS.

Ref: #10929
Closes #10946

2 years agosmb: remove double assign
Daniel Stenberg [Thu, 13 Apr 2023 07:33:55 +0000 (09:33 +0200)] 
smb: remove double assign

The same value is assigned the same value already a few lines above.
Pointed out by PVS.

Ref: #10929
Closes #10945

2 years agotransfer: skip extra assign
Daniel Stenberg [Thu, 13 Apr 2023 07:29:59 +0000 (09:29 +0200)] 
transfer: skip extra assign

The 'result' variable already contains CURLE_OK at this point, no use in
setting it again. Pointed out by PVS.

Ref: #10929
Closes #10944

2 years agourlapi: skip a pointless assign
Daniel Stenberg [Thu, 13 Apr 2023 07:23:01 +0000 (09:23 +0200)] 
urlapi: skip a pointless assign

It stores a null byte after already having confirmed there is a null
byte there. Detected by PVS.

Ref: #10929
Closes #10943

2 years agoGHA: suppress git clone output
Philip H [Wed, 12 Apr 2023 08:27:42 +0000 (10:27 +0200)] 
GHA: suppress git clone output

Closes #10939

2 years agotests: make test_12_01 a bit more forgiving on connection counts
Stefan Eissing [Thu, 30 Mar 2023 13:25:14 +0000 (15:25 +0200)] 
tests: make test_12_01 a bit more forgiving on connection counts

2 years agocf-socket: add socket recv buffering for most tcp cases
Stefan Eissing [Thu, 30 Mar 2023 11:25:20 +0000 (13:25 +0200)] 
cf-socket: add socket recv buffering for most tcp cases

- use bufq as recv buffer, also for Windows pre-receive handling
- catch small reads followed by larger ones in a single socket
  call. A common pattern on TLS connections.

Closes #10787

2 years agourlapi: cleanups
Daniel Stenberg [Tue, 11 Apr 2023 15:06:54 +0000 (17:06 +0200)] 
urlapi: cleanups

- move host checks together
- simplify the scheme parser loop and the end of host name parser
- avoid itermediate buffer storing in multiple places
- reduce scope for several variables
- skip the Curl_dyn_tail() call for speed
- detect IPv6 earlier and skip extra checks for such hosts
- normalize directly in dynbuf instead of itermediate buffer
- split out the IPv6 parser into its own funciton
- call the IPv6 parser directly for ipv6 addresses
- remove (unused) special treatment of % in host names
- junkscan() once in the beginning instead of scattered
- make junkscan return error code
- remove unused query management from dedotdotify()
- make Curl_parse_login_details use memchr
- more use of memchr() instead of strchr() and less strlen() calls
- make junkscan check and return the URL length

An optimized build runs one of my benchmark URL parsing programs ~41%
faster using this branch. (compared against the shipped 7.88.1 library
in Debian)

Closes #10935

2 years agohttp2: fix typo in infof() call
Josh McCullough [Wed, 12 Apr 2023 17:08:18 +0000 (13:08 -0400)] 
http2: fix typo in infof() call

Closes #10940

2 years agonoproxy: pointer to local array 'hostip' is stored outside scope
Daniel Stenberg [Tue, 11 Apr 2023 14:24:29 +0000 (16:24 +0200)] 
noproxy: pointer to local array 'hostip' is stored outside scope

Ref: #10929
Closes #10933

2 years agoconnect: fix https connection setup to treat ssl_mode correctly
Stefan Eissing [Tue, 11 Apr 2023 14:34:01 +0000 (16:34 +0200)] 
connect: fix https connection setup to treat ssl_mode correctly

- for HTTPS protocol, a disabled ssl should never be acceptables.

Closes #10934

2 years agoCMakeLists.txt: fix typo for Haiku detection
Douglas R. Reno [Wed, 12 Apr 2023 01:11:41 +0000 (20:11 -0500)] 
CMakeLists.txt: fix typo for Haiku detection

Closes #10937

2 years agopathhelp: use the cached $use_cygpath when available
Dan Fandrich [Tue, 11 Apr 2023 00:28:09 +0000 (17:28 -0700)] 
pathhelp: use the cached $use_cygpath when available

2 years agoruntests: eliminate unneeded variable
Dan Fandrich [Mon, 10 Apr 2023 22:57:31 +0000 (15:57 -0700)] 
runtests: eliminate unneeded variable

2 years agoruntests: make the # of server start attempts a constant
Dan Fandrich [Sun, 9 Apr 2023 01:27:02 +0000 (18:27 -0700)] 
runtests: make the # of server start attempts a constant

2 years agoruntests: on startup failure call displaylogs only in serverfortest
Dan Fandrich [Sun, 9 Apr 2023 01:31:39 +0000 (18:31 -0700)] 
runtests: on startup failure call displaylogs only in serverfortest

This reduces the number of calls spread throughout the code.

Ref: #10818
Closes #10919

2 years agoruntests: return an error code with startservers()
Dan Fandrich [Sun, 9 Apr 2023 00:13:16 +0000 (17:13 -0700)] 
runtests: return an error code with startservers()

The code indicates the kind of failure encountered in starting a server,
which can be used by the caller to tailor the user experience.

Ref: #10818

2 years agoruntests: abort early if runpingpongserver is given a bad server type
Dan Fandrich [Sat, 8 Apr 2023 22:27:39 +0000 (15:27 -0700)] 
runtests: abort early if runpingpongserver is given a bad server type

2 years agoruntests: don't use the SMB server verification time as reference
Dan Fandrich [Sat, 1 Apr 2023 15:59:38 +0000 (08:59 -0700)] 
runtests: don't use the SMB server verification time as reference

%FTPTIME2 and %FTPTIME3 should be set by the FTP server only, for
consistency.

2 years agotests: factor out the test server management code
Dan Fandrich [Thu, 6 Apr 2023 00:26:20 +0000 (17:26 -0700)] 
tests: factor out the test server management code

This now lives in servers.pm with some configuration variables moved to
globalconfig.pm

Ref: #10818

2 years agoruntests: remove an inappropriate use of runclientoutput
Dan Fandrich [Tue, 11 Apr 2023 00:09:56 +0000 (17:09 -0700)] 
runtests: remove an inappropriate use of runclientoutput

This function is intended for running client code, not servers.