X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=blobdiff_plain;f=cgi;fp=cgi;h=1d29b1d91a7e64fb6f6ce079b899e7305dc79249;hb=b651d58a24d618930b4b6ddcbc611eb118f12111;hp=5133ffb9d5f36708fd32b447e83c8002b22844f2;hpb=cc86864ea090521271314b0deb48f80fc63d7f63;p=rrd-graphs.git diff --git a/cgi b/cgi index 5133ffb..1d29b1d 100755 --- a/cgi +++ b/cgi @@ -4,6 +4,7 @@ use strict qw(vars); use CGI::SpeedyCGI qw/:standard -no_xhtml/; use CGI qw/:standard -no_xhtml/; use POSIX; +use MD5; sub fail ($) { print(header(-status=>500), @@ -411,9 +412,6 @@ if (defined $elem) { my $end= $g->{TimeRanges}[$sloth]; die unless defined $end; - my $cacheid= "$section!$group!$elem!$sloth!$width!$height"; - my $cachepath= "cache/$cacheid.png"; - my @args= @{ $g->{Args} }; s,\, $end/$1 ,ge foreach @args; unshift @args, qw(--end now --start), "end-${end}s"; @@ -425,6 +423,10 @@ if (defined $elem) { unshift @args, '-t', $title, '-w',$width, '-h',$height; unshift @args, qw(-a PNG --full-size-mode); + my $cacheid= "$section!$group!$elem!$sloth!$width!$height!"; + $cacheid .= unpack "H*", MD5->hash(join '\0', @args); + my $cachepath= "cache/$cacheid.png"; + if (param('debug')) { print((join "\n",@args),"\n"); exit 0; }