Commit Graph

31151 Commits

Author SHA1 Message Date
Daniel Stenberg
c0998fa9a9
wolfSSL: avoid the OpenSSL compat API when not needed
... and instead call wolfSSL functions directly.

Closes #11752
2023-08-28 23:46:52 +02:00
Viktor Szakats
d50fe6becb
lib: fix null ptr derefs and uninitialized vars (h2/h3)
Fixing compiler warnings with gcc 13.2.0 in unity builds.

Assisted-by: Jay Satiro
Assisted-by: Stefan Eissing
Closes #11739
2023-08-28 19:47:14 +00:00
Jay Satiro
51686e0054 secureserver.pl: fix stunnel version parsing
- Allow the stunnel minor-version version part to be zero.

Prior to this change with the stunnel version scheme of <major>.<minor>
if either part was 0 then version parsing would fail, causing
secureserver.pl to fail with error "No stunnel", causing tests that use
the SSL protocol to be skipped. As a practical matter this bug can only
be caused by a minor-version part of 0, since the major-version part is
always greater than 0.

Closes https://github.com/curl/curl/pull/11722
2023-08-28 15:10:48 -04:00
Jay Satiro
f2bc51a0bd secureserver.pl: fix stunnel path quoting
- Store the stunnel path in the private variable $stunnel unquoted and
  instead quote it in the command strings.

Prior to this change the quoted stunnel path was passed to perl's file
operators which cannot handle quoted paths. For example:

$stunnel = "\"/C/Program Files (x86)/stunnel/bin/tstunnel\"";
if(-x $stunnel or -x "$stunnel")
# false even if path exists and is executable

Our other test scripts written in perl, unlike this one, use servers.pm
which has a global $stunnel variable with the path stored unquoted and
therefore those scripts don't have this problem.

Closes https://github.com/curl/curl/pull/11721
2023-08-28 15:01:50 -04:00
Daniel Stenberg
25ca79df1e
altsvc: accept and parse IPv6 addresses in response headers
Store numerical IPv6 addresses in the alt-svc file with the brackets
present.

Verify with test 437 and 438

Fixes #11737
Reported-by: oliverpool on github
Closes #11743
2023-08-28 17:08:42 +02:00
Daniel Stenberg
a06de2b772
libtest: use curl_free() to free libcurl allocated data
In several test programs. These mistakes are not detected or a problem
as long as memdebug.h is included, as that provides the debug wrappers
for all memory functions in the same style libcurl internals do it,
which makes curl_free and free effectively the same call.

Reported-by: Nicholas Nethercote
Closes #11746
2023-08-28 13:24:51 +02:00
Jay Satiro
89b3cbd0e0
disable.d: explain --disable not implemented prior to 7.50.0
Option -q/--disable was added in 5.0 but only -q was actually
implemented. Later --disable was implemented in e200034 (precedes
7.49.0), but incorrectly, and fixed in 6dbc23c (precedes 7.50.0).

Reported-by: pszlazak@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/11710
Closes #11712
2023-08-28 11:11:12 +02:00
Nicholas Nethercote
9b84f274f1
hyper: fix ownership problems
Some of these changes come from comparing `Curl_http` and
`start_CONNECT`, which are similar, and adding things to them that are
present in one and missing in another.

The most important changes:
- In `start_CONNECT`, add a missing `hyper_clientconn_free` call on the
  happy path.
- In `start_CONNECT`, add a missing `hyper_request_free` on the error
  path.
- In `bodysend`, add a missing `hyper_body_free` on an early-exit path.
- In `bodysend`, remove an unnecessary `hyper_body_free` on a different
  error path that would cause a double-free.
  https://docs.rs/hyper/latest/hyper/ffi/fn.hyper_request_set_body.html
  says of `hyper_request_set_body`: "This takes ownership of the
  hyper_body *, you must not use it or free it after setting it on the
  request." This is true even if `hyper_request_set_body` returns an
  error; I confirmed this by looking at the hyper source code.

Other changes are minor but make things slightly nicer.

Closes #11745
2023-08-28 11:06:15 +02:00
Daniel Stenberg
a43511bff2
multi.h: the 'revents' field of curl_waitfd is supported
Since 6d30f8ebed

Reported-by: Nicolás Ojeda Bär
Ref: #11748
Closes #11749
2023-08-28 11:05:05 +02:00
Gerome Fournier
458c70db6a
tool_paramhlp: improve str2num(): avoid unnecessary call to strlen()
Closes #11742
2023-08-27 17:55:05 +02:00
Daniel Stenberg
864090ca39
docs: mention critical files in same directories as curl saves
... cannot be fully protected. Don't do it.

Co-authored-by: Jay Satiro
Reported-by: Harry Sintonen
Fixes #11530
Closes #11701
2023-08-27 11:16:29 +02:00
John Hawthorn
6d44625305
OpenSSL: clear error queue after SSL_shutdown
We've seen errors left in the OpenSSL error queue (specifically,
"shutdown while in init") by adding some logging it revealed that the
source was this file.

Since we call SSL_read and SSL_shutdown here, but don't check the return
code for an error, we should clear the OpenSSL error queue in case one
was raised.

This didn't affect curl because we call ERR_clear_error before every
write operation (a0dd9df9ab), but when
libcurl is used in a process with other OpenSSL users, they may detect
an OpenSSL error pushed by libcurl's SSL_shutdown as if it was their
own.

Co-authored-by: Satana de Sant'Ana <satana@skylittlesystem.org>

Closes #11736
2023-08-26 19:36:40 +02:00
Alexander Kanavin
c2212c05aa
tests: update cookie expiry dates to far in the future
This allows testing Y2038 with system time set to after that, so that
actual Y2038 issues can be exposed, and not masked by expiry errors.

Fixes #11576
Closes #11610
2023-08-25 20:57:05 +02:00
John Bampton
bc7c4996f1
misc: fix spelling
Closes #11733
2023-08-25 20:54:14 +02:00
Daniel Stenberg
a722ce71a3
cmdline-opts/page-header: clarify stronger that !opt == URL
Everything provided on the command line that is not an option (or an
argument to an option) is treated as a URL.

Closes #11734
2023-08-25 20:53:15 +02:00
Daniel Stenberg
1d2f41a8a3
tests/runner: fix %else handling
Getting the show state proper for %else and %endif did not properly work
in nested cases.

Follow-up to 3d089c41ea

Closes #11731
2023-08-25 15:46:50 +02:00
Nicholas Nethercote
629723ecf2
docs: Remove mention of #10803 from KNOWN_BUGS.
Because the leaks have been fixed.
2023-08-25 15:27:32 +02:00
Nicholas Nethercote
e854166472
c-hyper: fix another memory leak in Curl_http.
There is a `hyper_clientconn_free` call on the happy path, but not one
on the error path. This commit adds one.

Fixes the second memory leak reported by Valgrind in #10803.

Fixes #10803
Closes #11729
2023-08-25 15:27:22 +02:00
Nicholas Nethercote
c61dd5fed2
c-hyper: fix a memory leak in Curl_http.
A request created with `hyper_request_new` must be consumed by either
`hyper_clientconn_send` or `hyper_request_free`.

This is not terrifically clear from the hyper docs --
`hyper_request_free` is documented only with "Free an HTTP request if
not going to send it on a client" -- but a perusal of the hyper code
confirms it.

This commit adds a `hyper_request_free` to the `error:` path in
`Curl_http` so that the request is consumed when an error occurs after
the request is created but before it is sent.

Fixes the first memory leak reported by Valgrind in #10803.

Closes #11729
2023-08-25 15:27:11 +02:00
Daniel Stenberg
7e371dc994
RELEASE-NOTES: synced 2023-08-25 13:56:46 +02:00
John Bampton
fb3180a024
misc: spellfixes
Closes #11730
2023-08-25 13:21:07 +02:00
Daniel Stenberg
3d089c41ea
tests: add support for nested %if conditions
Provides more flexiblity to test cases.

Also warn and bail out if there is an '%else' or %endif' without a
preceeding '%if'.

Ref: #11610
Closes #11728
2023-08-25 08:25:25 +02:00
Daniel Stenberg
bb65f73b5d
time-cond.d: mention what happens on a missing file
Closes #11727
2023-08-24 23:04:32 +02:00
Christian Hesse
b02b907099
docs/cmdline-opts: match the current output
The release date has been added in output, reflect that in documentation.

Closes #11723
2023-08-24 23:03:34 +02:00
Daniel Stenberg
2ff7cd75c7
lib: minor comment corrections 2023-08-24 10:02:23 +02:00
Daniel Stenberg
5b060a4108
docs: rewrite to present tense
... instead of using future tense.

+ numerous cleanups and improvements
+ stick to "reuse" not "re-use"
+ fewer contractions

Closes #11713
2023-08-23 23:26:10 +02:00
Daniel Stenberg
887b998e6e
urlapi: setting a blank URL ("") is not an ok URL
Test it in 1560
Fixes #11714
Reported-by: ad0p on github
Closes #11715
2023-08-23 23:24:16 +02:00
Daniel Stenberg
5e2beb3395
spelling: use 'reuse' not 're-use' in code and elsewhere
Unify the spelling as both versions were previously used intermittently

Closes #11717
2023-08-23 23:22:36 +02:00
Michael Osipov
1a14f2179b
system.h: add CURL_OFF_T definitions on HP-UX with HP aCC
HP-UX on IA64 provides two modes: 32 and 64 bit while 32 bit being the
default one. Use "long long" in 32 bit mode and just "long" in 64 bit
mode.

Closes #11718
2023-08-23 23:19:28 +02:00
Dan Fandrich
814dc4b240 tests: don't call HTTP errors OK in test cases
Some HTTP errors codes were accompanied by the text OK, which causes
some cognitive dissonance when reading them.
2023-08-22 15:32:16 -07:00
Dan Fandrich
86179afcbb http: close the connection after a late 417 is received
In this situation, only part of the data has been sent before aborting
so the connection is no longer usable.

Assisted-by: Jay Satiro
Fixes #11678
Closes #11679
2023-08-22 15:32:16 -07:00
Dan Fandrich
0d89c9096d runtests: slightly increase the longest log file displayed
The new limit provides enough space for a 64 KiB data block to be logged
in a trace file, plus a few lines at the start and end for context. This
happens to be the amount of data sent at a time in a PUT request.
2023-08-22 15:32:16 -07:00
Dan Fandrich
66883a89d6 tests: add delay command to the HTTP server
This adds a delay after client connect.
2023-08-22 15:32:16 -07:00
Daniel Stenberg
a2caea87bc
cirrus: install everthing with pkg, avoid pip
Assisted-by: Sevan Janiyan

Closes #11711
2023-08-22 23:06:20 +02:00
Daniel Stenberg
8ef2992e11
curl_url*.3: update function descriptions
- expand and clarify several descriptions
- avoid using future tense all over

Closes #11708
2023-08-22 15:40:57 +02:00
Daniel Stenberg
c996e02afe
RELEASE-NOTES: synced 2023-08-22 08:26:12 +02:00
Stefan Eissing
527a17dc21
CI/cirrus: disable python install on FreeBSD
- python cryptography package does not build build FreeBSD
- install just mentions "error"
- this gets the build and the main test suite going again

Closes #11705
2023-08-21 19:46:00 +02:00
Stefan Eissing
862741637b
test2600: fix flakiness on low cpu
- refs #11355 where failures to to low cpu resources in CI
  are reported
- vastly extend CURLOPT_CONNECTTIMEOUT_MS and max durations
  to test cases
- trigger Curl_expire() in test filter to allow re-checks before
  the usual 1second interval

Closes #11690
2023-08-21 11:30:35 +02:00
Maksim Sciepanienka
20e3287aca
tool_urlglob: use the correct format specifier for curl_off_t in msnprintf
Closes #11698
2023-08-20 23:14:50 +02:00
Daniel Stenberg
73b6d4e814
test687/688: two more basic --xattr tests
Closes #11697
2023-08-20 10:31:41 +02:00
Daniel Stenberg
b3ee22193a
cmdline-opts/docs: mentioned the negative option part
... for --no-alpn and --no-buffer in the same style done for other --no-
options:

"Note that this is the negated option name documented."

Closes #11695
2023-08-19 23:51:46 +02:00
Emanuele Torre
70f1b540f3
tool/var: also error when expansion result starts with NUL
Expansions whose output starts with NUL were being expanded to the empty
string, and not being recognised as values that contain a NUL byte, and
should error.

Closes #11694
2023-08-19 23:50:37 +02:00
Daniel Stenberg
1c3fcbdaa9
tests: add 'large-time' as a testable feature
This allows test cases to require this feature to run and to be used in
%if conditions.

Large here means larger than 32 bits. Ie does not suffer from y2038.

Closes #11696
2023-08-19 23:37:02 +02:00
Daniel Stenberg
98483a8a3f
tests/Makefile: add check-translatable-options.pl to tarball
Used in test 1544

Follow-up to ae806395ab
2023-08-18 08:49:17 +02:00
Daniel Stenberg
c5eda5df64
gen.pl: fix a long version generation mistake
Too excessive escaping made the parsing not find the correct long names
later and instead add "wrong" links.

Follow-up to 439ff2052e

Reported-by: Lukas Tribus
Fixes #11688
Closes #11689
2023-08-18 08:18:30 +02:00
Daniel Stenberg
74b87a8af1
lib: move mimepost data from ->req.p.http to ->state
When the legacy CURLOPT_HTTPPOST option is used, it gets converted into
the modem mimpost struct at first use. This data is (now) kept for the
entire transfer and not only per single HTTP request. This re-enables
rewind in the beginning of the second request instead of in end of the
first, as brought by 1b39731.

The request struct is per-request data only.

Extend test 650 to verify.

Fixes #11680
Reported-by: yushicheng7788 on github
Closes #11682
2023-08-17 23:49:57 +02:00
Patrick Monnerat
821d108fc9
os400: do not check translatable options at build time
Now that there is a test for this, the build time check is not needed
anymore.

Closes #11650
2023-08-17 17:34:57 +02:00
Patrick Monnerat
ae806395ab
test1554: check translatable string options in OS400 wrapper
This test runs a perl script that checks all string options are properly
translated by the OS400 character code conversion wrapper. It also
verifies these options are listed in alphanumeric order in the wrapper
switch statement.

Closes #11650
2023-08-17 17:34:35 +02:00
Daniel Stenberg
e90d356570
unit3200: skip testing if function is not present
Fake a successful run since we have no easy mechanism to skip this test
for this advanced condition.
2023-08-17 17:17:59 +02:00
Daniel Stenberg
de7d421067
unit2600: fix build warning if built without verbose messages 2023-08-17 17:17:59 +02:00