xfer: manage pause bits

Concentrate the handling of KEEP_RECV_PAUSE and KEEP_SEND_PAUSE into
common transfer functions. Setting or clearing these bits requires
subsequent actions involving connection events and client reader/writer
notifications. Have it in one place.

Closes #17650
This commit is contained in:
Stefan Eissing 2025-06-17 13:13:26 +02:00 committed by Daniel Stenberg
parent e60103cbb8
commit 0d70dfb79b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 114 additions and 76 deletions

View file

@ -137,11 +137,18 @@ CURLcode Curl_xfer_recv(struct Curl_easy *data,
CURLcode Curl_xfer_send_close(struct Curl_easy *data);
CURLcode Curl_xfer_send_shutdown(struct Curl_easy *data, bool *done);
/**
* Return TRUE iff the transfer is not done, but further progress
/* Return TRUE if the transfer is not done, but further progress
* is blocked. For example when it is only receiving and its writer
* is PAUSED.
*/
* is PAUSED. */
bool Curl_xfer_is_blocked(struct Curl_easy *data);
/* Query if send/recv for transfer is paused. */
bool Curl_xfer_send_is_paused(struct Curl_easy *data);
bool Curl_xfer_recv_is_paused(struct Curl_easy *data);
/* Enable/Disable pausing of send/recv for the transfer. */
CURLcode Curl_xfer_pause_send(struct Curl_easy *data, bool enable);
CURLcode Curl_xfer_pause_recv(struct Curl_easy *data, bool enable);
#endif /* HEADER_CURL_TRANSFER_H */