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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 19 Jul 2004 20:16:41 -0000


albertel		Mon Jul 19 16:16:41 2004 EDT

  Modified files:              
    /loncom/lonnet/perl	lonuploadrep.pm 
  Log:
  - this caused a fun infinite loop of requests, multidomain server
     -server asked for /raw/uploaded, machine saw that it wasn't the homeserver since it belonged to a different domin, so asked itself for /raw/uploaded which it didn't think it was the homeserver for so it asked itself for /raw/uploaded ...
  
  
  
Index: loncom/lonnet/perl/lonuploadrep.pm
diff -u loncom/lonnet/perl/lonuploadrep.pm:1.2 loncom/lonnet/perl/lonuploadrep.pm:1.3
--- loncom/lonnet/perl/lonuploadrep.pm:1.2	Thu Apr  1 12:36:53 2004
+++ loncom/lonnet/perl/lonuploadrep.pm	Mon Jul 19 16:16:40 2004
@@ -35,7 +35,8 @@
     my $r = shift;
     if ($r->uri =~m|^/*uploaded/(\w+)/(\w+)/(.+)$|) {
         my $chome=&Apache::lonnet::homeserver($2,$1);
-        if ($chome eq $Apache::lonnet::perlvar{'lonHostID'}) { return OK; }
+	my @ids=&Apache::lonnet::current_machine_ids();
+	foreach my $id (@ids) { if ($id eq $chome) { return OK; } }
         my $filename =  $Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$1.'/'.$2.'/'.$3;
         my ($info, $rtncode);
         if (-f $filename) {