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

2 years agoruntests: only add $LIBDIR to the path for checktestcmd
Dan Fandrich [Mon, 10 Apr 2023 23:41:07 +0000 (16:41 -0700)] 
runtests: only add $LIBDIR to the path for checktestcmd

Since checkcmd is for finding servers, there will never be anything in
this directory of interest to them.

Ref: #10818

2 years agotests: log sshserver.pl messages to a file
Dan Fandrich [Sat, 8 Apr 2023 20:18:22 +0000 (13:18 -0700)] 
tests: log sshserver.pl messages to a file

The logmsg messages were thrown away before, so they are now available
for debugging.

2 years agoruntests: also show DISABLED tests with -l
Dan Fandrich [Sat, 8 Apr 2023 19:11:26 +0000 (12:11 -0700)] 
runtests: also show DISABLED tests with -l

Other reasons for skipping tests are ignored for -l, so being explicitly
disabled should be too.

2 years agoruntests: move the UNIX sockets into $PIDDIR
Dan Fandrich [Sat, 8 Apr 2023 17:56:15 +0000 (10:56 -0700)] 
runtests: move the UNIX sockets into $PIDDIR

These were missed when the other server files were moved there.

Follow-up to 70d2fca2

Ref: #10818

2 years agotests: tighten up perl exports
Dan Fandrich [Wed, 5 Apr 2023 22:29:00 +0000 (15:29 -0700)] 
tests: tighten up perl exports

This reduces namespace pollution a little.

Ref: #10818

2 years agotests: turn perl modules into full packages
Dan Fandrich [Wed, 5 Apr 2023 19:28:26 +0000 (12:28 -0700)] 
tests: turn perl modules into full packages

This helps enforce more modularization and encapsulation. Enable and fix
warnings on a few packages.  Also, rename ftp.pm to processhelp.pm since
there's really nothing ftp-specific in it.

Ref: #10818

2 years agomulti: remove a few superfluous assigns
Daniel Stenberg [Tue, 11 Apr 2023 13:01:22 +0000 (15:01 +0200)] 
multi: remove a few superfluous assigns

PVS found these "The 'rc' variable was assigned the same value." cases.

Ref: #10929
Closes #10932

2 years agoschannel: add clarifying comment
Daniel Stenberg [Tue, 11 Apr 2023 12:40:46 +0000 (14:40 +0200)] 
schannel: add clarifying comment

Explaining how the PVS warning in #10929 is wrong: Dereferencing of the
null pointer 'backend->cred' might take place.

Closes #10931

2 years agocookie: clarify that init with data set to NULL reads no file
Daniel Stenberg [Tue, 11 Apr 2023 12:14:09 +0000 (14:14 +0200)] 
cookie: clarify that init with data set to NULL reads no file

... and make Curl_cookie_add() require 'data' being set proper with an
assert.

The function has not worked with a NULL data for quite some time so this
just corrects the code and comment.

This is a different take than the proposed fixed in #10927

Reported-by: Kvarec Lezki
Ref: #10929
Closes #10930

2 years agovtls: remove int typecast for sizeof()
Kvarec Lezki [Tue, 11 Apr 2023 11:11:50 +0000 (16:11 +0500)] 
vtls: remove int typecast for sizeof()

V220 Suspicious sequence of types castings: memsize -> 32-bit integer ->
memsize. The value being cast: 'sizeof
(buf->data)'. curl\lib\vtls\vtls.c 2025

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

Closes #10928

2 years agohttp2: fix copynpaste error reported by coverity
Stefan Eissing [Tue, 11 Apr 2023 08:07:59 +0000 (10:07 +0200)] 
http2: fix copynpaste error reported by coverity

- move all code handling HTTP/2 frames for a particular
  stream into a separate function to keep from confusing
  the call `data` with the stream `data`.

Closes #10924

2 years agotests: log a too-long Unix socket path in sws and socksd
Dan Fandrich [Tue, 11 Apr 2023 17:07:30 +0000 (10:07 -0700)] 
tests: log a too-long Unix socket path in sws and socksd

Ref: #10919

2 years agogen.pl: error on duplicated See-Also fields
Daniel Stenberg [Tue, 11 Apr 2023 09:15:33 +0000 (11:15 +0200)] 
gen.pl: error on duplicated See-Also fields

Updated http2.d accordingly.

Closes #10925

2 years agohttp2: avoid possible null pointer dereference
Daniel Stenberg [Tue, 11 Apr 2023 07:22:08 +0000 (09:22 +0200)] 
http2: avoid possible null pointer dereference

Reported-by: Dan Fandrich
Fixes #10920
Closes #10923

2 years agolib1560: verify that more bad host names are rejected
Daniel Stenberg [Tue, 11 Apr 2023 07:15:41 +0000 (09:15 +0200)] 
lib1560: verify that more bad host names are rejected

when setting the hostname component of a URL

Closes #10922

2 years agocurl_url_set.3: mention that users can set content rather freely
Daniel Stenberg [Tue, 11 Apr 2023 06:59:00 +0000 (08:59 +0200)] 
curl_url_set.3: mention that users can set content rather freely

... which then might render bad URLs if you extract a URL later.

Closes #10921

2 years agoCI: retry failed downloads of aws-lc
Dan Fandrich [Mon, 10 Apr 2023 19:19:11 +0000 (12:19 -0700)] 
CI: retry failed downloads of aws-lc

Don't fail the build in case of a temporary server problem.

2 years agotest1169: fix so it works properly everywhere 10917/head
Dan Fandrich [Mon, 10 Apr 2023 18:05:55 +0000 (11:05 -0700)] 
test1169: fix so it works properly everywhere

- Use an absolute path for the -L option since the module isn't in the
  perl path
- Create the needed test file in a <file> section; <precheck> isn't
  intended for this
- Fix the test number in the file name, which was wrong

Follow-up to f754990a

Ref: #10818
Fixes #10889
Closes #10917

2 years agotests: stop using strndup(), which isn't portable
Dan Fandrich [Mon, 10 Apr 2023 17:35:04 +0000 (10:35 -0700)] 
tests: stop using strndup(), which isn't portable

It's not available on Solaris 10, for example. Since this is just test
code that doesn't need to use an optimized system version, replace it
with the implementation copied from tool_cb_hdr.c.

2 years agoruntests: fix an incorrect comment about the ld_preload feature
Dan Fandrich [Mon, 10 Apr 2023 17:42:21 +0000 (10:42 -0700)] 
runtests: fix an incorrect comment about the ld_preload feature

Follow-up to 1f631864

Ref: #10818

2 years agourlapi: prevent setting invalid schemes with *url_set()
Daniel Stenberg [Sat, 8 Apr 2023 22:38:00 +0000 (00:38 +0200)] 
urlapi: prevent setting invalid schemes with *url_set()

A typical mistake would be to try to set "https://" - including the
separator - this is now rejected as that would then lead to
url_get(... URL...) would get an invalid URL extracted.

Extended test 1560 to verify.

Closes #10911

2 years agohttp2: remove unused Curl_http2_strerror function declaration
Biswapriyo Nath [Sun, 9 Apr 2023 05:48:53 +0000 (11:18 +0530)] 
http2: remove unused Curl_http2_strerror function declaration

Curl_http2_strerror was renamed to http2_strerror in
05b100aee247bb9bec8e9a1b0 and then http2_strerror was removed in
5808a0d0f5ea0399d4a2a2

This also fixes the following compiler error

lib/http2.h:41:33: error: unknown type name 'uint32_t'
lib/http2.h:1:1: note: 'uint32_t' is defined in header '<stdint.h>'

Closes #10912

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 8 Apr 2023 21:57:30 +0000 (23:57 +0200)] 
RELEASE-NOTES: synced

2 years agoconfig-dos.h: fix SIZEOF_CURL_OFF_T for MS-DOS/DJGPP
SuperIlu on github [Sat, 8 Apr 2023 15:50:14 +0000 (17:50 +0200)] 
config-dos.h: fix SIZEOF_CURL_OFF_T for MS-DOS/DJGPP

Fixes #10905
Closes #10910

2 years agolib: remove CURLX_NO_MEMORY_CALLBACKS
Daniel Stenberg [Fri, 7 Apr 2023 22:44:59 +0000 (00:44 +0200)] 
lib: remove CURLX_NO_MEMORY_CALLBACKS

The only user of this define was 'chkdecimalpoint' - a special purpose
test tool that was built but not used anymore (since 17c18fbc3 - Apr
2020).

Closes #10908

2 years agoCURLPROXY_HTTPS2: for HTTPS proxy that may speak HTTP/2
Daniel Stenberg [Thu, 6 Apr 2023 12:33:05 +0000 (14:33 +0200)] 
CURLPROXY_HTTPS2: for HTTPS proxy that may speak HTTP/2

Setting this proxy type allows curl to negotiate and use HTTP/2 with
HTTPS proxies.

Closes #10900