[libhijk-perl] 03/05: Fix a relatively minor regression in 0.12-45-g972c2f2

Robin Sheat eythian-guest at moszumanska.debian.org
Thu Feb 12 21:55:46 UTC 2015


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

eythian-guest pushed a commit to annotated tag 0.19
in repository libhijk-perl.

commit c2ec53749e59093f35d4b793cc5234985968ca8c
Author: Ævar Arnfjörð Bjarmason <avarab at gmail.com>
Date:   Sat Jan 10 16:23:50 2015 +0000

    Fix a relatively minor regression in 0.12-45-g972c2f2
    
    While I'm at it make the variable declaration less confusing by using
    the same order as the assignment.
---
 Changes     | 6 ++++++
 lib/Hijk.pm | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Changes b/Changes
index 001bc46..b075d96 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,9 @@
+0.19: # 
+- Fix a minor regression in 0.16: The introduction of "head_as_array"
+  broke the "proto" part of the return value in a relatively obscure
+  edge case where we'd read the header & had no Content-Length and
+  couldn't read() anything.
+
 0.18: # 2014-12-10T14:00:00+000
 - We now do the right thing on "method => 'HEAD'". I.e. ignore the
   Content-Length parameter, previously we'd just hang trying to slurp
diff --git a/lib/Hijk.pm b/lib/Hijk.pm
index 382ad7e..c403cae 100644
--- a/lib/Hijk.pm
+++ b/lib/Hijk.pm
@@ -34,7 +34,7 @@ sub _read_http_message {
             if ((select($rin, undef, undef, $read_timeout) != 1) || (defined($read_timeout) && $read_timeout <= 0));
 
         my $nbytes = POSIX::read($fd, $buf, $read_length);
-        return ($proto, undef, $status_code, $header, $body)
+        return (undef, $proto, $status_code, $header, $body)
             if $no_content_len && $decapitated && (!defined($nbytes) || $nbytes == 0);
         if (!defined($nbytes)) {
             next if ($! == EWOULDBLOCK || $! == EAGAIN);
@@ -336,7 +336,7 @@ sub request {
         $left -= $rc;
     }
 
-    my ($proto,$close_connection,$status,$head,$body,$error,$error_message,$errno_number,$errno_string);
+    my ($close_connection,$proto,$status,$head,$body,$error,$error_message,$errno_number,$errno_string);
     eval {
         ($close_connection,$proto,$status,$head,$body,$error,$error_message,$errno_number,$errno_string) =
         _read_http_message(fileno($soc), @$args{qw(read_length read_timeout parse_chunked head_as_array method)});

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



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