[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn@source.lon-capa.org
Wed, 30 Dec 2009 18:01:17 -0000


raeburn		Wed Dec 30 18:01:17 2009 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Sanity checking when using &userenvironment(). 
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1047 loncom/lonnet/perl/lonnet.pm:1.1048
--- loncom/lonnet/perl/lonnet.pm:1.1047	Mon Nov 30 06:23:37 2009
+++ loncom/lonnet/perl/lonnet.pm	Wed Dec 30 18:01:17 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1047 2009/11/30 06:23:37 raeburn Exp $
+# $Id: lonnet.pm,v 1.1048 2009/12/30 18:01:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1728,6 +1728,9 @@
     unless ($uhome eq 'no_host') {
         my @answer=split(/\&/, 
             &reply('get:'.$udom.':'.$unam.':environment:'.$items,$uhome));
+        if ($#answer==0 && $answer[0] =~ /^(con_lost|error:|no_such_host)/i) {
+            return %returnhash;
+        }
         my $i;
         for ($i=0;$i<=$#what;$i++) {
 	    $returnhash{$what[$i]}=&unescape($answer[$i]);