From 3b8c08a174dfffd12c5cb178067e35a356b6f2cb Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 2 Sep 2011 20:16:24 +0200 Subject: [PATCH] [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. --- src/proto_http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto_http.c b/src/proto_http.c index 7f37002cd..439e1cee0 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++;