+ #
+ # A lot of cgi wrapper processes can potentially build
+ # up and clog an otherwise unloaded web server. To
+ # partially avoid this, when a GET comes in and the lock
+ # is already held, rather than blocking a html page is
+ # constructed that retries. This is enabled by setting
+ # cgi_overload_delay.
+ if (defined $config{cgi_overload_delay} &&
+ $config{cgi_overload_delay} =~/^[0-9]+/) {
+ my $i=int($config{cgi_overload_delay});
+ $pre_exec.="#define CGI_OVERLOAD_DELAY $i\n"
+ if $i > 0;
+ my $msg=gettext("Please wait");
+ $msg=~s/"/\\"/g;
+ $pre_exec.='#define CGI_PLEASE_WAIT_TITLE "'.$msg."\"\n";
+ if (defined $config{cgi_overload_message} && length $config{cgi_overload_message}) {
+ $msg=$config{cgi_overload_message};
+ $msg=~s/"/\\"/g;
+ }
+ $pre_exec.='#define CGI_PLEASE_WAIT_BODY "'.$msg."\"\n";
+ }
+ $pre_exec.=<<"EOF";