Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
MemoryBuffer.pm is implemented as follows, but it doesn't raise a TTransportException when no data is available.
lib/perl/lib/Thrift/MemoryBuffer.pm
113 sub readAll 114 { 115 my $self = shift; 116 my $len = shift; 117 118 my $avail = ($self->{wPos} - $self->{rPos}); 119 if ($avail < $len) { 120 die TTransportException->new("Attempt to readAll($len) found only $avail available", 121 Thrift::TTransportException::END_OF_FILE); 122 } 123
Instead, it dies due to a wrong package name as follows. The right name is Thrift::TTransportException.
$ perl -Ilib -de 1 (snip) DB<1> use Thrift::BinaryProtocol DB<2> use Thrift::MemoryBuffer DB<3> $trans = Thrift::MemoryBuffer->new DB<4> $proto = Thrift::BinaryProtocol->new($trans) DB<5> $s DB<6> $proto->readString(\$s) Can't locate object method "new" via package "TTransportException" (perhaps you forgot to load "TTransportException"?) at lib/Thrift/MemoryBuffer.pm line 120.
Attachments
Issue Links
- links to