From af7ab7c0002ef2cdfb1a4c0a468c5dbbda3d5dd0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2020 11:40:14 +0200 Subject: http: Restore successful exits from Die() We have successfully finished reading data if our buffer is empty, so we don't need to do any further checks. --- methods/http.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'methods') diff --git a/methods/http.cc b/methods/http.cc index 77348d760..b9e82166c 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -709,10 +709,12 @@ ResultState HttpServerState::Die(RequestState &Req) // can't be set if (Req.File.Name() != "/dev/null") SetNonBlock(Req.File.Fd(),false); - if (In.WriteSpace()) { - _error->Error(_("Data left in buffer")); - return ResultState::TRANSIENT_ERROR; - } + + if (not In.WriteSpace() || In.IsLimit() == true || Persistent == false) + return ResultState::SUCCESSFUL; + + _error->Error(_("Data left in buffer")); + return ResultState::TRANSIENT_ERROR; } // See if this is because the server finished the data stream -- cgit v1.2.3