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

http: Fix infinite loop on read errors

If there was a transient error and the server fd was closed, the
code would infinitely retry - it never reached FailCounter >= 2
because it falls through to the end of the loop, which sets
FailCounter = 0.

Add a continue just like the DNS rotation code has, so that the
retry actually fails after 2 attempts.

Also rework the error logic to forward the actual error message.
parent 91ab0a67
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,!14More HTTP fixes
......@@ -774,16 +774,23 @@ int BaseHttpMethod::Loop()
if (Server->IsOpen() == false)
{
FailCounter++;
_error->Discard();
Server->Close();
if (FailCounter >= 2)
{
Fail(_("Connection failed"),true);
Fail(true);
FailCounter = 0;
}
else
{
_error->Discard();
}
// Reset the pipeline
QueueBack = Queue;
Server->PipelineAnswersReceived = 0;
continue;
}
else
{
......
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