Commit Graph

31650 Commits

Author SHA1 Message Date
Stefan Eissing
a0f94800d5
transfer: adjust_pollset improvements
- let `multi_getsock()` initialize the pollset in what the
  transfer state requires in regards to SEND/RECV
- change connection filters `adjust_pollset()` implementation
  to react on the presence of POLLIN/-OUT in the pollset and
  no longer check CURL_WANT_SEND/CURL_WANT_RECV
- cf-socket will no longer add POLLIN on its own
- http2 and http/3 filters will only do adjustments if the
  passed pollset wants to POLLIN/OUT for the transfer on
  the socket. This is similar to the HTTP/2 proxy filter
  and works in stacked filters.

Closes #12640
2024-01-07 14:36:25 +01:00
Daniel Stenberg
8edcfedc1a
ftp: use memdup0 to store the OS from a SYST 215 response
avoid malloc + direct buffer fiddle

Closes #12639
2024-01-06 11:26:31 +01:00
Daniel Stenberg
f4beef524a
ftp: use dynbuf to store entrypath
avoid direct malloc

Closes #12638
2024-01-06 11:25:37 +01:00
Lealem Amedie
afdb6c2d34
wolfssl: load certificate *chain* for PEM client certs
Closes #12634
2024-01-06 11:24:11 +01:00
Stefan Eissing
8e2d7b9fa4
http: adjust_pollset fix
do not add a socket for POLLIN when the transfer does not want to send
(for example is paused).

Follow-up to 47f5b1a

Reported-by: bubbleguuum on github
Fixes #12632
Closes #12633
2024-01-04 15:45:22 +01:00
Daniel Stenberg
07bcae89d5
tool: make parser reject blank arguments if not supported
Already in the getstr() function that clones the input argument.

Closes #12620
2024-01-03 23:21:29 +01:00
dependabot[bot]
f59223f500
build(deps): bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #12625
2024-01-03 14:29:19 +01:00
dependabot[bot]
943ec10b6e
build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #12624
2024-01-03 14:28:25 +01:00
dependabot[bot]
1f138afcc2
build(deps): bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #12627
2024-01-03 14:27:06 +01:00
dependabot[bot]
03fcddba22
build(deps): bump actions/download-artifact from 3 to 4
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #12626
2024-01-03 14:26:39 +01:00
Stefan Eissing
f712af2891
http3/quiche: fix result code on a stream reset
- fixes pytest failures in test 07_22
- aligns CURLcode values on stream reset with ngtcp2

Closes #12629
2024-01-03 13:10:21 +01:00
Daniel Stenberg
eeda18b1d2
setopt: clear mimepost when formp is freed
A precaution to avoid a possibly dangling pointer left behind.

Reported-by: Thomas Ferguson
Fixes #12608
Closes #12621
2024-01-02 23:32:43 +01:00
andy5995
bf7cd837a6
CI: Add dependabot.yml
This will cause dependabot to open a PR when various actions are
updated, provided that the action maintainer has issued a release.

Closes #12623
2024-01-02 23:31:49 +01:00
Gisle Vanem
8558647613
content_encoding: change return code to typedef'ed enum
... to work around a clang ubsan warning.

Fixes #12618
Closes #12622
2024-01-02 23:28:17 +01:00
Daniel Stenberg
941b56d790
tool: prepend output_dir in header callback
When Content-Disposition parsing is used and an output dir is prepended,
make sure to store that new file name correctly so that it can be used
for setting the file timestamp when --remote-time is used.

Extended test 3012 to verify.

Co-Authored-by: Jay Satiro
Reported-by: hgdagon on github
Fixes #12614
Closes #12617
2024-01-02 23:26:56 +01:00
Daniel Stenberg
1d8e8c9ad1
test1254: fix typo in name plus shorten it 2024-01-02 14:31:25 +01:00
Daniel Stenberg
7d103f0043
RELEASE-NOTES: synced 2024-01-02 09:05:19 +01:00
Viktor Szakats
aff26089e8
schannel: fix -Warith-conversion gcc 13 warning
```
lib/vtls/schannel.c:1201:22: warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Warith-conversion]
 1201 |     *extension_len = *list_len +
      |                      ^
```

Closes #12616
2024-01-02 07:50:47 +00:00
Viktor Szakats
f0ea11b50b
asyn-thread: silence -Wcast-align warning for Windows
Seen with llvm/clang 17:
```
lib/asyn-thread.c:310:5: warning: cast from 'PCHAR' (aka 'char *') to 'struct thread_sync_data *' increases required alignment from 1 to 8 [-Wcast-align]
  310 |     CONTAINING_RECORD(overlapped, struct thread_sync_data, w8.overlapped);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../llvm-mingw/aarch64-w64-mingw32/include/winnt.h:717:48: note: expanded from macro 'CONTAINING_RECORD'
  717 | #define CONTAINING_RECORD(address,type,field) ((type *)((PCHAR)(address) - (ULONG_PTR)(&((type *)0)->field)))
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Follow-up to a6bbc87f9e #12482

Ref: https://github.com/curl/curl/pull/12482#issuecomment-1873017261
Closes #12615
2024-01-02 07:50:46 +00:00
Daniel Stenberg
b23255af99
tool_listhelp: regenerate after recent .d updates
Makes it survive test 1478

Closes #12612
2024-01-02 08:44:12 +01:00
Daniel Stenberg
0f1bb61e86
test1478: verify src/tool_listhelp.c
Verify that the source file on disk is identical to the output of gen.pl
listhelp, as otherwise they are out of sync and need attention.

Closes #12612
2024-01-02 08:44:10 +01:00
Daniel Stenberg
12f832d950
testutil: make runtests support %include
Using this instruction, a test case can include the contents of a file
into the test during the preprocessing.

Closes #12612
2024-01-02 08:44:06 +01:00
Daniel Stenberg
8620b11c3a
runtests: for mode="text" on <stdout>, fix newlines on both parts
Closes #12612
2024-01-02 08:44:01 +01:00
Jay Satiro
b83729a339 quiche: return CURLE_HTTP3 on send to invalid stream
Prior to this change if a send failed on a stream in an invalid state
(according to quiche) and not marked as closed (according to libcurl)
then the send function would return CURLE_SEND_ERROR.

We already have similar code for ngtcp2 to return CURLE_HTTP3 in this
case.

Caught by test test_07_upload.py: test_07_22_upload_parallel_fail.

Fixes https://github.com/curl/curl/issues/12590
Closes https://github.com/curl/curl/pull/12597
2024-01-02 00:54:15 -05:00
Daniel Stenberg
373d34494c
cmdline-opts: update availability for the *-ca-native options
Closes #12613
2024-01-01 00:46:08 +01:00
Patrick Monnerat
4b6d44f6e9
openldap: fix STARTTLS
It was not working anymore since introduction of connection filters.

Also do not attempt to recover from a failing TLS negotiation with
CURLUSESSL_TRY.

Closes #12610
2023-12-31 17:11:51 +01:00
Daniel Stenberg
d16d18cf64
haproxy-clientip.d: document the arg
The arg keyword was missing and therefore not present in the man page.

Closes #12611
2023-12-31 00:35:30 +01:00
annalee
ae75db3527
configure: fix no default int compile error in ipv6 detection
Closes #12607
2023-12-29 10:47:40 +01:00
Dan Fandrich
0af61bffb1 CI: Fix use of any-glob-to-all-files in the labeler
Despite its name, this atom acts like one-glob-to-all-files and a
different syntax with braces must be used to get
any-glob-to-all-files semantics. Unfortunately, this makes the file
completely unreadable.

Ref: https://github.com/actions/labeler/issues/731
2023-12-28 22:26:02 -08:00
Daniel Stenberg
69b6953681
CURLOPT_AUTOREFERER.3: mention CURLINFO_REFERER 2023-12-29 00:40:03 +01:00
Daniel Stenberg
6f17ead7b3
CURLINFO_REFERER.3: clarify that it is the *request* header
That libcurl itself sent in the most recent request

Closes #12605
2023-12-29 00:39:54 +01:00
Jay Satiro
26f002e02e system_win32: fix a function pointer assignment warning
- Use CURLX_FUNCTION_CAST to suppress a function pointer assignment
  warning.

a6bbc87f added lookups of some Windows API functions and then cast them
like `*(FARPROC*)&Curl_funcname = address`. Some versions of gcc warn
about that as breaking strict-aliasing rules so this PR changes those
assignments to use CURLX_FUNCTION_CAST.

Bug: https://github.com/curl/curl/pull/12581#issuecomment-1869804317
Reported-by: Marcel Raad

Closes https://github.com/curl/curl/pull/12602
2023-12-28 03:38:44 -05:00
Jay Satiro
aa2c2ab837 verify-examples.pl: fail verification on unescaped backslash
- Check that all backslashes in EXAMPLE are properly escaped.

eg manpage must always use `\\n` never `\n`.

This is because the manpage requires we always double blackslash to show
a single backslash. Prior to this change an erroneous single backslash
would pass through and compile even though it would not show correctly
in the manpage.

Co-authored-by: Daniel Stenberg

Ref: https://github.com/curl/curl/pull/12588

Closes https://github.com/curl/curl/pull/12589
2023-12-28 03:34:16 -05:00
Jay Satiro
e251e858b9 vtls: fix missing multissl version info
- Fix erroneous buffer copy logic from ff74cef5.

Prior to this change the MultiSSL version info returned to the user
was empty.

Closes https://github.com/curl/curl/pull/12599
2023-12-27 17:49:27 -05:00
Daniel Stenberg
f111603176
KNOWN_BUGS: [RTSP] Some methods do not support response bodies
Closes #12414
2023-12-27 23:15:09 +01:00
Patrick Monnerat
fa6e123929
openldap: fix an LDAP crash
Reported-by: Ozan Cansel
Fixes #12593
Closes #12600
2023-12-27 14:42:32 +01:00
Daniel Stenberg
68f96fc9bf
getinfo: CURLINFO_QUEUE_TIME_T
Returns the time, in microseconds, during which this transfer was held
in a waiting queue before it started "for real". A transfer might be put
in a queue if after getting started, it cannot create a new connection
etc due to set conditions and limits imposed by the application.

Ref: #12293
Closes #12368
2023-12-27 09:28:48 +01:00
Daniel Stenberg
2b221d4214
RELEASE-NOTES: synced 2023-12-27 09:24:42 +01:00
Jay Satiro
82cbdd8396 examples/sendrecv: fix comment line length
Caught by checksrc.
2023-12-26 03:28:46 -05:00
Haydar Alaidrus
9faeebca88 CURLOPT_POSTFIELDS.3: fix incorrect C string escape in example
- Escape inner quotes with two backslashes.

Two backslashes escapes the backslash for the man page and will show as
a single backslash.

eg: "{\\"name\\": \\"daniel\\"}" shows as "{\"name\": \"daniel\"}".

Closes https://github.com/curl/curl/pull/12588
2023-12-23 15:04:56 -05:00
Viktor Szakats
296cb805cf
appveyor: tidy-ups
- replace two remaining backslashes with forward slashes.
- tidy up the way we form and pass `TFLAGS`.

Follow-up to 2d4d0c1fd3 #12572

Closes #12582
2023-12-23 03:33:22 +00:00
Stefan Eissing
e492c7c524
transfer: fix upload rate limiting, add test cases
- add test cases for rate limiting uploads for all
  http versions
- fix transfer loop handling of limits. Signal a re-receive
  attempt only on exhausting maxloops without an EAGAIN
- fix `data->state.selectbits` forcing re-receive to also
  set re-sending when transfer is doing this.

Reported-by: Karthikdasari0423 on github
Fixes #12559
Closes #12586
2023-12-22 16:52:02 +01:00
Daniel Stenberg
8b1d229835
mbedtls: free the entropy when threaded
The entropy_free was never done for threaded builds, causing a small
(fixed) memory leak.

Reported-by: RevaliQaQ on github
Fixes #12584
Closes #12585
2023-12-22 10:58:07 +01:00
Stefan Eissing
35380273b9
http2: improved on_stream_close/data_done handling
- there seems to be a code path that cleans up easy handles without
  triggering DONE or DETACH events to the connection filters. This
  would explain wh nghttp2 still holds stream user data
- add GOOD check to easy handle used in on_close_callback to
  prevent crashes, ASSERTs in debug builds.
- NULL the stream user data early before submitting RST
- add checks in on_stream_close() to identify UNGOOD easy handles

Reported-by: Hans-Christian Egtvedt
Fixes #10936
Closes #12562
2023-12-22 10:06:01 +01:00
Daniel Stenberg
ef2cf58c77
mprintf: overhaul and bugfixes
In a test case using lots of snprintf() calls using many commonly used
%-codes per call, this version is around 30% faster than previous
version.

It also fixes the #12561 bug which made it not behave correctly when
given unknown %-sequences. Fixing that flaw required a different take on
the problem, which resulted in the new two-arrays model.

lib557: extended - Verify the #12561 fix and test more printf features

unit1398: fix test: It used a <num>$ only for one argument, which is not
supported.

Fixes #12561
Closes #12563
2023-12-22 09:51:57 +01:00
Viktor Szakats
2d4d0c1fd3
appveyor: replace PowerShell with bash + parallel autotools
PowerShell works (after a steep development curve), but one property of
it stuck and kept causing unresolvable usability issues: With
`$ErrorActionPreference=Stop`, it does abort on failures, but shows only
the first line of the error message. In `Continue` mode, it shows the
full error message, but doesn't stop on all errors. Another issue is
PowerShell considering any stderr output as if the command failed (this
has been improved in 7.2 (2021-Nov), but fixed versions aren't running
in CI and will not be for a long time in all test images.)

Thus, we're going with bash.

Also:
- use `-j2` with autotools tests, making them finish 5-15 minutes per
  job faster.
- omit `POSIX_PATH_PREFIX`.
- use `WINDIR`.
- prefer forward slashes.

Follow-up to: 75078a415d #11999
Ref: #12444

Fixes #12560
Closes #12572
2023-12-21 22:54:07 +00:00
Pavel P
a6bbc87f9e
asyn-thread: use GetAddrInfoExW on >= Windows 8
For doing async DNS resolution instead of starting a thread for each
request.

Fixes #12481
Closes #12482
2023-12-21 23:25:45 +01:00
Daniel Stenberg
a719be81e9
strerror: repair get_winsock_error()
It would try to read longer than the provided string and crash.

Follow-up to ff74cef5d4
Reported-by: calvin2021y on github
Fixes #12578
Closes #12579
2023-12-21 23:17:15 +01:00
Daniel Stenberg
5d2b0faec2
CURLOPT_SSH_*_KEYFILE: clarify
Closes #12554
2023-12-21 16:24:51 +01:00
ivanfywang
98794c56af
ngtcp2: put h3 at the front of alpn
Closes #12576
2023-12-21 15:28:40 +01:00