gitweb.perl: use die not goto
commit10c78946f549e85663d1d66c094657c4c51a6911
authorKyle J. McKay <mackyle@gmail.com>
Wed, 23 Sep 2015 22:11:13 +0000 (23 15:11 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 23 Sep 2015 22:11:13 +0000 (23 15:11 -0700)
tree895eed5fece3cb0431f14a2c3210cf46875abc95
parent52c12f7fa9cbb3ad316b0c26fd0877a447d4542e
gitweb.perl: use die not goto

Using "goto DONE_GITWEB" instead of throwing an exception
with die causes any optimized CGI processing (mod_perl,
FCGI, PSGI, etc.) to be aborted prematurely.

This can happen for various reasons that are not fatal,
rather they are simply indicating that all output has
been written for the current request (perhaps an object
wasn't found) and the current request is done.

These conditions are part of normal CGI processing and
SHOULD NOT abort the script entirely, rather just finish
up the current request.

What happens when the script is aborted entirely is that
the host process (mod_perl, mod_fcgid, etc.) must detect
the error and then spawn another copy of the script.

That all takes time and devastates throughput unnecessarily.

Instead throw an exception using die in these cases and
catch it with eval to indicate that the current request
has ended and the next should begin.

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