You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2012/04/24 19:16:54 UTC

svn commit: r1329869 - /spamassassin/trunk/sa-update.raw

Author: mmartinec
Date: Tue Apr 24 17:16:53 2012
New Revision: 1329869

URL: http://svn.apache.org/viewvc?rev=1329869&view=rev
Log:
Bug 6654 detail: increase timeouts, ignore empty file for IMS, drop --wait with lwp

Modified:
    spamassassin/trunk/sa-update.raw

Modified: spamassassin/trunk/sa-update.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sa-update.raw?rev=1329869&r1=1329868&r2=1329869&view=diff
==============================================================================
--- spamassassin/trunk/sa-update.raw (original)
+++ spamassassin/trunk/sa-update.raw Tue Apr 24 17:16:53 2012
@@ -1388,12 +1388,12 @@ sub http_get {
 
   if (defined $ext_prog && $ext_prog eq 'curl') {
     push(@args, qw(-s -L -O --remote-time -g --max-redirs 2
-                   --connect-timeout 15 --max-time 300
+                   --connect-timeout 30 --max-time 300
                    --fail -o), $out_fname_short);
     push(@args, '-z', $out_fname_short)  if $out_fname_exists && !$force_reload;
   } elsif (defined $ext_prog && $ext_prog eq 'wget') {
-    push(@args, qw(-q -N --max-redirect=2 --tries=3 --wait=20 --random-wait
-                   --dns-timeout=15 --connect-timeout=15 --read-timeout=300
+    push(@args, qw(-q -N --max-redirect=2 --tries=3
+                   --dns-timeout=20 --connect-timeout=30 --read-timeout=300
                    -o), $out_fname_short);
     #*** ???  if $out_fname_exists && !$force_reload;
   } elsif (defined $ext_prog && $ext_prog eq 'fetch') {
@@ -1402,7 +1402,11 @@ sub http_get {
   } elsif ($have_lwp) {
     dbg("http: no external tool for download, fallback to using LWP");
     my $ims;
-    $ims = (stat $out_fname)[9]  if $out_fname_exists && !$force_reload;
+    if ($out_fname_exists && !$force_reload) {
+      my @out_fname_stat = stat($out_fname);
+      my $size = $out_fname_stat[7];
+      $ims = $out_fname_stat[9]  if $size;  # only if nonempty
+    }
     my $out_fh = IO::File->new;
     $out_fh->open($out_fname,'>',0640)
       or die "Cannot create a file $out_fname: $!";