summaryrefslogtreecommitdiff
path: root/lib/urldata.h
diff options
context:
space:
mode:
authorStefan Eissing <stefan@eissing.org>2023-04-21 12:04:46 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-04-25 17:49:28 +0200
commitcab2d56ea52b3724495b3dbc5bfef3343d4ecadc (patch)
tree7aea2eecec9df647106ddb351b6e62d8d6c907f0 /lib/urldata.h
parenta97e4eb95f86adb6043a3388250f34841440981e (diff)
downloadcurl-cab2d56ea52b3724495b3dbc5bfef3343d4ecadc.tar.gz
h2/h3: replace `state.drain` counter with `state.dselect_bits`
- `drain` was used by http/2 and http/3 implementations to indicate that the transfer requires send/recv independant from its socket poll state. Intended as a counter, it was used as bool flag only. - a similar mechanism exists on `connectdata->cselect_bits` where specific protocols can indicate something similar, only for the whole connection. - `cselect_bits` are cleard in transfer.c on use and, importantly, also set when the transfer loop expended its `maxloops` tries. `drain` was not cleared by transfer and the http2/3 implementations had to take care of that. - `dselect_bits` is cleared *and* set by the transfer loop. http2/3 does no longer clear it, only set when new events happen. This change unifies the handling of socket poll overrides, extending `cselect_bits` by a easy handle specific value and a common treatment in transfers. Closes #11005
Diffstat (limited to 'lib/urldata.h')
-rw-r--r--lib/urldata.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/urldata.h b/lib/urldata.h
index a8580bdb6..777bc36f9 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1319,6 +1319,8 @@ struct UrlState {
char *scratch; /* huge buffer[set.buffer_size*2] for upload CRLF replacing */
long followlocation; /* redirect counter */
int requests; /* request counter: redirects + authentication retakes */
+ int dselect_bits; /* != 0 -> bitmask of socket events for this transfer
+ * overriding anything the socket may report */
#ifdef HAVE_SIGNAL
/* storage for the previous bag^H^H^HSIGPIPE signal handler :-) */
void (*prev_signal)(int sig);
@@ -1374,9 +1376,6 @@ struct UrlState {
curl_off_t infilesize; /* size of file to upload, -1 means unknown.
Copied from set.filesize at start of operation */
#if defined(USE_HTTP2) || defined(USE_HTTP3)
- size_t drain; /* Increased when this stream has data to read, even if its
- socket is not necessarily is readable. Decreased when
- checked. */
struct Curl_data_priority priority; /* shallow copy of data->set */
#endif