ganglia/ganglia-web — pull request #201 by hnakamur (2013-08-17 08:56:31+00:00)
Title: Define and use my_passthru() to avoid incomplete images shown in browsers

I got incomplete graphs over internet connections without this modification.
Here is an example screenshot for
http://ganglia.wmflabs.org/latest/?c=mwreview&h=unicorn&m=load_one&r=hour&s=by%20name&hc=4&mc=2
(Note: this is not my site).
![ganglia_incomplete_graph_images](https://f.cloud.github.com/assets/19299/979613/fff32fdc-0719-11e3-915b-5d5f3fdd9dc8.png)
I got the same problem for my private site in the AWS Tokyo region.

I don't have any incomplete graphs in my setup of ganglia accessed via LAN connections.

It seems a problem of Transfer-Encoding: chunked which is used by php passthru().
I modified that first run the rrdtool command to write ouput to a temporary file and then
set a Content-Length: response header.

With this modification, I don't have any incomplete graphs on my private site at the AWS Tokyo region.