Commit graph

15125 commits

Author SHA1 Message Date
Viktor Szakats
904ddd39c6
smtp fix unsued variable
lib/smtp.c:356:42: error: unused parameter 'data' [-Werror,-Wunused-parameter]
  356 | static void smtp_state(struct Curl_easy *data,
      |                                          ^

-DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_BINDLOCAL=ON -DCURL_DISABLE_CA_SEARCH=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DICT=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FORM_API=ON -DCURL_DISABLE_GOPHER=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_INSTALL=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_MQTT=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROXY=ON -DCURL_DISABLE_RTSP=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DENABLE_CURLDEBUG=ON -DENABLE_DEBUG=ON -DENABLE_UNICODE=ON
2025-07-23 19:54:57 +02:00
Viktor Szakats
3c1c1e4c7d
http: fix unused variables
lib/http.c:1002:49: error: unused parameter 'data' [-Werror,-Wunused-parameter]
 1002 | CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy,
      |                                                 ^
lib/http.c:1003:43: error: unused parameter 'auth' [-Werror,-Wunused-parameter]
 1003 |                               const char *auth) /* the first non-space */
      |                                           ^
2 errors generated.

options='-DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_CA_SEARCH=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DICT=ON -DCURL_DISABLE_DIGEST_AUTH=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FILE=ON -DCURL_DISABLE_FORM_API=ON -DCURL_DISABLE_FTP=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_GOPHER=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_HTTP_AUTH=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_INSTALL=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_PROXY=ON -DCURL_DISABLE_RTSP=ON -DCURL_DISABLE_SHA512_256=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SMB=ON -DCURL_DISABLE_SMTP=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_TELNET=ON -DCURL_DISABLE_TFTP=ON -DCURL_DISABLE_WEBSOCKETS=ON -DENABLE_CURLDEBUG=ON -DENABLE_DEBUG=ON -DENABLE_UNICODE=ON -DUSE_SSLS_EXPORT=ON '
2025-07-23 19:54:56 +02:00
Viktor Szakats
e70938193a
cf-h2-proxy: disable when !http + nghttp2
lib/cf-h2-proxy.c:97:12: error: call to undeclared function 'Curl_http_proxy_get_destination'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   97 |   result = Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip);
      |            ^
lib/cf-h2-proxy.c:937:12: error: call to undeclared function 'Curl_http_proxy_create_CONNECT'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  937 |   result = Curl_http_proxy_create_CONNECT(&req, cf, data, 2);
      |            ^
lib/cf-h2-proxy.c:986:14: error: call to undeclared function 'Curl_http_input_auth'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  986 |     result = Curl_http_input_auth(data, ts->resp->status == 407,
      |              ^
lib/cf-h2-proxy.c:986:14: note: did you mean 'Curl_http_output_auth'?
lib/http.h:209:1: note: 'Curl_http_output_auth' declared here
  209 | Curl_http_output_auth(struct Curl_easy *data,
      | ^
3 errors generated.

options='-DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_BINDLOCAL=ON -DCURL_DISABLE_CA_SEARCH=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DICT=ON -DCURL_DISABLE_DIGEST_AUTH=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FILE=ON -DCURL_DISABLE_FORM_API=ON -DCURL_DISABLE_FTP=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_GOPHER=ON -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_HTTP=ON -DCURL_DISABLE_HTTP_AUTH=ON -DCURL_DISABLE_INSTALL=ON -DCURL_DISABLE_IPFS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_MQTT=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_POP3=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_RTSP=ON -DCURL_DISABLE_SHA512_256=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SMB=ON -DCURL_DISABLE_SMTP=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_TELNET=ON -DCURL_DISABLE_TFTP=ON -DCURL_DISABLE_WEBSOCKETS=ON -DENABLE_UNICODE=ON -DHTTP_ONLY=ON -DUSE_SSLS_EXPORT=ON  -DENABLE_IPV6=OFF'
2025-07-23 19:54:56 +02:00
Viktor Szakats
207f25c004
fix missing function !http + nghttp2
Undefined symbols for architecture arm64:
  "_Curl_cft_nghttp2", referenced from:
      _trc_cfts in unity_1_c.c.o

options='-DCURL_DISABLE_AWS=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FILE=ON -DCURL_DISABLE_GOPHER=ON -DCURL_DISABLE_HTTP=ON -DCURL_DISABLE_HTTP_AUTH=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_POP3=ON -DCURL_DISABLE_PROXY=ON -DCURL_DISABLE_SHA512_256=ON -DCURL_DISABLE_SMB=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_TELNET=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DUSE_SSLS_EXPORT=ON'
2025-07-23 19:54:56 +02:00
Viktor Szakats
0482130edc
fix builds with !http + nghttp2
_buildroulette/lib/http2.c:218:24: error: field has incomplete type 'struct h1_req_parser'
  218 |   struct h1_req_parser h1; /* parsing the request */
      |                        ^
_buildroulette/lib/http2.c:218:10: note: forward declaration of 'struct h1_req_parser'
  218 |   struct h1_req_parser h1; /* parsing the request */
      |          ^
_buildroulette/lib/http2.c:258:3: error: call to undeclared function 'Curl_h1_req_parse_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-funct
  258 |   Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
      |   ^
_buildroulette/lib/http2.c:258:39: error: use of undeclared identifier 'H1_PARSE_DEFAULT_MAX_LINE_LEN'
  258 |   Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
      |                                       ^
_buildroulette/lib/http2.c:282:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-funct
  282 |   Curl_h1_req_parse_free(&stream->h1);
      |   ^
_buildroulette/lib/http2.c:2237:14: error: call to undeclared function 'Curl_h1_req_parse_read'; ISO C99 and later do not support implicit function declarations [-Wimplicit-fun
 2237 |   nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result);
      |              ^
_buildroulette/lib/http2.c:2251:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-func
 2251 |   Curl_h1_req_parse_free(&stream->h1);
      |   ^
_buildroulette/lib/http2.c:2866:19: error: no member named 'http_neg' in 'struct UrlState'
 2866 |      (data->state.http_neg.wanted & CURL_HTTP_V2x) &&
      |       ~~~~~~~~~~~ ^
_buildroulette/lib/http2.c:2867:18: error: no member named 'http_neg' in 'struct UrlState'
 2867 |      data->state.http_neg.h2_prior_knowledge) {
      |      ~~~~~~~~~~~ ^
8 errors generated.
2025-07-23 19:54:56 +02:00
Viktor Szakats
4f1cfdc2de
vtls fix unused function
```
lib/vtls/vtls.c:153:1: error: unused function 'alpn_get_spec' [-Werror,-Wunused-function]
  153 | alpn_get_spec(http_majors allowed, bool use_alpn)
      | ^~~~~~~~~~~~~
```

options='-DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_BINDLOCAL=ON -DCURL_DISABLE_CA_SEARCH=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DICT=ON -DCURL_DISABLE_DIGEST_AUTH=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FILE=ON -DCURL_DISABLE_FORM_API=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_HTTP=ON -DCURL_DISABLE_HTTP_AUTH=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_INSTALL=ON -DCURL_DISABLE_IPFS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_MQTT=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_POP3=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_PROXY=ON -DCURL_DISABLE_RTSP=ON -DCURL_DISABLE_SHA512_256=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SMTP=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_TELNET=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DENABLE_UNICODE=ON -DUSE_SSLS_EXPORT=ON'
2025-07-23 19:54:56 +02:00
Viktor Szakats
402230626a
ftp fix unused var
lib/ftp.c:145:42: error: unused parameter 'data' [-Werror,-Wunused-parameter]
  145 | static void _ftp_state(struct Curl_easy *data,
      |                                          ^

options='-DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_BINDLOCAL=ON -DCURL_DISABLE_CA_SEARCH=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DICT=ON -DCURL_DISABLE_DIGEST_AUTH=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FILE=ON -DCURL_DISABLE_FORM_API=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_HTTP=ON -DCURL_DISABLE_HTTP_AUTH=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_INSTALL=ON -DCURL_DISABLE_IPFS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_MQTT=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_POP3=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_PROXY=ON -DCURL_DISABLE_RTSP=ON -DCURL_DISABLE_SHA512_256=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SMTP=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_TELNET=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DENABLE_UNICODE=ON -DUSE_SSLS_EXPORT=ON'
2025-07-23 19:54:56 +02:00
Viktor Szakats
4cb031f1f6
sync Curl_trc_ws guard with declaration
```
lib/curl_trc.c:637:6: error: no previous prototype for function 'Curl_trc_ws' [-Werror,-Wmissing-prototypes]
  637 | void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...)
      |      ^
lib/curl_trc.c:637:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
  637 | void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...)
      | ^
      | static
```

options='-DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_CA_SEARCH=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FTP=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_GOPHER=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_INSTALL=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_MQTT=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_POP3=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_PROXY=ON -DCURL_DISABLE_RTSP=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DENABLE_UNICODE=ON -DHTTP_ONLY=ON -DUSE_SSLS_EXPORT=ON -DENABLE_UNIX_SOCKETS=OFF'
2025-07-23 19:54:56 +02:00
Viktor Szakats
1c48966315
fixed potential unused variable
lib/vtls/vtls.c:1634:51: error: unused parameter 'conn' [-Werror,-Wunused-parameter]
 1634 |                               struct connectdata *conn)
      |                                                   ^
2025-07-23 19:54:56 +02:00
Stefan Eissing
ab5e0bfddc
pytest: add SOCKS tests and scoring
Configure curl with `--with-test-sockd=<path to sockd>` for a locally
installed dante sockd server and new `test_40_*` will verify that
down- and uploads work via SOCKS.

Invoke scorecard.py with `--socks4` or `--socks5` to run performance
tests with SOCKS. Note that SOCKS is not supported for HTTP/3.

Ref: #17969
Closes #17986
2025-07-23 18:12:31 +02:00
Caolán McNamara
fb0b4c8710
http: const up readonly H2_NON_FIELD
Closes #17996
2025-07-23 16:23:39 +02:00
Viktor Szakats
ee232917dc
tidy-up: Curl_thread_create() callback return type
Replace repeat `#ifdef` code with a macro for the return type of
the thread function.

Also:
- always define `CURL_STDCALL`, allowing to use it without guards.
- lib1307: drop single-use macro `CAINFO`.

Closes #17889
2025-07-21 16:17:42 +02:00
Viktor Szakats
8ae93a95f8
curl_fnmatch, servers: drop local macros in favour of sizeof()
Closes #17898
2025-07-21 16:14:14 +02:00
Viktor Szakats
0260e8465a
GHA/checksrc: expand spellcheck, fix issues found
- codespell: break logic out into its own runnable script. Allowing
  to run it on local machines.
- codespell: install via `pip`, bump to latest version.
- codespell: show version number in CI log.
- codespell: drop no longer needed word exception: `msdos`.
- codespell: include all curl source tree, except `packages` and
  `winbuild`. Drop an obsolete file exclusion.
- add new spellchecker job using the `typos` tool. It includes
  the codespell dictionary and a couple more. Use linuxbrew to install
  it. This takes 10 seconds, while installing via `cargo` from source
  would take over a minute.
- codespell: introduce an inline ignore filter compatible with `cspell`
  Make `typos` recognize it, too. Move single exceptions inline.

Fix new typos found. Also rename variables and words to keep
spellchecking exceptions at minumum. This involves touching some tests.
Also switch base64 strings to `%b64[]` to avoid false positives.

Ref: https://github.com/crate-ci/typos/blob/master/docs/reference.md
Ref: https://github.com/codespell-project/codespell?tab=readme-ov-file#inline-ignore
Ref: https://github.com/codespell-project/codespell/issues/1212#issuecomment-1721152455
Ref: https://cspell.org/docs/Configuration/document-settings

Closes #17905
2025-07-21 16:09:01 +02:00
Viktor Szakats
792a61e204
curl_setup.h: move UWP detection after config-win32.h
To honor a `_WIN32_WINNT` set by `config-win32.h`.

Closes #17980
2025-07-21 15:02:21 +02:00
Stefan Eissing
3d302250ec
multi event: remove only announced
When a socket is closed, only inform the application
socket callback about it if the socket had been announced
before to the callback.

Reported-by: yaoy6 on github
Fixes #17949
Closes #17950
2025-07-20 23:17:28 +02:00
Stefan Eissing
960fb49245
easy handle: check validity on external calls
In each external API function passing a `CURL *` into the library, check
`GOOD_EASY_HANDLE()` if its magic is still there.

Ref: #17957
Closes #17958
2025-07-20 23:11:05 +02:00
Stefan Eissing
a15a5f4d29
vquic-tls: fix SSL backend type for QUIC connections using gnutls
Fix the copy&paste error when querying ssl info for gnutls
on QUIC connections.

Reported-by: Harry Sintonen
Closes #17976
2025-07-20 23:10:15 +02:00
Viktor Szakats
bf9d9fe0bd
multissl: initialize when requesting a random number
To fix test 1308 in MultiSSL builds.

Failure was caused by the random number generator virtual function being
NULL, instead of pointing to the implementation in the runtime-selected
TLS backend. This could happen in MultiSSL builds when a functionality
was asking for a random number without triggering a VTLS function table
initialization first. Such functionality is MIME, or form data via MIME.

The reason CI did not catch it in an earlier MultiSSL GHA/windows job,
is that it was a debug-enabled one. In debug-enabled builds the test
runner was overriding the random number generator for all tests.

Fixed this by moving the override to the tests requiring it, via
1fcf22585f #17971, enabling debug builds
to catch this issue.

Enable MultiSSL in two CI jobs, to verify this patch.

Fixing:
```
test 1308...[formpost tests]

libtests returned 44, when expecting 0
 1308: exit FAILED
[...]
=== Start of file stderr1308
 URL: log/3/test-1308
 tests/libtest/lib1308.c:70 Assertion 'res == 0' FAILED: curl_formget returned error
 tests/libtest/lib1308.c:72 Assertion 'total_size == 518' FAILED: curl_formget got wrong size back
 tests/libtest/lib1308.c:88 Assertion 'res == 0' FAILED: curl_formget returned error
 tests/libtest/lib1308.c:89 Assertion 'total_size == 899' FAILED: curl_formget got wrong size back
```
Ref: https://github.com/curl/curl/actions/runs/16387693424/job/46309536359?pr=17963#step:16:2515

Bug: https://github.com/curl/curl/pull/17963#issuecomment-3092282057

Closes #17970
2025-07-20 12:03:56 +02:00
Stefan Eissing
044de8e19b
gnutls: some small cleanups
- de-complex Curl_gtls_verifyserver() by splitting of static
  functions for parts of it.
- follow the `goto out` style with common deallocation code

Closes #17941
2025-07-18 00:41:09 +02:00
Stefan Eissing
3ad4b44073
openssl: some small cleanups
- rename Curl_oss_check_peer_cert() to Curl_ossl_check_peer_cert()
- leave altname match loop after the first success when the match
  was an ip address
- remove static subj_alt_hostcheck() since it did not really do much
- use length based infof() output of altname, even though it does
  seem always to be nul terminated

Closes #17940
2025-07-18 00:40:26 +02:00
Ammar Faizi
5cefe93eb6
socks: do_SOCKS5: Fix invalid buffer content on short send
Ahmad Gani intercepts the sendto syscall to simulate short send, but
curl incorrectly handles it. It keeps resending the version:

  sendto(4, "\x05", 1, MSG_NOSIGNAL, NULL, 0) = 1
  sendto(4, "\x05", 1, MSG_NOSIGNAL, NULL, 0) = 1

Don't restart the buffer in the `CONNECT_SOCKS_INIT` case if
`sx->outstanding` is not zero. It should continue sending the
advanced buffer.

Fixes #17942
Reported-by: Ahmad Gani <reyuki@gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Closes #17943
2025-07-18 00:38:15 +02:00
Viktor Szakats
8535068c24
config-win32: fix to set target version early
To set it before checking for it while enabling `HAVE_INET_NTOP` and
`HAVE_INET_PTON` for Vista (and up) targets.

May have affected winbuild or Visual Studio IDE Project Files.

Follow-up to 68fa9bf3f5 #9712

Closes #17928
2025-07-15 12:56:05 +02:00
Viktor Szakats
3222eabe18
tidy-up: whitespace/indent
Closes #17925
2025-07-14 18:33:43 +02:00
Stefan Eissing
e9ae1bd404
connection: clarify transport
The `transport` to use for a transfer, e.g. TCP/QUIC/UNIX/UDP, is
initially selected by options and protocol used. This is set at the
`struct connectdata` as `transport` member.

During connection establishment, this transport may change due to
Alt-Svc or Happy-Eyeballing. Most common is the switch from TCP to QUIC.

Rename the connection member to `transport_wanted` and add a way to
query the connection for the transport in use via a new connection
filter query.

The filter query can also be used in the happy eyeballing attempts when
code needs to know which transport is used by the "filter below". This
happens in wolfssl initialization, as one example.

Closes #17923
2025-07-14 14:33:18 +02:00
Stefan Eissing
674ad27f77
http/3: report handshake with version and cipher as for TCP connections
Make reporting into separate functions, to be called from QUIC handshakes
as well.

Closes #17922
2025-07-14 14:08:32 +02:00
Viktor Szakats
2f3890baaf
config-win32: fix default targets, shorten macro logic
When using winbuild or Visual Studio IDE Project Files.
To simplify and prepare for dropping support for VS2008.

Details:
- fix VS2012 default target to be Windows 8 (was Vista).
  Confirmed by CI:
  ```
  -- The C compiler identification is MSVC 17.0.61030.0
  -- Found _WIN32_WINNT=0x0602
  ```
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51594696/job/elbl0w5n7fmoos2f#L45
  It also aligns with the default being Windows 7 for VS2010,
  and Windows Vista for VS2008.
- bump minimum target to XP (was Windows 2000) when using VS2008.
  curl requires XP.
- add Windows release names to comments for clarity.
- add hex Windows version to a comment for clarity.
- merge VS2008/VS2012 minimum/default logic and comments.
- reduce scope of local minimum/default macros.
- shorten comments to fit within line limit.

Closes #17916
2025-07-14 13:18:32 +02:00
Daniel Stenberg
826a32dff3
altsvc: accept 'clear' without semicolon as well
Extend test 1654 to verify

Fixes #17917
Reported-by: Luke Wilde
Closes #17918
2025-07-13 17:02:34 +02:00
Ryan Hooper
b1fb8da0fa
wolfssl: add support for ML_KEM hybrids
For parity with OpenSSL 3.5

Closes #17902
2025-07-12 22:51:08 +02:00
Daniel McCarney
a2028823a8
lib/vts: fix a copy-pasted early data comment typo
In gtls.c there was a typo'd comment that I think was missing the word
"no" to indicate there's "no GnuTLS way to signal no EarlyData".

This commit fixes that typo, and also updates a copy-pasted instance
that made it into wolfssl.c where it should refer to the WolfSSL API
missing the capability, not GnuTLS.

Closes #17907
2025-07-12 19:27:36 +02:00
Daniel McCarney
d85b5d2656
lib/vtls: log rustls negotiated KEX group name
Closes #17906
2025-07-12 19:26:41 +02:00
Daniel McCarney
308922ed04
lib/vtls: prefer ciphersuite to cipher in msgs
Closes #17906
2025-07-12 19:26:38 +02:00
Daniel McCarney
e23ba71269
lib/vtls: prefer rustls-ffi ciphersuite name API
Closes #17906
2025-07-12 19:26:28 +02:00
Patrick Stoeckle
86f43af951
misc: fix typos
Just fixing some typos using: https://github.com/crate-ci/typos

Closes #17904
2025-07-12 08:59:44 +02:00
Viktor Szakats
c6b2d3d911
connect: drop unused struct member
Follow-up to 283af039c8 #14863

Closes #17908
2025-07-12 08:59:44 +02:00
Viktor Szakats
886389dc01
lib: stop time() debug overrides at the end of source in altsvc, hsts
To avoid applying it to all other sources in unity mode.

This may have affected tests setting a custom time via `CURL_TIME`,
in unity builds: 446, 780, 781, 782, 783, 970, 972, 1654, 1660

Closes #17897
2025-07-12 08:59:44 +02:00
Viktor Szakats
368ba4e13f
tidy-up: drop redundant #ifdef before #undef
Closes #17899
2025-07-12 08:59:44 +02:00
Viktor Szakats
8eab2b7086
tidy-up: whitespace
Cherry-picked from #17877
Cherry-picked from #17876

Closes #17896
2025-07-11 13:32:54 +02:00
Stefan Eissing
695eee432f
h3: fix query of concurrent streams
Queries gave wrong value or ran into NULL pointers when called at
times when connection filter was not fully initialized.

Closes #17886
2025-07-10 17:29:54 +02:00
Stefan Eissing
74a94e699a
socks: fix query when filter context is null
socks connection filter context may be NULL at the time
of a query, accomodate for that.

Closes #17885
2025-07-10 17:28:49 +02:00
Stefan Eissing
51369ae78b
http2: fix var types in is_alive() implementations
Closes #17881
2025-07-10 10:47:04 +02:00
Karthik Dasari
454395ba1e
curl_osslq: fix missing include of url.h
Follow-up to 4ccf3a31f5 #17783
Follow-up to b270fec68d #17858
Ref: #17857
Closes #17864
2025-07-08 19:58:21 +02:00
Viktor Szakats
8afb623bdd
windows: drop redundant curl_wcsdup_callback callback
This callback was permanently mapped to libcurl's internal
`Curl_wcsdup()`, which always uses the customizable malloc for
allocation, thus making a custom mapping redundant anyway.

To simplify, drop the callback and map `_tcsdup()` in Unicode mode
directly to `Curl_wcsdup()`.

Also fixes:
- `curl_global_init()` which, before this patch, (re)initialized its
  mapping to `_wcsdup()`, returning buffers potentially incompatible
  with a custom allocator.
  Bug: https://github.com/curl/curl/pull/17840#issuecomment-3044361245
  Bug: https://github.com/curl/curl/pull/7540#issuecomment-2380995349
  Co-reported-by: Luca Kellermann

Follow-up to 76e047fc27 #7540
Assisted-by: Jay Satiro

Closes #17843
2025-07-08 13:33:38 +02:00
Eshan Kelkar
ac8271d020
libssh: fix readdir issues
Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Closes #17856
2025-07-08 12:43:09 +02:00
Stefan Eissing
b270fec68d
quiche: fix missing include of url.h
Reported-by: Karthik Dasari
Fixes #17857
Closes #17858
2025-07-08 11:07:39 +02:00
Viktor Szakats
172ca3bba9
memory: tidy up _tcsdup() override
Follow-up to ef2ccf862f #17840
Closes #17845
2025-07-07 15:32:15 +02:00
Viktor Szakats
ef2ccf862f
memory: stop overriding unused wcsdup()/_wcsdup() system functions
Also ban them via `checksrc`.

The code continues to use `_tcsdup()`.

Assisted-by: Daniel Stenberg

Closes #17840
2025-07-07 15:03:31 +02:00
Daniel Stenberg
f048546c87
libssh2: remove use of 'initialised' for cleanup
It could previously cause a memory-leak when the cleanup was not
performed because it was not set.

Reported-by: albrechtd on github
Fixes #17819
Closes #17837
2025-07-07 12:01:22 +02:00
Stefan Eissing
4ccf3a31f5
ngtcp2: fix coverity warning about result handling
Closes #17783
2025-07-07 08:58:46 +02:00
Stefan Eissing
2db8ae480f
quic: implement CURLINFO_TLS_SSL_PTR
Replace the old Curl_ssl_get_internals() with a new connection filter
query to retrieve the information. Implement that filter query for TCP
and QUIC TLS filter types.

Add tests in client tls_session_reuse to use the info option and check
that pointers are returned.

Reported-by: Larry Campbell
Fixes #17801
Closes #17809
2025-07-06 20:29:54 +02:00