From: Christopher Faulet Date: Tue, 23 May 2023 13:13:40 +0000 (+0200) Subject: MEDIUM: stconn/applet: Allow SF_SL_EOS flag alone X-Git-Tag: v2.8-dev13~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2437377445967b594c72cddf7fc36b80e0b1acb8;p=thirdparty%2Fhaproxy.git MEDIUM: stconn/applet: Allow SF_SL_EOS flag alone During the refactoring on SC/SE flags, it was stated that SE_FL_EOS flag should not be set without on of SE_FL_EOI or SE_FL_ERROR flags. In fact, it is a problem for the QUIC/H3 multiplexer. When a RST_STREAM frame is received, it means no more data will be received from the peer. And this happens before the end of the message (RST_STREAM frame received after the end of the message are ignored). At this stage, it is a problem to report an error because from the QUIC point of view, it is valid. Data may still be sent to the peer. If an error is reported, this will stop the data sending too. In the same idea, the H1 mulitplexer reports an error when the message is truncated because of a read0. But only an EOS flag should be reported in this case, not an error. Fundamentally, it is important to distinguish errors from shuts for reads because some cases are valid. For instance a H1 client can choose to stop uploading data if it received the server response. So, relax tests on SE flags by removing BUG_ON_HOT() on SE_FL_EOS flag. For now, the abort will be handled in the HTTP analyzers. --- diff --git a/src/applet.c b/src/applet.c index 91f9cca5f4..00afaca5da 100644 --- a/src/applet.c +++ b/src/applet.c @@ -481,8 +481,6 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state) stream_dump_and_crash(&app->obj_type, read_freq_ctr(&app->call_rate)); } - BUG_ON_HOT((sc_ep_get(sc) & (SE_FL_EOI|SE_FL_EOS|SE_FL_ERROR)) == SE_FL_EOS); - sc->app_ops->wake(sc); channel_release_buffer(sc_ic(sc), &app->buffer_wait); TRACE_LEAVE(APPLET_EV_PROCESS, app); diff --git a/src/stconn.c b/src/stconn.c index 3d80b2c190..8bffba73df 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1514,7 +1514,6 @@ static int sc_conn_recv(struct stconn *sc) ret = 1; } - BUG_ON_HOT((sc_ep_get(sc) & (SE_FL_EOI|SE_FL_EOS|SE_FL_ERROR)) == SE_FL_EOS); return ret; }