From f506d96839cf1128730b3bfb4e8f6c527b3a59c0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 27 Apr 2021 10:56:28 +0200 Subject: [PATCH] MEDIUM: http-ana: handle read error on server side if waiting for response A read error on the server side is also reported as a write error on the client side. It means some times, a server side error is handled on the client side. Among others, it is the case when the client side is waiting for the response while the request processing is already finished. In this case, the error is not handled as a server error. It is not accurate. So now, when the request processing is finished but not the response processing and if a read error was encountered on the server side, the error is not immediatly processed on the client side, to let a chance to response analysers to properly catch the error. --- src/http_ana.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/http_ana.c b/src/http_ana.c index 77d6d1b..f662a31 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1013,7 +1013,13 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) ((req->flags & CF_SHUTW) && (req->to_forward || co_data(req)))) { /* Output closed while we were sending data. We must abort and * wake the other side up. + * + * If we have finished to send the request and the response is + * still in progress, don't catch write error on the request + * side if it is in fact a read error on the server side. */ + if (msg->msg_state == HTTP_MSG_DONE && (s->res.flags & CF_READ_ERROR) && s->res.analysers) + return 0; /* Don't abort yet if we had L7 retries activated and it * was a write error, we may recover. -- 1.7.10.4