gitweb: correct config loading logic
commit646a713dca7f2c771ba935edbd813ff31e0b19b1
authorKyle J. McKay <mackyle@gmail.com>
Mon, 13 Apr 2015 07:32:06 +0000 (13 00:32 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 13 Apr 2015 07:32:06 +0000 (13 00:32 -0700)
tree2b1299044ea1a23e07ea3da2c1134288c556e481
parenta52fb04eb4ab13dbccdf1838f117590bbad70569
gitweb: correct config loading logic

Correct the logic for loading the GITWEB_CONFIG file so that the
config file is always run very early -- early enough to set
$auto_fcgi and have it be effective before entering the run_request
loop.

For non-FCGI mode, the behavior is identical (config file is read
exactly once, if $per_request_config is a 'CODE' ref [after reading
the config file] that's executed exactly once].

The difference is in FastCGI mode.  Now the config file will be read
once BEFORE starting to process any FCGI requests at all.
Previously it would not have been read until starting to process the
first request.

If $per_request_config is true but not a 'CODE' ref (the default),
then the config file will be read AGAIN on the first FCGI request
(this is new behavior) and AGAIN on each subsequent FCGI request
(same behavior as before).

If $per_request_config is false, in FCGI mode the config file will
ony be read once BEFORE any FCGI requests are processed at all (this
is different from before where it would only be read once, but
during the first FCGI request).

If $per_request_config is a 'CODE' ref, then the config file is read
exactly once in FCGI mode and at the same point as if
$per_request_config were false (again this is much early than
before) AND the $per_request_code ref is executed for each request
(including the first) at exactly the same point it was before.

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