mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-23 11:51:00 +01:00
[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:
parent
b608feb82a
commit
082b01c541
@ -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_txn *txn = &s->txn;
|
||||||
struct http_msg *msg = &s->txn.req;
|
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))
|
if (unlikely(msg->msg_state < HTTP_MSG_BODY))
|
||||||
return 0;
|
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_txn *txn = &s->txn;
|
||||||
struct http_msg *msg = &s->txn.rsp;
|
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))
|
if (unlikely(msg->msg_state < HTTP_MSG_BODY))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user