Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.2
-
None
-
Debian Linux 5.0 (stable), Perl 5.10.0.
-
Patch Available
Description
The Perl code generator creates code for containers which doesn't count the length of their begin and end data, with the result that calling write on anything involving a map returns a length that's 6 bytes shorter than the actual amount written. The fix seems pretty obvious, adding $xfer += to the relevant lines in t_perl_generator::generate_serialize_container(). Here's an example of current generated code for example - note the lack of $xfer += before $output->writeMapBegin or ...End:
if (defined $self->
{fname}) {
$xfer += $output->writeFieldBegin('fname', TType::MAP, 3);
{
$output->writeMapBegin(TType::STRING, TType::STRING, scalar(keys %{$self->{fname}}));
{
while( my ($kiter7,$viter8) = each %{$self->{fname}})
}
$output->writeMapEnd();
}
$xfer += $output->writeFieldEnd();
}