diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-08-11 11:40:14 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-08-11 13:09:04 +0200 |
commit | af7ab7c0002ef2cdfb1a4c0a468c5dbbda3d5dd0 (patch) | |
tree | 64f687d79b55243aae17b1fa251716a1d3581e33 | |
parent | 626b7ccc8cec120f789ef89c2d5d28b8b6d67a04 (diff) |
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.
-rw-r--r-- | methods/http.cc | 10 |
1 files changed, 6 insertions, 4 deletions
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 |