]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: fix request flags when keep-alive is enabled
authorCyril Bonté <cyril.bonte@free.fr>
Wed, 22 Oct 2014 20:30:13 +0000 (22:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Oct 2014 20:37:30 +0000 (22:37 +0200)
Colin Ingarfield reported some unexplainable flags in the logs.
For example, a "LR" termination state was set on a request which was forwarded
to a server, where "LR" means that the request should have been handled
internally by haproxy.

This case happens when at least client side keep-alive is enabled. Next
requests in the connection will inherit the flags from the previous request.

2 fields are impacted : "termination_state" and "Tt" in the timing events,
where a "+" can be added, when a previous request was redispatched.

This is not critical for the service itself but can confuse troubleshooting.

The fix must be backported to 1.5 and 1.4.

src/proto_http.c

index 6497dac501abffd13a60d011079814e966770b14..c793d99f407a3556a30f79a48469bb1b2ba93b83 100644 (file)
@@ -4926,6 +4926,7 @@ void http_end_txn_clean_session(struct session *s)
        s->rep->flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT|CF_WROTE_DATA);
        s->flags &= ~(SN_DIRECT|SN_ASSIGNED|SN_ADDR_SET|SN_BE_ASSIGNED|SN_FORCE_PRST|SN_IGNORE_PRST);
        s->flags &= ~(SN_CURR_SESS|SN_REDIRECTABLE|SN_SRV_REUSED);
+       s->flags &= ~(SN_ERR_MASK|SN_FINST_MASK|SN_REDISP);
 
        s->txn.meth = 0;
        http_reset_txn(s);