]> git.ipfire.org Git - thirdparty/curl.git/commit
lib: move 'done' parameter to SingleRequests
authorStefan Eissing <stefan@eissing.org>
Mon, 11 Mar 2024 11:35:07 +0000 (12:35 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 11 Mar 2024 22:27:02 +0000 (23:27 +0100)
commit4e4e8af1f6b45b365c2f9778371578c93cf3b244
tree6cb293793d5f3371439a2a02ef6a520d080d3aab
parent6aeb729b5c0d2a4162aca0b58660edf9ef36f8f6
lib: move 'done' parameter to SingleRequests

A transfer may do several `SingleRequest`s for its success. This happens
regularly for authentication, follows and retries on failed connections.
The "readwrite()" calls and functions connected to those carried a `bool
*done` parameter to indicate that the current `SingleRequest` is over.
This may happen before `upload_done` or `download_done` bits of
`SingleRequest` are set.

The problem with that is now `write_resp()` protocol handlers are
invoked in places where the `bool *done` cannot be passed up to the
caller. Instead of being a bool in the call chain, it needs to become a
member of `SingleRequest`, reflecting its state.

This removes the `bool *done` parameter and adds the `done` bit to
`SingleRequest` instead. It adds `Curl_req_soft_reset()` for using a
`SingleRequest` in a follow up, clearing `done` and other
flags/counters.

Closes #13096
16 files changed:
lib/c-hyper.c
lib/c-hyper.h
lib/cf-h1-proxy.c
lib/easy.c
lib/http.c
lib/http.h
lib/http2.c
lib/multi.c
lib/request.c
lib/request.h
lib/rtsp.c
lib/transfer.c
lib/transfer.h
lib/url.c
lib/urldata.h
lib/vquic/curl_ngtcp2.c