Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a bitset
dirty
to the multi handle. The presence of a transfer in the "dirty" set means: this transfer has something to do ASAP."dirty" is set by multiplexing protocols like HTTP/2 and 3 when encountering response data for another transfer than the current one. "dirty" is set by protocols that want to be called.
Implementation:
uint_bset
in the multi handleCurl_multi_mark_dirty()
to add a transfer to the dirty set.multi_runsingle()
clears the dirty bit of the transfer at start. Without new dirty marks, this empties the set after all dirty transfers have been run.multi_timeout()
immediately gives the current time and timeout_ms == 0 when dirty transfers are present.all dirty transfers.
With this mechanism:
EXPIRE_RUN_NOW
are replaced byCurl_multi_mark_dirty()
Curl_multi_mark_dirty()
is cheaper than querying if a transfer is already dirty or set for timeout. There is no need to check, just do it.data->state.select_bits
is eliminated. We need no longer to simulate a poll event to make a transfer run.based on #17650