From: Willy Tarreau Date: Fri, 27 May 2022 14:49:18 +0000 (+0200) Subject: CLEANUP: stream: remove unneeded test on appctx during initialization X-Git-Tag: v2.6-dev12~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=369d5aa208bab943150dbc8951fee4537d190075;p=thirdparty%2Fhaproxy.git 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. --- 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;