[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.
This commit is contained in:
Willy Tarreau 2011-09-02 20:16:24 +02:00
parent fec4d89b24
commit 3b8c08a174

View File

@ -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++;