Commit Graph

32226 Commits

Author SHA1 Message Date
Stefan Eissing
dd8ffa73ff
CI: macos fixes for new ARM GHA images
- based on #13478 with additions from #13476
- make homebrew install path flexible
- fix OpenSSL pkgconfig files libdir
- add path to --with-libssh2 target
- disable gcc securetransport due to linker
  errors (missing symbols), probably because
  the os version is no longer low enough

Assisted-by: Viktor Szakats

Closes #13479
2024-04-25 22:25:12 +02:00
Stefan Eissing
886899143f
content_encoding: ignore duplicate chunked encoding
- ignore duplicate "chunked" transfer-encodings from
  a server to accomodate for broken implementations
- add test1482 and test1483

Reported-by: Mel Zuser
Fixes #13451
Closes #13461
2024-04-25 17:50:16 +02:00
Daniel Stenberg
9fc4b2c78c
tool: move tool_ftruncate64 to tool_util.c
... and the prototype to tool_setup.h, to make them both available more
widely and accurately.

Follow-up to 00bef95946

Fixes #13458
Closes #13459
2024-04-25 09:20:38 +02:00
Viktor Szakats
03cf1c7b8c
lib: silence -Wsign-conversion in base64, strcase, mprintf
Closes #13467
2024-04-24 23:29:30 +02:00
Viktor Szakats
1972588d26
CI: retain failure code after ./configure with Circle CI
Suggested-by: Dan Fandrich
Follow-up to 43299e93c0 #13462
Follow-up to d7332e3e46 #12635
Closes #13468
2024-04-24 23:29:30 +02:00
Daniel Stenberg
ac7670b158
RELEASE-NOTES: synced 2024-04-24 14:34:39 +02:00
Jan Venekamp
fba9afebba
mbedTLS: implement CURLOPT_SSL_CIPHER_LIST option
Use a lookup list to set the cipher suites, allowing the
ciphers to be set by either openssl or IANA names.

To keep the binary size of the lookup list down we compress
each entry in the cipher list down to 2 + 6 bytes using the
C preprocessor.

Closes #13442
2024-04-24 14:30:37 +02:00
Viktor Szakats
43299e93c0
CI: show more failed config.log on Circle CI
Show last 1000 lines of `config.log` if `./configure` fails. This was
already done for one job, this patch extends it to all.

Ref: #13438
Closes #13462
2024-04-24 12:30:54 +02:00
Daniel Stenberg
a090111613
telnet: check return code from fileno()
and return error if necessary

Spotted by CodeSonar

Closes #13457
2024-04-24 10:51:53 +02:00
Viktor Szakats
f33ee2e73b
tls: fix SecureTransport + BearSSL cmake unity builds
Avoid clashing static function names by namespacing them.

Pointed-out-by: Jan Venekamp
Ref: https://github.com/curl/curl/pull/13442#discussion_r1576350700
Closes #13450
2024-04-24 10:08:24 +02:00
Jay Satiro
7860f575fe dllmain: Call OpenSSL thread cleanup for Windows and Cygwin
- Call OPENSSL_thread_stop on thread termination (DLL_THREAD_DETACH)
  to prevent a memory leak in case OpenSSL is linked statically.

- Warn in libcurl-thread.3 that if OpenSSL is linked statically then it
  may require thread cleanup.

OpenSSL may need per-thread cleanup to stop a memory leak. For Windows
and Cygwin if libcurl was built as a DLL then we can do that for the
user by calling OPENSSL_thread_stop on thread termination. However, if
libcurl was built statically then we do not have notification of thread
termination and cannot do that for the user.

Also, there are several other unusual cases where it may be necessary
for the user to call OPENSSL_thread_stop, so in the libcurl-thread
warning I added a link to the OpenSSL documentation.

Co-authored-by: Viktor Szakats

Reported-by: southernedge@users.noreply.github.com
Reported-by: zmcx16@users.noreply.github.com

Ref: https://www.openssl.org/docs/man3.0/man3/OPENSSL_thread_stop.html#NOTES

Fixes https://github.com/curl/curl/issues/12327
Closes https://github.com/curl/curl/pull/12408
2024-04-24 04:04:25 -04:00
Jan Venekamp
3b8db84c1b
rustls: remove incorrect SSLSUPP_TLS13_CIPHERSUITES flag
The rustls backend advertises SSLSUPP_TLS13_CIPHERSUITES, but
the code does not actually seem to support it (yet?). Removed
the flag and corrected documentation.

Closes #13452
2024-04-24 08:59:14 +02:00
Stefan Eissing
cfb9991723
quiche: expire all active transfers on connection close
- when a connection close is detected, all ongoing transfers
  need to expire bc no more POLL events are likely to happen
  for them.

Fixes #13439
Reported-by: Jay Satiro
Closes #13447
2024-04-24 08:31:37 +02:00
Dan Fandrich
7237ee2c3d tests: fix feature case in test1481
This test was being skipped everywhere because the feature never
matched.

Closes #13445
2024-04-23 08:46:17 -07:00
Gusted
00bef95946
tool_operate: don't truncate the etag save file by default
This fixes a regression of 75d79a4486. The
code in tool-operate truncated the etag save file, under the assumption
that the file would be written with a new etag value. However since
75d79a4486 that might not be the case
anymore and could result in the file being truncated when --etag-compare
and --etag-save was used and that the etag value matched with what the
server responded. Instead the truncation should not be done when a new
etag value should be written.

Test 3204 was added to verify that the file with the etag value doesn't
change the contents when used by --etag-compare and --etage-save and
that value matches with what the server returns on a non 2xx response.

Closes #13432
2024-04-23 11:33:20 +02:00
Abdullah Alyan
f8011ffa1e
tests: enable test 1117 for hyper
Closes #13436
2024-04-22 13:30:14 +02:00
Daniel Stenberg
999bdfc47e
sendf: useless assignment in cr_lc_read()
Spotted by CodeSonar

Closes #13437
2024-04-22 12:58:30 +02:00
Daniel Stenberg
cf337d851a
tool_paramhlp: remove duplicate assign
Spotted by CodeSonar

Closes #13433
2024-04-21 10:51:12 +02:00
Daniel Stenberg
8a5fe04c7b
transfer: remove useless assignment
in Curl_xfer_recv_resp

Spotted by CodeSonar

Closes #13435
2024-04-21 10:50:37 +02:00
Daniel Stenberg
727c946d82
http: acknowledge a returned error code
... and do not overwrite it with a new value that could then hide the
problem.

Spotted by CodeSonar

Closes #13434
2024-04-21 10:49:48 +02:00
Daniel Stenberg
5fa594ab7b
tool_operate: init vars unconditionally in post_per_transfer
In case of (the unlikely) early return, they could otherwise remain
uninitialized

Spotted by CodeSonar

Closes #13430
2024-04-20 22:47:42 +02:00
Daniel Stenberg
d1a8b3519f
RELEASE-NOTES: synced 2024-04-19 23:59:43 +02:00
Daniel Stenberg
fe17c162d0
urlapi: allow setting port number zero
Also set and check errno when strtoul() parsing numbers for better error
checking.

Updated test 1560

Closes #13427
2024-04-19 23:54:21 +02:00
Daniel Stenberg
ac49152e26
http_aws_sigv4: remove useless assignment
This code assigned the variable the same value it already had

Spotted by CodeSonar

Closes #13426
2024-04-19 23:46:54 +02:00
Daniel Stenberg
51a3b9f8b3
file: remove useless assignment
This code assigned the variable the same value it already had.

Spotted by CodeSonar

Closes #13425
2024-04-19 23:46:16 +02:00
Daniel Stenberg
d54b0adbad
test2406: verify -f with HTTP/2 2024-04-19 23:45:16 +02:00
Stefan Eissing
5c59f91427
http2 + ngtcp2: pass CURLcode errors from callbacks
- errors returned by Curl_xfer_write_resp() and the header variant are
  not errors in the protocol. The result needs to be returned on the
  next recv() from the protocol filter.

- make xfer write errors for response data cause the stream to be
  cancelled

- added pytest test_02_14 and test_02_15 to verify that also for
  parallel processing

Reported-by: Laramie Leavitt
Fixes #13411
Closes #13424
2024-04-19 23:45:16 +02:00
Daniel Stenberg
926fb00405
request: make Curl_req_init return void
Since it could not return error and therefore this change removes dead
code for the caller.

Spotted by CodeSonar.

Closes #13423
2024-04-19 23:42:33 +02:00
Daniel Stenberg
25236c6a80
multi: remove the unused Curl_preconnect function
The implementation has been removed, no point in keeping it around.

Follow-up to 476adfeac0

Closes #13422
2024-04-19 15:06:48 +02:00
Daniel Stenberg
fe226af174
Curl_creader_read: init two variables to avoid using them uninited
Spotted by CodeSonar

Closes #13419
2024-04-19 13:35:54 +02:00
Daniel Stenberg
a032e97f2b
http: reject HTTP major version switch mid connection
A connection that has seen an HTTP major version now refuses any other
major HTTP version in future responses. Previously, a HTTP/1.x
connection would just silently accept HTTP/2 or HTTP/3 in the status
lines as long as it had support for those built-in. It would then just
lead to confusion and badness.

Indirectly Spotted by CodeSonar which identified a duplicate assignment
in this function.

Add test 471 to verify

Closes #13421
2024-04-19 13:34:00 +02:00
Daniel Stenberg
123d3ef5db
mqtt: when Curl_xfer_recv returns error, don't use nread
A returned error code makes other return value unreliable, and in this
case potentially uninitialized. On error, do not read other return
values like the nread counter.

Spotted by CodeSonar

Closes #13418
2024-04-19 13:30:09 +02:00
Daniel Stenberg
b2523fc439
ftp: fix socket leak on rare error
In the function AcceptServerConnect() the newly created socket would
leak if Curl_conn_tcp_accepted_set() returns error. Which basically
should never happen.

Spotted by CodeSonar.

Closes #13417
2024-04-19 11:10:50 +02:00
Daniel Stenberg
0a25b3e014
urlapi: remove unused flags argument from Curl_url_set_authority
The function is only called from a single place (for HTTP/2 server push)
so might as well just assume this fixed option every time.

Closes #13409
2024-04-18 22:24:33 +02:00
Daniel Stenberg
89ce720028
github/ISSUE_TEMPLATE: tweak the commericual support text 2024-04-18 17:00:57 +02:00
Daniel Stenberg
2011e49347
github/ISSUE_TEMPLATE: link the GitHub discussions too
... and move the feature request line to the bottom.
2024-04-18 16:59:21 +02:00
Daniel Stenberg
229c144fe8
curl_url_get.md: clarify queries and fragments and CURLU_GET_EMPTY
Follow-up to 3eac21d86b

Closes #13407
2024-04-18 16:13:34 +02:00
Stefan Eissing
3e16c97fe9
tests: check caddy server version to match test expectations
- new caddy servers no longer return 200 on POSTs, but 405
  as they should

Closes #13405
2024-04-18 16:10:42 +02:00
Daniel Stenberg
1634330474
curl_url_set.md: extended
Closes #13404
2024-04-18 11:10:46 +02:00
Daniel Stenberg
3eac21d86b
urlapi: add CURLU_GET_EMPTY for empty queries and fragments
By default the API inhibits empty queries and fragments extracted.
Unless this new flag is set.

This also makes the behavior more consistent: without it set, zero
length queries and fragments are considered not present in the URL. With
the flag set, they are returned as a zero length strings if they were in
fact present in the URL.

This applies when extracting the individual query and fragment
components and for the full URL.

Closes #13396
2024-04-18 10:37:28 +02:00
Daniel Stenberg
5379dbc248
RELEASE-NOTES: synced 2024-04-17 22:53:40 +02:00
Daniel Stenberg
4dc414c3ec
lib1560: test with leading zeroes and more IPv4 versions
Inspired by WHATWG URL Spec test inputs

Closes #13400
2024-04-17 22:45:24 +02:00
MonkeybreadSoftware
4746b8362b
smtp: result of Curl_bufq_cread was not used
return the result back to the caller.

Closes #13398
2024-04-17 22:44:39 +02:00
Daniel Stenberg
c37b694e46
urlapi: fix relative redirects to fragment-only
Using the URL API for a redirect URL when the redirected-to string
starts with a hash, ie is only a fragment, the API would produce the
wrong final URL.

Adjusted test 1560 to test for several new redirect cases.

Closes #13394
2024-04-17 22:41:47 +02:00
Jiwoo Park
5fb018494d
url: fix use of an uninitialized variable
Closes #13399
2024-04-17 22:34:47 +02:00
Patrick Monnerat
411d12886e
os400: sync with latest changes
- Conversion support for new version info character field rtmp_version.
- New ILE/RPG declarations.

Closes #13402
2024-04-17 22:33:40 +02:00
Daniel Stenberg
c22f463071
ngtcp2: fix macro use
macro "H3_STREAM_CTX" requires 2 arguments, but only 1 given

Follow-up to c6655f7029

Closes #13401
2024-04-17 15:55:30 +02:00
MonkeybreadSoftware
b879edef7e
sendf: fix two typos in comments
The parameters are named data, not date.

Closes #13393
2024-04-17 14:28:24 +02:00
MonkeybreadSoftware
0b4401a4fb
lib: silence warnings on comma misuse
Building curl with -Wcomma, I see warnings about "possible misuse of
comma operator here" and moving fields assignment out of the for() fixes
it.

Closes #13392
2024-04-17 14:26:35 +02:00
Stefan Eissing
c6655f7029
http/2, http/3: decouple stream state from easy handle
- add `Curl_hash_offt` as hashmap between a `curl_off_t` and
  an object. Use this in h2+h3 connection filters to associate
  `data->id` with the internal stream state.
- changed implementations of all affected connection filters
- removed `h2_ctx*` and `h3_ctx*` from `struct HTTP` and thus
  the easy handle
- solves the problem of attaching "foreign protocol" easy handles
  during connection shutdown

Test 1616 verifies the new hash functions.

Closes #13204
2024-04-17 14:24:09 +02:00