From 1baef1523d1be1b6edf76c78688af932d4d36d8a Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 8 Apr 2021 18:42:59 +0200 Subject: [PATCH] BUG/MEDIUM: mux-h1: Properly report client close if abortonclose option is set On client side, if CO_RFL_KEEP_RECV flags is set when h1_rcv_buf() is called, we force subscription for reads to be able to catch read0. This way, the event will be reported to upper layer to let the stream abort the request. This patch fixes the abortonclose option for H1 connections. It depends on following patches : * MEDIUM: mux-h1: Don't block reads when waiting for the other side * MINOR: conn-stream: Force mux to wait for read events if abortonclose is set But to be sure the event is handled by the stream, the following patches are also required : * BUG/MINOR: stream-int: Don't block reads in si_update_rx() if chn may receive * MINOR: channel: Rely on HTX version if appropriate in channel_may_recv() All the series must be backported with caution as far as 2.0, and only after a period of observation to be sure nothing broke. --- src/mux_h1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index b16f52a7a..89817df62 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -3356,7 +3356,7 @@ static size_t h1_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun } } else { - if (h1m->state != H1_MSG_DONE && !(h1c->wait_event.events & SUB_RETRY_RECV)) + if (((flags & CO_RFL_KEEP_RECV) || (h1m->state != H1_MSG_DONE)) && !(h1c->wait_event.events & SUB_RETRY_RECV)) h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event); } -- 2.47.3