r36613 - in /trunk/libcgi-simple-perl: ./ debian/ lib/CGI/ lib/CGI/Simple/ t/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Fri May 29 01:32:42 UTC 2009


Author: ryan52-guest
Date: Fri May 29 01:32:38 2009
New Revision: 36613

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=36613
Log:
New upstream release

Added:
    trunk/libcgi-simple-perl/t/041.multipart.t
      - copied unchanged from r36612, branches/upstream/libcgi-simple-perl/current/t/041.multipart.t
Modified:
    trunk/libcgi-simple-perl/Changes
    trunk/libcgi-simple-perl/MANIFEST
    trunk/libcgi-simple-perl/META.yml
    trunk/libcgi-simple-perl/README
    trunk/libcgi-simple-perl/SIGNATURE
    trunk/libcgi-simple-perl/debian/changelog
    trunk/libcgi-simple-perl/lib/CGI/Simple.pm
    trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm
    trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm
    trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm
    trunk/libcgi-simple-perl/t/050.simple.t
    trunk/libcgi-simple-perl/t/060.slow_post.t
    trunk/libcgi-simple-perl/t/070.standard.t

Modified: trunk/libcgi-simple-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/Changes?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/Changes (original)
+++ trunk/libcgi-simple-perl/Changes Fri May 29 01:32:38 2009
@@ -168,3 +168,7 @@
       - Added a test to ensure the manifest is consistent.
       - Migrated to git.
 
+1.111   2009-05-28
+      - Implemented Michael Nachbaur fixes for multipart form data
+        handling.
+

Modified: trunk/libcgi-simple-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/MANIFEST?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/MANIFEST (original)
+++ trunk/libcgi-simple-perl/MANIFEST Fri May 29 01:32:38 2009
@@ -13,6 +13,7 @@
 t/020.cookie.t
 t/030.function.t
 t/040.request.t
+t/041.multipart.t
 t/050.simple.t
 t/060.slow_post.t
 t/070.standard.t

Modified: trunk/libcgi-simple-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/META.yml?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/META.yml (original)
+++ trunk/libcgi-simple-perl/META.yml Fri May 29 01:32:38 2009
@@ -1,6 +1,6 @@
 ---
 name: CGI-Simple
-version: 1.110
+version: 1.111
 author:
   - 'Andy Armstrong <andy at hexten.net>'
 abstract: A Simple totally OO CGI interface that is CGI.pm compliant
@@ -14,16 +14,16 @@
 provides:
   CGI::Simple:
     file: lib/CGI/Simple.pm
-    version: 1.110
+    version: 1.111
   CGI::Simple::Cookie:
     file: lib/CGI/Simple/Cookie.pm
-    version: 1.110
+    version: 1.111
   CGI::Simple::Standard:
     file: lib/CGI/Simple/Standard.pm
-    version: 1.110
+    version: 1.111
   CGI::Simple::Util:
     file: lib/CGI/Simple/Util.pm
-    version: 1.110
+    version: 1.111
 generated_by: Module::Build version 0.33
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html

Modified: trunk/libcgi-simple-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/README?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/README (original)
+++ trunk/libcgi-simple-perl/README Fri May 29 01:32:38 2009
@@ -1,4 +1,4 @@
-CGI-Simple version 1.110
+CGI-Simple version 1.111
 
 INSTALLATION
 

Modified: trunk/libcgi-simple-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/SIGNATURE?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/SIGNATURE (original)
+++ trunk/libcgi-simple-perl/SIGNATURE Fri May 29 01:32:38 2009
@@ -15,23 +15,24 @@
 Hash: SHA1
 
 SHA1 fc4b33de31e24bb7c44a98431665173c3289a18f Build.PL
-SHA1 82f164164433db49e227738355f0f566d2d61eb2 Changes
-SHA1 a38f26cfbf04ddcb971c5b16d975d6c0c41f3c7d MANIFEST
-SHA1 0f2b5bc32e07fce7336bfd47452b8a1ade04f074 META.yml
+SHA1 b435cfd2c23edcb30b8ed4046e1ea474165c3992 Changes
+SHA1 63309d39b5c5374b4666faca712d3a092e1595f7 MANIFEST
+SHA1 e194764b6f9f875898e301cd90e868b1a1625d24 META.yml
 SHA1 a319c0eeaf2d35f87387cca92b851564bcb128d6 Makefile.PL
-SHA1 8d2ebaced748ca88c518a289e315b18b5f49b9e3 README
+SHA1 098b8588638698bdafe40bb84003f4949052d711 README
 SHA1 8c97bbeb63b586ee9c722313c2ad7858e32ff52c inc/MyBuilder.pm
-SHA1 6afb1f8c65c9f53ff5f266ef36a38d883f5483bd lib/CGI/Simple.pm
-SHA1 d9fbe4faf6c3d6609e8bda0746de9405bbdaee1e lib/CGI/Simple/Cookie.pm
-SHA1 23a6eea9097d6efd97097fd1c8579b47bd96280d lib/CGI/Simple/Standard.pm
-SHA1 0d103dc0671d70c40c5bae3ee145ab16537fbd69 lib/CGI/Simple/Util.pm
+SHA1 59a6ea4fb22dde6e0adaab85c8ac150ac2828573 lib/CGI/Simple.pm
+SHA1 7fac2de382840bf97bfdd013fd843c5991b0f281 lib/CGI/Simple/Cookie.pm
+SHA1 c373d9070c569f90aea54c1ad1e80d108c8018f9 lib/CGI/Simple/Standard.pm
+SHA1 57797e264412af0d165e921a2ab693e437306100 lib/CGI/Simple/Util.pm
 SHA1 029a0c2274884058f99bc339fd5bb073348c2b77 t/000.load.t
 SHA1 b02cd8953e5da31678711b93f4f8ebc2939e453a t/020.cookie.t
 SHA1 ca2ff8ba2f9a5f68c75e8d9527af38b042067148 t/030.function.t
 SHA1 e8fbebb9354bcd7755bfecaa564f44467265242c t/040.request.t
-SHA1 c4cb337005177eec328117ad15ed86514e9cdb0d t/050.simple.t
-SHA1 4d5dd87be1d9d13a0eadd45a448d3373a6092415 t/060.slow_post.t
-SHA1 04d5d7917dc9398866a05e660f0c729158d51830 t/070.standard.t
+SHA1 3678058ca2f62b397aab7560caeec6a06c4c1117 t/041.multipart.t
+SHA1 8d8747fc53c5f306ab4fbc7db03542580f0b3ada t/050.simple.t
+SHA1 f77e6013c2de0bcf99c73c4af2ecc6220f7ec3a1 t/060.slow_post.t
+SHA1 5e01c2acd0bd0ee4ebf9b04a02e4d87e1b879b60 t/070.standard.t
 SHA1 4a7dade2334d9e4f5b223cbb6c9ebd49cb5cf4a3 t/080.util.t
 SHA1 432c00d3873dd6c70998f18149ba7517ffb56602 t/090.14838.t
 SHA1 73ac0f1550806696461a8c356aaff53393837aa7 t/100.set-cookie.t
@@ -43,7 +44,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (Darwin)
 
-iEYEARECAAYFAkoZuyAACgkQwoknRJZQnCFo+gCgnIBAYzBXHGgaY4Sef6XG+CbH
-TaUAni3VD/nkbj7I/eAUAlFEVIhk1wCn
-=gy0d
+iEYEARECAAYFAkoe0UwACgkQwoknRJZQnCEoFQCdGeexog7wtmgD4pHK4U/XMQIi
+JeYAn2J6xfYAFuWg58zQIWd9URxfWR2X
+=qImp
 -----END PGP SIGNATURE-----

Modified: trunk/libcgi-simple-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/debian/changelog?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/debian/changelog (original)
+++ trunk/libcgi-simple-perl/debian/changelog Fri May 29 01:32:38 2009
@@ -1,10 +1,11 @@
-libcgi-simple-perl (1.110-1) UNRELEASED; urgency=low
+libcgi-simple-perl (1.111-1) UNRELEASED; urgency=low
 
   no need to upload, only POD and test changes
 
   * New upstream release
+  * New upstream release
 
- -- Ryan Niebur <ryanryan52 at gmail.com>  Mon, 25 May 2009 02:28:59 -0700
+ -- Ryan Niebur <ryanryan52 at gmail.com>  Thu, 28 May 2009 18:32:28 -0700
 
 libcgi-simple-perl (1.109-1) unstable; urgency=low
 

Modified: trunk/libcgi-simple-perl/lib/CGI/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple.pm?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple.pm Fri May 29 01:32:38 2009
@@ -13,7 +13,7 @@
  $NPH $DEBUG $NO_NULL $FATAL *in
 );
 
-$VERSION = "1.110";
+$VERSION = "1.111";
 
 # you can hard code the global variable settings here if you want.
 # warning - do not delete the unless defined $VAR part unless you
@@ -279,7 +279,7 @@
   # chromatic's blessed GLOB patch
   # elsif ( (ref $init) =~ m/GLOB/i ) { # initialize from a file
   elsif ( UNIVERSAL::isa( $init, 'GLOB' ) ) {   # initialize from a file
-    $self->_init_from_file( $init );
+    $self->_read_parse( $init );
   }
   elsif ( ( ref $init ) eq 'CGI::Simple' ) {
 
@@ -301,20 +301,22 @@
   }
 }
 
-sub _internal_read($\$;$) {
-  my ( $self, $buffer, $len ) = @_;
+sub _internal_read($*\$;$) {
+  my ( $self, $glob, $buffer, $len ) = @_;
   $len = 4096 if !defined $len;
   if ( $self->{'.mod_perl'} ) {
     my $r = $self->_mod_perl_request();
     $r->read( $$buffer, $len );
   }
   else {
-    read( STDIN, $$buffer, $len );
+    read( $glob, $$buffer, $len );
   }
 }
 
 sub _read_parse {
-  my $self   = shift;
+  my $self = shift;
+  my $handle = shift || \*STDIN;
+
   my $data   = '';
   my $type   = $ENV{'CONTENT_TYPE'} || 'No CONTENT_TYPE received';
   my $length = $ENV{'CONTENT_LENGTH'} || 0;
@@ -330,7 +332,7 @@
 
     # silently discard data ??? better to just close the socket ???
     while ( $length > 0 ) {
-      last unless _internal_read( $self, my $buffer );
+      last unless _internal_read( $self, $handle, my $buffer );
       $length -= length( $buffer );
     }
 
@@ -338,7 +340,7 @@
   }
 
   if ( $length and $type =~ m|^multipart/form-data|i ) {
-    my $got_length = $self->_parse_multipart;
+    my $got_length = $self->_parse_multipart( $handle );
     if ( $length != $got_length ) {
       $self->cgi_error(
         "500 Bad read on multipart/form-data! wanted $length, got $got_length"
@@ -353,9 +355,9 @@
       # we may not get all the data we want with a single read on large
       # POSTs as it may not be here yet! Credit Jason Luther for patch
       # CGI.pm < 2.99 suffers from same bug
-      _internal_read( $self, $data, $length );
+      _internal_read( $self, $handle, $data, $length );
       while ( length( $data ) < $length ) {
-        last unless _internal_read( $self, my $buffer );
+        last unless _internal_read( $self, $handle, my $buffer );
         $data .= $buffer;
       }
 
@@ -464,6 +466,7 @@
 
 sub _parse_multipart {
   my $self = shift;
+  my $handle = shift or die "NEED A HANDLE!?";
 
   my ( $boundary )
    = $ENV{'CONTENT_TYPE'} =~ /boundary=\"?([^\";,]+)\"?/;
@@ -478,7 +481,7 @@
   READ:
 
   while ( $got_data < $length ) {
-    last READ unless _internal_read( $self, my $buffer );
+    last READ unless _internal_read( $self, $handle, my $buffer );
     $data .= $buffer;
     $got_data += length $buffer;
 
@@ -515,8 +518,8 @@
         my ( $mime ) = $unfold =~ m/Content-Type:\s+([-\w\/]+)/io;
         $data =~ s/^\Q$header\E//;
         ( $got_data, $data, my $fh, my $size )
-         = $self->_save_tmpfile( $boundary, $filename, $got_data,
-          $data );
+         = $self->_save_tmpfile( $handle, $boundary, $filename,
+          $got_data, $data );
         $self->_add_param( $param, $filename );
         $self->{'.upload_fields'}->{$param} = $filename;
         $self->{'.filehandles'}->{$filename} = $fh if $fh;
@@ -545,7 +548,7 @@
 }
 
 sub _save_tmpfile {
-  my ( $self, $boundary, $filename, $got_data, $data ) = @_;
+  my ( $self, $handle, $boundary, $filename, $got_data, $data ) = @_;
   my $fh;
   my $CRLF      = $self->crlf;
   my $length    = $ENV{'CONTENT_LENGTH'} || 0;
@@ -569,7 +572,7 @@
   while ( $got_data < $length ) {
 
     my $buffer = $data;
-    last unless _internal_read( $self, $data );
+    last unless _internal_read( $self, \*STDIN, $data );
 
     # fixed hanging bug if browser terminates upload part way through
     # thanks to Brandon Black
@@ -843,6 +846,8 @@
 ################   Save and Restore params from file    ###############
 
 sub _init_from_file {
+  use Carp qw(confess);
+  confess "INIT_FROM_FILE called, stupid fucker!";
   my ( $self, $fh ) = @_;
   local $/ = "\n";
   while ( my $pair = <$fh> ) {
@@ -1412,7 +1417,7 @@
     $url .= $script_name;
   }
   elsif ( $relative ) {
-    ( $url ) = $script_name =~ m!([^/]+)$!;
+    ( $url ) = $script_name =~ m#([^/]+)$#;
   }
   elsif ( $absolute ) {
     $url = $script_name;
@@ -1445,7 +1450,7 @@
 
 =head1 VERSION
 
-This document describes CGI::Simple version 1.110.
+This document describes CGI::Simple version 1.111.
 
 =head1 SYNOPSIS
 

Modified: trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm Fri May 29 01:32:38 2009
@@ -12,7 +12,7 @@
 
 use strict;
 use vars '$VERSION';
-$VERSION = '1.110';
+$VERSION = '1.111';
 use CGI::Simple::Util qw(rearrange unescape escape);
 use overload '""' => \&as_string, 'cmp' => \&compare, 'fallback' => 1;
 

Modified: trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm Fri May 29 01:32:38 2009
@@ -7,7 +7,7 @@
  $NO_UNDEF_PARAMS $USE_PARAM_SEMICOLONS $HEADERS_ONCE
  $NPH $DEBUG $NO_NULL $FATAL *in %EXPORT_TAGS $AUTOLOAD );
 
-$VERSION = "1.110";
+$VERSION = "1.111";
 
 %EXPORT_TAGS = (
   ':html'     => [qw(:misc)],

Modified: trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm Fri May 29 01:32:38 2009
@@ -1,7 +1,7 @@
 package CGI::Simple::Util;
 use strict;
 use vars qw( $VERSION @EXPORT_OK @ISA $UTIL );
-$VERSION = '1.110';
+$VERSION = '1.111';
 require Exporter;
 @ISA       = qw( Exporter );
 @EXPORT_OK = qw(

Modified: trunk/libcgi-simple-perl/t/050.simple.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/t/050.simple.t?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/t/050.simple.t (original)
+++ trunk/libcgi-simple-perl/t/050.simple.t Fri May 29 01:32:38 2009
@@ -1,4 +1,4 @@
-use Test::More tests => 332;
+use Test::More tests => 318;
 use Carp;
 use strict;
 use vars qw(%field %in);
@@ -224,52 +224,6 @@
 $q->save_parameters( \*FH );
 close FH;
 
-# new() file constructor
-open FH, $tmpfile, or carp "Can't open temp file\n";
-is(
-  join( '', <FH> ),
-  "foo=1\nbar=2\nbar=3\nbar=4\n=\nfoo=5\nbar=6\nbar=7\nbar=8\n=\n",
-  'new() file constructor, 1'
-);
-close FH;
-open FH, $tmpfile, or carp "Can't open temp file\n";
-$q = new CGI::Simple( \*FH );
-close FH;
- at av = $q->param;
-is( join( ' ', @av ), 'foo bar', 'new() file constructor, 2' );
-is( $q->param( 'foo' ), 1, 'new() file constructor, 3' );
-is( $q->param( 'bar' ), 2, 'new() file constructor, 4' );
- at av = $q->param( 'bar' );
-is( join( '', @av ), 234, 'new() file constructor, 5' );
-
-# call new twice to read two sections of file
-open FH, $tmpfile, or carp "Can't open temp file\n";
-$q  = new CGI::Simple( \*FH );
- at av = $q->param;
-is( join( ' ', @av ), 'foo bar', 'new() file constructor, 6' );
-is( $q->param( 'foo' ), 1, 'new() file constructor, 7' );
-is( $q->param( 'bar' ), 2, 'new() file constructor, 8' );
- at av = $q->param( 'bar' );
-is( join( '', @av ), 234, 'new() file constructor, 9' );
-
-# call new again
-$q = new CGI::Simple( \*FH );
-close FH;
- at av = $q->param;
-is( join( ' ', @av ), 'foo bar', 'new() file constructor, 10' );
-is( $q->param( 'foo' ), 5, 'new() file constructor, 11' );
-is( $q->param( 'bar' ), 6, 'new() file constructor, 12' );
- at av = $q->param( 'bar' );
-is( join( '', @av ), 678, 'new() file constructor, 13' );
-
-# call new with a blessed glob  ( test chromatic's patch with chromatic's test!)
-open FH, $tmpfile, or carp "Can't open temp file\n";
-my $fh = bless \*FH, 'Some::Class';
-$q = new CGI::Simple( $fh );
-close FH;
- at av = $q->param;
-is( join( ' ', @av ), 'foo bar', 'new() file constructor, 14' );
-
 # new() CGI::Simple object constructor
 
 my $q_old = new CGI::Simple( 'foo=1&bar=2&bar=3&bar=4' );

Modified: trunk/libcgi-simple-perl/t/060.slow_post.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/t/060.slow_post.t?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/t/060.slow_post.t (original)
+++ trunk/libcgi-simple-perl/t/060.slow_post.t Fri May 29 01:32:38 2009
@@ -33,7 +33,6 @@
   $q  = new CGI::Simple;
   $sv = $q->param( 'SLOW' );
 
-## Please see file perltidy.ERR
-  is( length $sv, 10_000,      'length ok' );
-  is( $sv,        'X' x10_000, 'value ok' );
+  is( length $sv, 10_000,       'length ok' );
+  is( $sv,        'X' x 10_000, 'value ok' );
 }

Modified: trunk/libcgi-simple-perl/t/070.standard.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/t/070.standard.t?rev=36613&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/t/070.standard.t (original)
+++ trunk/libcgi-simple-perl/t/070.standard.t Fri May 29 01:32:38 2009
@@ -1,4 +1,4 @@
-use Test::More tests => 301;
+use Test::More tests => 288;
 use Carp;
 use strict;
 use vars qw(%field %in);
@@ -247,45 +247,6 @@
 save_parameters( \*FH );
 close FH;
 
-# new() file constructor
-
-open FH, $tmpfile, or carp "Can't open temp file\n";
-is(
-  join( '', <FH> ),
-  "foo=1\nbar=2\nbar=3\nbar=4\n=\nfoo=5\nbar=6\nbar=7\nbar=8\n=\n",
-  'new() file constructor, 1'
-);
-close FH;
-open FH, $tmpfile, or carp "Can't open temp file\n";
-restore_parameters( \*FH );
-close FH;
- at av = param();
-is( join( ' ', @av ), 'foo bar', 'new() file constructor, 2' );
-is( param( 'foo' ), 1, 'new() file constructor, 3' );
-is( param( 'bar' ), 2, 'new() file constructor, 4' );
- at av = param( 'bar' );
-is( join( '', @av ), 234, 'new() file constructor, 5' );
-
-# call new twice to read two sections of file
-open FH, $tmpfile, or carp "Can't open temp file\n";
-restore_parameters( \*FH );
- at av = param();
-is( join( ' ', @av ), 'foo bar', 'new() file constructor, 6' );
-is( param( 'foo' ), 1, 'new() file constructor, 7' );
-is( param( 'bar' ), 2, 'new() file constructor, 8' );
- at av = param( 'bar' );
-is( join( '', @av ), 234, 'new() file constructor, 9' );
-
-# call new again
-restore_parameters( \*FH );
-close FH;
- at av = param();
-is( join( ' ', @av ), 'foo bar', 'new() file constructor, 10' );
-is( param( 'foo' ), 5, 'new() file constructor, 11' );
-is( param( 'bar' ), 6, 'new() file constructor, 12' );
- at av = param( 'bar' );
-is( join( '', @av ), 678, 'new() file constructor, 13' );
-
 # new() \@ARGV constructor
 
 $ENV{'REQUEST_METHOD'} = '';




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