[BUG] http: some possible missed close remain in the forward chain
We basically have to mimmic the code of process_session() here, so
when the remote output is closed, we must abort otherwise we'll end
up with data which cannot leave the buffer.
diff --git a/src/proto_http.c b/src/proto_http.c
index c68d49d..968c4c6 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3687,9 +3687,17 @@
(txn->req.msg_state == HTTP_MSG_CLOSED &&
txn->rsp.msg_state == HTTP_MSG_CLOSED)) {
s->req->analysers = 0;
+ s->req->flags &= ~BF_DONT_READ;
+ buffer_auto_close(s->req);
s->rep->analysers = 0;
+ buffer_auto_close(s->rep);
+ s->rep->flags &= ~BF_DONT_READ;
}
- else if (txn->rsp.msg_state == HTTP_MSG_CLOSED) {
+ else if (txn->rsp.msg_state == HTTP_MSG_CLOSED ||
+ txn->rsp.msg_state == HTTP_MSG_ERROR ||
+ (s->rep->flags & BF_SHUTW)) {
+ s->rep->flags &= ~BF_DONT_READ;
+ s->req->flags &= ~BF_DONT_READ;
buffer_abort(s->req);
buffer_auto_close(s->req);
buffer_ignore(s->req, s->req->l - s->req->send_max);
@@ -3734,6 +3742,7 @@
/* Output closed while we were sending data. We must abort. */
buffer_ignore(req, req->l - req->send_max);
req->analysers &= ~an_bit;
+ req->flags &= ~BF_DONT_READ;
return 1;
}
@@ -4668,10 +4677,12 @@
return 0;
if ((res->flags & (BF_READ_ERROR|BF_READ_TIMEOUT|BF_WRITE_ERROR|BF_WRITE_TIMEOUT)) ||
+ ((res->flags & BF_SHUTW) && (res->to_forward || res->send_max)) ||
!s->req->analysers) {
/* in case of error or if the other analyser went away, we can't analyse HTTP anymore */
buffer_ignore(res, res->l - res->send_max);
res->analysers &= ~an_bit;
+ res->flags &= ~BF_DONT_READ;
return 1;
}