HTTP::Body 1.01, fixed regex to restore performance of urlencoded parser, the previou... v1.01
Andy Grundman [Sat, 23 Feb 2008 16:15:18 +0000 (16:15 +0000)]
Changes
lib/HTTP/Body.pm
lib/HTTP/Body/UrlEncoded.pm

diff --git a/Changes b/Changes
index a9099fb..355ac08 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for Perl extension HTTP::Body.
 
+1.01    2008-02-23 11:30:00
+        - Fixed performance issue with urlencoded regex.
+
 1.00    2008-02-23 11:00:00
         - Added support for chunked requests if no $length value is passed to new().
         - Added support for XForms submissions. (Daniel Ruoso)
index 859e6eb..7bdd14b 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 
 use Carp       qw[ ];
 
-our $VERSION = '1.00';
+our $VERSION = '1.01';
 
 our $TYPES = {
     'application/octet-stream'          => 'HTTP::Body::OctetStream',
index 671ba47..aacef3b 100644 (file)
@@ -45,7 +45,7 @@ sub spin {
     # Note: s/// appears faster than tr///
     $self->{buffer} =~ s/\+/ /g;
 
-    for my $pair ( split( /&|;(?:\s+)?/, $self->{buffer} ) ) {
+    for my $pair ( split( /[&;](?:\s+)?/, $self->{buffer} ) ) {
 
         my ( $name, $value ) = split( /=/, $pair , 2 );