X-Git-Url: https://git.octo.it/?p=collection4.git;a=blobdiff_plain;f=src%2Faction_graph.c;h=148921c52e0b7249e5632f84077f96069e6ef2b7;hp=f43f997a0afec28e530786d5fa5d2f6703e7662e;hb=58086cbfebfd1725a3b77b4cb7ce2b5c9f6d9d4c;hpb=50cfec7a946dba4099733332626a7e64ee564d40 diff --git a/src/action_graph.c b/src/action_graph.c index f43f997..148921c 100644 --- a/src/action_graph.c +++ b/src/action_graph.c @@ -119,7 +119,8 @@ static int ag_info_print (rrd_info_t *info) /* {{{ */ 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; @@ -132,9 +133,19 @@ static int output_graph (rrd_info_t *info) /* {{{ */ 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); @@ -193,7 +204,7 @@ int action_graph (void) /* {{{ */ { int status; - status = output_graph (info); + status = output_graph (info, inst_get_mtime (inst)); if (status != 0) { rrd_info_t *ptr;