Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-XMPP CPAN distribution.

Report information
The Basics
Id: 61611
Status: open
Priority: 3/
Queue: Net-XMPP

People
Owner: Nobody in particular
Requestors: linus.widstromer [...] it.su.se
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.02
  • 1.02_01
Fixed in: (no value)



Subject: String comparison with != rather than ne
Date: Fri, 24 Sep 2010 17:00:11 +0200
To: bug-Net-XMPP [...] rt.cpan.org
From: linus.widstromer [...] it.su.se (Linus Widströmer)
lib/Net/XMPP/Protocol.pm line 3236 improperly uses != for string comparison, which results in: Show quoted text
> Argument "HASH" isn't numeric in numeric ne (!=) at > /usr/share/perl5/Net/XMPP/Protocol.pm line 3235, <DATA> line 466.
Attaching a patch.
--- Protocol.pm 2007-03-29 14:24:35.000000000 +0200 +++ Protocol_fix.pm 2010-09-24 16:56:53.234080033 +0200 @@ -3233,7 +3233,7 @@ $self->{DEBUG}->Log1("callbackIQ: type($type) ns($ns)"); if (exists($self->{CB}->{IQns}->{$ns}) - && (ref($self->{CB}->{IQns}->{$ns}) != 'HASH' ) + && (ref($self->{CB}->{IQns}->{$ns}) ne 'HASH' ) ) { $self->{DEBUG}->Log1("callbackIQ: goto user function( $self->{CB}->{IQns}->{$ns} )");
Linus Widströmer Stockholm University
Linus, Please try to attached developer pre-release versions of XML::Stream and Net::XMPP. Please note that these version now require that you specify a path to SSL CA cert(s) for verifying the server's certificate if you are using SSL or TLS. Thanks, Darian
Subject: XML-Stream-1.23_04.tar.gz
Download XML-Stream-1.23_04.tar.gz
application/x-gzip 77.1k

Message body not shown because it is not plain text.

Subject: Net-XMPP-1.02_02.tar.gz
Download Net-XMPP-1.02_02.tar.gz
application/x-gzip 123k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #61611] String comparison with != rather than ne
Date: Fri, 24 Sep 2010 17:43:38 +0200
To: bug-Net-XMPP [...] rt.cpan.org
From: linus.widstromer [...] it.su.se (Linus Widströmer)
Hi Darian, the numerical compare seems to exist in that pre-release as well; line 3248. Should probably be replaced with an "ne". Best regards, Linus "Darian Anthony Patrick via RT" <bug-Net-XMPP@rt.cpan.org> writes: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61611 > > > Linus, > > Please try to attached developer pre-release versions of XML::Stream and > Net::XMPP. > > Please note that these version now require that you specify a path to > SSL CA cert(s) for verifying the server's certificate if you are using > SSL or TLS. > > Thanks, > > Darian
Linus, Thanks. This now patched and committed to the source tree. I'm going to hold off for a couple more days before publishing another developer release. For now, you may install directly from github using cpanminus like so: cpanm http://github.com/dap/Net-XMPP/tarball/master Best, Darian
From: whynot [...] pozharski.name
On Fri Sep 24 13:12:41 2010, DAPATRICK wrote: Show quoted text
> This now patched and committed to the source tree.
Excuse me, what are you doing? You've changed numerical '!=' with stringwise 'eq'. And then five lines ahead you're using that HASH ref as a CODE ref. Please, either check for CODE or check with 'ne', as suggested.
Subject: callbackIQ.diff
diff -ur backup-1.002004/lib/Net/XMPP/Protocol.pm callbackIQ/lib/Net/XMPP/Protocol.pm --- backup-1.002004/lib/Net/XMPP/Protocol.pm 2011-07-19 19:58:40.000000000 +0300 +++ callbackIQ/lib/Net/XMPP/Protocol.pm 2012-01-28 01:14:50.000000000 +0200 @@ -3530,7 +3530,7 @@ $self->{DEBUG}->Log1("callbackIQ: type($type) ns($ns)"); if (exists($self->{CB}->{IQns}->{$ns}) - && (ref($self->{CB}->{IQns}->{$ns}) eq 'HASH' ) + && (ref($self->{CB}->{IQns}->{$ns}) eq 'CODE' ) ) { $self->{DEBUG}->Log1("callbackIQ: goto user function( $self->{CB}->{IQns}->{$ns} )");