r61159 - in /branches/upstream/libnet-stomp-perl/current: CHANGES MANIFEST.SKIP META.yml Makefile.PL lib/Net/Stomp.pm lib/Net/Stomp/Frame.pm

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Wed Aug 4 07:40:55 UTC 2010


Author: ansgar-guest
Date: Wed Aug  4 07:40:35 2010
New Revision: 61159

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=61159
Log:
[svn-upgrade] new version libnet-stomp-perl (0.38)

Modified:
    branches/upstream/libnet-stomp-perl/current/CHANGES
    branches/upstream/libnet-stomp-perl/current/MANIFEST.SKIP
    branches/upstream/libnet-stomp-perl/current/META.yml
    branches/upstream/libnet-stomp-perl/current/Makefile.PL
    branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp.pm
    branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp/Frame.pm

Modified: branches/upstream/libnet-stomp-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-stomp-perl/current/CHANGES?rev=61159&op=diff
==============================================================================
--- branches/upstream/libnet-stomp-perl/current/CHANGES (original)
+++ branches/upstream/libnet-stomp-perl/current/CHANGES Wed Aug  4 07:40:35 2010
@@ -1,4 +1,9 @@
 Revision history for Perl module Net::Stomp:
+
+0.38 Tue Aug 03 13:58:10 BST 2010
+  - Fix an issue with IO::Handle buffering interfering with IO::Select. This
+    manifested as receive_frame hanging, or as if not all messages would get
+    delivered to the client. (RT 44629)
 
 0.37 Fri May 28 15:26:17 BST 2010
   - Report a proper error if non-SSL STOMP server is not listening rather than

Modified: branches/upstream/libnet-stomp-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-stomp-perl/current/MANIFEST.SKIP?rev=61159&op=diff
==============================================================================
--- branches/upstream/libnet-stomp-perl/current/MANIFEST.SKIP (original)
+++ branches/upstream/libnet-stomp-perl/current/MANIFEST.SKIP Wed Aug  4 07:40:35 2010
@@ -3,6 +3,8 @@
 ^Build$
 ^Makefile
 
+^\.DS_Store
+^Net-Stomp-.*
 \.tar\.gz$
 ^\.git
 \.swp$

Modified: branches/upstream/libnet-stomp-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-stomp-perl/current/META.yml?rev=61159&op=diff
==============================================================================
--- branches/upstream/libnet-stomp-perl/current/META.yml (original)
+++ branches/upstream/libnet-stomp-perl/current/META.yml Wed Aug  4 07:40:35 2010
@@ -4,7 +4,7 @@
   - "Leon Brocard <acme at astray.com>.\nThom May <thom.may at betfair.com>.\nAsh Berlin <ash_github at firemirror.com>."
 configure_requires:
   Module::Build: 0.36
-generated_by: 'Module::Build version 0.3607'
+generated_by: 'Module::Build version 0.3603'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -13,7 +13,7 @@
 provides:
   Net::Stomp:
     file: lib/Net/Stomp.pm
-    version: 0.37
+    version: 0.38
   Net::Stomp::Frame:
     file: lib/Net/Stomp/Frame.pm
 requires:
@@ -22,4 +22,4 @@
   IO::Socket::INET: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.37
+version: 0.38

Modified: branches/upstream/libnet-stomp-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-stomp-perl/current/Makefile.PL?rev=61159&op=diff
==============================================================================
--- branches/upstream/libnet-stomp-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-stomp-perl/current/Makefile.PL Wed Aug  4 07:40:35 2010
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.3607
+# Note: this file was auto-generated by Module::Build::Compat version 0.3603
 use ExtUtils::MakeMaker;
 WriteMakefile
 (

Modified: branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp.pm?rev=61159&op=diff
==============================================================================
--- branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp.pm (original)
+++ branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp.pm Wed Aug  4 07:40:35 2010
@@ -6,7 +6,7 @@
 use Net::Stomp::Frame;
 use Carp;
 use base 'Class::Accessor::Fast';
-our $VERSION = '0.37';
+our $VERSION = '0.38';
 __PACKAGE__->mk_accessors( qw(
     _cur_host failover hostname hosts port select serial session_id socket ssl
     ssl_options subscriptions _connect_headers

Modified: branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp/Frame.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp/Frame.pm?rev=61159&op=diff
==============================================================================
--- branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp/Frame.pm (original)
+++ branches/upstream/libnet-stomp-perl/current/lib/Net/Stomp/Frame.pm Wed Aug  4 07:40:35 2010
@@ -42,6 +42,23 @@
     $frame .= "\000";
 }
 
+# NBK - $sock->getline does buffered IO which screws up select.  Use
+# sysread one char at a time to avoid reading part of the next line.
+sub _readline {
+    my($self, $socket, $terminator, $msg) = @_;
+
+    $terminator = "\n" unless defined($terminator);
+    $msg ||= "";
+
+    my $s = "";
+    while( 1 ) {
+        $socket->sysread($s, 1, length($s)) or die("Error reading $msg: $!");
+        last if substr($s, -1) eq $terminator;
+    }
+
+    return $s;
+}
+
 sub parse {
     my ( $package, $socket ) = @_;
     local $/ = "\n";
@@ -49,7 +66,7 @@
     # read the command
     my $command;
     while (1) {
-        $command = $socket->getline || die "Error reading command: $!";
+        $command = $package->_readline($socket, "\n", "command");
         chop $command;
         last if $command;
     }
@@ -57,31 +74,29 @@
     # read headers
     my $headers;
     while (1) {
-        my $line = $socket->getline || die "Error reading header: $!";
+        my $line = $package->_readline($socket, "\n", "header");
         chop $line;
         last if $line eq "";
-        my ( $key, $value ) = split /: ?/, $line, 2;
+        my ( $key, $value ) = split(/: ?/, $line, 2);
         $headers->{$key} = $value;
     }
 
     # read the body
     my $body;
+    my $c;
     if ( $headers->{"content-length"} ) {
-        $socket->read( $body, $headers->{"content-length"} )
+        $socket->sysread( $body, $headers->{"content-length"} + 1 )
             || die "Error reading body: $!";
-        $socket->getc;    # eat the trailing null
         $headers->{bytes_message} = 1;
     } else {
-        while (1) {
-            my $byte = $socket->getc;
-            die "Error reading body: $!" unless defined $byte;
-            last if $byte eq "\000";
-            $body .= $byte;
-        }
+        $body = $package->_readline($socket, "\000", "body");
     }
-
+    # strip trailing null
+    $body =~ s/\000$//;
+    
     my $frame = Net::Stomp::Frame->new(
         { command => $command, headers => $headers, body => $body } );
+
     return $frame;
 }
 




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