--- loncom/lond 2001/03/22 13:28:15 1.38 +++ loncom/lond 2001/03/24 16:07:36 1.41 @@ -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 @@ -965,10 +966,17 @@ 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); @@ -1070,10 +1078,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'; }