History log of /curl/lib/multi.c (Results 1 – 25 of 811)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 9b863ac6 30-Oct-2024 Stefan Eissing

vquic: recv_mmsg, use fewer, but larger buffers

Reported-by: koujaz on github
Fixes #15267
Closes #15454


# a273cc25 29-Oct-2024 Daniel Stenberg

multi: fix "Useless Assignment"

CodeSonar pointed out "This code assigns the variable the same value it
already had"

Follow-up to e77326403d3d27e7e

Closes #15441


# cd2b4520 28-Oct-2024 Daniel Stenberg

src/lib: remove redundant ternary operators

Closes #15435


# e7732640 26-Oct-2024 Daniel Stenberg

multi: split multi_runsingle into sub functions

Introduce five functions named after the state they serve:

- state_connect for MSTATE_CONNECT
- state_do for MSTATE_DO
- stat

multi: split multi_runsingle into sub functions

Introduce five functions named after the state they serve:

- state_connect for MSTATE_CONNECT
- state_do for MSTATE_DO
- state_performing for MSTATE_PERFORMING
- state_ratelimiting for MSTATE_RATELIMITING
- state_resolving for MSTATE_RESOLVING

Closes #15418

show more ...


# 522c89a1 26-Oct-2024 Daniel Stenberg

lib: remove Curl_ prefix from static functions

'Curl_' is a prefix used for library global functions (cross-files).
Static functions should thus not use it.

Closes #15419


# eed3c8f4 14-Oct-2024 Daniel Stenberg

curl.h: remove the struct pointer for CURL/CURLSH/CURLM typedefs

It makes the callbacks get different signnatures when used from within
libcurl vs outside of it by libcurl-using applicat

curl.h: remove the struct pointer for CURL/CURLSH/CURLM typedefs

It makes the callbacks get different signnatures when used from within
libcurl vs outside of it by libcurl-using applications (such as the
libtests) and this triggers UndefinedBehaviorSanitizer errors.

Closes #15289

show more ...


# 3b43a05e 10-Oct-2024 Daniel Stenberg

netrc: cache the netrc file in memory

So that on redirects etc it does not reread the file but just parses it
again.

Reported-by: Pierre-Etienne Meunier
Fixes #15248
Clo

netrc: cache the netrc file in memory

So that on redirects etc it does not reread the file but just parses it
again.

Reported-by: Pierre-Etienne Meunier
Fixes #15248
Closes #15259

show more ...


# d0377f5a 11-Oct-2024 Daniel Stenberg

multi: convert Curl_follow to static multi_follow

Moved over from transfer.c because it is only used in multi.c

Closes #15260


# 461ce6c6 08-Oct-2024 Emanuel Komínek

multi: make curl_multi_cleanup invalidate magic latter

When a multi handle is being cleaned up, it can still cause user
callbacks to be fired. Notably Curl_cpool_destroy calls socket_cal

multi: make curl_multi_cleanup invalidate magic latter

When a multi handle is being cleaned up, it can still cause user
callbacks to be fired. Notably Curl_cpool_destroy calls socket_callback
on all pooled connections. It's still possible for the callback to call
curl_multi_assign leading to an assert.

This commit moves clearing of a multi handle magic to a point where the
multi handle stops being a valid object.

Fixes #15201
Closes #15206

show more ...


# bcec0840 02-Oct-2024 Daniel Stenberg

lib: use bool/TRUE/FALSE properly

booleans should use the type 'bool' and set the value to TRUE/FALSE

non-booleans should not be 'bool' and should not set the value to
TRUE/FALS

lib: use bool/TRUE/FALSE properly

booleans should use the type 'bool' and set the value to TRUE/FALSE

non-booleans should not be 'bool' and should not set the value to
TRUE/FALSE

Closes #15123

show more ...


# 23386872 02-Oct-2024 Daniel Stenberg

multi: make multi_handle_timeout use the connect timeout

For all states before MSTATE_DO the connect timeout needs to be
considered.

Regression since #13371 (be659030ba078d6) sh

multi: make multi_handle_timeout use the connect timeout

For all states before MSTATE_DO the connect timeout needs to be
considered.

Regression since #13371 (be659030ba078d6) shipped in 8.8.0

Reported-by: Deniz Sökmen
Fixes #15100
Closes #15119

show more ...


# aca28aba 27-Sep-2024 Daniel Stenberg

lib: fix disabled-verbose-strings + enable-debug build warnings


# d08d16ca 26-Sep-2024 Daniel Stenberg

multi: avoid reading whole struct pointer from pointer

The proper alignment is not guaranteed. This function now instead uses
only the first and last byte of the key since they are the o

multi: avoid reading whole struct pointer from pointer

The proper alignment is not guaranteed. This function now instead uses
only the first and last byte of the key since they are the ones likely
to change most (one of them, depending on CPU endian) and the hash is
tiny anyway.

Closes #15063

show more ...


# 98c7d4b1 24-Sep-2024 Stefan Eissing

multi.c: warn/assert on stall only without timer

Warn/assert about a possibly stalling transfer only when it
has no timeout set.

The assertion triggered in test 1540 on loaded C

multi.c: warn/assert on stall only without timer

Warn/assert about a possibly stalling transfer only when it
has no timeout set.

The assertion triggered in test 1540 on loaded CI sometimes.

Closes #15028

show more ...


# b20ac93f 20-Sep-2024 Stefan Eissing

multi.c: make stronger check for paused transfer before asserting

With higher parallelism in CI, the ASSERT triggered on pause tests.
Strengthen the check. We might want to think about r

multi.c: make stronger check for paused transfer before asserting

With higher parallelism in CI, the ASSERT triggered on pause tests.
Strengthen the check. We might want to think about removing
KEEP_RECV_PAUSE|KEEP_SEND_PAUSE altogether.

Closes #14981

show more ...


# fbf5d507 18-Sep-2024 Daniel Stenberg

lib/src: white space edits to comply better with code style

... as checksrc now finds and complains about these.

Closes #14921


# 5a263710 14-Sep-2024 Gabriel Marin

lib, src, tests: added space around ternary expressions

Closes #14912


# 48f61e78 11-Sep-2024 Daniel Stenberg

multi: check that the multi handle is valid in curl_multi_assign

By requiring that the multi handle is fine, it can detect bad usage
better and by that avoid crashes. Like in the #14860

multi: check that the multi handle is valid in curl_multi_assign

By requiring that the multi handle is fine, it can detect bad usage
better and by that avoid crashes. Like in the #14860 case, which is an
application calling curl_multi_assign() with a NULL pointer multi
handle.

Reported-by: Carlo Cabrera
Fixes #14860
Closes #14862

show more ...


# 4ff04615 02-Sep-2024 Daniel Stenberg

lib: use FMT_ as prefix instead of CURL_FORMAT_

For printf format defines used internally. Makes the code slighly
easier to read.

Closes #14764


# 9280bbea 28-Aug-2024 Stefan Eissing

urldata: remove proxy_connect_closed bit

The connections 'proxy_connect_closed' bit was not used any more. Remove
it.

Closes #14708


# 1be704e1 23-Aug-2024 Stefan Eissing

cpool: rename "connection cache/conncache" to "Connection Pools/cpool"

This is a better match for what they do and the general "cpool"
var/function prefix works well.

The pool n

cpool: rename "connection cache/conncache" to "Connection Pools/cpool"

This is a better match for what they do and the general "cpool"
var/function prefix works well.

The pool now handles very long hostnames correctly.

The following changes have been made:

* 'struct connectdata', e.g. connections, keep new members
named `destination` and ' destination_len' that fully specifies
interface+port+hostname of where the connection is going to.
This is used in the pool for "bundling" of connections with
the same destination. There is no limit on the length any more.
* Locking: all locks are done inside conncache.c when calling
into the pool and released on return. This eliminates hazards
of the callers keeping track.
* 'struct connectbundle' is now internal to the pool. It is no
longer referenced by a connection.
* 'bundle->multiuse' no longer exists. HTTP/2 and 3 and TLS filters
no longer need to set it. Instead, the multi checks on leaving
MSTATE_CONNECT or MSTATE_CONNECTING if the connection is now
multiplexed and new, e.g. not conn->bits.reuse. In that case
the processing of pending handles is triggered.
* The pool's init is provided with a callback to invoke on all
connections being discarded. This allows the cleanups in
`Curl_disconnect` to run, wherever it is decided to retire
a connection.
* Several pool operations can now be fully done with one call.
Pruning dead connections, upkeep and checks on pool limits
can now directly discard connections and need no longer return
those to the caller for doing that (as we have now the callback
described above).
* Finding a connection for reuse is now done via `Curl_cpool_find()`
and the caller provides callbacks to evaluate the connection
candidates.
* The 'Curl_cpool_check_limits()' now directly uses the max values
that may be set in the transfer's multi. No need to pass them
around. Curl_multi_max_host_connections() and
Curl_multi_max_total_connections() are gone.
* Add method 'Curl_node_llist()' to get the llist a node is in.
Used in cpool to verify connection are indeed in the list (or
not in any list) as they need to.

I left the conncache.[ch] as is for now and also did not touch the
documentation. If we update that outside the feature window, we can
do this in a separate PR.

Multi-thread safety is not achieved by this PR, but since more details
on how pools operate are now "internal" it is a better starting
point to go for this in the future.

Closes #14662

show more ...


# a58b50fc 15-Aug-2024 Stefan Eissing

transfer: Curl_sendrecv() and event related improvements

- Renames Curl_readwrite() to Curl_sendrecv() to reflect that it
is mainly about talking to the server, not reads or writes to

transfer: Curl_sendrecv() and event related improvements

- Renames Curl_readwrite() to Curl_sendrecv() to reflect that it
is mainly about talking to the server, not reads or writes to the
client. Add a `nowp` parameter since the single caller already
has this.
- Curl_sendrecv() now runs all possible operations whenever it is
called and either it had been polling sockets or the 'select_bits'
are set.
POLL_IN/POLL_OUT are not always directly related to send/recv
operations. Filters like HTTP/2, QUIC or TLS may monitor reverse
directions. If a transfer does not want to send (KEEP_SEND), it
will not do so, as before. Same for receives.
- Curl_update_timer() now checks the absolute timestamp of an expiry
and the last/new timeout to determine if the application needs
to stop/start/restart its timer. This fixes edge cases where
updates did not happen as they should have.
- improved --test-event curl_easy_perform() simulation to handle
situations where no sockets are registered but a timeout is
in place.
- fixed bug in events_socket() that complained about removing
a socket that was unknown, when indeed it had removed the socket
just before, only it was the last in the list
- fixed conncache's internal handle to carry the multi instance
(where the cache has one) so that operations on the closure handle
trigger event callbacks correctly.
- fixed conncache to not POLL_REMOVE a socket twice when a conneciton
was closed.

Closes #14561

show more ...


# dcb51baf 15-Aug-2024 Daniel Stenberg

splay: use access functions, add asserts, use Curl_timediff

- add set/get functions for the custom data in a tree node

- use Curl_timediff for time comparisons instead of the custom

splay: use access functions, add asserts, use Curl_timediff

- add set/get functions for the custom data in a tree node

- use Curl_timediff for time comparisons instead of the custom macro, as they
do the exact same things.

- add asserts to catch mistakes better

- updated test 1309 accordingly

Closes #14562

show more ...


# 160f0233 15-Aug-2024 Daniel Stenberg

multi: on socket callback error, remove socket hash entry nonetheless

Previously an error from the callback accidentally made libcurl keep the
hash entry which would lead to the entry re

multi: on socket callback error, remove socket hash entry nonetheless

Previously an error from the callback accidentally made libcurl keep the
hash entry which would lead to the entry remaining and then potentially
getting removed *again* which would lead to internal confusions.

This is an old issue (introduced in 2b3dd01b779e4eff6), caught by the new
asserts from c0233a35da81.

Closes #14557

show more ...


# c0233a35 12-Aug-2024 Daniel Stenberg

hash: provide asserts to verify API use

- converted the Curl_hash_count() macro to a function

- Discourage accessing struct fields directly

- Document the internal API in H

hash: provide asserts to verify API use

- converted the Curl_hash_count() macro to a function

- Discourage accessing struct fields directly

- Document the internal API in HASH.md

Closes #14503

show more ...


12345678910>>...33