]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] logs: don't report "last data" when we have just closed after an error
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 16:54:21 +0000 (17:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 17:45:47 +0000 (18:45 +0100)
Some people have reported seeing "SL" flags in their logs quite often while
this should never happen. The reason was that then a server error is detected,
we close the connection to that server and when we decide what state we were
in, we see the connection is closed, and deduce it was the last data transfer,
which is wrong. We should report DATA if the previous state was an established
state, which this patch does.

Now logs correctly report "SD" and not "SL" when a server resets a connection
before the end of the transfer.

src/session.c

index 91edd736e5a842605a330c3f381595aa06ca333e..b6021474534f76f3d8e2b0589a5c0c715e14babe 100644 (file)
@@ -1642,7 +1642,7 @@ void sess_set_term_flags(struct session *s)
                        s->flags |= SN_FINST_Q;
                else if (s->si[1].state < SI_ST_EST)
                        s->flags |= SN_FINST_C;
-               else if (s->si[1].state == SI_ST_EST)
+               else if (s->si[1].state == SI_ST_EST || s->si[1].prev_state == SI_ST_EST)
                        s->flags |= SN_FINST_D;
                else
                        s->flags |= SN_FINST_L;