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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Fri, 06 Jun 2008 04:53:51 -0000


raeburn		Fri Jun  6 00:53:51 2008 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Detect con_lost and other error conditions when retrieving institutional user types in &retrieve_inst_usertypes(), and do not populate hash.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.959 loncom/lonnet/perl/lonnet.pm:1.960
--- loncom/lonnet/perl/lonnet.pm:1.959	Thu May 29 01:44:53 2008
+++ loncom/lonnet/perl/lonnet.pm	Fri Jun  6 00:53:51 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.959 2008/05/29 05:44:53 raeburn Exp $
+# $Id: lonnet.pm,v 1.960 2008/06/06 04:53:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -958,6 +958,10 @@
     if (defined(&domain($udom,'primary'))) {
         my $uhome=&domain($udom,'primary');
         my $rep=&reply("inst_usertypes:$udom",$uhome);
+        if ($rep =~ /^(con_lost|error|no_such_host|refused)/) {
+            &logthis("get_dom failed - $rep returned from $uhome in domain: $udom");
+            return (\%returnhash,\@order);
+        }
         my ($hashitems,$orderitems) = split(/:/,$rep); 
         my @pairs=split(/\&/,$hashitems);
         foreach my $item (@pairs) {
@@ -4534,7 +4538,6 @@
     }
     
 # Full access at system, domain or course-wide level? Exit.
-
     if ($thisallowed=~/F/) {
 	return 'F';
     }