r34257 - in /trunk/libcompress-raw-zlib-perl: Changes MANIFEST META.yml Makefile.PL README Zlib.xs debian/changelog lib/Compress/Raw/Zlib.pm pod/FAQ.pod t/000prereq.t t/02zlib.t t/09limitoutput.t t/compress/CompTestUtils.pm

jeremiah-guest at users.alioth.debian.org jeremiah-guest at users.alioth.debian.org
Tue Apr 28 13:52:07 UTC 2009


Author: jeremiah-guest
Date: Tue Apr 28 13:52:01 2009
New Revision: 34257

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34257
Log:
Updating source from upstream, new test added.

Added:
    trunk/libcompress-raw-zlib-perl/t/09limitoutput.t
      - copied unchanged from r34256, branches/upstream/libcompress-raw-zlib-perl/current/t/09limitoutput.t
Modified:
    trunk/libcompress-raw-zlib-perl/Changes
    trunk/libcompress-raw-zlib-perl/MANIFEST
    trunk/libcompress-raw-zlib-perl/META.yml
    trunk/libcompress-raw-zlib-perl/Makefile.PL
    trunk/libcompress-raw-zlib-perl/README
    trunk/libcompress-raw-zlib-perl/Zlib.xs
    trunk/libcompress-raw-zlib-perl/debian/changelog
    trunk/libcompress-raw-zlib-perl/lib/Compress/Raw/Zlib.pm
    trunk/libcompress-raw-zlib-perl/pod/FAQ.pod
    trunk/libcompress-raw-zlib-perl/t/000prereq.t
    trunk/libcompress-raw-zlib-perl/t/02zlib.t
    trunk/libcompress-raw-zlib-perl/t/compress/CompTestUtils.pm

Modified: trunk/libcompress-raw-zlib-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/Changes?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/Changes (original)
+++ trunk/libcompress-raw-zlib-perl/Changes Tue Apr 28 13:52:01 2009
@@ -1,5 +1,18 @@
 CHANGES
 -------
+
+  2.017 28 March 2009
+
+      * Added 'LimitOutput' option
+
+      * Removed MAN3PODS from Makefile.PL
+
+      * Fixed coring issue when LimitOutput was used.
+
+      * Documented Compress::Raw::Zlib::zlib_version()
+
+      * Documented Compress::Raw::Zlib::deflateReset()
+        [RT #40566]
 
   2.015 3 September 2008
 

Modified: trunk/libcompress-raw-zlib-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/MANIFEST?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/MANIFEST (original)
+++ trunk/libcompress-raw-zlib-perl/MANIFEST Tue Apr 28 13:52:01 2009
@@ -4,6 +4,7 @@
 t/01version.t
 t/02zlib.t
 t/07bufsize.t
+t/09limitoutput.t
 t/18lvalue.t
 t/99pod.t
 t/Test/Builder.pm

Modified: trunk/libcompress-raw-zlib-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/META.yml?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/META.yml (original)
+++ trunk/libcompress-raw-zlib-perl/META.yml Tue Apr 28 13:52:01 2009
@@ -1,13 +1,20 @@
 --- #YAML:1.0
-name:                Compress-Raw-Zlib
-version:             2.015
-abstract:            Low-Level Interface to zlib compression library
-license:             perl
-author:              
-    - Paul Marquess <pmqs at cpan.org>
-generated_by:        ExtUtils::MakeMaker version 6.44
-distribution_type:   module
-requires:     
+name:               Compress-Raw-Zlib
+version:            2.017
+abstract:           ~
+author:  []
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:  {}
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.50
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
-    version: 1.3
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libcompress-raw-zlib-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/Makefile.PL?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/Makefile.PL (original)
+++ trunk/libcompress-raw-zlib-perl/Makefile.PL Tue Apr 28 13:52:01 2009
@@ -77,24 +77,11 @@
                     },
 
     (
-      $ENV{SKIP_FOR_CORE}
-        ? (MAN3PODS    => {})
-        : ()
-    ),
-       
-    (
       $BUILD_ZLIB
         ? zlib_files($ZLIB_LIB)
         : (LIBS => [ "-L$ZLIB_LIB -lz " ])
     ),
       
-    (
-      $] >= 5.005
-        ? (ABSTRACT_FROM => 'lib/Compress/Raw/Zlib.pm',
-            AUTHOR       => 'Paul Marquess <pmqs at cpan.org>')
-        : ()
-    ),
-
     INSTALLDIRS => ($] >= 5.009 ? 'perl' : 'site'),
 
     ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?

Modified: trunk/libcompress-raw-zlib-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/README?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/README (original)
+++ trunk/libcompress-raw-zlib-perl/README Tue Apr 28 13:52:01 2009
@@ -1,11 +1,11 @@
 
                              Compress-Raw-Zlib
 
-                             Version 2.015
-
-                            2nd September 2008
-
-       Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
+                             Version 2.017
+
+                            28th March 2009
+
+       Copyright (c) 2005-2009 Paul Marquess. All rights reserved.
           This program is free software; you can redistribute it
            and/or modify it under the same terms as Perl itself.
 
@@ -177,6 +177,35 @@
 TROUBLESHOOTING
 ---------------
 
+Undefined Symbol gzsetparams
+----------------------------
+
+If you get the error shown below when you run the Compress-Raw-Zlib test
+harness it probably means you are running a copy of zlib that is
+version 1.0.5 or older.
+
+t/01version.........Can't load 'blib/arch/auto/Compress/Zlib/Zlib.so' for 
+                    module Compress::Raw::Zlib: blib/arch/auto/Compress/Raw/Zlib/Zlib.so:
+                    undefined symbol: gzsetparams at ...
+
+There are two ways to fix this problem:
+
+    1. Upgrade to the latest version of zlib.
+
+    2. Edit config.in and set the OLD_ZLIB variable to True.
+
+Test Harness 01version fails
+----------------------------
+If the 01version test harness fails, and the problem isn't covered by the
+scenario above, it probably means that you have two versions of 
+zlib installed on your system.
+
+Run the command below to see if this is indeed the case
+
+    make test TEST_VERBOSE=1 TEST_FILES=t/01version.t 
+
+Try removing the one you don't want to use and rebuild.   
+
 Solaris build fails with "language optional software package not installed"
 ---------------------------------------------------------------------------
 
@@ -277,7 +306,7 @@
 newer version of Compress-Raw-Zlib is available run this from the command
 prompt
 
-    C:\> ppm verify -upgrade Compress-Zlib
+    C:\> ppm verify -upgrade Compress-Raw-Zlib
 
 If you are not running Activestate Perl and you don't have access
 to a C compiler, you will not be able to build and install this module.
@@ -326,7 +355,7 @@
         If you haven't installed Compress-Raw-Zlib then search Compress::Raw::Zlib.pm
         for a line like this:
 
-          $VERSION = "2.015" ;
+          $VERSION = "2.017" ;
 
      c. The version of zlib you have used.
         If you have successfully installed Compress-Raw-Zlib, this one-liner

Modified: trunk/libcompress-raw-zlib-perl/Zlib.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/Zlib.xs?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/Zlib.xs (original)
+++ trunk/libcompress-raw-zlib-perl/Zlib.xs Tue Apr 28 13:52:01 2009
@@ -3,7 +3,7 @@
  * Created : 22nd January 1996
  * Version : 2.000
  *
- *   Copyright (c) 1995-2007 Paul Marquess. All rights reserved.
+ *   Copyright (c) 1995-2009 Paul Marquess. All rights reserved.
  *   This program is free software; you can redistribute it and/or
  *   modify it under the same terms as Perl itself.
  *
@@ -541,6 +541,8 @@
             case SVt_PVHV:
             case SVt_PVCV:
                 croak("%s: buffer parameter is not a SCALAR reference", string);
+            default:
+                break;
         }
         if (SvROK(sv))
             croak("%s: buffer parameter is a reference to a reference", string) ;
@@ -578,6 +580,8 @@
             case SVt_PVHV:
             case SVt_PVCV:
                 croak("%s: buffer parameter is not a SCALAR reference", string);
+            default:
+                break;
         }
         if (SvROK(sv))
             croak("%s: buffer parameter is a reference to a reference", string) ;
@@ -1272,7 +1276,7 @@
     bool 	eof 
     uInt	cur_length = 0;
     uInt	prefix_length = 0;
-    uInt	increment = 0;
+    int	    increment = 0;
     STRLEN  stmp    = NO_INIT
     uLong     bufinc = NO_INIT
   PREINIT:
@@ -1306,23 +1310,39 @@
     if((s->flags & FLAG_APPEND) != FLAG_APPEND) {
         SvCUR_set(output, 0);
     }
+   
+    /* Assume no output buffer - the code below will update if there is any available */
+    s->stream.avail_out = 0;
+
+
     if (SvLEN(output)) {
         prefix_length = cur_length =  SvCUR(output) ;
-        s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length;
-        increment = SvLEN(output) -  cur_length - 1;
-        s->stream.avail_out = increment;
-    }
-    else {
-        s->stream.avail_out = 0;
-    }
+    
+        if (s->flags & FLAG_LIMIT_OUTPUT && SvLEN(output) - cur_length - 1 < bufinc)
+        {
+            Sv_Grow(output, bufinc + cur_length + 1) ;
+        }
+    
+        /* Only setup the stream output pointers if there is spare 
+           capacity in the outout SV
+        */
+        if (SvLEN(output) > cur_length + 1)
+        {
+            s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length;
+            increment = SvLEN(output) -  cur_length - 1;
+            s->stream.avail_out = increment;
+        }
+    }
+    
+
     s->bytesInflated = 0;
     
     RETVAL = Z_OK;
 
     while (RETVAL == Z_OK) {
-        if (s->stream.avail_out == 0 ) {
+        if (s->stream.avail_out == 0) {
 	    /* out of space in the output buffer so make it bigger */
-            Sv_Grow(output, SvLEN(output) + bufinc) ;
+            Sv_Grow(output, SvLEN(output) + bufinc +1) ;
             cur_length += increment ;
             s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length ;
             increment = bufinc ;
@@ -1330,7 +1350,13 @@
             bufinc *= 2 ; 
         }
 
+        /* printf("INFLATE Availl In %d, Out %d\n", s->stream.avail_in,
+ s->stream.avail_out); 
+DispStream(s, "BEFORE");
+Perl_sv_dump(output); */
         RETVAL = inflate(&(s->stream), Z_SYNC_FLUSH);
+        /* printf("INFLATE returned %d %s, avail in %d, out %d\n", RETVAL,
+ GetErrorString(RETVAL), s->stream.avail_in, s->stream.avail_out); */
 
     
         if (RETVAL == Z_NEED_DICT && s->dictionary) {
@@ -1338,11 +1364,16 @@
             RETVAL = inflateSetDictionary(&(s->stream), 
             (const Bytef*)SvPVbyte_nolen(s->dictionary),
             SvCUR(s->dictionary));
+            if (RETVAL == Z_OK)
+                continue;
         }
         
-        if (s->flags & FLAG_LIMIT_OUTPUT ||
-            RETVAL == Z_STREAM_ERROR || RETVAL == Z_MEM_ERROR ||
-            RETVAL == Z_DATA_ERROR  || RETVAL == Z_STREAM_END )
+        if (s->flags & FLAG_LIMIT_OUTPUT && 
+                (RETVAL == Z_OK || RETVAL == Z_BUF_ERROR ))
+            break;
+
+        if (RETVAL == Z_STREAM_ERROR || RETVAL == Z_MEM_ERROR ||
+            RETVAL == Z_DATA_ERROR   || RETVAL == Z_STREAM_END )
             break ;
 
         if (RETVAL == Z_BUF_ERROR) {
@@ -1376,8 +1407,8 @@
 #endif
     
     s->last_error = RETVAL ;
-    if (RETVAL == Z_OK || RETVAL == Z_STREAM_END || RETVAL == Z_DATA_ERROR) {
-	unsigned in ;
+    if (RETVAL == Z_OK || RETVAL == Z_STREAM_END || RETVAL == Z_BUF_ERROR || RETVAL == Z_DATA_ERROR) {
+	   unsigned in ;
 
         s->bytesInflated = cur_length + increment - s->stream.avail_out - prefix_length;
         s->uncompressedBytes += s->bytesInflated ;
@@ -1411,6 +1442,7 @@
             *SvEND(buf) = '\0';
             SvSETMAGIC(buf);
 	}
+
     }
     OUTPUT:
 	RETVAL

Modified: trunk/libcompress-raw-zlib-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/debian/changelog?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/debian/changelog (original)
+++ trunk/libcompress-raw-zlib-perl/debian/changelog Tue Apr 28 13:52:01 2009
@@ -1,3 +1,9 @@
+libcompress-raw-zlib-perl (2.017-1) UNRELEASED; urgency=low
+
+  * (NOT RELEASED YET) New upstream release
+
+ -- Jeremiah C. Foster <jeremiah at jeremiahfoster.com>  Tue, 28 Apr 2009 15:51:10 +0200
+
 libcompress-raw-zlib-perl (2.015-2) UNRELEASED; urgency=low
 
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN

Modified: trunk/libcompress-raw-zlib-perl/lib/Compress/Raw/Zlib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/lib/Compress/Raw/Zlib.pm?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/lib/Compress/Raw/Zlib.pm (original)
+++ trunk/libcompress-raw-zlib-perl/lib/Compress/Raw/Zlib.pm Tue Apr 28 13:52:01 2009
@@ -13,7 +13,7 @@
 use bytes ;
 our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
 
-$VERSION = '2.015';
+$VERSION = '2.017';
 $XS_VERSION = $VERSION; 
 $VERSION = eval $VERSION;
 
@@ -547,6 +547,7 @@
     ($d, $status) = new Compress::Raw::Zlib::Deflate( [OPT] ) ;
     $status = $d->deflate($input, $output) ;
     $status = $d->flush($output [, $flush_type]) ;
+    $d->deflateReset() ;
     $d->deflateParams(OPTS) ;
     $d->deflateTune(OPTS) ;
     $d->dict_adler() ;
@@ -576,8 +577,7 @@
     $crc = adler32_combine($crc1, $crc2, $len2)l
     $crc = crc32_combine($adler1, $adler2, $len2)
 
-    ZLIB_VERSION
-    ZLIB_VERNUM
+    my $version = Compress::Raw::Zlib::zlib_version();
 
 =head1 DESCRIPTION
 
@@ -763,6 +763,16 @@
 it is false, C<$output> will be truncated before any compressed data is
 written to it.
 
+=head2 B<$status = $d-E<gt>deflateReset() >
+
+This method will reset the deflation object C<$d>. It can be used when you
+are compressing multiple data streams and want to use the same object to
+compress each of them. It should only be used once the previous data stream
+has been flushed successfully, i.e. a call to C<< $d->flush(Z_FINISH) >> has
+returned C<Z_OK>.
+
+Returns C<Z_OK> if successful.
+
 =head2 B<$status = $d-E<gt>deflateParams([OPT])>
 
 Change settings for the deflate object C<$d>.
@@ -965,13 +975,36 @@
 =item B<-ConsumeInput>
 
 If set to true, this option will remove compressed data from the input
-buffer of the the C< $i-E<gt>inflate > method as the inflate progresses.
+buffer of the C<< $i->inflate >> method as the inflate progresses.
 
 This option can be useful when you are processing compressed data that is
 embedded in another file/buffer. In this case the data that immediately
 follows the compressed stream will be left in the input buffer.
 
 This option defaults to true.
+
+=item B<-LimitOutput>
+
+The C<LimitOutput> option changes the behavior of the C<< $i->inflate >>
+method so that the amount of memory used by the output buffer can be
+limited. 
+
+When C<LimitOutput> is used the size of the output buffer used will either
+be the value of the C<Bufsize> option or the amount of memory already
+allocated to C<$output>, whichever is larger. Predicting the output size
+available is tricky, so don't rely on getting an exact output buffer size.
+
+When C<LimitOutout> is not specified C<< $i->inflate >> will use as much
+memory as it takes to write all the uncompressed data it creates by
+uncompressing the input buffer.
+
+If C<LimitOutput> is enabled, the C<ConsumeInput> option will also be
+enabled.
+
+This option defaults to false.
+
+See L</The LimitOutput option> for a discussion on why C<LimitOutput> is
+needed and how to use it.
 
 =back
 
@@ -1101,7 +1134,7 @@
 
 Returns the buffer size used to carry out the decompression.
 
-=head2 Example
+=head2 Examples
 
 Here is an example of using C<inflate>.
 
@@ -1120,12 +1153,51 @@
     my ($output, $status) ;
     while (read(STDIN, $input, 4096))
     {
-        $status = $x->inflate(\$input, $output) ;
-    
-        print $output 
-            if $status == Z_OK or $status == Z_STREAM_END ;
+        $status = $x->inflate($input, $output) ;
+    
+        print $output ;
     
         last if $status != Z_OK ;
+    }
+    
+    die "inflation failed\n"
+        unless $status == Z_STREAM_END ;
+
+The next example show how to use the C<LimitOutput> option. Notice the use
+of two nested loops in this case. The outer loop reads the data from the
+input source - STDIN and the inner loop repeatedly calls C<inflate> until
+C<$input> is exhausted, we get an error, or the end of the stream is
+reached. One point worth remembering is by using the C<LimitOutput> option
+you also get C<ConsumeInput> set as well - this makes the code below much
+simpler.
+
+    use strict ;
+    use warnings ;
+    
+    use Compress::Raw::Zlib;
+    
+    my $x = new Compress::Raw::Zlib::Inflate(LimitOutput => 1)
+       or die "Cannot create a inflation stream\n" ;
+    
+    my $input = '' ;
+    binmode STDIN;
+    binmode STDOUT;
+    
+    my ($output, $status) ;
+
+  OUTER:
+    while (read(STDIN, $input, 4096))
+    {
+        do
+        {
+            $status = $x->inflate($input, $output) ;
+
+            print $output ;
+
+            last OUTER
+                unless $status == Z_OK || $status == Z_BUF_ERROR ;
+        }
+        while ($status == Z_OK && length $input);
     }
     
     die "inflation failed\n"
@@ -1153,6 +1225,148 @@
 
 These functions allow checksums to be merged.
 
+=head1 Misc
+
+=head2 my $version = Compress::Raw::Zlib::zlib_version();
+
+Returns the version of the zlib library.
+
+=head1 The LimitOutput option.
+
+By default C<< $i->inflate($input, $output) >> will uncompress I<all> data
+in C<$input> and write I<all> of the uncompressed data it has generated to
+C<$output>. This makes the interface to C<inflate> much simpler - if the
+method has uncompressed C<$input> successfully I<all> compressed data in
+C<$input> will have been dealt with. So if you are reading from an input
+source and uncompressing as you go the code will look something like this
+
+    use strict ;
+    use warnings ;
+    
+    use Compress::Raw::Zlib;
+    
+    my $x = new Compress::Raw::Zlib::Inflate()
+       or die "Cannot create a inflation stream\n" ;
+    
+    my $input = '' ;
+    
+    my ($output, $status) ;
+    while (read(STDIN, $input, 4096))
+    {
+        $status = $x->inflate($input, $output) ;
+    
+        print $output ;
+    
+        last if $status != Z_OK ;
+    }
+    
+    die "inflation failed\n"
+        unless $status == Z_STREAM_END ;
+
+The points to note are 
+
+=over 5
+
+=item *
+
+The main processing loop in the code handles reading of compressed data
+from STDIN.
+
+=item *
+
+The status code returned from C<inflate> will only trigger termination of
+the main processing loop if it isn't C<Z_OK>. When C<LimitOutput> has not
+been used the C<Z_OK> status means means that the end of the compressed
+data stream has been reached or there has been an error in uncompression.
+
+=item *
+
+After the call to C<inflate> I<all> of the uncompressed data in C<$input>
+will have been processed. This means the subsequent call to C<read> can
+overwrite it's contents without any problem.
+
+=back
+
+For most use-cases the behavior described above is acceptable (this module
+and it's predecessor, C<Compress::Zlib>, have used it for over 10 years
+without an issue), but in a few very specific use-cases the amount of
+memory required for C<$output> can prohibitively large. For example, if the
+compressed data stream contains the same pattern repeated thousands of
+times, a relatively small compressed data stream can uncompress into
+hundreds of megabytes.  Remember C<inflate> will keep allocating memory
+until I<all> the uncompressed data has been written to the output buffer -
+the size of C<$output> is unbounded. 
+
+The C<LimitOutput> option is designed to help with this use-case.
+
+The main difference in your code when using C<LimitOutput> is having to
+deal with cases where the C<$input> parameter still contains some
+uncompressed data that C<inflate> hasn't processed yet. The status code
+returned from C<inflate> will be C<Z_OK> if uncompression took place and
+C<Z_BUF_ERROR> if the output buffer is full.
+
+Below is typical code that shows how to use C<LimitOutput>.
+
+    use strict ;
+    use warnings ;
+    
+    use Compress::Raw::Zlib;
+    
+    my $x = new Compress::Raw::Zlib::Inflate(LimitOutput => 1)
+       or die "Cannot create a inflation stream\n" ;
+    
+    my $input = '' ;
+    binmode STDIN;
+    binmode STDOUT;
+    
+    my ($output, $status) ;
+
+  OUTER:
+    while (read(STDIN, $input, 4096))
+    {
+        do
+        {
+            $status = $x->inflate($input, $output) ;
+
+            print $output ;
+
+            last OUTER
+                unless $status == Z_OK || $status == Z_BUF_ERROR ;
+        }
+        while ($status == Z_OK && length $input);
+    }
+    
+    die "inflation failed\n"
+        unless $status == Z_STREAM_END ;
+
+Points to note this time:
+
+=over 5
+
+=item *
+
+There are now two nested loops in the code: the outer loop for reading the
+compressed data from STDIN, as before; and the inner loop to carry out the
+uncompression.
+
+=item *
+
+There are two exit points from the inner uncompression loop.
+
+Firstly when C<inflate> has returned a status other than C<Z_OK> or
+C<Z_BUF_ERROR>.  This means that either the end of the compressed data
+stream has been reached (C<Z_STREAM_END>) or there is an error in the
+compressed data. In either of these cases there is no point in continuing
+with reading the compressed data, so both loops are terminated.
+
+The second exit point tests if there is any data left in the input buffer,
+C<$input> - remember that the C<ConsumeInput> option is automatically
+enabled when C<LimitOutput> is used.  When the input buffer has been
+exhausted, the outer loop can run again and overwrite a now empty
+C<$input>.
+
+=back
+
 =head1 ACCESSING ZIP FILES
 
 Although it is possible (with some effort on your part) to use this
@@ -1199,7 +1413,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2009 Paul Marquess. All rights reserved.
 
 This program is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.

Modified: trunk/libcompress-raw-zlib-perl/pod/FAQ.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/pod/FAQ.pod?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/pod/FAQ.pod (original)
+++ trunk/libcompress-raw-zlib-perl/pod/FAQ.pod Tue Apr 28 13:52:01 2009
@@ -135,7 +135,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2009 Paul Marquess. All rights reserved.
 
 This program is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.

Modified: trunk/libcompress-raw-zlib-perl/t/000prereq.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/t/000prereq.t?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/t/000prereq.t (original)
+++ trunk/libcompress-raw-zlib-perl/t/000prereq.t Tue Apr 28 13:52:01 2009
@@ -19,7 +19,7 @@
         if eval { require Test::NoWarnings ;  import Test::NoWarnings; 1 };
 
 
-    my $VERSION = '2.015';
+    my $VERSION = '2.017';
     my @NAMES = qw(
 			
 			);

Modified: trunk/libcompress-raw-zlib-perl/t/02zlib.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/t/02zlib.t?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/t/02zlib.t (original)
+++ trunk/libcompress-raw-zlib-perl/t/02zlib.t Tue Apr 28 13:52:01 2009
@@ -24,13 +24,13 @@
 
     my $count = 0 ;
     if ($] < 5.005) {
-        $count = 229 ;
+        $count = 230 ;
     }
     elsif ($] >= 5.006) {
-        $count = 283 ;
+        $count = 284 ;
     }
     else {
-        $count = 241 ;
+        $count = 242 ;
     }
 
     plan tests => $count + $extra;
@@ -443,10 +443,13 @@
     
     # create a flush point
     cmp_ok $x->flush($Answer, Z_FULL_FLUSH), '==', Z_OK ;
+    
+    my $len1 = length $Answer;
      
     cmp_ok $x->deflate($goodbye, $Answer), '==', Z_OK;
     
     cmp_ok $x->flush($Answer), '==', Z_OK ;
+    my $len2 = length($Answer) - $len1 ;
      
     my ($first, @Answer) = split('', $Answer) ;
      
@@ -475,7 +478,6 @@
         $GOT .= $Z if defined $Z ;
         # print "x $status\n";
         last if $status == Z_STREAM_END or $status != Z_OK ;
-     
     }
      
     cmp_ok $status, '==', Z_DATA_ERROR ;
@@ -488,7 +490,7 @@
     my $initial = $1 ;
 
     
-    ok(($k, $err) = new Compress::Raw::Zlib::Inflate(-ConsumeInput => 0)) ;
+    ok(($k, $err) = new Compress::Raw::Zlib::Inflate(ConsumeInput => 0)) ;
     ok $k ;
     cmp_ok $err, '==', Z_OK ;
      
@@ -499,8 +501,11 @@
     cmp_ok $status, '==', Z_OK
      or diag "status '$status'\nlength rest is " . length($rest) . "\n" ;
      
-    cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR;
-    is $Z . $GOT, $goodbye ;
+    is length($rest), $len2, "expected compressed output";
+    
+    $GOT = ''; 
+    cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR";
+    is $GOT, $goodbye ;
 }
 
 {

Modified: trunk/libcompress-raw-zlib-perl/t/compress/CompTestUtils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcompress-raw-zlib-perl/t/compress/CompTestUtils.pm?rev=34257&op=diff
==============================================================================
--- trunk/libcompress-raw-zlib-perl/t/compress/CompTestUtils.pm (original)
+++ trunk/libcompress-raw-zlib-perl/t/compress/CompTestUtils.pm Tue Apr 28 13:52:01 2009
@@ -232,6 +232,8 @@
                     'IO::Compress::Lzf::lzf'                 => 'IO::Uncompress::UnLzf',
                     'IO::Compress::PPMd'                     => 'IO::Uncompress::UnPPMd' ,
                     'IO::Compress::PPMd::ppmd'               => 'IO::Uncompress::UnPPMd',
+                    'IO::Compress::Lzma'                     => 'IO::Uncompress::UnLzma',
+                    'IO::Compress::Lzma::lzma'               => 'IO::Uncompress::UnLzma',
                     'IO::Compress::DummyComp'                => 'IO::Uncompress::DummyUncomp',
                     'IO::Compress::DummyComp::dummycomp'     => 'IO::Uncompress::DummyUncomp',
                 );
@@ -275,10 +277,14 @@
                     'IO::Compress::Lzf::lzf'            => \$IO::Compress::Lzf::LzfError,
                     'IO::Uncompress::UnLzf'             => \$IO::Uncompress::UnLzf::UnLzfError,
                     'IO::Uncompress::UnLzf::unlzf'      => \$IO::Uncompress::UnLzf::UnLzfError,
-                    'IO::Compress::PPMd'                 => \$IO::Compress::PPMd::PPMdError,
-                    'IO::Compress::PPMd::ppmd'            => \$IO::Compress::PPMd::PPMdError,
-                    'IO::Uncompress::UnPPMd'             => \$IO::Uncompress::UnPPMd::UnPPMdError,
-                    'IO::Uncompress::UnPPMd::unppmd'      => \$IO::Uncompress::UnPPMd::UnPPMdError,
+                    'IO::Compress::PPMd'                => \$IO::Compress::PPMd::PPMdError,
+                    'IO::Compress::PPMd::ppmd'          => \$IO::Compress::PPMd::PPMdError,
+                    'IO::Uncompress::UnPPMd'            => \$IO::Uncompress::UnPPMd::UnPPMdError,
+                    'IO::Uncompress::UnPPMd::unppmd'    => \$IO::Uncompress::UnPPMd::UnPPMdError,
+                    'IO::Compress::Lzma'                => \$IO::Compress::Lzma::LzmaError,
+                    'IO::Compress::Lzma::lzma'          => \$IO::Compress::Lzma::LzmaError,
+                    'IO::Uncompress::UnLzma'            => \$IO::Uncompress::UnLzma::UnLzmaError,
+                    'IO::Uncompress::UnLzma::unlzma'    => \$IO::Uncompress::UnLzma::UnLzmaError,
 
                     'IO::Compress::DummyComp'           => \$IO::Compress::DummyComp::DummyCompError,
                     'IO::Compress::DummyComp::dummycomp'=> \$IO::Compress::DummyComp::DummyCompError,
@@ -307,8 +313,12 @@
                     'IO::Uncompress::UnLzop'      => 'IO::Uncompress::UnLzop::unlzop',
                     'IO::Compress::Lzf'           => 'IO::Compress::Lzf::lzf',
                     'IO::Uncompress::UnLzf'       => 'IO::Uncompress::UnLzf::unlzf',
-                    'IO::Compress::PPMd'           => 'IO::Compress::PPMd::ppmd',
-                    'IO::Uncompress::UnPPMd'       => 'IO::Uncompress::UnPPMd::unppmd',
+                    'IO::Compress::PPMd'          => 'IO::Compress::PPMd::ppmd',
+                    'IO::Uncompress::UnPPMd'      => 'IO::Uncompress::UnPPMd::unppmd',
+
+                    'IO::Compress::Lzma'          => 'IO::Compress::Lzma::lzma',
+                    'IO::Uncompress::UnLzma'      => 'IO::Uncompress::UnLzma::unlzma',
+
                     'IO::Compress::DummyComp'     => 'IO::Compress::DummyComp::dummyuncomp',
                     'IO::Uncompress::DummyUncomp' => 'IO::Uncompress::DummyUncomp::dummyuncomp',
                  );
@@ -337,6 +347,8 @@
                  'IO::Compress::Lzf'                     => 'IO::Uncompress::UnLzf',
                  'IO::Compress::PPMd::ppmd'              => 'IO::Uncompress::UnPPMd::unppmd',
                  'IO::Compress::PPMd'                    => 'IO::Uncompress::UnPPMd',
+                 'IO::Compress::Lzma::lzma'              => 'IO::Uncompress::UnLzma::unlzma',
+                 'IO::Compress::Lzma'                    => 'IO::Uncompress::UnLzma',
                  'IO::Compress::DummyComp::dummycomp'    => 'IO::Uncompress::DummyUncomp::dummyuncomp',
                  'IO::Compress::DummyComp'               => 'IO::Uncompress::DummyUncomp',
              );
@@ -396,6 +408,8 @@
                     'IO::Uncompress::AnyInflate::anyinflate'  => 'IO::Compress::Gzip',
                     'IO::Uncompress::AnyUncompress'           => 'IO::Compress::Gzip',
                     'IO::Uncompress::AnyUncompress::anyuncompress'  => 'IO::Compress::Gzip',
+                    'IO::Uncompress::UnLzma'                  => 'IO::Compress::Lzma',
+                    'IO::Uncompress::UnLzma::unlzma'          => 'IO::Compress::Lzma',
                     'IO::Uncompress::DummyUncomp'             => 'IO::Compress::DummyComp',
                     'IO::Uncompress::DummyUncomp::dummyuncomp'=> 'IO::Compress::DummyComp',
                 );




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