Hello community,

here is the log from the commit of package perl-Net-HTTP for openSUSE:Factory 
checked in at 2013-06-14 16:47:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Net-HTTP (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Net-HTTP.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Net-HTTP"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Net-HTTP/perl-Net-HTTP.changes      
2012-02-17 12:08:06.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Net-HTTP.new/perl-Net-HTTP.changes 
2013-06-14 16:47:02.000000000 +0200
@@ -1,0 +2,7 @@
+Wed Jun  5 19:17:49 UTC 2013 - co...@suse.com
+
+- updated to 6.06
+      IO::Socket::SSL doesn't play well with select() [RT#81237]
+      Convert to Test::More style and disable test on Windows [RT#81090]
+
+-------------------------------------------------------------------

Old:
----
  Net-HTTP-6.03.tar.gz

New:
----
  Net-HTTP-6.06.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Net-HTTP.spec ++++++
--- /var/tmp/diff_new_pack.qjLNBW/_old  2013-06-14 16:47:03.000000000 +0200
+++ /var/tmp/diff_new_pack.qjLNBW/_new  2013-06-14 16:47:03.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Net-HTTP
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Net-HTTP
-Version:        6.03
+Version:        6.06
 Release:        0
 %define cpan_name Net-HTTP
 Summary:        Low-level HTTP connection (client)
@@ -35,6 +35,7 @@
 #BuildRequires: perl(IO::Uncompress::Gunzip)
 #BuildRequires: perl(Net::HTTP)
 #BuildRequires: perl(Net::HTTP::Methods)
+#BuildRequires: perl(Net::HTTP::NB)
 #BuildRequires: perl(Net::HTTPS)
 #BuildRequires: perl(Net::SSL)
 Requires:       perl(Compress::Raw::Zlib)

++++++ Net-HTTP-6.03.tar.gz -> Net-HTTP-6.06.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/Changes new/Net-HTTP-6.06/Changes
--- old/Net-HTTP-6.03/Changes   2012-02-16 21:19:50.000000000 +0100
+++ new/Net-HTTP-6.06/Changes   2013-03-10 23:37:09.000000000 +0100
@@ -1,4 +1,42 @@
 _______________________________________________________________________________
+2013-03-10 Net-HTTP 6.06
+
+Jesse Luehrs (1):
+      IO::Socket::SSL doesn't play well with select() [RT#81237]
+
+
+
+_______________________________________________________________________________
+2012-11-10 Net-HTTP 6.05
+
+Gisle Aas (1):
+      Convert to Test::More style and disable test on Windows [RT#81090]
+
+Marinos Yannikos (1):
+      SSL broken for some servers [RT#81073]
+
+
+
+_______________________________________________________________________________
+2012-11-08 Net-HTTP 6.04
+
+Gisle Aas (3):
+      Simpler handling of double chunked [RT#77240]
+      Check for timeouts before reading [RT#72676]
+      Fake can_read
+
+Dagfinn Ilmari Mannsåker (1):
+      Fix chunked decoding on temporary read error [RT#74431]
+
+Eric Wong (1):
+      NB: set http_bytes if read_entity_body hits EAGAIN on first read
+
+Jay Hannah (1):
+      chunked,chunked is invalid, but happens. :( Ignore all but the first. 
[RT#77240]
+
+
+
+_______________________________________________________________________________
 2012-02-16 Net-HTTP 6.03
 
 Restore blocking override for Net::SSL [RT#72790]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/MANIFEST new/Net-HTTP-6.06/MANIFEST
--- old/Net-HTTP-6.03/MANIFEST  2012-02-16 21:21:35.000000000 +0100
+++ new/Net-HTTP-6.06/MANIFEST  2013-03-10 23:38:46.000000000 +0100
@@ -7,6 +7,7 @@
 MANIFEST                       This list of files
 README
 t/http.t
+t/http-nb.t
 t/apache.t
 t/apache-https.t
 META.yml                                 Module meta-data (added by MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/META.yml new/Net-HTTP-6.06/META.yml
--- old/Net-HTTP-6.03/META.yml  2012-02-16 21:21:35.000000000 +0100
+++ new/Net-HTTP-6.06/META.yml  2013-03-10 23:38:46.000000000 +0100
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Net-HTTP
-version:            6.03
+version:            6.06
 abstract:           Low-level HTTP connection (client)
 author:
     - Gisle Aas <gi...@activestate.com>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/lib/Net/HTTP/Methods.pm 
new/Net-HTTP-6.06/lib/Net/HTTP/Methods.pm
--- old/Net-HTTP-6.03/lib/Net/HTTP/Methods.pm   2012-02-15 20:42:03.000000000 
+0100
+++ new/Net-HTTP-6.06/lib/Net/HTTP/Methods.pm   2013-03-10 23:35:43.000000000 
+0100
@@ -5,7 +5,7 @@
 use strict;
 use vars qw($VERSION);
 
-$VERSION = "6.00";
+$VERSION = "6.06";
 
 my $CRLF = "\015\012";   # "\r\n" is not portable
 
@@ -233,6 +233,7 @@
            return length($_[0]);
        }
        else {
+           die "read timeout" unless $self->can_read;
            return $self->sysread($_[0], $len);
        }
     }
@@ -255,15 +256,10 @@
            # need to read more data to find a line ending
           READ:
             {
+                die "read timeout" unless $self->can_read;
                 my $n = $self->sysread($_, 1024, length);
                 unless (defined $n) {
-                    redo READ if $!{EINTR};
-                    if ($!{EAGAIN}) {
-                        # Hmm, we must be reading from a non-blocking socket
-                        # XXX Should really wait until this socket is 
readable,...
-                        select(undef, undef, undef, 0.1);  # but this will do 
for now
-                        redo READ;
-                    }
+                    redo READ if $!{EINTR} || $!{EAGAIN};
                     # if we have already accumulated some data let's at least
                     # return that as a line
                     die "$what read failed: $!" unless length;
@@ -284,6 +280,38 @@
 }
 
 
+sub can_read {
+    my $self = shift;
+    return 1 unless defined(fileno($self));
+    return 1 if $self->isa('IO::Socket::SSL') && $self->pending;
+
+    # With no timeout, wait forever.  An explict timeout of 0 can be
+    # used to just check if the socket is readable without waiting.
+    my $timeout = @_ ? shift : (${*$self}{io_socket_timeout} || undef);
+
+    my $fbits = '';
+    vec($fbits, fileno($self), 1) = 1;
+  SELECT:
+    {
+        my $before;
+        $before = time if $timeout;
+        my $nfound = select($fbits, undef, undef, $timeout);
+        if ($nfound < 0) {
+            if ($!{EINTR} || $!{EAGAIN}) {
+                # don't really think EAGAIN can happen here
+                if ($timeout) {
+                    $timeout -= time - $before;
+                    $timeout = 0 if $timeout < 0;
+                }
+                redo SELECT;
+            }
+            die "select failed: $!";
+        }
+        return $nfound > 0;
+    }
+}
+
+
 sub _rbuf {
     my $self = shift;
     if (@_) {
@@ -415,6 +443,7 @@
            my @te = split(/\s*,\s*/, lc($te));
            die "Chunked must be last Transfer-Encoding '$te'"
                unless pop(@te) eq "chunked";
+           pop(@te) while @te && $te[-1] eq "chunked";  # ignore repeated 
chunked spec
 
            for (@te) {
                if ($_ eq "deflate" && inflate_ok()) {
@@ -489,6 +518,7 @@
                die "Bad chunk-size in HTTP response: $line";
            }
            $chunked = hex($1);
+           ${*$self}{'http_chunked'} = $chunked;
            if ($chunked == 0) {
                ${*$self}{'http_trailers'} = [$self->_read_header_lines];
                $$buf_ref = "";
@@ -536,8 +566,7 @@
        my $n = $bytes;
        $n = $size if $size && $size < $n;
        $n = my_read($self, $$buf_ref, $n);
-       return undef unless defined $n;
-       ${*$self}{'http_bytes'} = $bytes - $n;
+       ${*$self}{'http_bytes'} = defined $n ? $bytes - $n : $bytes;
        return $n;
     }
     else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/lib/Net/HTTP/NB.pm 
new/Net-HTTP-6.06/lib/Net/HTTP/NB.pm
--- old/Net-HTTP-6.03/lib/Net/HTTP/NB.pm        2012-02-15 20:42:03.000000000 
+0100
+++ new/Net-HTTP-6.06/lib/Net/HTTP/NB.pm        2012-11-08 19:54:52.000000000 
+0100
@@ -3,11 +3,15 @@
 use strict;
 use vars qw($VERSION @ISA);
 
-$VERSION = "6.00";
+$VERSION = "6.04";
 
 require Net::HTTP;
 @ISA=qw(Net::HTTP);
 
+sub can_read {
+    return 1;
+}
+
 sub sysread {
     my $self = $_[0];
     if (${*$self}{'httpnb_read_count'}++) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/lib/Net/HTTP.pm 
new/Net-HTTP-6.06/lib/Net/HTTP.pm
--- old/Net-HTTP-6.03/lib/Net/HTTP.pm   2012-02-16 21:17:26.000000000 +0100
+++ new/Net-HTTP-6.06/lib/Net/HTTP.pm   2013-03-10 23:35:20.000000000 +0100
@@ -3,7 +3,7 @@
 use strict;
 use vars qw($VERSION @ISA $SOCKET_CLASS);
 
-$VERSION = "6.03";
+$VERSION = "6.06";
 unless ($SOCKET_CLASS) {
     eval { require IO::Socket::INET } || require IO::Socket;
     $SOCKET_CLASS = "IO::Socket::INET";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/lib/Net/HTTPS.pm 
new/Net-HTTP-6.06/lib/Net/HTTPS.pm
--- old/Net-HTTP-6.03/lib/Net/HTTPS.pm  2012-02-15 20:42:03.000000000 +0100
+++ new/Net-HTTP-6.06/lib/Net/HTTPS.pm  2012-11-08 19:54:51.000000000 +0100
@@ -3,7 +3,7 @@
 use strict;
 use vars qw($VERSION $SSL_SOCKET_CLASS @ISA);
 
-$VERSION = "6.02";
+$VERSION = "6.04";
 
 # Figure out which SSL implementation to use
 if ($SSL_SOCKET_CLASS) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/t/http-nb.t 
new/Net-HTTP-6.06/t/http-nb.t
--- old/Net-HTTP-6.03/t/http-nb.t       1970-01-01 01:00:00.000000000 +0100
+++ new/Net-HTTP-6.06/t/http-nb.t       2012-11-10 16:09:32.000000000 +0100
@@ -0,0 +1,53 @@
+#!perl -w
+
+use strict;
+use Test::More;
+plan skip_all => "This test doesn't work on Windows" if $^O eq "MSWin32";
+
+plan tests => 14;
+
+require Net::HTTP::NB;
+use IO::Socket::INET;
+use Data::Dumper;
+use IO::Select;
+use Socket qw(TCP_NODELAY);
+my $buf;
+
+# bind a random TCP port for testing
+my %lopts = (
+    LocalAddr => "127.0.0.1",
+    LocalPort => 0,
+    Proto => "tcp",
+    ReuseAddr => 1,
+    Listen => 1024
+);
+
+my $srv = IO::Socket::INET->new(%lopts);
+is(ref($srv), "IO::Socket::INET");
+my $host = $srv->sockhost . ':' . $srv->sockport;
+my $nb = Net::HTTP::NB->new(Host => $host, Blocking => 0);
+is(ref($nb), "Net::HTTP::NB");
+is(IO::Select->new($nb)->can_write(3), 1);
+
+ok($nb->write_request("GET", "/"));
+my $acc = $srv->accept;
+is(ref($acc), "IO::Socket::INET");
+$acc->sockopt(TCP_NODELAY, 1);
+ok($acc->sysread($buf, 4096));
+ok($acc->syswrite("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"));
+
+is(1, IO::Select->new($nb)->can_read(3));
+my @r = $nb->read_response_headers;
+is($r[0], 200);
+
+# calling read_entity_body before response body is readable causes
+# EOF to never happen eventually
+ok(!defined($nb->read_entity_body($buf, 4096)) && $!{EAGAIN});
+
+is($acc->syswrite("hello"), 5, "server wrote response body");
+
+is(IO::Select->new($nb)->can_read(3), 1, "client body is readable");
+is($nb->read_entity_body($buf, 4096), 5, "client gets 5 bytes");
+
+# this fails if we got EAGAIN from the first read_entity_body call:
+is($nb->read_entity_body($buf, 4096), 0, "client gets EOF");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-HTTP-6.03/t/http.t new/Net-HTTP-6.06/t/http.t
--- old/Net-HTTP-6.03/t/http.t  2012-02-15 20:42:03.000000000 +0100
+++ new/Net-HTTP-6.06/t/http.t  2012-06-10 23:22:12.000000000 +0200
@@ -3,7 +3,7 @@
 use strict;
 use Test;
 
-plan tests => 34;
+plan tests => 37;
 #use Data::Dump ();
 
 my $CRLF = "\015\012";
@@ -19,7 +19,8 @@
       a => { "/" => "HTTP/1.0 200 OK${CRLF}Content-Type: 
text/plain${CRLF}Content-Length: 6${CRLF}${CRLF}Hello\n",
             "/bad1" => "HTTP/1.0 200 OK${LF}Server: foo${LF}HTTP/1.0 200 
OK${LF}Content-type: text/foo${LF}${LF}abc\n",
             "/09" => "Hello${CRLF}World!${CRLF}",
-            "/chunked" => "HTTP/1.1 200 OK${CRLF}Transfer-Encoding: 
chunked${CRLF}${CRLF}0002; foo=3; 
bar${CRLF}He${CRLF}1${CRLF}l${CRLF}2${CRLF}lo${CRLF}0000${CRLF}Content-MD5: 
xxx${CRLF}${CRLF}",
+            "/chunked"         => "HTTP/1.1 200 OK${CRLF}Transfer-Encoding: 
chunked${CRLF}${CRLF}0002; foo=3; 
bar${CRLF}He${CRLF}1${CRLF}l${CRLF}2${CRLF}lo${CRLF}0000${CRLF}Content-MD5: 
xxx${CRLF}${CRLF}",
+            "/chunked,chunked" => "HTTP/1.1 200 OK${CRLF}Transfer-Encoding: 
chunked${CRLF}Transfer-Encoding: chunked${CRLF}${CRLF}0002; foo=3; 
bar${CRLF}He${CRLF}1${CRLF}l${CRLF}2${CRLF}lo${CRLF}0000${CRLF}Content-MD5: 
xxx${CRLF}${CRLF}",
             "/head" => "HTTP/1.1 200 OK${CRLF}Content-Length: 
16${CRLF}Content-Type: text/plain${CRLF}${CRLF}",
             "/colon-header" => "HTTP/1.1 200 OK${CRLF}Content-Type: 
text/plain${CRLF}Content-Length: 6${CRLF}Bad-Header: :foo${CRLF}${CRLF}Hello\n",
           },
@@ -137,6 +138,7 @@
 ok($res->{content}, "TRACE /foo HTTP/1.1${CRLF}Connection: close${CRLF}Host: 
a${CRLF}${CRLF}");
 
 # try a bad one
+# It's bad because 2nd 'HTTP/1.0 200' is illegal. But passes anyway if laxed 
=> 1.
 $res = $h->request(GET => "/bad1", [], {laxed => 1});
 ok($res->{code}, "200");
 ok($res->{message}, "OK");
@@ -171,6 +173,12 @@
 ok($res->{content}, "Hello");
 ok("@{$res->{headers}}", "Transfer-Encoding chunked Content-MD5 xxx");
 
+# Test bogus headers. Chunked appearing twice is illegal, but happens anyway 
sometimes. [RT#77240]
+$res = $h->request(GET => "/chunked,chunked");
+ok($res->{code}, "200");
+ok($res->{content}, "Hello");
+ok("@{$res->{headers}}", "Transfer-Encoding chunked Transfer-Encoding chunked 
Content-MD5 xxx");
+
 # test head
 $res = $h->request(HEAD => "/head");
 ok($res->{code}, "200");

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to