From fec4d89b24ffc5f2599fe8595c6fd8b967b7a667 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 2 Sep 2011 20:04:57 +0200 Subject: [PATCH] [MINOR] http: take a capture of too large requests and responses It's hard to prove a request or response is too large if there is no capture, so let's take a snapshot of those too. --- src/proto_http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/proto_http.c b/src/proto_http.c index a56be3885..7f37002cd 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -2490,6 +2490,8 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit) session_inc_http_req_ctr(s); session_inc_http_err_ctr(s); proxy_inc_fe_req_ctr(s->fe); + if (msg->err_pos < 0) + msg->err_pos = req->l; goto return_bad_req; } @@ -4758,6 +4760,8 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit) /* too large response does not fit in buffer. */ else if (rep->flags & BF_FULL) { + if (msg->err_pos < 0) + msg->err_pos = rep->l; goto hdr_response_bad; }