[BUG] http: ensure we abort data transfer on write error

When a write error is encountered during a data phase, we must
absolutely abort the pending data transfer, otherwise it will
never complete.
This commit is contained in:
Willy Tarreau 2010-01-02 23:58:04 +01:00
parent b608feb82a
commit 082b01c541

View File

@ -3244,6 +3244,11 @@ int http_request_forward_body(struct session *s, struct buffer *req, int an_bit)
struct http_txn *txn = &s->txn;
struct http_msg *msg = &s->txn.req;
if (req->flags & (BF_SHUTW|BF_WRITE_ERROR|BF_WRITE_TIMEOUT)) {
req->analysers &= ~an_bit;
return 1;
}
if (unlikely(msg->msg_state < HTTP_MSG_BODY))
return 0;
@ -4347,6 +4352,11 @@ int http_response_forward_body(struct session *s, struct buffer *res, int an_bit
struct http_txn *txn = &s->txn;
struct http_msg *msg = &s->txn.rsp;
if (res->flags & (BF_SHUTW|BF_WRITE_ERROR|BF_WRITE_TIMEOUT)) {
res->analysers &= ~an_bit;
return 1;
}
if (unlikely(msg->msg_state < HTTP_MSG_BODY))
return 0;