--- loncom/lonnet/perl/lonnet.pm 2002/06/18 19:39:13 1.241 +++ loncom/lonnet/perl/lonnet.pm 2002/06/24 14:16:58 1.242 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.241 2002/06/18 19:39:13 www Exp $ +# $Id: lonnet.pm,v 1.242 2002/06/24 14:16:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1840,6 +1840,11 @@ sub log_query { my $queryid=&reply("querysend:".$query.':'.$udom.':'.$uname.':'.$command, $uhome); unless ($queryid=~/^$uhost\_/) { return 'error: '.$queryid; } + return get_query_reply($queryid); +} + +sub get_query_reply { + my $queryid=shift; my $replyfile=$perlvar{'lonDaemons'}.'/tmp/'.$queryid; my $reply=''; for (1..100) { @@ -1849,10 +1854,10 @@ sub log_query { $reply.=<$fh>; $fh->close; } else { return 'error: reply_file_error'; } - } - return &unescape($reply); + return &unescape($reply); + } } - return 'error: timeout'; + return 'timeout:'.$queryid; } sub courselog_query { @@ -2689,10 +2694,15 @@ sub symbclean { sub symbread { my $thisfn=shift; +# no filename provided? try from environment unless ($thisfn) { if ($ENV{'request.symb'}) { return &symbclean($ENV{'request.symb'}); } $thisfn=$ENV{'request.filename'}; } +# is that filename actually a symb? Verify, clean, and return + if ($thisfn=~/\_\_\_\d+\_\_\_(.*)$/) { + if (&symbverify($thisfn,$1)) { return &symbclean($thisfn); } + } $thisfn=declutter($thisfn); my %hash; my %bighash; @@ -2721,6 +2731,10 @@ sub symbread { unless ($ids) { $ids=$bighash{'ids_/'.$thisfn}; } + unless ($ids) { +# alias? + $ids=$bighash{'mapalias_'.$thisfn}; + } if ($ids) { # ------------------------------------------------------------------- Has ID(s) my @possibilities=split(/\,/,$ids);