]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stream: remove unneeded test on appctx during initialization
authorWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 14:49:18 +0000 (16:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
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

index 9f04e9601628fcc9385de648c6fdc670d9348155..e20ac9867d0279e5182ccc800ae1930dcd4c7713 100644 (file)
@@ -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;