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

From: <poeml_at_mirrorbrain.org>
Date: Sun, 19 Feb 2012 13:33:48 -0000
Author: poeml
Date: Sun Feb 19 14:33:48 2012
New Revision: 8250

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8250&view=rev
Log:
mb scan:
- if some directories on a mirror return 404, the scanner crashed. This
  is fixed with a patch kindly contributed by Thorsten Behrens.

Modified:
    trunk/tools/scanner.pl

Modified: trunk/tools/scanner.pl
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/tools/scanner.pl?rev=8250&r1=8249&r2=8250&view=diff
==============================================================================
--- trunk/tools/scanner.pl	(original)
+++ trunk/tools/scanner.pl	Sun Feb 19 14:33:48 2012
_at_@ -561,7 +561,11 @@
   my _at_r;
   print "$identifier: http dir: $url/$name\n" if $verbose > 2;
   print "$identifier: http dir: $name\n" if $verbose == 2;
-  my $contents = cont("$url/$name/?F=1");
+  my ($res, $contents) = cont("$url/$name/?F=1");
+  if(!$res) {
+    print "$url/$name/?F=1: error \"$contents\" fetching index, skipped.\n" if $verbose;
+    return;
+  }
   if($contents =~ s{^.*<(PRE|pre|table)>.*<(a href|A HREF)="\?(N=A|C=.*;O=)[^"]*">}{}s) {
     ## good, we know that one. It is a standard apache dir-listing.
     ## 
_at_@ -949,10 +953,10 @@
 
   # Check the outcome of the response
   if ($res->is_success) {
-    return ($res->content);
+    return (1,$res->content);
   }
   else {
-    return ($res->status_line);
+    return (0,$res->status_line);
   }
 }
 




_______________________________________________
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 Sun Feb 19 2012 - 13:33:49 GMT

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