summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50cfec7)
raw | patch | inline | side by side (parent: 50cfec7)
author | Florian Forster <ff@octo.it> | |
Fri, 18 Jun 2010 19:04:26 +0000 (21:04 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 18 Jun 2010 19:04:26 +0000 (21:04 +0200) |
src/action_graph.c | patch | blob | history |
diff --git a/src/action_graph.c b/src/action_graph.c
index f43f997a0afec28e530786d5fa5d2f6703e7662e..148921c52e0b7249e5632f84077f96069e6ef2b7 100644 (file)
--- a/src/action_graph.c
+++ b/src/action_graph.c
return (0);
} /* }}} int ag_info_print */
-static int output_graph (rrd_info_t *info) /* {{{ */
+static int output_graph (rrd_info_t *info, /* {{{ */
+ time_t mtime)
{
rrd_info_t *img;
return (ENOENT);
printf ("Content-Type: image/png\n"
- "Content-Length: %lu\n"
- "\n",
+ "Content-Length: %lu\n",
img->value.u_blo.size);
+ if (mtime > 0)
+ {
+ char buffer[256];
+ int status;
+
+ status = time_to_rfc1123 (mtime, buffer, sizeof (buffer));
+ if (status == 0)
+ printf ("Last-Modified: %s\n", buffer);
+ }
+ printf ("\n");
+
fwrite (img->value.u_blo.ptr, img->value.u_blo.size,
/* nmemb = */ 1, stdout);
{
int status;
- status = output_graph (info);
+ status = output_graph (info, inst_get_mtime (inst));
if (status != 0)
{
rrd_info_t *ptr;