Commit Graph

13185 Commits

Author SHA1 Message Date
Emanuele Torre
7f712399d5
checksrc: check for spaces before the colon of switch labels
Closes #11047
2023-04-27 23:26:50 +02:00
Daniel Stenberg
ff67da58c4
libssh: tell it to use SFTP non-blocking
Reported-by: Andreas Huebner
Fixes #11020
Closes #11039
2023-04-27 17:59:56 +02:00
Stefan Eissing
de4b0164f2
http2: enlarge the connection window
- fixes stalled connections

- Make the connection window large enough, so that there is
  some room left should 99/100 streams be PAUSED by the application

Reported-by: Paweł Wegner
Fixes #10988
Closes #11043
2023-04-27 17:44:55 +02:00
Daniel Stenberg
d567cca1de
checksrc: fix SPACEBEFOREPAREN for conditions starting with "*"
The open paren check wants to warn for spaces before open parenthesis
for if/while/for but also for any function call. In order to avoid
catching function pointer declarations, the logic allows a space if the
first character after the open parenthesis is an asterisk.

I also spotted what we did not include "switch" in the check but we should.

This check is a little lame, but we reduce this problem by not allowing
that space for if/while/for/switch.

Reported-by: Emanuele Torre
Closes #11044
2023-04-27 17:24:47 +02:00
Daniel Stenberg
bb0b245cc1
ws: fix CONT opcode check
Detected by Coverity. Follow-up to 930c00c259

Closes #11037
2023-04-27 11:08:48 +02:00
Daniel Stenberg
b7b1846275
urlapi: make internal function start with Curl_
Curl_url_set_authority() it is.

Follow-up to acd82c8bfd

Closes #11035
2023-04-27 08:36:51 +02:00
YX Hao
ca3f6decb9
cf-socket: turn off IPV6_V6ONLY on Windows if it is supported
IPV6_V6ONLY refs:
https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses
https://github.com/golang/go/blob/master/src/net/ipsock_posix.go
https://en.wikipedia.org/wiki/Unix-like
https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options

default value refs:
https://datatracker.ietf.org/doc/html/rfc3493#section-5.3
https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables

Closes #10975
2023-04-26 23:39:57 +02:00
Daniel Stenberg
65f03e507f
urldata: shrink *select_bits int => unsigned char
- dselect_bits
- cselect_bits

... are using less than 8 bits. Changed types and moved them towards
the end of the structs to fit better.

Closes #11025
2023-04-26 23:36:45 +02:00
Stefan Eissing
acd82c8bfd
tests/http: more tests with specific clients
- Makefile support for building test specific clients in tests/http/clients
- auto-make of clients when invoking pytest
- added test_09_02 for server PUSH_PROMISEs using clients/h2-serverpush
- added test_02_21 for lib based downloads and pausing/unpausing transfers

curl url parser:
- added internal method `curl_url_set_authority()` for setting the
  authority part of a url (used for PUSH_PROMISE)

http2:
- made logging of PUSH_PROMISE handling nicer

Placing python test requirements in requirements.txt files
- separate files to base test suite and http tests since use
  and module lists differ
- using the files in the gh workflows

websocket test cases, fixes for we and bufq
- bufq: account for spare chunks in space calculation
- bufq: reset chunks that are skipped empty
- ws: correctly encode frames with 126 bytes payload
- ws: update frame meta information on first call of collect
  callback that fills user buffer
- test client ws-data: some test/reporting improvements

Closes #11006
2023-04-26 23:24:46 +02:00
Jay Satiro
21575b26fe libssh2: fix crash in keyboard callback
- Always set the libssh2 'abstract' user-pointer to the libcurl easy
  handle associated with the ssh session, so it is always passed to the
  ssh keyboard callback.

Prior to this change and since 8b5f100 (precedes curl 8.0.0), if libcurl
was built without CURL_DEBUG then it could crash during the ssh auth
phase due to a null dereference in the ssh keyboard callback.

Reported-by: Andreas Falkenhahn

Fixes https://github.com/curl/curl/pull/11024
Closes https://github.com/curl/curl/pull/11026
2023-04-26 15:04:29 -04:00
Harry Sintonen
13718030ad
hostip: add locks around use of global buffer for alarm()
When building with the sync name resolver and timeout ability we now
require thread-safety to be present to enable it.

Closes #11030
2023-04-26 15:40:07 +02:00
Daniel Stenberg
91b53efa4b
curl_path: bring back support for SFTP path ending in /~
libcurl used to do a directory listing for this case (even though the
documentation says a URL needs to end in a slash for this), but
4e2b52b5f7 modified the behavior.

This change brings back a directory listing for SFTP paths that are
specified exactly as /~ in the URL.

Reported-by: Pavel Mayorov
Fixes #11001
Closes #11023
2023-04-26 11:26:35 +02:00
Daniel Stenberg
199f2d440d
hostcheck: fix host name wildcard checking
The leftmost "label" of the host name can now only match against single
'*'. Like the browsers have worked for a long time.

- extended unit test 1397 for this
- move some SOURCE variables from unit/Makefile.am to unit/Makefile.inc

Reported-by: Hiroki Kurosawa
Closes #11018
2023-04-26 09:07:27 +02:00
Stefan Eissing
930c00c259
Websocket en-/decoding
- state is fully kept at connection, since curl_ws_send() and
  curl_ws_rec() have lifetime beyond usual transfers
- no more limit on frame sizes

Reported-by: simplerobot on github
Fixes #10962
Closes #10999
2023-04-25 23:16:51 +02:00
Patrick Monnerat
3f0b81c112 urldata: copy CURLOPT_AWS_SIGV4 value on handle duplication
Prior to this change STRING_AWS_SIGV4 (CURLOPT_AWS_SIGV4) was wrongly
marked as binary data that could not be duplicated.

Without this fix, this option's value is not copied upon calling
curl_easy_duphandle().

Closes https://github.com/curl/curl/pull/11021
2023-04-25 14:59:12 -04:00
Stefan Eissing
3b7a8a25b6
http3: expire unpaused transfers in all HTTP/3 backends
Closes #11005
2023-04-25 17:50:57 +02:00
Stefan Eissing
5622e431ed
http2: always EXPIRE_RUN_NOW unpaused http/2 transfers
- just increasing the http/2 flow window does not necessarily
  make a server send new data. It may already have exhausted
  the window before

Closes #11005
2023-04-25 17:50:53 +02:00
Stefan Eissing
fbea71f293
http2: pass stream to http2_handle_stream_close to avoid NULL checks
Closes #11005
2023-04-25 17:50:45 +02:00
Stefan Eissing
cab2d56ea5
h2/h3: replace state.drain counter with state.dselect_bits
- `drain` was used by http/2 and http/3 implementations to indicate
  that the transfer requires send/recv independant from its socket
  poll state. Intended as a counter, it was used as bool flag only.
- a similar mechanism exists on `connectdata->cselect_bits` where
  specific protocols can indicate something similar, only for the
  whole connection.
- `cselect_bits` are cleard in transfer.c on use and, importantly,
  also set when the transfer loop expended its `maxloops` tries.
  `drain` was not cleared by transfer and the http2/3 implementations
  had to take care of that.
- `dselect_bits` is cleared *and* set by the transfer loop. http2/3
  does no longer clear it, only set when new events happen.

This change unifies the handling of socket poll overrides, extending
`cselect_bits` by a easy handle specific value and a common treatment in
transfers.

Closes #11005
2023-04-25 17:49:28 +02:00
Daniel Stenberg
a97e4eb95f
socketpair: verify with a random value
... instead of using the curl time struct, since it would use a few
uninitialized bytes and the sanitizers would complain. This is a neater
approach I think.

Reported-by: Boris Kuschel
Fixes #10993
Closes #11015
2023-04-25 17:40:15 +02:00
Daniel Stenberg
7815647d65
lib: unify the upload/method handling
By making sure we set state.upload based on the set.method value and not
independently as set.upload, we reduce confusion and mixup risks, both
internally and externally.

Closes #11017
2023-04-25 12:38:38 +02:00
Daniel Stenberg
406cc24f5d
http: store the password in the correct variable
Typo from fc2f1e547a, detected by Coverity (because there's dead code
due to this).

Closes #11002
2023-04-24 13:54:52 +02:00
Stefan Eissing
20252b77bc
HTTP3/quiche: terminate h1 response header when no body is sent
- fixes a failure in test2501 where a response without body was missing
  the final empty line

Closes #11003
2023-04-24 13:40:47 +02:00
Stefan Eissing
db82878afd quiche: Enable IDLE egress handling
Follow-up to 544abeea which added the handling but wrongly left it
commented out.

Closes https://github.com/curl/curl/pull/11000
2023-04-18 15:35:38 -04:00
Stefan Eissing
fc2f1e547a
http2: support HTTP/2 to forward proxies, non-tunneling
- with `--proxy-http2` allow h2 ALPN negotiation to
  forward proxies
- applies to http: requests against a https: proxy only,
  as https: requests will auto-tunnel
- adding a HTTP/1 request parser in http1.c
- removed h2h3.c
- using new request parser in nghttp2 and all h3 backends
- adding test 2603 for request parser
- adding h2 proxy test cases to test_10_*

scorecard.py: request scoring accidentally always run curl
with '-v'. Removed that, expect double numbers.

labeller: added http1.* and h2-proxy sources to detection

Closes #10967
2023-04-17 17:27:49 +02:00
Andreas Falkenhahn
15a361892d
nbtlm: use semicolons instead of commas for (void) args
Closes #10978
2023-04-16 17:05:15 +02:00
Daniel Stenberg
81b2b577df
multi: free up more data earleier in DONE
Before checking for more users of the connection and possibly bailing
out.

Fixes #10971
Reported-by: Paweł Wegner
Closes #10972
2023-04-15 23:30:05 +02:00
Daniel Stenberg
21e7e44fb9
url: fix PVS nits
- expression 'hostptr' is always true
- a part of conditional expression is always true: proxypasswd
- expression 'proxyuser' is always true
- avoid multiple Curl_now() calls in allocate_conn

Ref: #10929
Closes #10959
2023-04-14 09:29:33 +02:00
Daniel Stenberg
0ebf111b37
bufq: simplify since expression is always true
The check for 'len' is already done so it will remain true until
updated. Pointed out by PVS.

Ref: #10929
Closes #10958
2023-04-14 09:28:33 +02:00
Daniel Stenberg
a299099ba4
hash: fix assigning same value
Pointed out by PVS

Ref: #10929
Closes #10956
2023-04-14 09:26:26 +02:00
Daniel Stenberg
c79356d852
cookie: address PVS nits
- avoid assigning the same value again
- remove superfluous check of co->domain
- reduce variable scope for namep/valuep

Ref: #10929
Closes #10954
2023-04-14 09:23:04 +02:00
Stefan Eissing
4bc597d27c cf-socket: Disable socket receive buffer by default
- Disable socket receive buffer unless USE_RECV_BEFORE_SEND_WORKAROUND
  is in place.

While we would like to use the receive buffer, we have stalls in
parallel transfers where not all buffered data is consumed and no socket
events happen.

Note USE_RECV_BEFORE_SEND_WORKAROUND is a Windows sockets workaround
that has been disabled by default since b4b6e4f1, due to other bugs.

Closes https://github.com/curl/curl/pull/10961
2023-04-14 03:15:05 -04:00
Stefan Eissing
43d7ccd03d
cf-h2-proxy: fix processing ingress to stop too early
- progress ingress stopped too early, causing data
  from the underlying filters to not be processed and
  report that no tunnel data was available
- this lead to "hangers" where no socket activity was
  seen but data rested in buffers

Closes #10952
2023-04-13 23:54:43 +02:00
Stefan Eissing
be800a6cab
http3: check stream_ctx more thoroughly in all backends
- callbacks and filter methods might be invoked at unexpected
  times, e.g. when the transfer's stream_ctx has not been initialized
  yet or, more likely, has already been taken down.
- check for existance of stream_ctx in such places and return
  an error or silently succeed the call.

Closes #10951
2023-04-13 23:53:36 +02:00
Daniel Stenberg
7e68133d04
ftp: fix 'portsock' variable was assigned the same value
Pointed out by PVS

Ref: #10929
Closes #10955
2023-04-13 18:14:30 +02:00
Daniel Stenberg
41a53b159d
ftp: remove dead code
This condition can never be true here since it is handled already 28
lines above.

Pointed out by PVS.

Ref: #10929
Closes #10957
2023-04-13 18:13:40 +02:00
Daniel Stenberg
aabfa60371
cf-h1-proxy: skip an extra NULL assign
and use Curl_safefree() once to save another NULL assign. Found by PVS.

Ref. #10929
Closes #10953
2023-04-13 17:23:50 +02:00
Stefan Eissing
f67d6a6888
cf-socket: remove dead code discovered by PVS
Closes #10960
2023-04-13 17:20:29 +02:00
Daniel Stenberg
8b8d7acc6e
http: skip a double NULL assign
and also use a local variable to shorten the long names and increase
readability in the function. Pointed out by PVS.

Ref: #10929
Closes #10950
2023-04-13 17:16:43 +02:00
Daniel Stenberg
51b615a3eb
mime: skip NULL assigns after Curl_safefree()
Pointed out by PVS.

Ref: #10929
Closes #10947
2023-04-13 17:15:08 +02:00
Daniel Stenberg
aa3ee0a13a
rtsp: skip NULL assigns after Curl_safefree()
... since this is a macro that assigns NULL itself. Pointed out by PVS.

Ref: #10929
Closes #10946
2023-04-13 17:14:03 +02:00
Daniel Stenberg
d50045509c
smb: remove double assign
The same value is assigned the same value already a few lines above.
Pointed out by PVS.

Ref: #10929
Closes #10945
2023-04-13 17:12:55 +02:00
Daniel Stenberg
19c36f5ca3
transfer: skip extra assign
The 'result' variable already contains CURLE_OK at this point, no use in
setting it again. Pointed out by PVS.

Ref: #10929
Closes #10944
2023-04-13 14:39:08 +02:00
Daniel Stenberg
3f1d89ed24
urlapi: skip a pointless assign
It stores a null byte after already having confirmed there is a null
byte there. Detected by PVS.

Ref: #10929
Closes #10943
2023-04-13 14:36:28 +02:00
Stefan Eissing
24726a437e
cf-socket: add socket recv buffering for most tcp cases
- use bufq as recv buffer, also for Windows pre-receive handling
- catch small reads followed by larger ones in a single socket
  call. A common pattern on TLS connections.

Closes #10787
2023-04-13 08:46:38 +02:00
Daniel Stenberg
4cfa5bcc9a
urlapi: cleanups
- move host checks together
- simplify the scheme parser loop and the end of host name parser
- avoid itermediate buffer storing in multiple places
- reduce scope for several variables
- skip the Curl_dyn_tail() call for speed
- detect IPv6 earlier and skip extra checks for such hosts
- normalize directly in dynbuf instead of itermediate buffer
- split out the IPv6 parser into its own funciton
- call the IPv6 parser directly for ipv6 addresses
- remove (unused) special treatment of % in host names
- junkscan() once in the beginning instead of scattered
- make junkscan return error code
- remove unused query management from dedotdotify()
- make Curl_parse_login_details use memchr
- more use of memchr() instead of strchr() and less strlen() calls
- make junkscan check and return the URL length

An optimized build runs one of my benchmark URL parsing programs ~41%
faster using this branch. (compared against the shipped 7.88.1 library
in Debian)

Closes #10935
2023-04-13 08:41:40 +02:00
Josh McCullough
233b4e4589
http2: fix typo in infof() call
Closes #10940
2023-04-13 08:39:56 +02:00
Daniel Stenberg
ca05e1afba
noproxy: pointer to local array 'hostip' is stored outside scope
Ref: #10929
Closes #10933
2023-04-12 09:00:20 +02:00
Stefan Eissing
dd8130406e
connect: fix https connection setup to treat ssl_mode correctly
- for HTTPS protocol, a disabled ssl should never be acceptables.

Closes #10934
2023-04-12 08:51:14 +02:00
Daniel Stenberg
9eeb7d3ed5
multi: remove a few superfluous assigns
PVS found these "The 'rc' variable was assigned the same value." cases.

Ref: #10929
Closes #10932
2023-04-11 23:51:49 +02:00
Daniel Stenberg
90aea8e2a9
schannel: add clarifying comment
Explaining how the PVS warning in #10929 is wrong: Dereferencing of the
null pointer 'backend->cred' might take place.

Closes #10931
2023-04-11 23:50:49 +02:00
Daniel Stenberg
b1b326ec50
cookie: clarify that init with data set to NULL reads no file
... and make Curl_cookie_add() require 'data' being set proper with an
assert.

The function has not worked with a NULL data for quite some time so this
just corrects the code and comment.

This is a different take than the proposed fixed in #10927

Reported-by: Kvarec Lezki
Ref: #10929
Closes #10930
2023-04-11 23:49:50 +02:00
Kvarec Lezki
a1763648a5
vtls: remove int typecast for sizeof()
V220 Suspicious sequence of types castings: memsize -> 32-bit integer ->
memsize. The value being cast: 'sizeof
(buf->data)'. curl\lib\vtls\vtls.c 2025

https://pvs-studio.com/en/docs/warnings/v220/

Closes #10928
2023-04-11 23:48:06 +02:00
Stefan Eissing
c59b5b3c87
http2: fix copynpaste error reported by coverity
- move all code handling HTTP/2 frames for a particular
  stream into a separate function to keep from confusing
  the call `data` with the stream `data`.

Closes #10924
2023-04-11 23:46:53 +02:00
Daniel Stenberg
452b8e39ef
http2: avoid possible null pointer dereference
Reported-by: Dan Fandrich
Fixes #10920
Closes #10923
2023-04-11 12:29:03 +02:00
Daniel Stenberg
826e8011d5
urlapi: prevent setting invalid schemes with *url_set()
A typical mistake would be to try to set "https://" - including the
separator - this is now rejected as that would then lead to
url_get(... URL...) would get an invalid URL extracted.

Extended test 1560 to verify.

Closes #10911
2023-04-09 23:23:54 +02:00
Biswapriyo Nath
5023d7c944
http2: remove unused Curl_http2_strerror function declaration
Curl_http2_strerror was renamed to http2_strerror in
05b100aee2 and then http2_strerror was removed in
5808a0d0f5

This also fixes the following compiler error

lib/http2.h:41:33: error: unknown type name 'uint32_t'
lib/http2.h:1:1: note: 'uint32_t' is defined in header '<stdint.h>'

Closes #10912
2023-04-09 23:21:42 +02:00
SuperIlu on github
92617713b6
config-dos.h: fix SIZEOF_CURL_OFF_T for MS-DOS/DJGPP
Fixes #10905
Closes #10910
2023-04-08 23:53:50 +02:00
Daniel Stenberg
5f307986a3
lib: remove CURLX_NO_MEMORY_CALLBACKS
The only user of this define was 'chkdecimalpoint' - a special purpose
test tool that was built but not used anymore (since 17c18fbc3 - Apr
2020).

Closes #10908
2023-04-08 17:47:10 +02:00
Daniel Stenberg
712e5f1e7f
CURLPROXY_HTTPS2: for HTTPS proxy that may speak HTTP/2
Setting this proxy type allows curl to negotiate and use HTTP/2 with
HTTPS proxies.

Closes #10900
2023-04-08 00:27:53 +02:00
Daniel Stenberg
772e28ff76
http2: remove check for !data after it was already dereferenced
Pointed out by Coverity

Closes #10906
2023-04-07 23:49:51 +02:00
Daniel Stenberg
887acb48e4
http_proxy: provide missing arg to infof() call
Pointed out by Coverity

Closes #10904
2023-04-07 23:48:38 +02:00
Daniel Stenberg
4033642930
content_encoding: only do tranfer-encoding compression if asked to
To reduce surprises. Update test 387 and 418 accordingly.

Closes #10899
2023-04-07 13:39:20 +02:00
Daniel Stenberg
4838863d27
lib/cmake: add HAVE_WRITABLE_ARGV check
Assisted-by: Jakub Zakrzewski
Closes #10896
2023-04-06 23:52:31 +02:00
Daniel Stenberg
0ba120e307
vtls: fix build error when proxy-disabled
Closes #10901
2023-04-06 23:50:48 +02:00
Stefan Eissing
632e0fbe70
http2: move HTTP/2 stream vars into local context
- remove NGHTTP2 members of `struct HTTP`
- add `void *h2_ctx` to `struct HTTP`
- add `void *h3_ctx` to `struct HTTP`
- separate h2/h3 pointers are needed for eyeballing
- manage local stream_ctx in http implementations

Closes #10877
2023-04-06 16:27:50 +02:00
Stefan Eissing
4ae2d9f24d
proxy: http2 proxy tunnel implementation
- currently only on debug build and when env variable
  CURL_PROXY_TUNNEL_H2 is present.
- will ALPN negotiate with the proxy server and switch
  tunnel filter based on the protocol negotiated.
- http/1.1 tunnel code moved into cf-h1-proxy.[ch]
- http/2 tunnel code implemented in cf-h2-proxy.[ch]
- tunnel start and ALPN set remains in http_proxy.c
- moving all haproxy related code into cf-haproxy.[ch]

VTLS changes
- SSL filters rely solely on the "alpn" specification they
  are created with and no longer check conn->bits.tls_enable_alpn.
- checks on which ALPN specification to use (or none at all) are
  done in vtls.c when creating the filter.

Testing
- added a nghttpx forward proxy to the pytest setup that
  speaks HTTP/2 and forwards all requests to the Apache httpd
  forward proxy server.
- extending test coverage in test_10 cases
- adding proxy tests for direct/tunnel h1/h2 use of basic auth.
- adding test for http/1.1 and h2 proxy tunneling to pytest

Closes #10780
2023-04-06 13:04:46 +02:00
Stefan Eissing
8f50e393ab
vtls and h2 improvements
- eliminate receive loop in vtls to fill buffer. This may
  lead to partial reads of data which is counter productive
- let http2 instead loop smarter to process pending network
  data without transfer switches

scorecard improvements
- do not start caddy when only httpd is requested
- allow curl -v to stderr file on --curl-verbose

Closes #10891
2023-04-06 09:41:54 +02:00
Daniel Stenberg
17a15d8846
urlapi: detect and error on illegal IPv4 addresses
Using bad numbers in an IPv4 numerical address now returns
CURLUE_BAD_HOSTNAME.

I noticed while working on trurl and it was originally reported here:
https://github.com/curl/trurl/issues/78

Updated test 1560 accordingly.

Closes #10894
2023-04-06 09:02:00 +02:00
Daniel Stenberg
f042e1e75d
urlapi: URL encoding for the URL missed the fragment
Meaning that it would wrongly still store the fragment using spaces
instead of %20 if allowing space while also asking for URL encoding.

Discovered when playing with trurl.

Added test to lib1560 to verify the fix.

Closes #10887
2023-04-05 08:30:12 +02:00
Daniel Stenberg
4399a532e9
rtsp: convert mallocs to dynbuf for RTP buffering
Closes #10786
2023-04-04 14:44:25 +02:00
Stefan Eissing
3797f1a4ca
rustls: fix error in recv handling
- when rustls is told to recieve more TLS data and its internal
  plaintext buffers are full, it returns an IOERROR
- avoid receiving TLS data while plaintext is not read empty

pytest:
- increase curl run timeout when invoking pytest with higher verbosity

Closes #10876
2023-03-31 16:05:15 +02:00
Stefan Eissing
544abeea83
http3: improvements across backends
- ngtcp2: using bufq for recv stream data
- internal stream_ctx instead of `struct HTTP` members
  for quiche, ngtcp2 and msh3
- no more QUIC related members in `struct HTTP`
- experimental use of recvmmsg(), disabled by default
  - testing on my old debian box shows no throughput improvements.
  - leaving it in, but disabled, for future revisit
- vquic: common UDP receive code for ngtcp2 and quiche
- vquic: common UDP send code for ngtcp2 and quiche
- added pytest skips for known msh3 failures
- fix unit2601 to survive torture testing
- quiche: using latest `master` from quiche and enabling large download
  tests, now that key change is supported
- fixing test_07_21 where retry handling of starting a stream
  was faulty
- msh3: use bufq for recv buffering headers and data
- msh3: replace fprintf debug logging with LOG_CF where possible
- msh3: force QUIC expire timers on recv/send to have more than
  1 request per second served

Closes #10772
2023-03-31 15:44:57 +02:00
Daniel Stenberg
2d59eb0035
rtsp: fix Value stored to 'skip_size' is never read
Pointed out by scan-build

Follow-up to 6c6306f300

Closes #10872
2023-03-30 23:59:26 +02:00
Stefan Eissing
744dcf22fa
http2: flow control and buffer improvements
- use bufq for send/receive of network data
- usd bufq for send/receive of stream data
- use HTTP/2 flow control with no-auto updates to control the
  amount of data we are buffering for a stream
  HTTP/2 stream window set to 128K after local tests, defined
  code constant for now
- elminiating PAUSEing nghttp2 processing when receiving data
  since a stream can now take in all DATA nghttp2 forwards

Improved scorecard and adjuste http2 stream window sizes
- scorecard improved output formatting and options default
- scorecard now also benchmarks small requests / second

Closes #10771
2023-03-30 23:11:26 +02:00
Matt Jolly
0ae0abbe72
hostip: refuse to resolve the .onion TLD
RFC 7686 states that:

> Applications that do not implement the Tor
> protocol SHOULD generate an error upon the use of .onion and
> SHOULD NOT perform a DNS lookup.

Let's do that.

https://www.rfc-editor.org/rfc/rfc7686#section-2

Add test 1471 and 1472 to verify

Fixes #543
Closes #10705
2023-03-30 15:51:06 +02:00
Jim King
34ef4fab22
openssl: interop with AWS-LC
* Configure changes to detect AWS-LC
* CMakeLists.txt changes to detect AWS-LC
* Compile-time branches needed to support AWS-LC
* Correctly set OSSL_VERSION and report AWS-LC release number
* GitHub Actions script to build with autoconf and cmake against AWS-LC

AWS-LC is a BoringSSL/OpenSSL derivative
For more information see https://github.com/awslabs/aws-lc/

Closes #10320
2023-03-30 10:56:14 +02:00
Stefan Eissing
b74bba9aad
vlts: use full buffer size when receiving data if possible
SSL backends like OpenSSL/wolfSSL and other return the content of one
TLS record on read, but usually there are more available.

Change the vtls cfilter recv() function to fill the given buffer until a
read would block.

Closes #10736
2023-03-30 10:04:20 +02:00
dengjfzh
6c6306f300
rtsp: skip malformed RTSP interleaved frame data
Some IP cameras send malformed RTSP interleaved frames sometimes, which
can cause curl_easy_perform return 1 (CURLE_UNSUPPORTED_PROTOCOL).  This
change attempts to skip clearly incorrect RTSP interleaving frame data.

Closes #10808
2023-03-30 09:59:09 +02:00
Stefan Eissing
61f52a97e9
lib: add bufq and dynhds
Adding `bufq`:
- at init() time configured to hold up to `n` chunks of `m` bytes each.
- various methods for reading from and writing to it.
- `peek` support to get access to buffered data without copy
- `pass` support to allow buffer flushing on write if it becomes full
- use case: IO buffers for dynamic reads and writes that do not blow up
- distinct from `dynbuf` in that:
  - it maintains a read position
  - writes on a full bufq return CURLE_AGAIN instead of nuking itself
- Init options:
  - SOFT_LIMIT: allow writes into a full bufq
  - NO_SPARES: free empty chunks right away
- a `bufc_pool` that can keep a number of spare chunks to
  be shared between different `bufq` instances

Adding `dynhds`:
- a straightforward list of name+value pairs as used for HTTP headers
- headers can be appended dynamically
- headers can be removed again
- headers can be replaced
- headers can be looked up
- http/1.1 formatting into a `dynbuf`
- configured at init() with limits on header counts and total string
  sizes
- use case: pass a HTTP request or response around without being version
  specific
- express a HTTP request without a curl easy handle (used in h2 proxy
  tunnels)
- future extension possibilities:
  - conversions of `dynhds` to nghttp2/nghttp3 name+value arrays

Closes #10720
2023-03-30 09:08:05 +02:00
Daniel Stenberg
8455013359
lib: use correct printf flags for sockets and timediffs
Introduces CURL_FORMAT_SOCKET_T for outputting socket numbers.

Fixes #10737
Reported-by: Gisle Vanem
Closes #10855
2023-03-29 13:12:29 +02:00
Daniel Stenberg
9a607fd728
telnet: make MSVC ignore warning for assignment within conditional
Follow-up to d92a5007b6

Closes #10859
2023-03-29 13:07:17 +02:00
Daniel Stenberg
b19cbebbb4
ws: handle reads before EAGAIN better
Reported-by: simplerobot on github
Fixes #10831
Closes #10856
2023-03-29 10:23:29 +02:00
Frank Gevaerts
abb9be36f1
lib/sha256.c: typo fix in comment (duplicated "is available")
Closes #10851
2023-03-28 17:52:41 +02:00
Kamil Dudka
d92a5007b6 telnet: simplify the implementation of str_is_nonascii()
There is no need to traverse the string twice.

Closes #10852
2023-03-28 15:41:55 +02:00
Daniel Stenberg
5a10f48778
dynbuf: never allocate larger than "toobig"
As dynbufs always have a fixed maximum size which they are not allowed
to grow larger than, making sure that it never allocates a larger buffer
makes sure the buffer does not allocate memory that will never be used.

Closes #10845
2023-03-28 10:22:53 +02:00
Daniel Stenberg
c1d6fe2aaa
ftplistparser: replace realloc with dynbuf
Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
2203bd13ff
ftplistparser: use ISDIGIT()
Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
01114f6efd
ftplistparser: move out private data from public struct
The public 'curl_fileinfo' struct contained three fields that are for
internal purposes only. This change makes them unused in the public
struct.

The new private struct fields are also renamed to make this separation
more obvious internally.

Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
e4cd1ffed1
openssl: fix indents - white space edits only
Closes #10840
2023-03-28 10:02:40 +02:00
Daniel Stenberg
5fec927374
url: remove call to Curl_llist_destroy in Curl_close
A list that is created with a NULL "destructor" does not need to be
destroyed. Not calling it is faster than calling it.

Closes #10846
2023-03-27 23:36:16 +02:00
Daniel Stenberg
843b3baa3e
multi: remove PENDING + MSGSENT handles from the main linked list
As they are not driving transfers or any socket activity, the main loop
does not need to iterate over these handles. A performance improvement.

They are instead only held in their own separate lists.

'data->multi' is kept a pointer to the multi handle as long as the easy
handle is actually part of it even when the handle is moved to the
pending/msgsent lists. It needs to know which multi handle it belongs
to, if for example curl_easy_cleanup() is called before the handle is
removed from the multi handle.

Alll 'data->multi' pointers of handles still part of the multi handle
gets cleared by curl_multi_cleanup() which "orphans" all previously
attached easy handles.

This is take 2. The first version was reverted for the 8.0.1 release.

Assisted-by: Stefan Eissing
Closes #10801
2023-03-26 17:43:28 +02:00
Daniel Stenberg
4528690cd5
cmake: set SONAME for SunOS too
Provided-by: Brian Lund

Closes #10816
2023-03-23 15:40:44 +01:00
Stefan Eissing
78f73f79ca
ngtcp2: adjust config and code checks for ngtcp2 without nghttp3
- make configure show on HTTP3 feature that both ngtcp2 and nghttp3
  are in play
- define ENABLE_QUIC only when USE_NGTCP2 and USE_NGHTTP3 are defined
- add USE_NGHTTP3 in the ngtcp2 implementation

Fixes #10793
Closes #10821
2023-03-23 15:39:13 +01:00
Daniel Stenberg
0c2fcb0f60
ntlm: clear lm and nt response buffers before use
To avoid the risk of MemorySanitizer: use-of-uninitialized-value

Closes #10814
2023-03-23 09:25:05 +01:00
Daniel Stenberg
955e2769f7
digest: clear target buffer
Closes #10814
2023-03-23 09:24:59 +01:00
Stefan Eissing
5d1ecbcbd2
multi: add handle asserts in DEBUG builds
For GOOD_EASY_HANDLE and GOOD_MULTI_HANDLE checks

- allow NULL pointers to "just" return an error as before
- fail hard on nun-NULL pointers that no longer show the MAGICs

Closes #10812
2023-03-22 13:57:20 +01:00
jonrumsey
8a83bda0a2
gskit: various compile errors in OS400
Various compile failures in gskit.c;

- pipe_ssloverssl() needs Curl_easy data parameter for
  Curl_conn_cf_get_socket(cf, data)
- key_passwd is in ssl_config, not conn_config
- close_on() has 2 parameters, not 4
- getsockopt() needs to call Curl_conn_cf_get_socket(), not
  cxn->sock[FIRSTSOCKET]

Fixes #10799
Closes #10800
2023-03-22 13:55:26 +01:00
Daniel Stenberg
c2df780a97
Revert "multi: remove PENDING + MSGSENT handles from the main linked list"
This reverts commit f6d6f3ce01.

The commits caused issues in the 8.0.0 release. Needs a retake.

Reported-by: Kamil Dudka
Closes #10795
2023-03-20 14:49:04 +01:00
Daniel Stenberg
138860576f
cf-socket: use port 80 when resolving name for local bind
It turns out c-ares returns an error when asked to resolve a host name with
ares_getaddrinfo using port number 0.

Reported as a c-ares bug here: https://github.com/c-ares/c-ares/issues/517

The work-around is to simply use port 80 instead, as the number typically does
not make a difference and a non-zero number works for c-ares.

Fixes #10759
Reported-by: Matt Jolly
Closes #10789
2023-03-17 22:55:31 +01:00
Daniel Stenberg
f5e0f52dd3
Revert "rtsp: use dynbuf instead of custom reallocs"
This reverts commit 1b9ea3239d because of OSS-fuzz reports.
I'll do another take after the pending release.

Closes #10785
2023-03-17 15:41:07 +01:00
Daniel Stenberg
f7a3fae4cb
libssh: use dynbuf instead of realloc
When building lines to show for SFTP directory listings.

Closes #10778
2023-03-16 23:32:22 +01:00
Daniel Stenberg
1b9ea3239d
rtsp: use dynbuf instead of custom reallocs
For the RTP buffering.

Closes #10776
2023-03-16 16:09:55 +01:00
Daniel Stenberg
d2d0e60012
libssh2: remove unused variable from libssh2's struct
Closes #10777
2023-03-16 13:44:48 +01:00
Daniel Stenberg
f6d6f3ce01
multi: remove PENDING + MSGSENT handles from the main linked list
As they are not driving transfers or any socket activity, the main loop
does not need to iterate over these handles. A performance improvement.

They are instead only held in their own separate lists.

Assisted-by: Stefan Eissing
Ref: #10743
Closes #10762
2023-03-15 10:37:49 +01:00
Daniel Stenberg
a208be3710
multi: turn link/unlinking easy handles into dedicated functions 2023-03-15 10:37:48 +01:00
Daniel Stenberg
18a45a51ba
http_aws_sigv4: fix scan-build "value stored to 'ret' is never read"
Follow-up to 495d09810a

Closes #10766
2023-03-15 07:32:01 +01:00
Daniel Stenberg
e5e8815532
lib: skip Curl_llist_destroy calls
Linked lists themselves do not carry any allocations, so for the lists
that do not have have a set destructor we can just skip the
Curl_llist_destroy() call and save CPU time.

Closes #10764
2023-03-15 00:10:21 +01:00
Casey Bodley
495d09810a
aws_sigv4: fall back to UNSIGNED-PAYLOAD for sign_as_s3
all s3 requests default to UNSIGNED-PAYLOAD and add the required
x-amz-content-sha256 header. this allows CURLAUTH_AWS_SIGV4 to correctly
sign s3 requests to amazon with no additional configuration

Signed-off-by: Casey Bodley <cbodley@redhat.com>

Closes #9995
2023-03-14 17:04:47 +01:00
Viktor Szakats
ebef55a61d
wolfssl: add quic/ngtcp2 detection in cmake, and fix builds
- add QUIC/ngtcp2 detection in CMake with wolfSSL.

  Because wolfSSL uses zlib if available, move compression detection
  before TLS detection. (OpenSSL might also need this in the future.)

- wolfSSL 5.5.0 started using C99 types in its `quic.h` header, but it
  doesn't #include the necessary C99 header itself, breaking builds
  (unless another dependency pulled it by chance.) Add local workaround
  for it. For this to work with all build tools, we had to fix our
  header detection first. Ref: #10745

  Ref: 6ad5f6ecc1

Closes #10739
2023-03-14 11:57:55 +00:00
Stefan Eissing
31889210b9
secure-transport: fix recv return code handling
Return code handling of recv calls were not always correct when an error
occured or the connection was closed.

Closes #10717
2023-03-14 09:59:27 +01:00
Stefan Eissing
06f65f771b http2: Use KEEP_SEND_HOLD for flow control in HTTP/2
- use the defined, but so far not used, KEEP_SEND_HOLD bit for flow
  control based suspend of sending in transfers.

Prior to this change KEEP_SEND_PAUSE bit was used instead, but that can
interfere with pausing streams from the user side via curl_easy_pause.

Fixes https://github.com/curl/curl/issues/10751
Closes https://github.com/curl/curl/pull/10753
2023-03-14 03:26:57 -04:00
Daniel Stenberg
bc90308328
multi: make multi_perform ignore/unignore signals less often
For improved performance

Reported-by: Jerome St-Louis
Ref: #10743
Closes #10750
2023-03-13 23:01:02 +01:00
Viktor Szakats
9f96537cc3
cmake: delete unused HAVE__STRTOI64
Also delete obsolete surrounding comments.

Reviewed-by: Daniel Stenberg
Closes #10756
2023-03-13 15:49:54 +00:00
Viktor Szakats
db073c9d88
build: fix stdint/inttypes detection with non-autotools
Fix `stdint.h` and `inttypes.h` detection with non-autotools builds on
Windows. (autotools already auto-detected them accurately.)

`lib/config-win32.h` builds (e.g. `Makefile.mk`):
- set `HAVE_STDINT_H` where supported.
- set `HAVE_INTTYPES_H` for MinGW.

CMake:
- auto-detect them on Windows. (They were both force-disabled.)
- delete unused `CURL_PULL_STDINT_H`.
- delete unused `CURL_PULL_INTTYPES_H`.
- stop detecting `HAVE_STDINT_H` twice.
  Present since the initial CMake commit: 4c5307b456

curl doesn't use these C99 headers, we need them now to workaround
broken wolfSSL builds. Ref: #10739

Once that clears up, we can delete these detections and macros (unless
we want to keep them for future us.)

Reviewed-by: Daniel Stenberg
Closes #10745
2023-03-13 10:47:21 +00:00
Daniel Stenberg
8f4608468b
ftp: add more conditions for connection reuse
Reported-by: Harry Sintonen
Closes #10730
2023-03-13 09:07:23 +01:00
Viktor Szakats
a285b22f8f
Makefile.mk: fix -g option in debug mode [ci skip]
Add it to `CFLAGS` (was: `LDFLAGS`).

Closes #10747
2023-03-13 00:16:30 +00:00
Dan Fandrich
ee521a1c88 http: don't send 100-continue for short PUT requests
This is already how curl is documented to behave in Everything curl, but
in actuality only short POSTs skip this. This should knock 30 seconds
off a full run of the test suite since the 100-continue timeout will no
longer be hit.

Closes #10740
2023-03-11 18:57:19 -08:00
Stefan Eissing
544a7f804d
http2: fix error handling during parallel operations
RST and connection close were not handled correctly during parallel
transfers, leading to aborted response bodies being reported complete.

Closes #10715
2023-03-10 23:52:53 +01:00
Daniel Stenberg
cb49e67303
url: only reuse connections with same GSS delegation
Reported-by: Harry Sintonen
Closes #10731
2023-03-10 23:30:34 +01:00
Viktor Szakats
b725fe1944
lib: silence clang/gcc -Wvla warnings in brotli headers
brotli v1.0.0 throughout current latest v1.0.9 and latest master [1]
trigger this warning.

It happened with CMake and GNU Make. autotools builds avoid it with
the `convert -I options to -isystem` macro.

llvm/clang:
```
In file included from ./curl/lib/content_encoding.c:36:
./brotli/x64-ucrt/usr/include/brotli/decode.h:204:34: warning: variable length array used [-Wvla]
    const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./brotli/x64-ucrt/usr/include/brotli/port.h:253:34: note: expanded from macro 'BROTLI_ARRAY_PARAM'
                                 ^~~~~~
In file included from ./curl/lib/content_encoding.c:36:
./brotli/x64-ucrt/usr/include/brotli/decode.h:206:48: warning: variable length array used [-Wvla]
    uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
                           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
./brotli/x64-ucrt/usr/include/brotli/port.h:253:35: note: expanded from macro 'BROTLI_ARRAY_PARAM'
                                 ~^~~~~
```

gcc:
```
In file included from ./curl/lib/content_encoding.c:36:
./brotli/x64-ucrt/usr/include/brotli/decode.h:204:5: warning: ISO C90 forbids variable length array 'encoded_buffer' [-Wvla]
  204 |     const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
      |     ^~~~~
./brotli/x64-ucrt/usr/include/brotli/decode.h:206:5: warning: ISO C90 forbids variable length array 'decoded_buffer' [-Wvla]
  206 |     uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
      |     ^~~~~~~
```

[1] ed1995b6bd

Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad
Closes #10738
2023-03-10 22:24:24 +00:00
Daniel Stenberg
4e2b52b5f7
curl_path: create the new path with dynbuf
Closes #10729
2023-03-10 23:20:19 +01:00
Daniel Stenberg
f384d40718
url: remove dummy protocol handler
Just two added checks were needed saves a whole handler struct.

Closes #10727
2023-03-10 23:19:20 +01:00
Daniel Stenberg
af369db4d3
url: fix the SSH connection reuse check
Reported-by: Harry Sintonen
Closes #10735
2023-03-10 17:54:32 +01:00
Daniel Stenberg
538b1e79a6
telnet: only accept option arguments in ascii
To avoid embedded telnet negotiation commands etc.

Reported-by: Harry Sintonen
Closes #10728
2023-03-10 17:43:18 +01:00
Jay Satiro
b559ef6f36 url: fix cookielist memleak when curl_easy_reset
- Free set.cookelist in Curl_freeset instead of Curl_close.

Prior to this change the cookielist linked list wasn't freed by
curl_easy_reset which calls Curl_freeset to free all set.

Bug: https://github.com/curl/curl/issues/10694#issuecomment-1458619157
Reported-by: Sergey Ryabinin

Closes https://github.com/curl/curl/pull/10709
2023-03-10 03:49:16 -05:00
Stefan Eissing
940b67803a
wolfSSL: ressurect the BIO io_result
In pytest'ing the situation occored that wolfSSL reported an
IO error when the underlying BIO operation was returning an
CURLE_AGAIN condition.

Readding the `io_result` filter context member to detect such
situations.

Also, making sure that the returned CURLcode is initialized
on all recv operations outcome.

Closes #10716
2023-03-10 08:06:17 +01:00
Stefan Eissing
adaec5d1d0
gssapi: align global gss_OID_desc vars to silence ld warnings on macOS ventura
Refs #9975 which first reported this.

Closes #10718
2023-03-10 08:04:42 +01:00
Daniel Stenberg
8b5f100db3
libssh2: only set the memory callbacks when debugging
This makes us debug libssh2 less and libcurl more when for example
running torture tests that otherwise will spend a lot of time in libssh2
functions.

We leave libssh2 to test libssh2.

Closes #10721
2023-03-10 08:01:47 +01:00
Daniel Stenberg
05616379ee
headers: make curl_easy_header and nextheader return different buffers
By letting curl_easy_header() and curl_easy_nextheader() store the
header data in their own struct storage when they return a pointer to
it, it makes it possible for applications to use them both in a loop.
Like the curl tool does.

Reported-by: Boris Okunskiy
Fixes #10704
Closes #10707
2023-03-09 00:13:41 +01:00
rcombs
b1d735956f
urlapi: take const args in _dup and _get functions
Closes #10708
2023-03-08 15:38:26 +01:00
rcombs
95cb7d3166
urlapi: avoid mutating internals in getter routine
This was not intended.

Closes #10708
2023-03-08 15:38:18 +01:00
Daniel Stenberg
0a0c9b6dfa
urlapi: '%' is illegal in host names
Update test 1560 to verify

Ref: #10708
Closes #10711
2023-03-08 15:33:43 +01:00
Daniel Stenberg
0546ed54c2
ftp: make the 'ftpauth' a more normal 'char *'-array
Closes #10703
2023-03-08 15:32:16 +01:00
Viktor Szakats
75087c3baa
misc: fix typos
Closes #10706
2023-03-08 08:00:35 +00:00
Stefan Eissing
a26418cf14
ftp: active mode with SSL, add the damn filter
- since 7.87.0 we lost adding the SSL filter for an active
  FTP connection that uses SSL. This leads to hangers and timeouts
  as reported in #10666.

Reported-by: SandakovMM on github
Fixes #10666
Closes #10669
2023-03-07 15:22:22 +01:00
Stefan Eissing
7c5637b8b4
url: fix logic in connection reuse to deny reuse on "unclean" connections
- add parameter to `conn_is_alive()` cfilter method that returns
  if there is input data waiting on the connection
- refrain from re-using connnection from the cache that have
  input pending
- adapt http/2 and http/3 alive checks to digest pending input
  to check the connection state
- remove check_cxn method from openssl as that was just doing
  what the socket filter now does.
- add tests for connection reuse with special server configs

Closes #10690
2023-03-07 12:50:31 +01:00
Daniel Stenberg
6466071e8e
x509asn1: use plain %x, not %lx, when the arg is an int
Pointed out by Coverity.

Closes #10689
2023-03-06 23:59:12 +01:00
Stefan Eissing
48cd032623
http2: fix handling of RST and GOAWAY to recognize partial transfers
- a reset transfer (HTTP/2 RST) did not always lead to the proper
  error message on receiving its response, leading to wrong reports
  of a successful transfer
- test_05_02 was able to trigger this condition with increased transfer
  count. The simulated response errors did not carry a 'Content-Length'
  so only proper RST handling could detect the abort
- When doing such transfers in parallel, a connection could enter the
  state where
  a) it had been closed (GOAWAY received)
  b) the RST had not been "seen" for the transfer yet
  or c) the GOAWAY announced an error and the last successful
  stream id was not checked against ongoing transfers

Closes #10693
2023-03-06 23:58:24 +01:00
Stefan Eissing
257416023d
connect: fix time_connect and time_appconnect timer statistics
- time_connect was not updated when the overall connection failed,
  e.g. when SSL verification was unsuccessful, refs #10670
- rework gather those values to interrogate involved filters,
  also from all eyeballing attempts, to report the maximum of
  those values.
- added 3 test cases in test_06 to check reported values on
  successful, partially failed and totally failed connections.

Reported-by: Master Inspire
Fixes #10670
Closes #10671
2023-03-06 20:16:43 +01:00
Daniel Stenberg
45d4bf5af3
cookie: don't load cookies again when flushing
Reported-by: Sergio Mijatovic
Fixes #10677
Closes #10685
2023-03-06 15:51:56 +01:00
Harry Sintonen
755ddbe901
rand: use arc4random as fallback when available
Normally curl uses cryptographically strong random provided by the
selected SSL backend. If compiled without SSL support, a naive built-in
function was used instead.

Generally this was okay, but it will result in some downsides for non-
SSL builds, such as predictable temporary file names.

This change ensures that arc4random will be used instead, if available.

Closes #10672
2023-03-06 11:21:38 +01:00
Viktor Szakats
8cfc936f5c
cmake: fix enabling LDAPS on Windows
Before this patch, enabling LDAPS required a manual C flag:
c1cfc31cfc/curl-cmake.sh (L105)

Fix this and enable LDAPS automatically when using `wldap32` (and
when not explicitly disabled). This matches autotools and `Makefile.mk`
behavior. Also remove issue from KNOWN_BUGS.

Add workaround for MSVS 2010 warning triggered by LDAPS now enabled
in more CI tests:
`ldap.c(360): warning C4306: 'type cast' : conversion from 'int' to 'void *' of greater size`
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/46408284/job/v8mwl9yfbmoeqwlr#L312

Reported-by: JackBoosY on github
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Fixes #6284
Closes #10674
2023-03-05 19:55:14 +00:00
Viktor Szakats
8d0fa3a70d
Makefile.mk: delete redundant HAVE_LDAP_SSL macro [ci skip]
Since abebb2b893, we set this macro for
all Windows `wldap32` builds using `Makefile.mk`.

For OpenLDAP builds this macro is not enough to enable LDAPS, and
OpenLDAP is not an option in `Makefile.mk`. For Novell LDAP it might
have helped, but it's also not an option anymore in `Makefile.mk`.

The future for LDAPS is that we should enable it by default without
extra build knobs.

Reviewed-by: Marcel Raad
Closes #10681
2023-03-05 19:52:21 +00:00
Daniel Stenberg
e135bc9d31
schannel: loop over the algos to pick the selected one
Avoid using the funny macro and the extra buffer copy.

Closes #10647
2023-03-03 23:26:41 +01:00
Daniel Stenberg
56d5c07bbb
wildcard: remove files and move functions into ftplistparser.c 2023-03-03 23:25:30 +01:00
Daniel Stenberg
9c188e771c
ftp: allocate the wildcard struct on demand
The feature is rarely used so this frees up data for the vast majority
of easy handles that don't use it.

Rename "protdata" to "ftpwc" since it is always an FTP wildcard struct
pointer. Made the state struct field an unsigned char to save space.

Closes #10639
2023-03-03 23:25:23 +01:00
Brad Spencer
ad4997e5b2
urlapi: parse IPv6 literals without ENABLE_IPV6
This makes the URL parser API stable and working the same way
independently of libcurl supporting IPv6 transfers or not.

Closes #10660
2023-03-03 10:05:08 +01:00
Stefan Eissing
9fd2d5aa72
socket: detect "dead" connections better, e.g. not fit for reuse
- refs #10646 where reuse was attempted on closed connections in the
  cache, leading to an exhaustion of retries on a transfer
- the mistake was that poll events like POLLHUP, POLLERR, etc
  were regarded as "not dead".
- change cf-socket filter check to regard such events as inidication
  of corpsiness.
- vtls filter checks: fixed interpretation of backend check result
  when inconclusive to interrogate status further down the filter
  chain.

Reported-by: SendSonS on github
Fixes #10646
Closes #10652
2023-03-02 09:03:06 +01:00
Stefan Eissing
9deebd311b
lib: give source files cf-http.* better fitting names
Closes #10656
2023-03-02 08:48:34 +01:00