From 033b2dbeb30f2d652f5683483d7d15b6c8ba413d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 4 Mar 2010 17:54:21 +0100 Subject: [PATCH] [BUG] logs: don't report "last data" when we have just closed after an error 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session.c b/src/session.c index 91edd736e..b60214745 100644 --- a/src/session.c +++ b/src/session.c @@ -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;