[LON-CAPA-cvs] cvs: loncom / lond

raeburn raeburn at source.lon-capa.org
Thu Jul 28 11:12:04 EDT 2011


raeburn		Thu Jul 28 15:12:04 2011 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - Replace hardcoded 'http' with check for protocol used by remote server.
  
  
Index: loncom/lond
diff -u loncom/lond:1.475 loncom/lond:1.476
--- loncom/lond:1.475	Sat Jun 11 21:10:03 2011
+++ loncom/lond	Thu Jul 28 15:12:03 2011
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.475 2011/06/11 21:10:03 raeburn Exp $
+# $Id: lond,v 1.476 2011/07/28 15:12:03 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -60,7 +60,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.475 $'; #' stupid emacs
+my $VERSION='$Revision: 1.476 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -2278,7 +2278,9 @@
 
 	my $destname=$udir.'/'.$ufile;
 	my $transname=$udir.'/'.$ufile.'.in.transit';
-	my $remoteurl='http://'.$clientip.'/userfiles/'.$fname;
+        my $clientprotocol=$Apache::lonnet::protocol{$clientname};
+        $clientprotocol = 'http' if ($clientprotocol ne 'https');
+	my $remoteurl=$clientprotocol.'://'.$clientip.'/userfiles/'.$fname;
 	my $response;
 	Debug("Remote URL : $remoteurl Transfername $transname Destname: $destname");
 	alarm(120);
@@ -7167,7 +7169,9 @@
                 # the metadata
 		unless ($fname=~/\.meta$/) { &unsub("$fname.meta",$clientip); }
 		$fname=~s/\/home\/httpd\/html\/res/raw/;
-		$fname="http://".&Apache::lonnet::hostname($perlvar{'lonHostID'})."/".$fname;
+                my $protocol = $Apache::lonnet::protocol{$perlvar{'lonHostID'}};
+                $protocol = 'http' if ($protocol ne 'https');
+		$fname=$protocol.'://'.&Apache::lonnet::hostname($perlvar{'lonHostID'})."/".$fname;
 		$result="$fname\n";
 	    }
 	} else {




More information about the LON-CAPA-cvs mailing list