From 04ec1eaa1ed05dffdcc91041b51d55dda658b6fe Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 16 Jun 2015 15:16:53 +0100 Subject: [PATCH] Fix digest invocation. --- utils/redirector.pl.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/redirector.pl.in b/utils/redirector.pl.in index 555006374..fb8daf251 100755 --- a/utils/redirector.pl.in +++ b/utils/redirector.pl.in @@ -186,8 +186,8 @@ sub memcached_check_url { my ( $url ) = @_; my $context = Digest->new("SHA-256"); - - return $memd->get(unpack("H*", ($context->hash($url)))); + $context->update($url); + return $memd->get($context->digest()); } # Write url to memcached key @@ -196,8 +196,8 @@ sub memcached_cache_url { if ($url ne $url_real) { my $context = Digest->new("SHA-256"); - - $memd->set(unpack("H*", ($context->hash($url))), $url_real, + $context->update($url); + $memd->set($context->digest(), $url_real, $cfg{cache_expire}); } } -- 2.39.5