Skip to content
Snippets Groups Projects
Unverified Commit b4c71a72 authored by Julian Andres Klode's avatar Julian Andres Klode Committed by Andrej Shadura
Browse files

http: Always Close() the connection in Die()

If we reached Die() there was an issue with the server connection,
so we should always explicitly close it.
parent 87808b23
No related branches found
No related tags found
7 merge requests!35Merge changes from apertis/v2020-updates into apertis/v2020,!34Merge changes from apertis/v2020-security into apertis/v2020,!30Merge buster security from Apertis/v2022dev1,!27Merge changes from apertis/v2019-updates into apertis/v2019,!26Sync apertis updates,!15v2020: Backport HTTP corruption fixes,!11T7140: (Hopefully) Fix HTTP data corruption
......@@ -695,6 +695,8 @@ ResultState HttpServerState::Die(RequestState &Req)
{
unsigned int LErrno = errno;
Close();
// Dump the buffer to the file
if (Req.State == RequestState::Data)
{
......@@ -722,7 +724,6 @@ ResultState HttpServerState::Die(RequestState &Req)
if (In.IsLimit() == false && Req.State != RequestState::Header &&
Persistent == true)
{
Close();
if (LErrno == 0)
{
_error->Error(_("Error reading from server. Remote end closed connection"));
......@@ -741,7 +742,6 @@ ResultState HttpServerState::Die(RequestState &Req)
return ResultState::TRANSIENT_ERROR;
// We may have got multiple responses back in one packet..
Close();
return ResultState::SUCCESSFUL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment