]> source.dussan.org Git - rspamd.git/commitdiff
Do not store redirects to the same url.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Apr 2015 15:48:32 +0000 (16:48 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Apr 2015 15:48:32 +0000 (16:48 +0100)
utils/redirector.pl.in

index b33886824c231179ddba1cc668388a7f101e0a83..232921d5b6dccca5acc742f4fc3756e6e86dc98c 100755 (executable)
@@ -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