gitweb: make htmlcache compatible with FCGI mode
commit532b51863d1d651ba51bfc7d99e537b5713f0aad
authorKyle J. McKay <mackyle@gmail.com>
Sat, 11 Apr 2015 03:36:28 +0000 (10 20:36 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 11 Apr 2015 03:36:28 +0000 (10 20:36 -0700)
tree9ef8bfc5bdfd2e3bfe2fd999544c2561ffa9f486
parent897547f67fe4382abfc85555a8afaea3ea5b2f37
gitweb: make htmlcache compatible with FCGI mode

When running in FCGI mode, the STDOUT file handle is not
necessarily related to the STDOUT_FILENO file descriptor
in any way.

In order to capture the created output for caching, we
need to point the STDOUT file handle to the cache file.

Rather than attempting to use file descriptor operators
on it (which will only work if it's associated with a
real file descriptor), just replace the entire typeglob
with a new file handle and restore the old one when done.

This works properly whether we are running in FCGI mode
or not.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
gitweb/gitweb.perl