r22714 - in /trunk/libpoe-filter-xml-perl: ChangeLog META.yml README debian/changelog debian/copyright lib/POE/Filter/XML.pm lib/POE/Filter/XML/Handler.pm lib/POE/Filter/XML/NS.pm lib/POE/Filter/XML/Node.pm lib/POE/Filter/XML/Utils.pm

tincho at users.alioth.debian.org tincho at users.alioth.debian.org
Thu Jul 3 07:26:30 UTC 2008


Author: tincho
Date: Thu Jul  3 07:26:30 2008
New Revision: 22714

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=22714
Log:
* New upstream release.
* debian/copyright: new format, updated CP info, added packaging copyright.

Modified:
    trunk/libpoe-filter-xml-perl/ChangeLog
    trunk/libpoe-filter-xml-perl/META.yml
    trunk/libpoe-filter-xml-perl/README
    trunk/libpoe-filter-xml-perl/debian/changelog
    trunk/libpoe-filter-xml-perl/debian/copyright
    trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML.pm
    trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Handler.pm
    trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/NS.pm
    trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Node.pm
    trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Utils.pm

Modified: trunk/libpoe-filter-xml-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/ChangeLog?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/ChangeLog (original)
+++ trunk/libpoe-filter-xml-perl/ChangeLog Thu Jul  3 07:26:30 2008
@@ -1,3 +1,14 @@
+2007-01-19 NPEREZ <nperez at cpan.org>
+
+	* Version bumped to 0.33 (in all modules so everything matches)
+	* Add definedness checks for a couple of more items in Utils
+
+2006-12-16 NPEREZ <nperez at cpan.org>
+	
+	* Version bumpted to 0.32 (I know, I skipped one)
+	* rt.cpan.org #23668: Add a check for defined-ness for encode/decode
+	* Thanks to David Davis <xantus at xantus.org> for bug submit
+
 2006-10-26 NPEREZ <nperez at cpan.org>
 	
 	* Version bumped to 0.30

Modified: trunk/libpoe-filter-xml-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/META.yml?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/META.yml (original)
+++ trunk/libpoe-filter-xml-perl/META.yml Thu Jul  3 07:26:30 2008
@@ -1,6 +1,6 @@
 ---
 name: POE-Filter-XML
-version: 0.31
+version: 0.33
 author: []
 abstract: A POE Filter for parsing XML
 license: gpl
@@ -16,19 +16,19 @@
 provides:
   POE::Filter::XML:
     file: lib/POE/Filter/XML.pm
-    version: 0.31
+    version: 0.33
   POE::Filter::XML::Handler:
     file: lib/POE/Filter/XML/Handler.pm
-    version: 0.23
+    version: 0.33
   POE::Filter::XML::NS:
     file: lib/POE/Filter/XML/NS.pm
-    version: 0.21
+    version: 0.33
   POE::Filter::XML::Node:
     file: lib/POE/Filter/XML/Node.pm
-    version: 0.29
+    version: 0.33
   POE::Filter::XML::Utils:
     file: lib/POE/Filter/XML/Utils.pm
-    version: 0.23
+    version: 0.33
 generated_by: Module::Build version 0.28
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

Modified: trunk/libpoe-filter-xml-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/README?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/README (original)
+++ trunk/libpoe-filter-xml-perl/README Thu Jul  3 07:26:30 2008
@@ -59,9 +59,15 @@
         handler and then deletes any data in the buffer.
 
 BUGS AND NOTES
-    Previous versions relied upon XML::Parser (an expat derivative) or a
-    very poor pure perl XML parser pulled from XML::Stream. XML::SAX is now
-    the standard and has greatly simplified development on this project.
+    The current XML::SAX::Expat::Incremental version introduces some ugly
+    circular references due to the way XML::SAX::Expat constructs itself (it
+    stores a references to itself inside the XML::Parser object it
+    constructs to get an OO-like interface within the callbacks passed to
+    it). Upon destroy, I clean these up with Scalar::Util::weaken and by
+    manually calling release() on the ExpatNB object created within
+    XML::SAX::Expat::Incremental. This is an ugly hack. If anyone finds some
+    subtle behavior I missed, let me know and I will drop XML::SAX support
+    all together going back to just plain-old XML::Parser.
 
     Meta filtering was removed. No one was using it and the increased level
     of indirection was a posible source of performance issues.
@@ -74,6 +80,6 @@
     consistent. Thanks Eric Waters (ewaters at uarc.com).
 
 AUTHOR
-    Copyright (c) 2003, 2004, 2005, 2006 Nicholas Perez. Released and
-    distributed under the GPL.
+    Copyright (c) 2003 - 2007 Nicholas Perez. Released and distributed under
+    the GPL.
 

Modified: trunk/libpoe-filter-xml-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/debian/changelog?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/debian/changelog (original)
+++ trunk/libpoe-filter-xml-perl/debian/changelog Thu Jul  3 07:26:30 2008
@@ -1,4 +1,4 @@
-libpoe-filter-xml-perl (0.31-1) UNRELEASED; urgency=low
+libpoe-filter-xml-perl (0.33-1) UNRELEASED; urgency=low
 
   [ gregor herrmann ]
   * Take over for the Debian Perl Group with maintainer's permission
@@ -12,12 +12,14 @@
   * Add debian/watch.
 
   [ Martín Ferrari ]
+  * New upstream release.
   * debian/control: bumped Standards-Version (no changes), debhelper version
     to 5, correct versioned dependencies (build and run-time), corrected
     Description.
   * debian/rules: refreshed from templates.
+  * debian/copyright: new format, updated CP info, added packaging copyright.
 
- -- gregor herrmann <gregoa at debian.org>  Sun, 15 Jun 2008 16:55:46 +0200
+ -- Martín Ferrari <tincho at debian.org>  Thu, 03 Jul 2008 04:18:57 -0300
 
 libpoe-filter-xml-perl (0.31-0.2) unstable; urgency=low
 

Modified: trunk/libpoe-filter-xml-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/debian/copyright?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/debian/copyright (original)
+++ trunk/libpoe-filter-xml-perl/debian/copyright Thu Jul  3 07:26:30 2008
@@ -1,12 +1,22 @@
-This package was debianized by Florian Ragwitz <rafl at debianforum.de> on
-Tue, 30 Aug 2005 16:28:06 +0200
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat
+Upstream-Author: Nicholas Perez <nperez at cpan.org>
+Packaged-By: Florian Ragwitz <rafl at debianforum.de>
+Packaged-Date: Tue, 30 Aug 2005 16:28:06 +0200
+Original-Source-Location: http://search.cpan.org/dist/POE-Filter-XML/
+Original-Source-Command: uscan --force-download
+Original-Source-Depends: devscripts
 
-It was downloaded from: http://search.cpan.org/~nperez/POE-Filter-XML/
+Files: *
+Copyright: © 2003-2007 Nicholas Perez.
+License: GPL-any
+ Released and distributed under the GPL.
 
-The upstream author is: Nicholas Perez <nperez at cpan.org>
-
-Copyright (c) 2003, 2004, 2005 Nicholas Perez. Released and distributed under
-the GPL.
+Files: debian/*
+Copyright: © 2008 Debian Perl Group <debian-perl at lists.debian.org>
+           © 2005 Florian Ragwitz <rafl at debianforum.de>
+License: other
+ It is being assumed that all maintainers did choose a license compatible with
+ the license used by upstream.
 
 On Debian GNU/Linux systems, the complete text of the GNU General
 Public License can be found in `/usr/share/common-licenses/GPL'.

Modified: trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML.pm?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML.pm (original)
+++ trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML.pm Thu Jul  3 07:26:30 2008
@@ -2,13 +2,14 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.31';
+our $VERSION = '0.33';
 
 use XML::SAX;
 use XML::SAX::ParserFactory;
 use POE::Filter::XML::Handler;
+use Scalar::Util qw/weaken/;
 use Carp;
-$XML::SAX::ParserPackage = "XML::SAX::Expat::Incremental (0.04)";
+$XML::SAX::ParserPackage = "XML::SAX::Expat::Incremental";
 
 # This is to make Filter::Stackable happy
 use base('POE::Filter');
@@ -51,6 +52,8 @@
 	$self->{'parser'} = $parser;
 	$self->{'callback'} = $callback;
 	
+	weaken($self->{'parser'});
+
 	eval
 	{
 		$self->{'parser'}->parse_string($buffer);
@@ -60,18 +63,24 @@
 	if ($@)
 	{
 		warn $@;
-		&{ $self->{'callback'} }($@);
+		$self->{'callback'}->($@);
 	}
 
 	bless($self, $class);
 	return $self;
 }
 
-sub DESTROY()
+sub DESTROY
 {
 	my $self = shift;
 	
-	delete $self->{'meta'};
+	#HACK: stupid circular references in 3rd party modules
+	#We need to weaken/break these or the damn parser leaks
+	$self->{'parser'}->{'_expat_nb_obj'}->release()
+		if defined($self->{'parser'}->{'_expat_nb_obj'});
+	weaken($self->{'parser'}->{'_expat_nb_obj'});
+	weaken($self->{'parser'}->{'_xml_parser_obj'}->{'__XSE'});
+	
 	delete $self->{'parser'};
 	delete $self->{'handler'};
 }
@@ -244,9 +253,14 @@
 
 =head1 BUGS AND NOTES
 
-Previous versions relied upon XML::Parser (an expat derivative) or a very poor
-pure perl XML parser pulled from XML::Stream. XML::SAX is now the standard and
-has greatly simplified development on this project.
+The current XML::SAX::Expat::Incremental version introduces some ugly circular
+references due to the way XML::SAX::Expat constructs itself (it stores a 
+references to itself inside the XML::Parser object it constructs to get an
+OO-like interface within the callbacks passed to it). Upon destroy, I clean
+these up with Scalar::Util::weaken and by manually calling release() on the
+ExpatNB object created within XML::SAX::Expat::Incremental. This is an ugly
+hack. If anyone finds some subtle behavior I missed, let me know and I will
+drop XML::SAX support all together going back to just plain-old XML::Parser.
 
 Meta filtering was removed. No one was using it and the increased level of
 indirection was a posible source of performance issues.
@@ -259,7 +273,7 @@
 
 =head1 AUTHOR
 
-Copyright (c) 2003, 2004, 2005, 2006 Nicholas Perez. 
+Copyright (c) 2003 - 2007 Nicholas Perez. 
 Released and distributed under the GPL.
 
 =cut

Modified: trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Handler.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Handler.pm?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Handler.pm (original)
+++ trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Handler.pm Thu Jul  3 07:26:30 2008
@@ -6,7 +6,7 @@
 use warnings;
 use POE::Filter::XML::Node;
 
-our $VERSION = '0.23';
+our $VERSION = '0.33';
 
 sub new()
 {

Modified: trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/NS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/NS.pm?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/NS.pm (original)
+++ trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/NS.pm Thu Jul  3 07:26:30 2008
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.21';
+our $VERSION = '0.33';
 
 use constant {
 	XMLNS_STREAM => 'http://etherx.jabber.org/streams',

Modified: trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Node.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Node.pm?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Node.pm (original)
+++ trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Node.pm Thu Jul  3 07:26:30 2008
@@ -15,7 +15,7 @@
 use constant tagparent => 7;
 use constant recursive => 8;
 
-our $VERSION = '0.29';
+our $VERSION = '0.33';
 
 my $id = 0;
 
@@ -691,7 +691,8 @@
 
 =head1 AUTHOR
 
-Copyright (c) 2003, 2004, 2006 Nicholas Perez. Released and distributed under the GPL.
+Copyright (c) 2003 - 2007 Nicholas Perez. 
+Released and distributed under the GPL.
 
 =cut
 

Modified: trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Utils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Utils.pm?rev=22714&op=diff
==============================================================================
--- trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Utils.pm (original)
+++ trunk/libpoe-filter-xml-perl/lib/POE/Filter/XML/Utils.pm Thu Jul  3 07:26:30 2008
@@ -8,7 +8,7 @@
 
 require Exporter;
 
-our $VERSION = '0.23';
+our $VERSION = '0.33';
 
 our @ISA = qw/ Exporter /;
 our @EXPORT = qw/ get_config get_reply get_error get_user get_host
@@ -18,27 +18,31 @@
 
 sub decode 
 {
-    my $data = shift;
-
-    $data =~ s/&amp;/&/go;
-    $data =~ s/&lt;/</go;
-    $data =~ s/&gt;/>/go;
-    $data =~ s/&apos;/'/go;
-    $data =~ s/&quot;/"/go;
-
+	my $data = shift;
+	
+	if(defined($data) and length($data))
+	{
+		$data =~ s/&amp;/&/go;
+	   	$data =~ s/&lt;/</go;
+		$data =~ s/&gt;/>/go;
+		$data =~ s/&apos;/'/go;
+		$data =~ s/&quot;/"/go;
+	}
 	return $data;
 }
 
 sub encode 
 {
-    my $data = shift;
-
-	$data =~ s/&/&amp;/go;
-	$data =~ s/</&lt;/go;
-	$data =~ s/>/&gt;/go;
-	$data =~ s/'/&apos;/go;
-	$data =~ s/"/&quot;/go;
-
+	my $data = shift;
+	
+	if(defined($data) and length($data))
+	{
+		$data =~ s/&/&amp;/go;
+		$data =~ s/</&lt;/go;
+		$data =~ s/>/&gt;/go;
+		$data =~ s/'/&apos;/go;
+		$data =~ s/"/&quot;/go;
+	}
 	return $data;
 
 }
@@ -145,29 +149,29 @@
 sub get_user
 {
 	my $jid = shift;
-	$jid =~ s/\@\S+$//;
+	$jid =~ s/\@\S+$// if defined $jid;
 	return $jid;
 }
 
 sub get_host
 {
 	my $jid = shift;
-	$jid =~ s/^\S+\@//;
-	$jid =~ s/\/\S+$//;
+	$jid =~ s/^\S+\@// if defined $jid;
+	$jid =~ s/\/\S+$// if defined $jid;
 	return $jid;
 }
 
 sub get_bare_jid
 {
 	my $jid = shift;
-	$jid =~ s/\/\S+$//;
+	$jid =~ s/\/\S+$// if defined $jid;
 	return $jid;
 }
 
 sub get_resource
 {
 	my $jid = shift;
-	$jid =~ s/^\S+\///;
+	$jid =~ s/^\S+\/// if defined $jid;
 	return $jid;
 }
 




More information about the Pkg-perl-cvs-commits mailing list