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

raeburn raeburn at source.lon-capa.org
Mon May 22 21:31:04 EDT 2017


raeburn		Tue May 23 01:31:04 2017 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - Eliminate use of alarm(), now that LWP's own timeout is used.
  - Update information about prerequisites. 
  
  
Index: loncom/lond
diff -u loncom/lond:1.536 loncom/lond:1.537
--- loncom/lond:1.536	Tue May  9 03:04:21 2017
+++ loncom/lond	Tue May 23 01:31:03 2017
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.536 2017/05/09 03:04:21 raeburn Exp $
+# $Id: lond,v 1.537 2017/05/23 01:31:03 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -65,7 +65,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.536 $'; #' stupid emacs
+my $VERSION='$Revision: 1.537 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -2591,15 +2591,10 @@
 		my $transname="$fname.in.transfer";
 		my $remoteurl=&Apache::lonnet::reply("sub:$fname","$clientname");
 		my $response;
-# FIXME: cannot replicate files that take more than two minutes to transfer?
-#		alarm(120);
-# FIXME: this should use the LWP mechanism, not internal alarms.
-                alarm(1200);
-		{
-		    my $request=new HTTP::Request('GET',"$remoteurl");
-                    $response=&LONCAPA::LWPReq::makerequest($clientname,$request,$transname,\%perlvar,1200,0,1);
-		}
-		alarm(0);
+# FIXME: cannot replicate files that take more than two minutes to transfer -- needs checking now 1200s timeout used
+# for LWP request.
+		my $request=new HTTP::Request('GET',"$remoteurl");
+                $response=&LONCAPA::LWPReq::makerequest($clientname,$request,$transname,\%perlvar,1200,0,1);
 		if ($response->is_error()) {
 # FIXME: we should probably clean up here instead of just whine
 		    unlink($transname);
@@ -2607,16 +2602,11 @@
 		    &logthis("LWP GET: $message for $fname ($remoteurl)");
 		} else {
 		    if ($remoteurl!~/\.meta$/) {
-# FIXME: isn't there an internal LWP mechanism for this?
-			alarm(120);
-			{
-			    my $mrequest=new HTTP::Request('GET',$remoteurl.'.meta');
-                            my $mresponse = &LONCAPA::LWPReq::makerequest($clientname,$mrequest,$fname.'.meta',\%perlvar,120,0,1);
-			    if ($mresponse->is_error()) {
-				unlink($fname.'.meta');
-			    }
+			my $mrequest=new HTTP::Request('GET',$remoteurl.'.meta');
+                        my $mresponse = &LONCAPA::LWPReq::makerequest($clientname,$mrequest,$fname.'.meta',\%perlvar,120,0,1);
+			if ($mresponse->is_error()) {
+			    unlink($fname.'.meta');
 			}
-			alarm(0);
 		    }
                     # we successfully transfered, copy file over to real name
 		    rename($transname,$fname);
@@ -2686,17 +2676,13 @@
 	my $remoteurl=$clientprotocol.'://'.$clienthost.'/userfiles/'.$fname;
 	my $response;
 	Debug("Remote URL : $remoteurl Transfername $transname Destname: $destname");
-	alarm(1200);
-	{
-	    my $request=new HTTP::Request('GET',"$remoteurl");
-            my $verifycert = 1;
-            my @machine_ids = &Apache::lonnet::current_machine_ids();
-            if (grep(/^\Q$clientname\E$/, at machine_ids)) {
-                $verifycert = 0;
-            }
-            $response = &LONCAPA::LWPReq::makerequest($clientname,$request,$transname,\%perlvar,1200,$verifycert);
-	}
-	alarm(0);
+	my $request=new HTTP::Request('GET',"$remoteurl");
+        my $verifycert = 1;
+        my @machine_ids = &Apache::lonnet::current_machine_ids();
+        if (grep(/^\Q$clientname\E$/, at machine_ids)) {
+            $verifycert = 0;
+        }
+        $response = &LONCAPA::LWPReq::makerequest($clientname,$request,$transname,\%perlvar,1200,$verifycert);
 	if ($response->is_error()) {
 	    unlink($transname);
 	    my $message=$response->status_line;
@@ -8742,7 +8728,6 @@
 Apache::File
 POSIX
 Crypt::IDEA
-LWP::UserAgent()
 GDBM_File
 Authen::Krb4
 Authen::Krb5




More information about the LON-CAPA-cvs mailing list