MINOR: mux-h2: make streams know if they need to send more data
H2 streams do not even know if they are expected to send more data or
not, which is problematic when closing because we don't know if we're
closing too early or not. Let's start by adding a new stream flag
"H2_SF_MORE_HTX_DATA" to indicate this on the tx path.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index e45e8f9..611fc21 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -208,6 +208,7 @@
#define H2_SF_EXT_CONNECT_RCVD 0x00080000 // rfc 8441 an Extended CONNECT has been received and parsed
#define H2_SF_TUNNEL_ABRT 0x00100000 // A tunnel attempt was aborted
+#define H2_SF_MORE_HTX_DATA 0x00200000 // more data expected from HTX
/* H2 stream descriptor, describing the stream as it appears in the H2C, and as
* it is being processed in the internal HTTP representation (HTX).
@@ -6590,6 +6591,11 @@
if (!(h2s->flags & H2_SF_OUTGOING_DATA) && count)
h2s->flags |= H2_SF_OUTGOING_DATA;
+ if (htx->extra)
+ h2s->flags |= H2_SF_MORE_HTX_DATA;
+ else
+ h2s->flags &= ~H2_SF_MORE_HTX_DATA;
+
if (h2s->id == 0) {
int32_t id = h2c_get_next_sid(h2s->h2c);