From 369d5aa208bab943150dbc8951fee4537d190075 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 27 May 2022 16:49:18 +0200 Subject: [PATCH] CLEANUP: stream: remove unneeded test on appctx during initialization Now that the data consumption from the endpoint is the default setting, we can generalize the pre-clearing of the wont_consume flag, which is no more specific to applets. In practice it's not needed anymore to do it, but since streams might be initiatied from asynchronous applets, these might have blocked their consumption side before creating the stream thus it's safer to preserve the clearing of the flag. --- src/stream.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stream.c b/src/stream.c index 9f04e96016..e20ac9867d 100644 --- a/src/stream.c +++ b/src/stream.c @@ -535,9 +535,8 @@ struct stream *stream_new(struct session *sess, struct stconn *sc, struct buffer if (flt_stream_init(s) < 0 || flt_stream_start(s) < 0) goto out_fail_accept; - /* finish initialization of the accepted file descriptor */ - if (sc_appctx(sc)) - se_will_consume(s->scf->sedesc); + /* just in case the caller would have pre-disabled it */ + se_will_consume(s->scf->sedesc); if (sess->fe->accept && sess->fe->accept(s) < 0) goto out_fail_accept;