[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Wed, 18 Jun 2003 15:49:24 -0000


bowersj2		Wed Jun 18 11:49:24 2003 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  This code helps with the "reload" attack, but it is not a cure by any 
  means. Still, the server does recover more quickly with this sort of 
  thing in place. Recommend adding this kind of code to any 
  student-accessible page that performs non-trivial computation.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.207 loncom/interface/lonnavmaps.pm:1.208
--- loncom/interface/lonnavmaps.pm:1.207	Wed Jun 18 11:14:23 2003
+++ loncom/interface/lonnavmaps.pm	Wed Jun 18 11:49:24 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.207 2003/06/18 15:14:23 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.208 2003/06/18 15:49:24 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1499,6 +1499,16 @@
         }
     } continue {
         $curRes = $it->next();
+
+	if ($r) {
+	    # If we have the connection, make sure the user is still connected
+	    my $c = $r->connection;
+	    if ($c->aborted()) {
+		Apache::lonnet::logthis("navmaps aborted");
+		# Who cares what we do, nobody will see it anyhow.
+		return '';
+	    }
+	}
     }
     
     # Print out the part that jumps to #curloc if it exists