[squid-dev] [PATCH] squid-3.5: fix for errors when receiving a non-existent file via ftp
Vitaly Lavrov
vel21ripn at gmail.com
Mon Oct 12 08:21:34 UTC 2015
On 11.10.2015 18:56, Amos Jeffries wrote:
> Attached is a cleaned version of the patch. It now meets the source
> coding guidelines, and applies cleanly to trunk / Squid-4.
>
> I took the opportunity to remove two useless if() conditions - one was
> duplicate checking a value, the other for values in a pointer that was
> just new()'d.
>
>
> Logic looks mostly okay, but this part in the middle of
> Ftp::Gateway::loginFailed() is rather odd:
>
> - // any other problems are general falures.
> - if (!err) {
> - ftpFail(this);
> + if (!err)
> return;
> - }
>
> The original behaviour was to output an error and perform the ftpQuit()
> sequence. Now it appears to just halt without doing anything.
>
> Is that behaviour change intentional? I suspect the correct behaviour is
> to remove that if()-condition entirely, but I'm unsure.
It is possible that ftpFail(this) was deleted accidentally during multiple rework code.
The original version "if(!err) { ftpFail(this); return; }" looks more logical.
More information about the squid-dev
mailing list