version 1.37, 2001/03/15 13:50:16
|
version 1.46, 2001/04/02 14:43:17
|
Line 13
|
Line 13
|
# Jan 01 Scott Harrison |
# Jan 01 Scott Harrison |
# 02/12 Gerd Kortemeyer |
# 02/12 Gerd Kortemeyer |
# 03/15 Scott Harrison |
# 03/15 Scott Harrison |
|
# 03/24 Gerd Kortemeyer |
# |
# |
# based on "Perl Cookbook" ISBN 1-56592-243-3 |
# based on "Perl Cookbook" ISBN 1-56592-243-3 |
# preforker - server who forks first |
# preforker - server who forks first |
Line 668 sub make_new_child {
|
Line 669 sub make_new_child {
|
print $sh "$clientip:$now\n"; |
print $sh "$clientip:$now\n"; |
} |
} |
} |
} |
|
unless ($fname=~/\.meta$/) { |
|
unlink("$fname.meta.$hostid{$clientip}"); |
|
} |
$fname=~s/\/home\/httpd\/html\/res/raw/; |
$fname=~s/\/home\/httpd\/html\/res/raw/; |
$fname="http://$thisserver/".$fname; |
$fname="http://$thisserver/".$fname; |
print $client "$fname\n"; |
print $client "$fname\n"; |
Line 965 sub make_new_child {
|
Line 969 sub make_new_child {
|
} |
} |
# ------------------------------------------------------------------- querysend |
# ------------------------------------------------------------------- querysend |
} elsif ($userinput =~ /^querysend/) { |
} elsif ($userinput =~ /^querysend/) { |
my ($cmd,$query)=split(/:/,$userinput); |
my ($cmd,$query, |
|
$custom,$customshow)=split(/:/,$userinput); |
$query=~s/\n*$//g; |
$query=~s/\n*$//g; |
print $client sqlreply("$hostid{$clientip}\&$query")."\n"; |
unless ($custom or $customshow) { |
|
print $client "". |
|
sqlreply("$hostid{$clientip}\&$query")."\n"; |
|
} |
|
else { |
|
print $client "". |
|
sqlreply("$hostid{$clientip}\&$query". |
|
"\&$custom"."\&$customshow")."\n"; |
|
} |
# ------------------------------------------------------------------ queryreply |
# ------------------------------------------------------------------ queryreply |
} elsif ($userinput =~ /^queryreply/) { |
} elsif ($userinput =~ /^queryreply/) { |
my ($cmd,$id,$reply)=split(/:/,$userinput); |
my ($cmd,$id,$reply)=split(/:/,$userinput); |
my $store; |
my $store; |
my $execdir=$perlvar{'lonDaemons'}; |
my $execdir=$perlvar{'lonDaemons'}; |
if ($store=IO::File->new(">$execdir/tmp/$id")) { |
if ($store=IO::File->new(">$execdir/tmp/$id")) { |
|
$reply=~s/\&/\n/g; |
print $store $reply; |
print $store $reply; |
close $store; |
close $store; |
|
my $store2=IO::File->new(">$execdir/tmp/$id.end"); |
|
print $store2 "done\n"; |
|
close $store2; |
print $client "ok\n"; |
print $client "ok\n"; |
} |
} |
else { |
else { |
Line 1069 sub make_new_child {
|
Line 1086 sub make_new_child {
|
my $ulsout=''; |
my $ulsout=''; |
my $ulsfn; |
my $ulsfn; |
if (-e $ulsdir) { |
if (-e $ulsdir) { |
while ($ulsfn=<$ulsdir/*>) { |
if (opendir(LSDIR,$ulsdir)) { |
|
while ($ulsfn=readdir(LSDIR)) { |
my @ulsstats=stat($ulsfn); |
my @ulsstats=stat($ulsfn); |
$ulsout.=$ulsfn.'&'.join('&',@ulsstats).':'; |
$ulsout.=$ulsfn.'&'.join('&',@ulsstats).':'; |
} |
} |
|
closedir(LSDIR); |
|
} |
} else { |
} else { |
$ulsout='no_such_dir'; |
$ulsout='no_such_dir'; |
} |
} |