Increase slow RPC timeout

This commit is contained in:
Jamie Cameron
2010-11-15 16:36:54 -08:00
parent 2427f53183
commit 1bfdb9f7a3
2 changed files with 8 additions and 5 deletions

View File

@@ -13,8 +13,9 @@ use POSIX;
&init_config();
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
local $got;
while(length($rawarg) < $ENV{'CONTENT_LENGTH'}) {
read(STDIN, $got, $ENV{'CONTENT_LENGTH'}) > 0 || last;
local $left = $ENV{'CONTENT_LENGTH'} - length($rawarg);
while($left > 0) {
read(STDIN, $got, $left) > 0 || last;
$rawarg .= $got;
}
}
@@ -49,9 +50,10 @@ if ($arg->{'newsession'}) {
close(STDOUT);
close(miniserv::SOCK);
local $stime = time();
local $rcount = 0;
while(1) {
local ($rawcmd, $cmd, @rv);
alarm(10);
alarm($rcount ? 360 : 60);
open(FIFO, $fifo1) || last;
while(<FIFO>) {
$rawcmd .= $_;
@@ -98,6 +100,7 @@ EOF
}
close(FIFO);
last if ($cmd->{'action'} eq 'quit');
$rcount++;
}
unlink($fifo1);
unlink($fifo2);

View File

@@ -5998,7 +5998,7 @@ foreach my $sn (keys %remote_session) {
delete($remote_session{$sn});
delete($remote_session_server{$sn});
}
foreach $fh (keys %fast_fh_cache) {
foreach my $fh (keys %fast_fh_cache) {
close($fh);
delete($fast_fh_cache{$fh});
}
@@ -6015,7 +6015,7 @@ sub remote_error_setup
$main::remote_error_handler = $_[0] || \&error;
}
=head2 remote_rpc_call(server, structure)
=head2 remote_rpc_call(server, &structure)
Calls rpc.cgi on some server and passes it a perl structure (hash,array,etc)
and then reads back a reply structure. This is mainly for internal use only,