From 8139b9959f31a4822f9c55fc8622481525725894 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 27 Nov 2012 07:35:31 +0100 Subject: [PATCH] MINOR: compression: make the stats a bit more robust To ensure that we only count when a response was compressed, we also check for the SN_COMP_READY flag which indicates that the compression was effectively initialized. Comp_algo alone is meaningless. --- src/proto_http.c | 4 ++-- src/session.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/proto_http.c b/src/proto_http.c index 3184e24fd..c01dfd288 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -4040,14 +4040,14 @@ void http_end_txn_clean_session(struct session *s) if (s->fe->mode == PR_MODE_HTTP) { s->fe->fe_counters.p.http.rsp[n]++; - if (s->comp_algo) + if (s->comp_algo && (s->flags & SN_COMP_READY)) s->fe->fe_counters.p.http.comp_rsp++; } if ((s->flags & SN_BE_ASSIGNED) && (s->be->mode == PR_MODE_HTTP)) { s->be->be_counters.p.http.rsp[n]++; s->be->be_counters.p.http.cum_req++; - if (s->comp_algo) + if (s->comp_algo && (s->flags & SN_COMP_READY)) s->be->be_counters.p.http.comp_rsp++; } } diff --git a/src/session.c b/src/session.c index 9aac91d40..330d7228f 100644 --- a/src/session.c +++ b/src/session.c @@ -2435,14 +2435,14 @@ struct task *process_session(struct task *t) if (s->fe->mode == PR_MODE_HTTP) { s->fe->fe_counters.p.http.rsp[n]++; - if (s->comp_algo) + if (s->comp_algo && (s->flags & SN_COMP_READY)) s->fe->fe_counters.p.http.comp_rsp++; } if ((s->flags & SN_BE_ASSIGNED) && (s->be->mode == PR_MODE_HTTP)) { s->be->be_counters.p.http.rsp[n]++; s->be->be_counters.p.http.cum_req++; - if (s->comp_algo) + if (s->comp_algo && (s->flags & SN_COMP_READY)) s->be->be_counters.p.http.comp_rsp++; } }