142 |
return 1; |
return 1; |
143 |
} elsif ( $method =~ m{^/gnuplot} ) { |
} elsif ( $method =~ m{^/gnuplot} ) { |
144 |
eval { |
eval { |
145 |
my $path = Sack::Server::Gnuplot::date( Sack::Merge->out ); |
my $path = Sack::Server::Gnuplot::date( Sack::Merge->out, $param ); |
146 |
if ( -e $path ) { |
if ( -e $path ) { |
147 |
print $send "HTTP/1.0 200 OK\r\nContent-Type: image/png\r\n\r\n"; |
print $send "HTTP/1.0 200 OK\r\nContent-Type: image/png\r\n\r\n"; |
148 |
open(my $fh, '<', $path) || die $path; |
open(my $fh, '<', $path) || die $path; |
151 |
print $send $b; |
print $send $b; |
152 |
} |
} |
153 |
return 1; |
return 1; |
154 |
|
} else { |
155 |
|
print $send "HTTP/1.0 404 no graph\r\n\r\n"; |
156 |
|
return 1; |
157 |
} |
} |
158 |
}; |
}; |
159 |
warn "ERROR: $@" if $@; |
warn "ERROR: $@" if $@; |