Fixed buffer bug in HTTP::Body::OctetStream
Christian Hansen [Tue, 22 Nov 2005 23:20:47 +0000 (23:20 +0000)]
Changes
lib/HTTP/Body.pm
lib/HTTP/Body/OctetStream.pm

diff --git a/Changes b/Changes
index 79c1422..1d38134 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for Perl extension HTTP::Body.
 
+0.6   2005-11-00 00:00:00
+        - Fixed buffer bug in OctetStream, reported by Daisuke Murase <typester@cpan.org>.
+
 0.5   2005-11-17 00:00:00
         - Updated for PAR compatibility
 
index 792dcda..13ae9c3 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 
 use Carp       qw[ ];
 
-our $VERSION = '0.5';
+our $VERSION = 0.6;
 
 our $TYPES = {
     'application/octet-stream'          => 'HTTP::Body::OctetStream',
index 23a834a..05c3cd2 100644 (file)
@@ -34,7 +34,7 @@ sub spin {
     }
 
     if ( my $length = length( $self->{buffer} ) ) {
-        $self->body->write( substr( $self->{buffer}, 0, $length ), $length );
+        $self->body->write( substr( $self->{buffer}, 0, $length, '' ), $length );
     }
 
     if ( $self->length == $self->content_length ) {