Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.26
-
None
Description
perl qpid client's qpid::messaging::Message() does not handle properly non-quoted floats in message properties.
Let's have following snippet:
- cat /tmp/a.pl
use qpid;
use Time::HiRes qw( time sleep );
use Data::Dumper;
- get_time()
- get precise time since epoch as float [ ~ time.time()]
sub get_time {
return ( time() );
}
my $message = new qpid::messaging::Message();
my $time = get_time();
$message->set_property('ts-float', $time);
$message->set_property('ts-int', 4);
$message->set_property('ts-nint', -4);
$message->set_property('ts-str', "4.556");
print $time;
print "\n";
print $message->get_properties();
print "\n";
print Dumper($message->get_properties());
print "\n";
print $message->get_properties()->
;
print "\n";
exit
When executed you can see ts-float' hash value is not carried properly.
- perl -W /tmp/a.pl
1397412379.47217
HASH(0x1c03720)
$VAR1 = { 'ts-int' => 4, 'ts-str' => '4.556', 'ts-nint' => -4, 'ts-float' => '1397412352' };
1397412352
Float value is read back as int which is incorrect.