From: Vsevolod Stakhov Date: Tue, 21 Apr 2015 15:48:32 +0000 (+0100) Subject: Do not store redirects to the same url. X-Git-Tag: 0.9.0~185 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ea6b0baf7a349c4ca41b4bf41bed3c7764f414cf;p=rspamd.git Do not store redirects to the same url. --- diff --git a/utils/redirector.pl.in b/utils/redirector.pl.in index b33886824..232921d5b 100755 --- a/utils/redirector.pl.in +++ b/utils/redirector.pl.in @@ -193,10 +193,13 @@ sub memcached_check_url { # Write url to memcached key sub memcached_cache_url { my ( $url, $url_real ) = @_; + + if ($url ne $url_real) { + my $context = Digest->new("SHA-256"); - my $context = Digest->new("SHA-256"); - - $memd->set(unpack("H*", ($context->hash($url))), $url_real, $cfg{cache_expire}); + $memd->set(unpack("H*", ($context->hash($url))), $url_real, + $cfg{cache_expire}); + } } # POE http client callback