--- loncom/lond 2001/03/22 13:28:15 1.38 +++ loncom/lond 2001/03/27 12:49:18 1.43 @@ -13,6 +13,7 @@ # Jan 01 Scott Harrison # 02/12 Gerd Kortemeyer # 03/15 Scott Harrison +# 03/24 Gerd Kortemeyer # # based on "Perl Cookbook" ISBN 1-56592-243-3 # preforker - server who forks first @@ -668,6 +669,9 @@ sub make_new_child { print $sh "$clientip:$now\n"; } } + unless ($fname=~/\.meta$/) { + unlink("$fname.meta.$hostid{$clientip}"); + } $fname=~s/\/home\/httpd\/html\/res/raw/; $fname="http://$thisserver/".$fname; print $client "$fname\n"; @@ -965,16 +969,24 @@ sub make_new_child { } # ------------------------------------------------------------------- querysend } elsif ($userinput =~ /^querysend/) { - my ($cmd,$query)=split(/:/,$userinput); + my ($cmd,$query,$custom)=split(/:/,$userinput); $query=~s/\n*$//g; - print $client sqlreply("$hostid{$clientip}\&$query"). - "\n"; + unless ($custom) { + print $client "". + sqlreply("$hostid{$clientip}\&$query")."\n"; + } + else { + print $client "". + sqlreply("$hostid{$clientip}\&$query". + "\&$custom")."\n"; + } # ------------------------------------------------------------------ queryreply } elsif ($userinput =~ /^queryreply/) { my ($cmd,$id,$reply)=split(/:/,$userinput); my $store; my $execdir=$perlvar{'lonDaemons'}; if ($store=IO::File->new(">$execdir/tmp/$id")) { + $reply=~s/\&/\n/g; print $store $reply; close $store; print $client "ok\n"; @@ -1070,10 +1082,13 @@ sub make_new_child { my $ulsout=''; my $ulsfn; if (-e $ulsdir) { - while ($ulsfn=<$ulsdir/*>) { + if (opendir(LSDIR,$ulsdir)) { + while ($ulsfn=readdir(LSDIR)) { my @ulsstats=stat($ulsfn); $ulsout.=$ulsfn.'&'.join('&',@ulsstats).':'; } + closedir(LSDIR); + } } else { $ulsout='no_such_dir'; }