# seconds of inactivity)
# access{'rpc'} 0=not allowed 1=allowed 2=allowed if root or admin
-do './web-lib.pl';
+BEGIN { push(@INC, ".."); };
+use WebminCore;
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;
+ $left = $ENV{'CONTENT_LENGTH'} - length($rawarg);
}
}
else {
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 .= $_;
}
close(FIFO);
last if ($cmd->{'action'} eq 'quit');
+ $rcount++;
}
unlink($fifo1);
unlink($fifo2);
# Check if some module is supported
print &serialise_variable(
{ 'status' => 1,
- 'rv' => &foreign_check($arg->{'module'}) } );
+ 'rv' => &foreign_check($arg->{'module'}, undef, undef,
+ $arg->{'api'}) } );
}
elsif ($arg->{'action'} eq 'config') {
# Get the config for some module