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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 15 Sep 2006 07:55:06 -0000


albertel		Fri Sep 15 03:55:06 2006 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - some more speedups, transferring env could happen in multiple places now (Access or Authz phase, no need to do it twice)
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.779 loncom/lonnet/perl/lonnet.pm:1.780
--- loncom/lonnet/perl/lonnet.pm:1.779	Fri Sep 15 03:14:04 2006
+++ loncom/lonnet/perl/lonnet.pm	Fri Sep 15 03:55:05 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.779 2006/09/15 07:14:04 albertel Exp $
+# $Id: lonnet.pm,v 1.780 2006/09/15 07:55:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -293,8 +293,10 @@
 }
 
 # ------------------------------------------- Transfer profile into environment
-
+my $env_loaded;
 sub transfer_profile_to_env {
+    if ($env_loaded) { return; } 
+
     my ($lonidsdir,$handle)=@_;
     if (!defined($lonidsdir)) {
 	$lonidsdir = $perlvar{'lonIDsDir'};
@@ -325,6 +327,7 @@
         }
     }
     $env{'user.environment'} = "$lonidsdir/$handle.id";
+    $env_loaded=1;
     foreach my $expired_key (keys(%Remove)) {
         &delenv($expired_key);
     }
@@ -894,6 +897,7 @@
     &purge_remembered();
     #&Apache::loncommon::validate_page();
     undef(%env);
+    undef($env_loaded);
 }
 
 my $to_remember=-1;