From ec4207cb68b1d7d50e06d35aaa73586e2c7d46b0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 8 Apr 2021 18:34:30 +0200 Subject: [PATCH] MEDIUM: mux-h1: Don't block reads when waiting for the other side When we are waiting for the other side to read more data, or to read the next request, we must only stop the processing of input data and not the data receipt. This patch don't change anything on the subscribes for reads. So it should not change anything. The only difference is that the H1 connection will try to read data if it is woken up for an I/O event and if it was subscribed for reads. This patch is required to fix abortonclose option for H1 client connections. --- src/mux_h1.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index 62bd4771d..b16f52a7a 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -393,11 +393,6 @@ static inline int h1_recv_allowed(const struct h1c *h1c) return 0; } - if (h1c->flags & H1C_F_WAIT_OUTPUT) { - TRACE_DEVEL("recv not allowed (wait_output)", H1_EV_H1C_RECV|H1_EV_H1C_BLK, h1c->conn); - return 0; - } - if (!(h1c->flags & (H1C_F_IN_ALLOC|H1C_F_IN_FULL|H1C_F_IN_SALLOC))) return 1; @@ -1538,7 +1533,7 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, size_t count goto end; if (h1c->flags & H1C_F_WAIT_OUTPUT) - goto end; + goto out; do { size_t used = htx_used_space(htx); @@ -1698,6 +1693,7 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, size_t count ((h1m->state == H1_MSG_DONE) && (h1s->meth != HTTP_METH_CONNECT) && !(h1m->flags & H1_MF_CONN_UPG))) h1s->cs->flags |= CS_FL_EOI; + out: if (h1s_data_pending(h1s) && !htx_is_empty(htx)) h1s->cs->flags |= CS_FL_RCV_MORE | CS_FL_WANT_ROOM; else {