]> git.ipfire.org Git - thirdparty/curl.git/commit
h2/h3: replace `state.drain` counter with `state.dselect_bits`
authorStefan Eissing <stefan@eissing.org>
Fri, 21 Apr 2023 10:04:46 +0000 (12:04 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 Apr 2023 15:49:28 +0000 (17:49 +0200)
commitcab2d56ea52b3724495b3dbc5bfef3343d4ecadc
tree7aea2eecec9df647106ddb351b6e62d8d6c907f0
parenta97e4eb95f86adb6043a3388250f34841440981e
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
lib/http2.c
lib/transfer.c
lib/urldata.h
lib/vquic/curl_msh3.c
lib/vquic/curl_ngtcp2.c
lib/vquic/curl_quiche.c
lib/vquic/vquic.c
tests/http/test_05_errors.py