Commit Graph

35764 Commits

Author SHA1 Message Date
Daniel Stenberg
f97d372703
tool_operate: move config2setopts to separate file, split into subs
To decrease size and complexity. Complexity taken down from 190 to 80.

Bonus:

- remove leftover HTTP/0.9 warning never triggered since hyper was dropped
- remove the ftp-skip-ip option unless FTP is used
- only set HTTP options if HTTP(S) is used
- remove use of the pointless SETOPT_CHECK macro

Side-effect:

- The order of the options in --libcurl is modified

Closes #17352
2025-05-15 14:32:45 +02:00
Daniel Stenberg
9c8cbbda5b
RELEASE-NOTES: synced 2025-05-15 14:16:15 +02:00
Daniel Stenberg
a9aafbea95
CONTRIBUTE: add project guidelines for AI use
Feedback-by: Daniel Fosco
Feedback-by: Jimmy Sjölund
Feedback-by: Christoph Jabs
Feedback-by: Manuel Strehl
Feedback-by: Dan Fandrich
Feedback-by: Sarah Gooding

Closes #17325
2025-05-15 14:07:39 +02:00
Stefan Eissing
d59d8530c6
ngtcp2: clarify ignoring of result
In shutdown, the result of a bufq_write() is intentionally ignored, but
it was not obvious why. Add a (void) cast to declare intent and a
comment explaining why.

Closes #17354
2025-05-15 11:10:02 +02:00
Stefan Eissing
0c749d8177
pytest: give parameterised tests better ids for read- and parsability
Closes #17340
2025-05-15 11:08:24 +02:00
Daniel Stenberg
f5b7eb27f0
netrc: deal with null token better
If there is no length of the token, assign a blank string to avoid
risking it being NULL.

Pointed out by Coverity

Closes #17351
2025-05-15 00:48:10 +02:00
Daniel Stenberg
473b3e51d6
tests/FILEFORMAT.md: document the aws feature
Closes #17350
2025-05-14 23:59:25 +02:00
Maksim Ściepanienka
235b575d3a
tests: add aws feature to the related tests
Closes #17347
2025-05-14 23:41:38 +02:00
Daniel Stenberg
b97d5f931a
GHA: add libssh to the openssl O3 job
To make sure we run libssh tests with valgrind enabled

Closes #17345
2025-05-14 23:36:54 +02:00
Daniel Stenberg
f0f6c610a9
_SEEALSO.md: remove spaces around command and man page section
Follows traditions better

Closes #17348
2025-05-14 23:34:28 +02:00
Daniel Stenberg
6f6ee601b9
libssh: split up the state machine function
This reduces the "complexity score" for myssh_statemach_act from 160 to
100, taking it down from the most complex function in libcurl to the
5th.

Also fixes a memory leak of the sftp session.

Closes #17346
2025-05-14 23:15:58 +02:00
Dan Fandrich
028c12948c scripts: move the ruff linter command into a script
This makes it easier for users to run it with the correct options
locally. Also, update the ruff, pytype and cmakelint versions to the
latest current ones.

Closes #17343
2025-05-13 16:41:32 -07:00
Viktor Szakats
828f998493
spacecheck.pl: drop more exceptions
- replace ß (scharfes S) with links.
- replace § (section sign) with links.
- replace 🙏 emoji with `🙏`.
 Supported by GitHub, Forgejo/Gitea and most likely GitLab.
- docs/libcurl/curl_mprintf.md: replace Unicode ± with `{+|-}`.
- docs/CIPHERS.md: URL encode Unicode in URLs.
- lib1560: use hex encoding in `räksmörgås.se`.
- unit1307: use hex encoding in `Lindmätarv`.
- drop LATIN SMALL LETTER A WITH ACUTE exception.
  No longer appears in tests.

This leaves the single character exception: `ö`
And file exceptions holding contributor names.

Follow-up to 9243ed59b3 #17329
Follow-up to 838dc53bb7 #17247

Closes #17335
2025-05-13 16:01:07 +02:00
Daniel Stenberg
4efeeaa22d
tests/server/Makefile.inc: cleanup
- drop curl_ctype.h as it is not used by test servers
- list all curlx files in the CURLX_* lists
- sort the lists alphabetically

Closes #17339
2025-05-13 14:19:01 +02:00
Daniel Stenberg
0cce66b3b3
setopt: provide info for CURLE_BAD_FUNCTION_ARGUMENT
If CURLE_BAD_FUNCTION_ARGUMENT is returned and failf() has not provided
any details, this adds a generic error string that includes the option
number.

This helps debugging for example the curl tool which does a lot of
setopt calls and in reading post fact logs it is not always easy to tell
exactly which call that failed.

Closes #17337
2025-05-13 14:18:19 +02:00
Daniel Stenberg
a8b947e7f4
headers: set an error message on illegal response headers
Makes it report "Invalid response header" instead of the slightly odd "A
libcurl function was given a bad argument".

Add test 749 and 750 for more CONNECT response testing.

Reported-by: Int64x86 on github
Fixes #17330
Closes #17336
2025-05-13 14:15:05 +02:00
Viktor Szakats
e270881a5d
lib1560: use hex notation, drop non-ASCII exception
Closes #17334
2025-05-13 11:04:43 +02:00
Daniel Stenberg
11cad7bf32
tests: provide all non-ascii data hex encoded
- make the scanner not whitelist anything for test cases making
  everything non-ascii forced to be hex encoded

- update all tests using non-ascii bytes to use %hex[] sequences

Closes #17331
2025-05-13 10:32:35 +02:00
Daniel Stenberg
65444f1dc3
curlx: move the docs to docs/internals/
Closes #17333
2025-05-13 10:30:02 +02:00
Daniel Stenberg
47896d4b59
tests/server: stop using libcurl string comparisons
Further untangle the test server code from curl code. While the string
comparison functions are available in the libcurl API, the tests servers
don't link with libcurl. Use native functions instead.

Closes #17328
2025-05-13 10:28:19 +02:00
Daniel Stenberg
abd400a972
tests/FILEFORMAT.md: clarify %hex[] formatting
Closes #17332
2025-05-13 08:50:12 +02:00
Viktor Szakats
9243ed59b3
spacecheck.pl: verify tests/data/test* for non-ASCII chars
Exclude test data files (4 of them) based on existing feature tags:
`codeset-utf8` and `Unicode`.

Add the new keyword `non-ascii` to mark remaining exceptions (9 files).

Follow-up to 838dc53bb7 #17247

Closes #17329
2025-05-13 08:47:47 +02:00
Dan Fandrich
fca1fdc988 docs: update distros links 2025-05-12 13:51:38 -07:00
Daniel Stenberg
8b33704511
tests/server: stop using libcurl's printf functions
Since the test servers are not built with libcurl the *printf code
needed to get built separately, and they are not in the curlx
collection.

snprintf() is provided in all modern systems these days.

Move curlx functions from lib/strerror.c to lib/curlx/winapi.c

Assisted-by: Viktor Szakats

Closes #17294
2025-05-12 22:45:37 +02:00
Stefan Eissing
2e1040fa5c
asny-thrdd: fix detach from running thread
When cancelling a threaded resolve and the thread is
still running, detach from it under the mutex lock.

Otherwise, the detach might happen after the thread finished
and access already freed memory.

Fixes #17256
Reported-by: Mathieu Garaud
Closes #17320
2025-05-12 17:17:19 +02:00
Daniel Stenberg
cf511e7726
TODO: Retry SOCKS handshake
Closes #17222
Closes #17326
2025-05-12 16:34:28 +02:00
Daniel Stenberg
1ef5bef055
tests/server: remove TEST use, include <memdebug.h>
- The TEST define is never set
- memdebug.h is not in the local dir, using angle bracket include

Closes #17323
2025-05-12 13:20:54 +02:00
Viktor Szakats
144706342f
tests/server: check for stream != NULL in mqttd
To avoid an assert in `fgets()` on MSVC when the test case is missing.

Bug: https://github.com/curl/curl/pull/17294#issuecomment-2867501300

Closes #17324
2025-05-12 13:16:42 +02:00
Daniel Stenberg
4f055feee2
mk-ca-bundle: switch URLs to GitHub versions
The offical Firefox source code has moved to GitHub:
https://github.com/mozilla-firefox/firefox

This change adjusts to the new URLs. The old branches nss and central
are not provided so they are removed and the new 'autoland' is added.

Closes #17321
2025-05-12 11:09:17 +02:00
Daniel Stenberg
dc4272318f
imap: remove redundant condition
'imap' always evaluates to true. Spotted by CodeSonar.

Closes #17318
2025-05-12 11:04:33 +02:00
Daniel Stenberg
da06f01ab9
rtsp: remove redundant condition
'rtsp' always evaluates to true. Spotted by CodeSonar.

Closes #17317
2025-05-12 11:03:44 +02:00
Daniel Stenberg
c5398fa393
netrc: avoid strdup NULL
Coverity found a code path where this might happen. Avoid it.

Closes #17319
2025-05-12 11:02:51 +02:00
Daniel Stenberg
5f6c714d24
http_chunks: narrow variable scope for 'trlen'
CodeSonar found a case where it would be assigned but never used and
narrowing the scope makes sense anyway.

Closes #17316
2025-05-12 11:02:00 +02:00
Daniel Stenberg
9455746af9
RELEASE-NOTES: synced 2025-05-12 07:47:34 +02:00
Daniel Stenberg
f862f863bf
mprintf: provide hex digits for escape.c to use
Since they need the exact same set, use the same set. The mprintf string
was longer than it had to be.

Closes #17311
2025-05-12 07:44:35 +02:00
Daniel Stenberg
1eb3928db6
mprintf: remove outdated comment about SIZEOF_SIZE_T
It was now plain wrong

Closes #17312
2025-05-12 07:43:54 +02:00
Daniel Stenberg
c37f4b6ac3
inet_ntop: rename curlx_inet_ntop to Curl_inet_ntop
It is not part of the curlx club.

Closes #17313
2025-05-12 07:42:59 +02:00
Jay Satiro
b794264408 curl_version_info.md: clarify ssl_version for MultiSSL
- Clarify that the ssl_version in MultiSSL builds contains all SSL
  backend names with the inactive backend names in parentheses.

Closes https://github.com/curl/curl/pull/17308
2025-05-11 12:23:36 -04:00
Daniel Stenberg
3b3d6a46ba
timeval.c: #include fix 2025-05-11 12:24:10 +02:00
Dan Fandrich
38865c8282 test1621: Improve stripcredentials tests
- add more unusual input cases
- add a valid non-http protocol
- fix tests so an input that should be stripped but isn't is a failure
- fix detection of when stripcredentials() would be available to test
- avoid using a NULL pointer

Closes #17304
2025-05-10 15:07:53 -07:00
Daniel Stenberg
674836399f
mime: reuse the base64 string from the base64 code
Avoids duplicating an identical string here.

Closes #17309
2025-05-10 23:01:14 +02:00
Daniel Stenberg
ff84228a53
base64: pass in the padding byte separately
The makes the string with base64 octets "pure" to be used elsewhere as
well.

Closes #17309
2025-05-10 23:01:07 +02:00
Daniel Stenberg
13032ff75c
curl: fix memory leak when -h is used in config file
Reported-by: antypanty on hackerone

Add test 748 to reproduce and verify fix

Closes #17306
2025-05-10 11:16:07 +02:00
Daniel Stenberg
cd7904f5a9
CURLMOPT_TIMERFUNCTION.md: correct the example
Fixes #17301
Reported-by: Dirk Feytons
Closes #17303
2025-05-09 17:04:40 +02:00
Viktor Szakats
1499319442
windows: fix to preserve error code in curlx_winapi_strerror()
Drop the interim macro `PRESERVE_WINDOWS_ERROR_CODE` and always preserve
error code for `_WIN32`. To make sure this is always done in
`curlx_winapi_strerror()`.

Follow-up to c74d3e10d2 #17299

Closes #17302
2025-05-09 15:56:07 +02:00
Daniel Stenberg
d4dd43b20d
curlx: move curlx_inet_pton
Used by test server code.

Closes #17300
2025-05-09 13:45:24 +02:00
Daniel Stenberg
c74d3e10d2
curlx: add curlx_winapi_ functions
Split them out from lib/strerror. Used by test code.

Closes #17299
2025-05-09 10:45:36 +02:00
Daniel Stenberg
9468503330
tests: stop using libcurl's strdup
It is not provided as a curlx function so should not be used outside of
libcurl.

I strongly suspect that no system we build the test suite on lack strdup
so this will not cause any harm.

The private version was added in b0936b8007 for Ultrix.

Closes #17297
2025-05-09 10:09:00 +02:00
Daniel Stenberg
a129859367
lib: drop curlx_getpid, use fake pid in SMB
It was not a function properly exposed in the curlx set. SMB cannot
possibly need to send a real pid, now sends a made up number.

The only real users of this function are test servers, so move the logic
over there.

Closes #17298
2025-05-09 10:01:30 +02:00
Daniel Stenberg
5fef848037
RELEASE-NOTES: synced 2025-05-08 22:33:01 +02:00