Commit Graph

33989 Commits

Author SHA1 Message Date
Viktor Szakats
a3a131b2a6
autotools: silence gcc warnings in libtool code
```
./.libs/lt-upload-pausing.c: In function 'lt_fatal':
./.libs/lt-upload-pausing.c:593:1: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
  593 | lt_fatal (const char *file, int line, const char *message, ...)
      | ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/12611924141/job/35148104431?pr=15911#step:11:264

Ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsuggest-attribute_003d

Closes #15915
2025-01-05 17:15:05 +01:00
Daniel Stenberg
893e57e84c
INFRASTRUCTURE.md: project infra
Closes #15906
2025-01-05 11:25:06 +01:00
Viktor Szakats
699ac9430c
cmake: publish/check supported protocols/features via CURLConfig.cmake
Via these variables, as lists:
- `CURL_SUPPORTED_PROTOCOLS`
- `CURL_SUPPORTED_FEATURES`

As individual flags:
- `CURL_SUPPORTS_<protocol/feature>` = `TRUE`

Also:
- set `CURL_VERSION_STRING` which was missing when using
  `find_package(CURL CONFIG)` or
  `find_package(CURL NO_MODULE)`.
- set `CURL_<prototol/feature>_FOUND` for compatibility.
- show full list of missing but required `COMPONENTS`.

Assisted-by: Derek Huang
Fixes #15854
Closes #15858
2025-01-04 10:29:00 +01:00
Daniel Stenberg
f62be9cfb6
checkdocs: trim links off docs/ markdowns before spellcheck
So that we can use words in links without having them spellchecked.

Closes #15910
2025-01-03 18:38:04 +01:00
Daniel Stenberg
cc16211a30
cleancmd.pl: strip out backticked words
To make sure they are not spellchecked. Also, leaving two backticks is
not good because they cause the spellchecker to misinterpret the
markdown file so they have to be removed as well.
2025-01-03 18:36:50 +01:00
Daniel Stenberg
0e120c5b92
netrc: 'default' with no credentials is not a match
Test 486 verifies.

Reported-by: Yihang Zhou

Closes #15908
2025-01-03 18:21:10 +01:00
Daniel Stenberg
abf8062449
CURLOPT_SEEKFUNCTION.md: used for FTP, HTTP and SFTP (only)
The same goes for *SEEKDATA.

Closes #15903
2025-01-02 22:31:11 +01:00
Viktor Szakats
852692b24f
GHA/http3-linux: fix cache rebuild conditions, switch to wolfSSL stable
ngtcp2 depends on crypto backends. nghttp2 depends on ngtcp2 and nghttp3
(for nghttpx server used in pytests).

Before this patch, ngtcp2, nghttp2 weren't rebuilt when their
dependencies changes. This worked fine until wolfSSL bumped its
soversion and caused CI to fail because ngtcp2 was not rebuilt and was
still referring to the old soname that was no longer offered by the
wolfSSL package.

Make sure to rebuild ngtcp2/nghttp2 when any of their dependencies bump.
To avoid rebuilding everything on every wolfSSL commit, switch to use
wolfSSL stable versions.

Bug: https://github.com/curl/curl/pull/15882#issuecomment-2566821417
Closes #15885
2025-01-02 21:04:02 +01:00
prpr19xx on github
d984209e59
smb: fix compiler warning
An old version of GCC (4.5.2 on a mipsel) moans about the constant being
too big to fit in a long.

Closes #15902
2025-01-02 18:01:17 +01:00
Daniel Stenberg
3eb57d6ba7
docs: use lowercase curl and libcurl
Adjusted badwords to find them.

Plus: make badwords run on all markdown files in the repo and update
markdowns previously unchecked

Closes #15898
2025-01-02 17:15:54 +01:00
Daniel Stenberg
e694c8284a
docs/libcurl/opts: clarify the return values
Expand a little.

- mention the type name of the return code
- avoid stating which exact return codes that might be returned, as that
  varies over time, builds and conditions
- avoid stating some always return OK
- refer to the manpage documenting all the return codes

Closes #15900
2025-01-02 17:13:33 +01:00
Daniel Stenberg
e256d9df6d
docs/cmdline-opts/_ENVIRONMENT.md: minor language fix
Closes #15897
2025-01-02 17:02:26 +01:00
Daniel Stenberg
4501b7e28d
docs/libcurl: return value overhall
Unified, extended, clarified the return values for numerous functions

Closes #15899
2025-01-02 16:58:05 +01:00
Viktor Szakats
41e5a116a1
src: drop support for CURL_TESTDIR debug env
No longer used by curl tests.

`--output-dir` option can be used as an alternative in all builds.

Follow-up to 39697dead3 #15114
Closes #15893
2025-01-02 14:44:39 +01:00
Viktor Szakats
772b6933bc
cmake/FindLDAP: avoid framework locations for libs too (Apple)
We already avoid system framework paths while looking for LDAP headers
to avoid issues.

Do the same while looking for LDAP libraries. This makes sure to find
the regular ldap library (`libldap.tbd`) instead of picking up
`ldap.framework` and let that seep into `libcurl.pc` with a full path.

This makes LDAP detection work on Apple as before introducing FindLDAP.

Follow-up to 49f2a23d50 #15273
Closes #15895
2025-01-02 12:55:50 +01:00
Viktor Szakats
27b9e76706
cmake: make system libraries dl, m, pthread customizable
via `DL_LIBRARY`, `MATH_LIBRARY`, `PTHREAD_LIBRARY` variables.

They are used in Rustls, wolfSSL Find modules.

Also:
- always use `NAMES` keyword in `find_library()` calls.
- respect `find_library()` results for `dl`, `m`, `pthread`.
- formatting.

Closes #15892
2025-01-02 12:55:50 +01:00
Viktor Szakats
9a9498ea1e
curl_sha512_256: rename symbols to the curl namespace
Closes #15894
2025-01-02 12:55:50 +01:00
Daniel Stenberg
91587522a1
docs/HTTP-COOKIES.md: link to more information
Closes #15891
2025-01-01 22:45:48 +01:00
Daniel Stenberg
7fb113f01f
hash: add asserts in hash_element_dtor()
This just adds a precaution and shows a clear intention in the code.
Added because CodeSonar is reporting a false positive Use After Free on
this function.

Closes #15889
2025-01-01 21:13:38 +01:00
Daniel Stenberg
7fed7274e4
COPYING: bump copyright year range to 1996 - 2025
Closes #15890
2025-01-01 21:12:12 +01:00
Daniel Stenberg
af4e85925d
select: avoid a NULL deref in cwfds_add_sock
curl_multi_waitfds(m, NULL, ...);

=> Curl_waitfds_init(&cwfds, ufds, size);

=> Curl_waitfds_add_ps(&cwfds);

=>   cwfds_add_sock(cwfds, ...);

Would then try to use the ->wfds array while set to NULL previously.
This should not happen, which this is now also protected with an assert
to trigger debug builds if it happens.

Caught by CodeSonar

Assisted-by: Jay Satiro

Closes #15881
2025-01-01 20:56:27 +01:00
Daniel Stenberg
26a672260b
RELEASE-NOTES: synced 2025-01-01 14:50:59 +01:00
Jakub Jelen
999cc818c5
openssl: add support to use keys and certificates from PKCS#11 provider
In OpenSSL < 3.0, the modularity was provided by mechanism called
"engines". This is supported in curl, but the engines got deprecated
with OpenSSL 3.0 in favor of more versatile providers.

This adds a support for OpenSSL Providers, to use PKCS#11 keys, namely
through the pkcs11 provider. This is done using similar approach as the
engines and this is automatically built in when the OpenSSL 3 and newer
is used.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>

Closes #15587
2025-01-01 14:47:31 +01:00
Viktor Szakats
d1336ca14a
GHA/http3-linux: drop redundant pkg-config paths for ngtcp2/nghttp2
- ngtcp2: drop `$PWD/build` (= self)
- ngtcp2: drop nghttp3. It's only used for examples, which we do not use
  here and are disabled by default.
- nghttp2: drop `$HOME/build` (does not exist)

Closes #15887
2025-01-01 14:28:38 +01:00
Daniel Stenberg
150b0d808b
urlapi: cleanup the redirect logic somewhat
Closes #15877
2025-01-01 14:11:15 +01:00
Viktor Szakats
07a084f539
lib: remove __EMX__ guards
Follow-up to 179ee78e86 #2166
Closes #15884
2025-01-01 12:44:20 +01:00
Viktor Szakats
70b49a4e4c
file: fix Android compiler warning
Apply the fix already used in `lib/fopen.c`.

```
lib/file.c:326:41: warning: implicit conversion loses integer precision: 'unsigned int' to 'mode_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
  326 |   fd = open(file->path, mode, data->set.new_file_perms);
      |        ~~~~                   ~~~~~~~~~~^~~~~~~~~~~~~~
```

Closes #15883
2025-01-01 12:44:20 +01:00
Viktor Szakats
5054c68b58
file: drop OPEN_NEEDS_ARG3 option
Not set since 1bf3643f7b #8362 (2022)
Added in 00883822be (2009) for VxWorks.

Closes #15882
2025-01-01 12:44:20 +01:00
Viktor Szakats
98932f3487
multissl: auto-enable OPENSSL_COEXIST for wolfSSL + OpenSSL
When building with both OpenSSL and wolfSSL set this necessary option.
Otherwise fail with an error.

Requires wolfSSL v5.7.6 or upper.

Closes #15765
2025-01-01 06:20:30 +01:00
renovate[bot]
1019b410c9
CI: update dependency wolfSSL/wolfssl to v5.7.6
Closes #15886
2025-01-01 05:46:31 +01:00
Viktor Szakats
0f1b23e960
build: replace configure check with PP condition (Android <21)
To make it build again with CMake + Android 20 and earlier.

8e34505776 synced `getpwuid_r()` detection
in cmake with autotools. It means cmake started detecting it with
Android <21 just like autotools, and thus cmake builds also need to
tackle the missing declaration with old Android SDK versions. Use a PP
solution, allowing to drop the autotools-specific on used before this
patch.

Follow-up to 8e34505776 #15164
Follow-up to 9c33813d83 #2609
Ref: #2058
Closes #15871
2025-01-01 04:55:54 +01:00
Marcel Raad
280ff5ca03
test483: require cookie support
The test fails with `--disable-cookies`.

Closes https://github.com/curl/curl/pull/15876
2024-12-31 16:35:54 +01:00
Daniel Stenberg
4f920122a2
test3105: verify multi_remove_handle done twice
It should be ok.

Ref: #15852
Closes #15860
2024-12-31 12:03:51 +01:00
Viktor Szakats
aef7888649
cmp-config: drop 3 exceptions
Follow-up to fd067bfb5b #15596
Closes #15872
2024-12-31 11:40:50 +01:00
Viktor Szakats
8d42016945
GHA/configure-vs-cmake: trigger by CMake/** updates
Closes #15875
2024-12-31 11:36:56 +01:00
Viktor Szakats
342a654ef3
cmake: sync OpenSSL QUIC fork detection with autotools
Before this patch, detection used a function which wasn't called
from curl since d2c6d8be18 #8968.

Follow-up to b3f02e1d92 #12683
Closes #15873
2024-12-31 11:36:56 +01:00
Viktor Szakats
4badbbeb5b
cmake: fix net/in.h detection for MS-DOS
Syncing this with autotools.

Follow-up to 8e34505776 #15164
Closes #15869
2024-12-31 11:36:56 +01:00
Viktor Szakats
10fe952da0
build: fix unsigned time_t detection for cmake, MS-DOS, AmigaOS
- cmake: add auto-detection. Sync this with autotools.
- enable for MS-DOS and AmigaOS builds.
  (auto-detection doesn't work for cross-builds.)
- tidy up detection snippet.
- fix comment.

Closes #15868
2024-12-31 11:36:56 +01:00
Viktor Szakats
f60f872bcd
configure: drop unused detections and macros
- drop `HAVE_IOCTL` macro, drop exception.
- drop unused `setjmp.h` detection, drop exception.
  It's a C89 header and result also not used in detections.
- use C89 `stdlib.h` without detection.
  (It's still being detected by autotools anyway.)

Closes #15867
2024-12-31 11:36:55 +01:00
Jay Satiro
713182bd19 multi: fix return code for an already-removed easy handle
- Ensure that CURLM_OK is returned when curl_multi_remove_handle is
  called with an already removed easy handle.

Prior to this change and since ba235ab2 which precedes 8.10.0, if
curl_multi_remove_handle was called with an already-removed easy handle
then the return code would be CURLM_OK or CURLM_BAD_EASY_HANDLE
depending respectively on whether the multi did or did not contain other
easy handles.

This change restores the old behavior of returning CURLM_OK in both
cases.

Reported-by: Ralph Sennhauser

Fixes https://github.com/curl/curl/issues/15844
Closes https://github.com/curl/curl/pull/15852
2024-12-31 03:20:36 -05:00
Jay Satiro
6c70ec16c7 http: ignore invalid Retry-After times
- Treat negative Retry-After date-based times as 0.

- Treat Retry-After times greater than 6 hours as 6 hours.

Prior to this change Retry-After did not have a limited range and the
server could have set a time greater than 6 hours or a date in the past
that would result in a negative time, either of which may be unexpected
by the user.

The 6 hour limit is purposely not documented so that it can be changed
in the future if necessary.

Closes https://github.com/curl/curl/pull/15833
2024-12-31 03:19:22 -05:00
Viktor Szakats
8d1f26b866
GHA/http3-linux: do run on cmake build updates
Closes #15874
2024-12-31 04:16:19 +01:00
Viktor Szakats
1e14e1682c
examples/block-ip: drop redundant memory.h include
Not used elsewhere in the repo.
2024-12-31 00:35:57 +01:00
Viktor Szakats
f7c2bf0818
cmake: rename Windows detection cache file
To flatten the directory tree.

Closes #15859
2024-12-31 00:24:00 +01:00
Stefan Eissing
8a66c11a29
vtls: only remember the expiry timestamp in session cache
Instead of receive and lifetime, keep only the eppch seconds when a
session expires.

Closes #15861
2024-12-30 16:14:52 +01:00
Daniel Stenberg
c2d37463b9
curl/var: change byte offset syntax for assignments
Follow-up to 40c264db61 after discussions on IRC.

The new style is

  name[0-99]=contents

and

  name[0-99]@filename

A) This does not cause the same problems with old curl versions trying
the new syntax as this way will cause old curls just fail with syntax
error and not risk using the wrong file.

B) Adds the same byte range support for "normal" assigns, which the
previous syntax did not. Thus lets a user get a partial content of a
variable etc.

Added test 790 and 791 to verify non-file assigns with ranges.

Closes #15862
2024-12-30 15:55:54 +01:00
Viktor Szakats
e7b90dadb2
GHA/non-native: measure duration of individual build steps inside VMs
Closes #15864
2024-12-30 14:23:45 +01:00
dependabot[bot]
5dc5bd7638
CI: bump actions/cache from 4.1.2 to 4.2.0
Bumps [actions/cache](https://github.com/actions/cache) from 4.1.2 to 4.2.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.1.2...1bd1e32a3bdc45362d1e726936510720a7c30a57)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Closes #15817
2024-12-30 14:05:25 +01:00
dependabot[bot]
2a6dfe0274
CI: bump actions/upload-artifact from 4.4.3 to 4.5.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.3 to 4.5.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b4b15b8c7c...6f51ac03b9)

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

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

Closes #15816
2024-12-30 14:03:46 +01:00
Daniel Stenberg
53fcac438a
TheArtOfHttpScripting.md: rewrite double 'that'
Closes #15863
2024-12-30 14:02:37 +01:00