Commit Graph

31562 Commits

Author SHA1 Message Date
Daniel Stenberg
9e4e527735
tool_getparam: switch to an enum for every option
To make the big switch much easier to read/understand and to make it
easier to add new options.
2024-01-08 22:39:11 +01:00
Daniel Stenberg
1f4433dad4
tool_getparam: build post data using dynbuf (more) 2024-01-08 22:38:22 +01:00
Daniel Stenberg
1dba44b2f1
tool_getparam: replace malloc + copy by dynbuf for --data 2024-01-08 22:38:22 +01:00
Daniel Stenberg
f37840a46e
tool_getparam: make data_urlencode avoid direct malloc
use aprintf() instead
2024-01-08 22:38:22 +01:00
Daniel Stenberg
3870d03b5d
tool_getparam: move the --url-query logic into url_query()
This function is not doing post at all so it was always weirdly placed.
2024-01-08 22:38:22 +01:00
Daniel Stenberg
8aecfad9e6
tool_getparam: move the --data logic into set_data() 2024-01-08 22:38:22 +01:00
Daniel Stenberg
f6e97effb6
tool_getparam: unify the cmdline switch() into a single one
- easier to follow, easier to modify, easier to extend, possibly slightly
  faster

- each case now has the long option as a comment
2024-01-08 22:38:22 +01:00
Daniel Stenberg
07dd60c05b
tool_getparam: bsearch cmdline options
- the option names are now alpha sorted and lookup is a lot faster

- use case sensitive matching. It was previously case insensitive, but that
  was not documented nor tested.

- remove "partial match" feature. It was not documented, not tested and
  was always fragile as existing use could break when we add a new
  option

- lookup short options via a table

Closes #12631
2024-01-08 22:38:22 +01:00
Gabe
57cc70e559
COPYING: update copyright year
Closes #12654
2024-01-08 18:40:06 +01:00
Stefan Eissing
d0cb2c7a1f
url: init conn->sockfd and writesockfd to CURL_SOCKET_BAD
Also add more tracing to test 19

Follow-up to a0f9480

Fixes #12657
Closes #12659
2024-01-08 16:51:13 +01:00
Daniel Stenberg
e556470c23
connect: remove margin from eyeballer alloc
Presumably leftovers from debugging

Closes #12647
2024-01-08 09:30:45 +01:00
Daniel Stenberg
1058483615
ftp: only consider entry path if it has a length
Follow-up from 8edcfedc1a

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65631

Avoids a NULL pointer deref.

Closes #12648
2024-01-07 16:34:55 +01:00
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