diff --git a/src/proto_http.c b/src/proto_http.c index 8c476c7c0..46b304f62 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -7155,12 +7155,15 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit if (res->flags & CF_SHUTR) { if ((s->req.flags & (CF_SHUTR|CF_SHUTW)) == (CF_SHUTR|CF_SHUTW)) goto aborted_xfer; - if (!(s->flags & SF_ERR_MASK)) - s->flags |= SF_ERR_SRVCL; - s->be->be_counters.srv_aborts++; - if (objt_server(s->target)) - objt_server(s->target)->counters.srv_aborts++; - goto return_bad_res_stats_ok; + /* If we have some pending data, we continue the processing */ + if (!buffer_pending(res->buf)) { + if (!(s->flags & SF_ERR_MASK)) + s->flags |= SF_ERR_SRVCL; + s->be->be_counters.srv_aborts++; + if (objt_server(s->target)) + objt_server(s->target)->counters.srv_aborts++; + goto return_bad_res_stats_ok; + } } /* we need to obey the req analyser, so if it leaves, we must too */