[mirrorbrain-commits] r8178 - /trunk/tools/scanner.pl

From: <poeml_at_mirrorbrain.org>
Date: Mon, 04 Oct 2010 15:35:08 -0000
Author: poeml
Date: Mon Oct  4 17:35:05 2010
New Revision: 8178

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8178&view=rev
Log:
mb scan:
- fix the timer that counts the time that passed since the last FTP command was
  issued. Not a functional change, because the timer is only used in debug
  logging.

Modified:
    trunk/tools/scanner.pl

Modified: trunk/tools/scanner.pl
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/tools/scanner.pl?rev=8178&r1=8177&r2=8178&view=diff
==============================================================================
--- trunk/tools/scanner.pl (original)
+++ trunk/tools/scanner.pl Mon Oct  4 17:35:05 2010
_at_@ -108,6 +108,8 @@
 push _at_exclude_list, '/.~tmp~/';
 push _at_exclude_list_rsync, '*/.~tmp~/';
 push _at_exclude_list_rsync, '/.~tmp~/';
+
+my $ftp_timer_global;
 
 exit usage() unless _at_ARGV;
 while (defined (my $arg = shift)) {
_at_@ -687,10 +689,11 @@
 sub ftp_readdir
 {
   my ($identifier, $id, $url, $ftp_timer, $name, $ftp) = _at__;
-
-  my $ftp_age = (time() - $ftp_timer);
+  $ftp_timer_global = $ftp_timer;
+
+  my $ftp_age = (time() - $ftp_timer_global);
   print "$identifier: last command issued $ftp_age"."s ago\n" if $verbose > 2;
-  $ftp_timer = time;
+  $ftp_timer_global = time();
 
   my $item;
 
_at_@ -780,7 +783,7 @@
           next;
         }
         sleep($recursion_delay) if $recursion_delay;
-        push _at_r, ftp_readdir($identifier, $id, $urlraw, $ftp_timer, $t, $ftp);
+        push _at_r, ftp_readdir($identifier, $id, $urlraw, $ftp_timer_global, $t, $ftp);
       }
 
       if($type eq 'l') {
_at_@ -878,7 +881,6 @@
 
   # Create a request
   my $req = HTTP::Request->new(GET => $url);
-  $req->header('Accept' => '*/*');
 
   # Pass request to the user agent and get a response back
   my $res = $ua->request($req);




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Mon Oct 04 2010 - 15:35:11 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT