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

2 years agowrite-out.d: add missing periods
Ali Khodkar [Thu, 6 Apr 2023 09:01:14 +0000 (12:31 +0330)] 
write-out.d: add missing periods

Closes #10897

2 years agohttp2: remove check for !data after it was already dereferenced
Daniel Stenberg [Fri, 7 Apr 2023 17:32:03 +0000 (19:32 +0200)] 
http2: remove check for !data after it was already dereferenced

Pointed out by Coverity

Closes #10906

2 years agohttp_proxy: provide missing arg to infof() call
Daniel Stenberg [Fri, 7 Apr 2023 12:05:00 +0000 (14:05 +0200)] 
http_proxy: provide missing arg to infof() call

Pointed out by Coverity

Closes #10904

2 years agocontent_encoding: only do tranfer-encoding compression if asked to
Daniel Stenberg [Thu, 6 Apr 2023 10:11:42 +0000 (12:11 +0200)] 
content_encoding: only do tranfer-encoding compression if asked to

To reduce surprises. Update test 387 and 418 accordingly.

Closes #10899

2 years agosws: comparison of unsigned expression < 0 is always false
Daniel Stenberg [Thu, 6 Apr 2023 21:55:00 +0000 (23:55 +0200)] 
sws: comparison of unsigned expression < 0 is always false

Follow-up to 356dd0b73a75ed6d5

Closes #10903

2 years agolib/cmake: add HAVE_WRITABLE_ARGV check
Daniel Stenberg [Thu, 6 Apr 2023 08:06:30 +0000 (10:06 +0200)] 
lib/cmake: add HAVE_WRITABLE_ARGV check

Assisted-by: Jakub Zakrzewski
Closes #10896

2 years agoconfigure: don't set HAVE_WRITABLE_ARGV on Windows
Daniel Stenberg [Thu, 6 Apr 2023 07:58:13 +0000 (09:58 +0200)] 
configure: don't set HAVE_WRITABLE_ARGV on Windows

Ref: #10888
Closes #10896

2 years agovtls: fix build error when proxy-disabled
Daniel Stenberg [Thu, 6 Apr 2023 14:34:21 +0000 (16:34 +0200)] 
vtls: fix build error when proxy-disabled

Closes #10901

2 years agotests: increase sws timeout for more robust testing
Stefan Eissing [Thu, 6 Apr 2023 09:19:46 +0000 (11:19 +0200)] 
tests: increase sws timeout for more robust testing

- for https CONNECT forwarding, this was fixed at 5 seconds
  which led to spurious CI test failures
- add --keepalive parameter to sws to control this
- let httpserver use 30 seconds

Closes #10898

2 years agohttp2: move HTTP/2 stream vars into local context
Stefan Eissing [Thu, 6 Apr 2023 09:59:12 +0000 (11:59 +0200)] 
http2: move HTTP/2 stream vars into local context

- remove NGHTTP2 members of `struct HTTP`
- add `void *h2_ctx` to `struct HTTP`
- add `void *h3_ctx` to `struct HTTP`
- separate h2/h3 pointers are needed for eyeballing
- manage local stream_ctx in http implementations

Closes #10877

2 years agoproxy: http2 proxy tunnel implementation
Stefan Eissing [Thu, 6 Apr 2023 07:54:57 +0000 (09:54 +0200)] 
proxy: http2 proxy tunnel implementation

- currently only on debug build and when env variable
  CURL_PROXY_TUNNEL_H2 is present.
- will ALPN negotiate with the proxy server and switch
  tunnel filter based on the protocol negotiated.
- http/1.1 tunnel code moved into cf-h1-proxy.[ch]
- http/2 tunnel code implemented in cf-h2-proxy.[ch]
- tunnel start and ALPN set remains in http_proxy.c
- moving all haproxy related code into cf-haproxy.[ch]

VTLS changes
- SSL filters rely solely on the "alpn" specification they
  are created with and no longer check conn->bits.tls_enable_alpn.
- checks on which ALPN specification to use (or none at all) are
  done in vtls.c when creating the filter.

Testing
- added a nghttpx forward proxy to the pytest setup that
  speaks HTTP/2 and forwards all requests to the Apache httpd
  forward proxy server.
- extending test coverage in test_10 cases
- adding proxy tests for direct/tunnel h1/h2 use of basic auth.
- adding test for http/1.1 and h2 proxy tunneling to pytest

Closes #10780

2 years agovtls and h2 improvements
Stefan Eissing [Wed, 5 Apr 2023 12:52:16 +0000 (14:52 +0200)] 
vtls and h2 improvements

- eliminate receive loop in vtls to fill buffer. This may
  lead to partial reads of data which is counter productive
- let http2 instead loop smarter to process pending network
  data without transfer switches

scorecard improvements
- do not start caddy when only httpd is requested
- allow curl -v to stderr file on --curl-verbose

Closes #10891

2 years agotests: 1078 1288 1297 use valid IPv4 addresses
Daniel Stenberg [Wed, 5 Apr 2023 21:44:44 +0000 (23:44 +0200)] 
tests: 1078 1288 1297 use valid IPv4 addresses

With the enhanced URL parser, these tests failed because of their bad
IPv4 use.

2 years agourlapi: detect and error on illegal IPv4 addresses
Daniel Stenberg [Wed, 5 Apr 2023 21:13:33 +0000 (23:13 +0200)] 
urlapi: detect and error on illegal IPv4 addresses

Using bad numbers in an IPv4 numerical address now returns
CURLUE_BAD_HOSTNAME.

I noticed while working on trurl and it was originally reported here:
https://github.com/curl/trurl/issues/78

Updated test 1560 accordingly.

Closes #10894

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 5 Apr 2023 06:34:30 +0000 (08:34 +0200)] 
RELEASE-NOTES: synced

2 years agourlapi: URL encoding for the URL missed the fragment
Daniel Stenberg [Tue, 4 Apr 2023 14:59:59 +0000 (16:59 +0200)] 
urlapi: URL encoding for the URL missed the fragment

Meaning that it would wrongly still store the fragment using spaces
instead of %20 if allowing space while also asking for URL encoding.

Discovered when playing with trurl.

Added test to lib1560 to verify the fix.

Closes #10887

2 years agortsp: convert mallocs to dynbuf for RTP buffering
Daniel Stenberg [Tue, 4 Apr 2023 12:44:25 +0000 (14:44 +0200)] 
rtsp: convert mallocs to dynbuf for RTP buffering

Closes #10786

2 years agotool_writeout: add URL component variables
Daniel Stenberg [Tue, 4 Apr 2023 12:42:44 +0000 (14:42 +0200)] 
tool_writeout: add URL component variables

Output specific components from the used URL. The following variables
are added for this purpose:

  url.scheme, url.user, url.password, url.options, url.host, url.port,
  url.path, url.query, url.fragment, url.zoneid

Add the following for outputting parts of the "effective URL":

 urle.scheme, urle.user, urle.password, urle.options, urle.host, urle.port,
 urle.path, urle.query, urle.fragment, urle.zoneid

Added test 423 and 424 to verify.

Closes #10853

2 years agotests/http: improved httpd detection
Stefan Eissing [Mon, 3 Apr 2023 09:58:21 +0000 (11:58 +0200)] 
tests/http: improved httpd detection

- better error messages when not found/complete
- handling of `--without-test-httpd`

Reported-by: kwind on github
Fixes #10879
Closes #10883

2 years agoconfigure: make quiche require quiche_conn_send_ack_eliciting
Daniel Stenberg [Tue, 4 Apr 2023 08:47:35 +0000 (10:47 +0200)] 
configure: make quiche require quiche_conn_send_ack_eliciting

curl now requires quiche version >= 1.17.1 to be used and this function
was added in this version and makes a convenient check.

This requirement is because this is the lowest quiche version that
supports peer-initiated key updates correctly.

Closes #10886

2 years agounit tests: use the unit test infrastructure better
Dan Fandrich [Sat, 1 Apr 2023 15:59:38 +0000 (08:59 -0700)] 
unit tests: use the unit test infrastructure better

Allow UNITTEST_STOP to return the error code, use the fail & abort
macros to indicate test failure and return success instead of fail if
the unit test can't test anything because of missing features at
compile-time.  A couple of tests could never fail because they were
overriding the failure return code.

2 years agoruntests: strip EOL on precheck output on Windows, too
Dan Fandrich [Fri, 31 Mar 2023 21:23:46 +0000 (14:23 -0700)] 
runtests: strip EOL on precheck output on Windows, too

Precheck failures would show on two lines in the test summary output
otherwise.

2 years agotests: move server config files under the pid dir
Dan Fandrich [Fri, 31 Mar 2023 04:32:17 +0000 (21:32 -0700)] 
tests: move server config files under the pid dir

These files are generated by the test servers and must therefore be
found in the log directory to make them available to only those servers
once multiple test runners are executing in parallel. They must also not
be deleted with the log files, so they are stored in the pidfile
directory.

Ref: #10818
Closes #10875

2 years agoruntests: use the ssh key filenames from the sshhelp package
Dan Fandrich [Fri, 31 Mar 2023 02:42:06 +0000 (19:42 -0700)] 
runtests: use the ssh key filenames from the sshhelp package

2 years agotests: move pidfiles and portfiles under the log directory
Dan Fandrich [Thu, 30 Mar 2023 20:25:17 +0000 (13:25 -0700)] 
tests: move pidfiles and portfiles under the log directory

This is to segregate all files written by a test process into a single
root to allow for future parallel testing.

Ref: #10818
Closes #10874