Commit Graph

7201 Commits

Author SHA1 Message Date
Daniel Stenberg
ca24b6a061
DISTROS: remove broken URLs for buildroot 2025-12-05 23:41:41 +01:00
Daniel Stenberg
e80682d429
FAQ: fix hackerone URL 2025-12-05 23:41:41 +01:00
Daniel Stenberg
58394b1c8c
docs: use .example URLs for proxies 2025-12-05 23:41:41 +01:00
Daniel Stenberg
0b69c47131
docs: remove dead URLs
- KNOWN_BUGS: remove dead URL
- ECH: remove two dead URLs
- MAIL-ETIQUETTE: remove dead URL
2025-12-05 23:41:41 +01:00
Viktor Szakats
af5def0738
tidy-up: avoid (()), clang-format fixes and more
- drop redundant parentheses from macro definitions.
- apply clang-format in some places missed earlier.
- wolfssl: fix a macro guard comment.
- curl_setup.h: drop empty lines
- FAQ: fix C formatting.

Closes #19854
2025-12-05 16:07:03 +01:00
Daniel Stenberg
68a44edd50
TODO: remove a mandriva.com reference
It's a casino now
2025-12-05 08:51:11 +01:00
Daniel Stenberg
a1531261b1
CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use
The example code does not use curl_multi_assign(), but its callback
function used socketp (called sockp in the function) to get the struct
priv pointer instead of the correct clientp (cbp).

Reported-by: Greg Hudson
Fixes #19840
Closes #19841
2025-12-04 22:59:51 +01:00
Viktor Szakats
ebe6fa08c9
docs/libcurl: fix C formatting nits
Closes #19844
2025-12-04 22:49:03 +01:00
Viktor Szakats
dfd781ff62
tidy-up: miscellaneous
- gnutls, mbedtls: fix casing in log messages.
- src/tool_cfgable.h: drop unused header.
- appveyor.sh: variable style.
- cmakelint.sh: sync with libssh2, catch `.cmake.in` explicitly.
- examples: drop obsolete comments, exclamation marks.
- fix comment typos, casing.

Closes #19839
2025-12-04 20:14:11 +01:00
Viktor Szakats
0476e4fc65
tidy-up: one more round of formatting nits
Closes #19835
2025-12-04 19:30:59 +01:00
Viktor Szakats
7a1e99eefa
badwords: check FAQ with allowlisted 'will', fix a typo
Also:
- badwords.pl: add support for filename:word exceptions.
- badwords.pl: handle `-w` file open errors.

Ref: https://github.com/curl/curl/pull/19817#issuecomment-3612386568
Closes #19837
2025-12-04 19:30:08 +01:00
Daniel Stenberg
d517efe5bd
bufref: add Curl_bufref_dup that returns a strdup()ed version
Cleans up a common pattern somewhat. Implemented as a macro.

Closes #19834
2025-12-04 19:04:19 +01:00
Daniel Stenberg
1def380032
bufref: rename *memdup() to *memdup0()
To make it clearer to readers of the code that the resulting dup also
has a null terminator. Something a "normal" memdup() does not provide.

Closes #19833
2025-12-04 16:49:16 +01:00
Patrick Monnerat
f39b8a1174
lib: add a Curl_bufref_uptr() function and use it
Function Curl_bufref_ptr() now returns a const char *.
New function Curl_bufref_uptr() returns a const unsigned char *.

Usage and doc updated.

Closes #19827
2025-12-04 16:17:21 +01:00
Daniel Stenberg
e8a4068e68
docs: clarify how to do unix domain sockets with SOCKS proxy
Ref: #19825
Closes #19829
2025-12-04 11:13:16 +01:00
Viktor Szakats
004f41c186
tests: add %AMP macro, use it in two tests
To allow replacing `&` characters in `tests/data/test*` files for
XML-compliance.

Also:
- document `%GT`, `%LT`
  Follow-up to de49cc89ab #19470

Closes #19824
2025-12-03 20:50:19 +01:00
Stefan Eissing
9cf4a400d2
pytest: improve stragglers
A fix for the tests that took the longest:
- test_05: make the server close the HTTP/1.1 connection when
  simulating an error during a download. This eliminates waiting
  for a keepalive timeout
- test_02: pause tests with slightly smaller documents, eliminate
  special setup for HTTP/2. We test stream window handling now
  elsewhere already
- cli_hx_download: run look in 500ms steps instead of 1sec, resuming
  paused tranfers earlier.

Closes #19809
2025-12-02 17:04:20 +01:00
Daniel Stenberg
4f2374810a
DEPRECATE.md: remove OpenSSL-QUIC in January 2026 instead
Move it up two months. It was only ever experimental so this cannot
interfere with any production code so shorten the "quarantine".

Closes #19805
2025-12-02 13:41:37 +01:00
Viktor Szakats
5356bce6ab
windows: use _strdup() instead of strdup() where missing
To replace deprecated `strdup()` CRT calls with the recommended
`_strdup()`.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup
https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup-mbsdup

Closes #19794
2025-12-01 21:32:09 +01:00
Daniel Stenberg
02aa75a8c2
runtests: allow a test to switch off memdebug
Test 3207 now uses this as its multi-threading is not fully memdebug
compliant.

Closes #19752
2025-11-28 22:39:19 +01:00
Stefan Eissing
12a3182fc3
ssh: tracing and better pollset handling
Remove connection member `waitfor` and keep it in the SSH connection
meta. Add `ssh` to supported tracing features, convert many DEBUGF
printgs to traces.

Closes #19745
2025-11-28 16:05:43 +01:00
Viktor Szakats
aad3c2e8e1
example: fix formatting nits
Also:
- drop non-portable `__STRING()` macro use where still used.

Closes #19746
2025-11-28 15:01:59 +01:00
Viktor Szakats
193cb00ce9
build: stop overriding standard memory allocation functions
Before this patch curl used the C preprocessor to override standard
memory allocation symbols: malloc, calloc, strdup, realloc, free.
The goal of these is to replace them with curl's debug wrappers in
`CURLDEBUG` builds, another was to replace them with the wrappers
calling user-defined allocators in libcurl. This solution needed a bunch
of workarounds to avoid breaking external headers: it relied on include
order to do the overriding last. For "unity" builds it needed to reset
overrides before external includes. Also in test apps, which are always
built as single source files. It also needed the `(symbol)` trick
to avoid overrides in some places. This would still not fix cases where
the standard symbols were macros. It was also fragile and difficult
to figure out which was the actual function behind an alloc or free call
in a specific piece of code. This in turn caused bugs where the wrong
allocator was accidentally called.

To avoid these problems, this patch replaces this solution with
`curlx_`-prefixed allocator macros, and mapping them _once_ to either
the libcurl wrappers, the debug wrappers or the standard ones, matching
the rest of the code in libtests.

This concludes the long journey to avoid redefining standard functions
in the curl codebase.

Note: I did not update `packages/OS400/*.c` sources. They did not
`#include` `curl_setup.h`, `curl_memory.h` or `memdebug.h`, meaning
the overrides were never applied to them. This may or may not have been
correct. For now I suppressed the direct use of standard allocators
via a local `.checksrc`. Probably they (except for `curlcl.c`) should be
updated to include `curl_setup.h` and use the `curlx_` macros.

This patch changes mappings in two places:
- `lib/curl_threads.c` in libtests: Before this patch it mapped to
  libcurl allocators. After, it maps to standard allocators, like
  the rest of libtests code.
- `units`: before this patch it mapped to standard allocators. After, it
  maps to libcurl allocators.

Also:
- drop all position-dependent `curl_memory.h` and `memdebug.h` includes,
  and delete the now unnecessary headers.
- rename `Curl_tcsdup` macro to `curlx_tcsdup` and define like the other
  allocators.
- map `curlx_strdup()` to `_strdup()` on Windows (was: `strdup()`).
  To fix warnings silenced via `_CRT_NONSTDC_NO_DEPRECATE`.
- multibyte: map `curlx_convert_*()` to `_strdup()` on Windows
  (was: `strdup()`).
- src: do not reuse the `strdup` name for the local replacement.
- lib509: call `_strdup()` on Windows (was: `strdup()`).
- test1132: delete test obsoleted by this patch.
- CHECKSRC.md: update text for `SNPRINTF`.
- checksrc: ban standard allocator symbols.

Follow-up to b12da22db1 #18866
Follow-up to db98daab05 #18844
Follow-up to 4deea9396b #18814
Follow-up to 9678ff5b1b #18776
Follow-up to 10bac43b87 #18774
Follow-up to 20142f5d06 #18634
Follow-up to bf7375ecc5 #18503
Follow-up to 9863599d69 #18502
Follow-up to 3bb5e58c10 #17827

Closes #19626
2025-11-28 10:44:26 +01:00
Viktor Szakats
986e6d4eae
CODE_STYLE.md: sync banned function list with checksrc.pl
Also alpha sort the list in checksrc.pl.

Closes #19733
2025-11-27 18:53:35 +01:00
Viktor Szakats
7a10f49322
badwords: make some words match case-insensitively
Also:
- wcurl.md: sync with upstream to pass the badwords check.

Ref: 11f840cddd
Ref: https://github.com/curl/wcurl/pull/79

Closes #19713
2025-11-27 15:10:34 +01:00
Stefan Eissing
c4f29cc508
ip_quadruple/proxy: make port uint16_t
Make `port` member in these struct of type `uint16_t`.

add `uint8_t transport` to `struct ip_quadruple

Define TRNSPRT_NONE as 0. By assigning a valid transport only on a
successful connection, it is clear when the ip_quadruple members are
valid. Also, for transports not involving ports, the getinfos for
`CURLINFO_PRIMARY_PORT` and `CURLINFO_LOCAL_PORT` will now always return
-1.

Make all `transport` members and parameters of type `uint8_t`.

Document the return value of `CURLINFO_LOCAL_PORT` and
`CURLINFO_PRIMARY_PORT` in this regard. Add tests that writeout stats
report ports correctly.

Closes #19708
2025-11-27 14:32:01 +01:00
Yedaya Katsman
9ea6f2bc69
docs: add rustls to supported backends for CERT and KEY
Followup to 1c8c93ae15

Closes #19709
2025-11-27 08:38:25 +01:00
Viktor Szakats
0b09ad8ecb
examples/multi-uv: simplify passing uv struct
Reported-by: st751228051 on github
Follow-up to c722346518 #19538 #19462
Closes #19707
2025-11-26 13:19:36 +01:00
BANADDA
c722346518
examples/multi-uv: fix invalid req->data access
The on_uv_timeout callback was trying to access req->data as
a curl_context pointer, but uv.timeout.data was never initialized,
making it always NULL. This rendered the code inside the if(context)
block unreachable.

Fixes #19462
Closes #19538
2025-11-26 12:52:10 +01:00
Daniel Stenberg
ea7df8d076
docs: spell it Rustls with a capital R
I believe this is how the project itself uses it.

Closes #19702
2025-11-26 09:41:09 +01:00
Stefan Eissing
4701a6d2ae
lib: change uint sets to operate on uint32_t
- clarify names and change types
- make multi's `mid` a uint32_t
- update documentation

Closes #19695
2025-11-25 17:22:13 +01:00
Viktor Szakats
4f807db155
INTERNALS.md: add more dependency versions and dates
Closes #19691
2025-11-25 11:11:06 +01:00
Patrick Monnerat
92e6782d1f
doc: some returned in-memory data may not be altered
Some public prototypes do not declare return values or out parameters as
const where they should be. Avoid changing the public interface, but
document those values as read-only.

Closes #19692
2025-11-25 11:05:27 +01:00
Sunny
a075d1c0d8
examples: fix minor typo
Closes #19683
2025-11-25 08:58:03 +01:00
Viktor Szakats
56bfde6554
INTERNALS.md: add release dates to build dependencies
Also:
- delete `roffit`, that's not used anymore.
  Follow-up to ea0b575dab #12753

Follow-up to 92d9dbe4c0 #19611

Closes #19677
2025-11-25 00:26:50 +01:00
Stefan Eissing
24b36fdd15
ratelimit: redesign
Description of how this works in `docs/internal/RATELIMITS.ms`.

Notable implementation changes:
- KEEP_SEND_PAUSE/KEEP_SEND_HOLD and KEEP_RECV_PAUSE/KEEP_RECV_HOLD
  no longer exist. Pausing is down via blocked the new rlimits.
- KEEP_SEND_TIMED no longer exists. Pausing "100-continue" transfers
  is done in the new `Curl_http_perform_pollset()` method.
- HTTP/2 rate limiting implemented via window updates. When
  transfer initiaiting connection has a ratelimit, adjust the
  initial window size
- HTTP/3 ngtcp2 rate limitin implemnented via ack updates
- HTTP/3 quiche does not seem to support this via its API
- the default progress-meter has been improved for accuracy
  in "current speed" results.

pytest speed tests have been improved.

Closes #19384
2025-11-24 23:34:05 +01:00
Daniel Stenberg
be4462a415
INTERNALS.md: add brotli and zstd version info
And alpha-sort the dependency list

Closes #19672
2025-11-24 23:26:45 +01:00
Viktor Szakats
d03712169b
cmake: add support for libbacktrace, fix two build issues
Also:
- memdebug: fix symbol collision in unity builds.
- memdebug: fix compiler warning by making a variable static.

Follow-up to c77bed81a2 #19657

Closes #19666
2025-11-24 14:29:29 +01:00
Daniel Stenberg
7d75c728a6
KNOWN_RISKS: known risks when running and using curl and libcurl
Closes #19631
2025-11-22 13:09:46 +01:00
Viktor Szakats
9e6f1c5efb
build: add build-level CURL_DISABLE_TYPECHECK options
Usage:
- autotools: `--disable-typecheck` (or `--enable-typecheck` (default))
- cmake: `-DCURL_DISABLE_TYPECHECK=ON`.

To disable `curl_easy_setopt()`/`curl_easy_getinfo()` type checking with
supported (new) gcc and clang compilers. It is useful to improve build
performance for the `tests/libtest` target. In particular the CodeQL
analyzer may take above an hour to compile with type checking enabled,
and disabling it brings it down to seconds. On local machines it may
also cut build times in half when build testdeps, depending on platform
and compiler.

Other than these cases, we recommend leaving type checking enabled.

Ref: fdacf34aae #19632

Also:
- GHA/codeql: use it.
- test1165: check in `include/curl`.
- lib1912: delete stray todo comment.
- spelling and comment nits.

Closes #19637
2025-11-21 13:48:35 +01:00
Daniel Stenberg
49ab46c9c5
gtls: drop support for GnuTLS < 3.6.5
Release date 2018-12-01. Has TLS 1.3 support.

Closes #19609
2025-11-21 10:37:24 +01:00
Marc Aldorasi
529f61388f
gnutls: implement CURLOPT_CAINFO_BLOB
This adds support for in-memory CA certs using CURLOPT_CAINFO_BLOB to
the GnuTLS backend.

Closes #19612
2025-11-21 08:55:44 +01:00
Daniel Stenberg
92d9dbe4c0
INTERNALS: add release dates to the oldest supported dependencies
Closes #19611
2025-11-20 22:11:48 +01:00
Viktor Szakats
7e8f36bf8e
cmake: honor CURL_DISABLE_INSTALL and CURL_ENABLE_EXPORT_TARGET in lib and src
Based on existing code and commit history it appears
`CURL_DISABLE_INSTALL` means to prevent calling `install()`;
`CURL_ENABLE_EXPORT_TARGET` means to prevent calling `export()` and
`install()`s with `EXPORT` in them.

Fix them to also apply to the lib and src directories in that vain:
- lib: honor `CURL_DISABLE_INSTALL`
- src: honor `CURL_DISABLE_INSTALL`
- src: honor `CURL_ENABLE_EXPORT_TARGET`

https://cmake.org/cmake/help/v4.2/command/install.html
https://cmake.org/cmake/help/v4.2/command/export.html

- `CURL_DISABLE_INSTALL` follow-up to:
  aace27b096 #12287
- `CURL_ENABLE_EXPORT_TARGET` follow-up to:
  8698825106 #9638
  643ec29645 #7060

Closes #19144
2025-11-20 00:23:08 +01:00
Viktor Szakats
3d80d37cf0
curlx: add and use curlx_freopen()
To complement the existing `curlx_fopen()` internal API.
It's used by the curl's `--stderr` option.

`curlx_freopen()` adds two features to the bare `freopen()`:
- tracing for debug-enabled builds.
- Unicode and long-filename support for Windows builds.

In effect this adds long-filename and enables Unicode support for
the `--stderr <filename>` curl command-line option on Windows.

Also add to checksrc.

Follow-up to 2f17a9b654 #10673

Closes #19598
2025-11-19 22:04:53 +01:00
Viktor Szakats
2decbb1c1f
runtests: add -m=seconds to override test curl command timeout
To override the curl default of 5 minutes (300000 ms).

Sometimes a simple test data change can result in a stuck test, this
option makes it exit with an error early. Possible future use in CI
or fast machines to prevent a single test taking 5 minutes and failing
the whole job.

Example hangers:

tests/data/test65:
```diff
-<data1000 crlf="yes">
+<data1000 crlf="headers">
```

tests/data/tests993:
```diff
-%repeat[1000 x 95 328485%0d%0a]%</data>
+%repeat[1000 x 95 328485%0d%0a]%
+</data>
```

Closes #19319
2025-11-19 22:04:52 +01:00
Viktor Szakats
7f3731ce14
tests/data: mark non-XML-compliant files as such, xmllint the rest in CI
There are 58 non-compliant files. Mark them with the `notxml` keyword.
Also include the compliant ones in the GHA/checksrc xmllint CI job.

Also:
- delete XML prolog from the 3 test data files that had them.
- FILEFORMAT.md: document the `notxml` keyword.
- FILEFORMAT.md: fix a typo.

Follow-up to de49cc89ab #19470
Follow-up to f3095f0dbd #19528
Follow-up to 87ba80a6df

Closes #19595
2025-11-19 00:02:45 +01:00
Viktor Szakats
36d0f12881
DISTROS.md: add OpenBSD
Closes #19596
2025-11-19 00:02:45 +01:00
Daniel Stenberg
1cbe510d8b
TEST-SUITE.md: correct the man page's path
Closes #19586
2025-11-18 11:02:17 +01:00
Viktor Szakats
3c7cf8eac3
examples: tidy-up headers and includes
To have a more similar layout across examples.

Closes #19580
2025-11-18 02:05:07 +01:00