[libconfig-model-dpkg-perl] 02/10: simplified usage of Async::Http requests...

dod at debian.org dod at debian.org
Thu Mar 6 18:18:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit fc90fbebdde493345a1b86ad77405c9323c6a3fa
Author: Dominique Dumont <dod at debian.org>
Date:   Sat Mar 1 18:42:27 2014 +0100

    simplified usage of Async::Http requests...
    
    ... Otherwise, one gets connection refused on the 2nd connection to
    madison (seen with cme edit dpkg, where cache is refreshed on start
    and a new dependency is added)
---
 lib/Config/Model/Dpkg/Dependency.pm | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/Config/Model/Dpkg/Dependency.pm b/lib/Config/Model/Dpkg/Dependency.pm
index c4e71e3..6dde727 100644
--- a/lib/Config/Model/Dpkg/Dependency.pm
+++ b/lib/Config/Model/Dpkg/Dependency.pm
@@ -797,8 +797,7 @@ sub get_available_version {
 
     say "Connecting to qa.debian.org to check $pkg_name versions. Please wait..." ;
 
-    my $request;
-    $request = http_request(
+    http_request(
         GET => $url,
         timeout => 20, # seconds
         sub {
@@ -820,7 +819,6 @@ sub get_available_version {
                 say "Error for $url: ($hdr->{Status}) $hdr->{Reason}";
                 delete $requested{$pkg_name} ; # trash the callbacks
             }
-            undef $request;
         }
     );
 }
@@ -854,8 +852,7 @@ sub cache_info_from_madison {
     my $url = "http://qa.debian.org/cgi-bin/madison.cgi?package=".join('+', at needed)."&text=on" ;
     say "Connecting to qa.debian.org to check ", scalar @needed, " package versions. Please wait..." ;
 
-    my $request;
-    $request = http_request(
+    http_request(
         GET => $url,
         timeout => 20, # seconds
         sub {
@@ -879,7 +876,6 @@ sub cache_info_from_madison {
             else {
                 say "Error for $url: ($hdr->{Status}) $hdr->{Reason}";
             }
-            undef $request;
         }
     );
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git



More information about the Pkg-perl-cvs-commits mailing list