]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stconn/applet: Allow SF_SL_EOS flag alone
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 23 May 2023 13:13:40 +0000 (15:13 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 23 May 2023 13:52:35 +0000 (15:52 +0200)
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
src/stconn.c

index 91f9cca5f49cc26be5cdcdbb03de709e6072c07a..00afaca5dacb0e1e6147a66899ef19bb8eb73282 100644 (file)
@@ -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);
index 3d80b2c1909aa8a3cf9569207d5bbdf9ce324102..8bffba73df0ab4aaa0d5552bbbb728c71cc2a520 100644 (file)
@@ -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;
 }