multi: add xfer_buf to multi handle

- can be borrowed by transfer during recv-write operation
- needs to be released before borrowing again
- adjustis size to `data->set.buffer_size`
- used in transfer.c readwrite_data()

Closes #12805
This commit is contained in:
Stefan Eissing 2024-01-26 12:05:08 +01:00 committed by Daniel Stenberg
parent c54d0ff6b3
commit 476adfeac0
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 113 additions and 25 deletions

View file

@ -124,6 +124,10 @@ struct Curl_multi {
times of all currently set timers */
struct Curl_tree *timetree;
/* buffer used for transfer data, lazy initialized */
char *xfer_buf; /* the actual buffer */
size_t xfer_buf_len; /* the allocated length */
#if defined(USE_SSL)
struct multi_ssl_backend_data *ssl_backend_data;
#endif
@ -171,6 +175,7 @@ struct Curl_multi {
#endif
BIT(dead); /* a callback returned error, everything needs to crash and
burn */
BIT(xfer_buf_borrowed); /* xfer_buf is currently being borrowed */
#ifdef DEBUGBUILD
BIT(warned); /* true after user warned of DEBUGBUILD */
#endif