Skip Menu |

This queue is for tickets about the POE-Filter-XML CPAN distribution.

Report information
The Basics
Id: 22288
Status: resolved
Priority: 0/
Queue: POE-Filter-XML

People
Owner: nperez [...] cpan.org
Requestors: ewaters [...] uarc.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.1
  • 0.1.1
  • 0.2.0
  • 0.2.1
  • 0.21
  • 0.22
  • 0.23
  • 0.24
  • 0.27
  • 0.28
  • 0.29
Fixed in: 0.30



Subject: Deleting callback upon reset()
Date: Thu, 19 Oct 2006 15:47:39 -0600
To: bug-POE-Filter-XML [...] rt.cpan.org
From: Eric Waters <ewaters [...] uarc.com>
Distribution: POE-Filter-XML-0.29 File: POE-Filter-XML-0.29/lib/POE/Filter/XML.pm Line: 91 Problems: Code deletes the callback if it's not passed to reset(). This breaks the callback if the users resets the filter. There's no need for this, and is a bug. Eric Waters -- Email signed with GnuPG key id 0x7FE92A42 http://www.vegcrew.net/~ewaters/pubkey.asc
Download (untitled)
application/pgp-signature 189b

Message body not shown because it is not plain text.

From: NPEREZ [...] cpan.org
Hi Eric, This is not a bug. reset() does as it was intended to do which is reset the state of the Filter. The callback may very well be context dependant and once the filter is reset, calling the wrong callback may have other developers complain to me about the opposite of what you are complaining about. You do unintentionally bring up a good point: the error callback needs more than one entry point (aka. get_error_callback(), set_error_callback()) and I believe I will implement this in the next release. This way when you need to reset() the filter, you can retain your same callback coderef. Thanks, Nick On Thu Oct 19 17:48:17 2006, ewaters@uarc.com wrote: Show quoted text
> Distribution: POE-Filter-XML-0.29 > > File: POE-Filter-XML-0.29/lib/POE/Filter/XML.pm > Line: 91 > > Problems: > > Code deletes the callback if it's not passed to reset(). This breaks > the callback if the users resets the filter. There's no need for > this, and is a bug. > > Eric Waters
Subject: Re: [rt.cpan.org #22288] Deleting callback upon reset()
Date: Fri, 20 Oct 2006 08:55:05 -0600
To: via RT <bug-POE-Filter-XML [...] rt.cpan.org>
From: Eric Waters <ewaters [...] uarc.com>
I hate to argue the point, but if this is not a bug, I'll have to submit another bug: File: POE-Component-Jabber-1.21/lib/POE/Component/Jabber/Server/Socket.pm On line 61: $heap->{'filter'} = POE::Filter::XML->new(undef, $heap->{'callback'}); the POE::Filter::XML object is created with the defined callback in the build_socket() subroutine. Later, in step_tls() (line 88) and step_sasl() (line 131) the filter is reset: $heap->{'filter'}->reset(); Since you're stating that it's somehow expected (but not documented I might add) that the reset will clear the callback, these two lines need to be changed to: $heap->{'filter'}->reset( $heap->{'callback'} ); I'd like to point out that the meta is not deleted if it's not passed to reset(), but callback is. Just seems inconsistent. Also, please change documentation. It currently reads: Since POE::Filter::XML follows the POE::Filter API look to POE::Filter for documentation. The only method covered here is new() It should mention reset() as well since this is a custom function and not part of the POE::Filter API. Eric On Thu, Oct 19, 2006 at 06:26:42PM -0400, via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=22288 > > > Hi Eric, > > This is not a bug. reset() does as it was intended to do which is reset > the state of the Filter. The callback may very well be context dependant > and once the filter is reset, calling the wrong callback may have other > developers complain to me about the opposite of what you are complaining > about. > > You do unintentionally bring up a good point: the error callback needs > more than one entry point (aka. get_error_callback(), > set_error_callback()) and I believe I will implement this in the next > release. This way when you need to reset() the filter, you can retain > your same callback coderef. > > Thanks, > > Nick > > On Thu Oct 19 17:48:17 2006, ewaters@uarc.com wrote:
> > Distribution: POE-Filter-XML-0.29 > > > > File: POE-Filter-XML-0.29/lib/POE/Filter/XML.pm > > Line: 91 > > > > Problems: > > > > Code deletes the callback if it's not passed to reset(). This breaks > > the callback if the users resets the filter. There's no need for > > this, and is a bug. > > > > Eric Waters
> > > > >
-- Email signed with GnuPG key id 0x7FE92A42 http://www.vegcrew.net/~ewaters/pubkey.asc
Download (untitled)
application/pgp-signature 189b

Message body not shown because it is not plain text.

From: NPEREZ [...] cpan.org
That is a very good point. I do know my original intentions were to require the guts everytime reset() was called. And you are right that it isn't consistent and that it isn't documented very well. I am going to have some time this weekend to sit down and resolve your tickets including this one. Thanks for even bothering to take the time. It certainly helps me. On Fri Oct 20 10:55:46 2006, ewaters@uarc.com wrote: Show quoted text
> I hate to argue the point, but if this is not a bug, I'll have to > submit another bug: > > File: POE-Component-Jabber- > 1.21/lib/POE/Component/Jabber/Server/Socket.pm > > On line 61: > > $heap->{'filter'} = POE::Filter::XML->new(undef, $heap-
> >{'callback'});
> > the POE::Filter::XML object is created with the defined callback in > the build_socket() subroutine. Later, in step_tls() (line 88) and > step_sasl() (line 131) the filter is reset: > > $heap->{'filter'}->reset(); > > Since you're stating that it's somehow expected (but not documented I > might add) that the reset will clear the callback, these two lines > need to be changed to: > > $heap->{'filter'}->reset( $heap->{'callback'} ); > > I'd like to point out that the meta is not deleted if it's not passed > to reset(), but callback is. Just seems inconsistent. Also, please > change documentation. It currently reads: > > Since POE::Filter::XML follows the POE::Filter API look to > POE::Filter for documentation. The only method covered here is new() > > It should mention reset() as well since this is a custom function and > not part of the POE::Filter API. > > Eric > > On Thu, Oct 19, 2006 at 06:26:42PM -0400, via RT wrote:
> > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=22288 > > > > > Hi Eric, > > > > This is not a bug. reset() does as it was intended to do which is
> reset
> > the state of the Filter. The callback may very well be context
> dependant
> > and once the filter is reset, calling the wrong callback may have
> other
> > developers complain to me about the opposite of what you are
> complaining
> > about. > > > > You do unintentionally bring up a good point: the error callback
> needs
> > more than one entry point (aka. get_error_callback(), > > set_error_callback()) and I believe I will implement this in the
> next
> > release. This way when you need to reset() the filter, you can
> retain
> > your same callback coderef. > > > > Thanks, > > > > Nick > > > > On Thu Oct 19 17:48:17 2006, ewaters@uarc.com wrote:
> > > Distribution: POE-Filter-XML-0.29 > > > > > > File: POE-Filter-XML-0.29/lib/POE/Filter/XML.pm > > > Line: 91 > > > > > > Problems: > > > > > > Code deletes the callback if it's not passed to reset(). This
> breaks
> > > the callback if the users resets the filter. There's no need for > > > this, and is a bug. > > > > > > Eric Waters
> > > > > > > > > >
>