Subject: | Net::STOMP::Client::IO::send_data BUG |
Date: | Tue, 28 Oct 2014 02:42:56 +0000 |
To: | "bug-Net-STOMP-Client [...] rt.cpan.org" <bug-Net-STOMP-Client [...] rt.cpan.org> |
From: | Pedro Morales <pedrom [...] ccbill.com> |
Hey team,
We've used this for a long time. No issues works great. However, we recently upgraded to perl 5.10 and we have found an issue. Let me know what you guys think.
Distro name and version: Net-STOMP-Client-2.2
Perl: v5.10.1 (*) built for x86_64-linux-thread-multi
OS vendor/version: x86_64 GNU/Linux
Pseudo code:
my $stompFrame = Net::STOMP::Client::Frame->new(
command => 'SEND',
headers => {
destination => '/queue/MYQUEUE',
'content-length' => '',
},
body => '<xml><testvalue>1</testvalue></xml>',
);
if (!Net::STOMP::Client::send_frame($stompFrame)){
print STDERR "Unable to send stomp packet to /queue/MYQUEUE\n";
return 0;
}
This is how we have our code implemented. The issue is that it seems that in the new version of PERL Net::STOMP::Client::send_frame doesn't actually return the number of bytes written. I did a little digging and I found the following snippet in there for that method:
sub send_frame : method {
my($self, $frame, %option);
$self = shift(@_);
$frame = shift(@_);
%option = _hackopt(@_);
# queue the frame
$self->queue_frame($frame, %option);
# send queued data
$self->send_data(%option);
# make sure we did send _all_ data
dief("could not send all data!") if $self->outgoing_buffer_length();
}
Do you see how send_frame doesn't have an explicit return value? Normally, this would return the last statement executed ($self->send_data()) however, it seems as of the new version of PERL it's not. I keep getting 0 which im guessing is coming from the last statement's $self->outgoing_buffer_length(). FYI, this doesn't cause any deal breaking issues. The frame still gets sent to the queue its just the way we test the condition for true fails now and we print the "Unable to send stomp packet... "message in our logs repeatedly.
Let me know if any of this doesn't make sense. Could it be a bug in PERL? Now that it's behaving differently? Are you able to reproduce this behavior in PERL 5.10? For reference, we have this implementation working on LIVE environment using PERL 5.8.7
Thanks.
Pedro M
Software Developer II
T 480.449.7751 ext. 143
M 602.206.1447
F 480.422.2038
E pedrom@ccbill.com
<mailto:pedrom@ccbill.com> http://www.ccbill.com/
[CCBill, LLC]<http://www.ccbill.com/>
CCBill, LLC * 2353 W University Dr. * Tempe, AZ 85281 * USA
Message body is not shown because it is too large.