]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] http: take a capture of too large requests and responses
authorWilly Tarreau <w@1wt.eu>
Fri, 2 Sep 2011 18:04:57 +0000 (20:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 4 Sep 2011 22:54:56 +0000 (00:54 +0200)
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

index a56be3885e325f244450a48a653d8850672713e4..7f37002cd22e08be71d7fb3c8d0c6732c11899f1 100644 (file)
@@ -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;
                }