From: Willy Tarreau Date: Sat, 17 Nov 2018 18:14:35 +0000 (+0100) Subject: BUG/MINOR: stream-int: set SI_FL_WANT_PUT in sess_establish() X-Git-Tag: v1.9-dev7~111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00b3b8c361d68eedc33036ec01c30fd12d46f536;p=thirdparty%2Fhaproxy.git BUG/MINOR: stream-int: set SI_FL_WANT_PUT in sess_establish() In commit f26c26c ("BUG/MEDIUM: stream-int: change the way buffer room is requested by a stream-int") we used to call si_want_put() at the end of sess_update_st_con_tcp(), when switching to SI_ST_EST state. But this is incorrect as there are a few other situations where we can switch to this state, such as in si_connect() where a connection reuse is detected, or when directly calling an applet (in which case that was already covered anyway). For now it doesn't have any side effect but it could impact connection reuse after the stream-int changes by stalling an immediately reused connection. Let's move this flag change to sess_establish() instead, which is the only place which is always called exactly once on connection setup. No backport is needed, this is purely 1.9. --- diff --git a/src/stream.c b/src/stream.c index fe07d4de52..6e73f8c710 100644 --- a/src/stream.c +++ b/src/stream.c @@ -673,7 +673,6 @@ static int sess_update_st_con_tcp(struct stream *s) /* OK, this means that a connection succeeded. The caller will be * responsible for handling the transition from CON to EST. */ - si_want_put(si); si->state = SI_ST_EST; si->err_type = SI_ET_NONE; return 1; @@ -853,6 +852,7 @@ static void sess_establish(struct stream *s) rep->analysers |= AN_RES_FLT_HTTP_HDRS; } + si_want_put(si); rep->flags |= CF_READ_ATTACHED; /* producer is now attached */ if (req->flags & CF_WAKE_CONNECT) { req->flags |= CF_WAKE_ONCE;