Package: debmirror
Version: 1:2.10
Severity: normal
Tags: patch

Dear Maintainer,

I use debmirror behind a proxy chain (with virus scanner) and had
problems on downloading big files (mostly orig tarballs or dbg
packages). The virus scan takes to long and debmirror report a timeout.
So I take a look at the source code and realize, that the '--timeout'
option only apply to rsync and ftp downloads. I've attach a patch to fix
this for http and hftp download.
Now the default timeout for http and hftp is set to 500 seconds, instead
of the default timeout in LWP::UserAgent, which is 180 seconds.

Cheers,
Christoph
From 40d309145d10751125dc0d854394a4b649271e8f Mon Sep 17 00:00:00 2001
From: Christoph Goehre <ch...@sigxcpu.org>
Date: Mon, 5 Mar 2012 20:57:32 +0100
Subject: [PATCH] apply timeout to http and hftp download

LWP::UserAgent has a default timeout of 180 seconds
---
 debmirror |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/debmirror b/debmirror
index b246a9d..fd7dfa4 100755
--- a/debmirror
+++ b/debmirror
@@ -817,6 +817,7 @@ sub init_connection {
 
   /^http$/ && do {
     $ua = LWP::UserAgent->new(keep_alive => 1);
+    $ua->timeout($timeout);
     $ua->proxy('http', $ENV{http_proxy}) if $ENV{http_proxy};
     $ua->proxy('http', $proxy) if $proxy;
     $ua->show_progress($progress);
@@ -826,6 +827,7 @@ sub init_connection {
   /^ftp$/ && do {
     if ($proxy || $ENV{ftp_proxy}) {
       $ua = LWP::UserAgent->new;
+      $ua->timeout($timeout);
       $ua->proxy('ftp', $proxy ? $proxy : $ENV{ftp_proxy});
     }
     else {
-- 
1.7.9.1

Attachment: signature.asc
Description: Digital signature

Reply via email to