aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-21 16:48:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-21 16:48:32 +0100
commitea6b0baf7a349c4ca41b4bf41bed3c7764f414cf (patch)
treeae80f8734c73b4892f56a94a852d47d848a1b9c4 /utils
parent5ce6980be276909ad4dc53398c746432c0a6e4ff (diff)
downloadrspamd-ea6b0baf7a349c4ca41b4bf41bed3c7764f414cf.tar.gz
rspamd-ea6b0baf7a349c4ca41b4bf41bed3c7764f414cf.zip
Do not store redirects to the same url.
Diffstat (limited to 'utils')
-rwxr-xr-xutils/redirector.pl.in9
1 files changed, 6 insertions, 3 deletions
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