From: Willy Tarreau Date: Fri, 2 Sep 2011 18:16:24 +0000 (+0200) Subject: [MINOR] http: take a capture of truncated responses X-Git-Tag: v1.5-dev8~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b8c08a174dfffd12c5cb178067e35a356b6f2cb;p=thirdparty%2Fhaproxy.git [MINOR] http: take a capture of truncated responses If a server starts to respond but stops before the body, then we capture the truncated response. We don't do this on the request because it would happen too often upon stupid attacks. --- diff --git a/src/proto_http.c b/src/proto_http.c index 7f37002cd2..439e1cee09 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -4815,9 +4815,9 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit) return 0; } - /* close from server */ + /* close from server, capture the response if the server has started to respond */ else if (rep->flags & BF_SHUTR) { - if (msg->err_pos >= 0) + if (msg->msg_state >= HTTP_MSG_RPVER || msg->err_pos >= 0) http_capture_bad_message(&s->be->invalid_rep, s, rep, msg, msg->msg_state, s->fe); s->be->be_counters.failed_resp++;