[LON-CAPA-cvs] cvs: loncom /auth lonracc.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 01 Feb 2007 06:31:34 -0000


albertel		Thu Feb  1 01:31:34 2007 EDT

  Modified files:              
    /loncom/auth	lonracc.pm 
  Log:
  - if the file doesn't exist return NOT_FOUND rather thaen letting it
    end up loggin the error message in the webserver error logs
  
  
Index: loncom/auth/lonracc.pm
diff -u loncom/auth/lonracc.pm:1.18 loncom/auth/lonracc.pm:1.19
--- loncom/auth/lonracc.pm:1.18	Thu Feb  1 01:20:34 2007
+++ loncom/auth/lonracc.pm	Thu Feb  1 01:31:33 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Access Handler for File Transfers
 #
-# $Id: lonracc.pm,v 1.18 2007/02/01 06:20:34 albertel Exp $
+# $Id: lonracc.pm,v 1.19 2007/02/01 06:31:33 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -58,6 +58,12 @@
 
 sub handler {
     my $r = shift;
+
+    my $filename=$r->filename;
+    if (!-e $filename) {
+	return NOT_FOUND;
+    }
+
     my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP);
     my %iphost=&Apache::lonnet::get_iphost();
     my $hostids=$iphost{$reqhost};
@@ -73,7 +79,6 @@
     my @ids;
 
     foreach my $id (@{$hostids}) {
-	my $filename=$r->filename;
 	my $uri =$r->uri;
 	if (($filename=~/\.meta$/) ||
 	    ($uri=~m|^/raw/uploaded|) ||