From: Willy Tarreau Date: Thu, 28 May 2015 23:09:15 +0000 (+0200) Subject: BUG/MEDIUM: http: fix body processing for the stats applet X-Git-Tag: v1.6-dev2~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8cdf52da05a37994596191a459e396c28c5a8e0;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: http: fix body processing for the stats applet Commit 9fbe18e ("MEDIUM: http: add a new option http-buffer-request") introduced a regression due to a misplaced check causing the admin mode of the HTTP stats not to work anymore. This patch tried to ensure that when we need a request body for the stats applet, and we have already waited for this body, we don't wait for it again, but the condition was applied too early causing a disabling of the entire processing the body, and based on the wrong HTTP state (MSG_BODY) resulting in the test never matching. Thanks to Chad Lavoie for reporting the problem. This bug is 1.6-only, no backport is needed. --- diff --git a/src/proto_http.c b/src/proto_http.c index 4d352f7638..def5670bb2 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3293,10 +3293,11 @@ int http_handle_stats(struct stream *s, struct channel *req) } /* Was the status page requested with a POST ? */ - if (unlikely(txn->meth == HTTP_METH_POST && txn->req.body_len > 0 && msg->msg_state < HTTP_MSG_BODY)) { + if (unlikely(txn->meth == HTTP_METH_POST && txn->req.body_len > 0)) { if (appctx->ctx.stats.flags & STAT_ADMIN) { /* we'll need the request body, possibly after sending 100-continue */ - req->analysers |= AN_REQ_HTTP_BODY; + if (msg->msg_state < HTTP_MSG_CHUNK_SIZE) + req->analysers |= AN_REQ_HTTP_BODY; appctx->st0 = STAT_HTTP_POST; } else {