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;