From 2437377445967b594c72cddf7fc36b80e0b1acb8 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 23 May 2023 15:13:40 +0200 Subject: [PATCH] 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. --- src/applet.c | 2 -- src/stconn.c | 1 - 2 files changed, 3 deletions(-) diff --git a/src/applet.c b/src/applet.c index 91f9cca5f..00afaca5d 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 3d80b2c19..8bffba73d 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; }