X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cgi%2Flibravatar.cgi;h=219d65ee0c268c69bca1f5d63b8467422072fa90;hb=1795f7f2a672ee6482240c4037b0bccd53117a2c;hp=276b3925fee74f07a658a9f595b457f66548ada0;hpb=6d58a53155cd78fd9ae2b8726da7dd9fc179ffbd;p=debbugs.git diff --git a/cgi/libravatar.cgi b/cgi/libravatar.cgi index 276b392..219d65e 100755 --- a/cgi/libravatar.cgi +++ b/cgi/libravatar.cgi @@ -8,13 +8,10 @@ use Debbugs::CGI qw(cgi_parameters); use Debbugs::Common; use Digest::MD5 qw(md5_hex); use File::LibMagic; -use File::Temp qw(tempfile); use Debbugs::Libravatar qw(:libravatar); use Libravatar::URL; -use HTTP::Request; - use CGI::Simple; use Cwd qw(abs_path); @@ -35,9 +32,9 @@ if ($param{avatar} ne 'yes' or not defined $param{email} or not length $param{em # figure out what the md5sum of the e-mail is. my $email_md5sum = md5_hex(lc($param{email})); -my $cache_location = cache_location(email => lc($param{email})); +my ($cache_location, $is_valid) = cache_location(email => lc($param{email})); # if we've got it, and it's less than one hour old, return it. -if (cache_valid($cache_location)) { +if ($is_valid) { serve_cache($cache_location,$q); exit 0; }