Changeset 531

Show
Ignore:
Timestamp:
05/02/07 22:06:57 (2 years ago)
Author:
bradfitz
Message:

Checking in changes prior to tagging of version 1.21. Changelog diff is:

Index: ChangeLog
===================================================================
--- ChangeLog (revision 529)
+++ ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2007-05-02: version 1.21
+
+ * new faster optional interface for GetParser subclasses. doing
+ this release so upcoming Cache::Memcached::GetParserXS can
+ depend on this. otherwise this release isn't interesting.
+

2007-04-16: version 1.20


  • fix "Warning produced when flush_all called" from CDENT
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/api/perl/ChangeLog

    r517 r531  
     12007-05-02: version 1.21 
     2 
     3        * new faster optional interface for GetParser subclasses.  doing 
     4          this release so upcoming Cache::Memcached::GetParserXS can 
     5          depend on this.  otherwise this release isn't interesting. 
     6 
    172007-04-16: version 1.20 
    28 
  • trunk/api/perl/lib/Cache/Memcached.pm

    r517 r531  
    99 
    1010use strict; 
     11use warnings; 
     12 
    1113no strict 'refs'; 
    1214use Storable (); 
     
    4143 
    4244use vars qw($VERSION $HAVE_ZLIB $FLAG_NOSIGNAL); 
    43 $VERSION = "1.20"; 
     45$VERSION = "1.21"; 
    4446 
    4547BEGIN { 
     
    623625    }; 
    624626 
     627    # $finalize->($key, $flags) 
     628    # $finalize->({ $key => $flags, $key => $flags }); 
    625629    my $finalize = sub { 
    626         my ($k, $flags) = @_; 
    627  
    628         # remove trailing \r\n 
    629         chop $ret->{$k}; chop $ret->{$k}; 
    630  
    631         $ret->{$k} = Compress::Zlib::memGunzip($ret->{$k}) 
    632             if $HAVE_ZLIB && $flags & F_COMPRESS; 
    633         if ($flags & F_STORABLE) { 
    634             # wrapped in eval in case a perl 5.6 Storable tries to 
    635             # unthaw data from a perl 5.8 Storable.  (5.6 is stupid 
    636             # and dies if the version number changes at all.  in 5.8 
    637             # they made it only die if it unencounters a new feature) 
    638             eval { 
    639                 $ret->{$k} = Storable::thaw($ret->{$k}); 
    640             }; 
    641             # so if there was a problem, just treat it as a cache miss. 
    642             if ($@) { 
    643                 delete $ret->{$k}; 
     630        my $map = $_[0]; 
     631        $map = {@_} unless ref $map; 
     632 
     633        while (my ($k, $flags) = each %$map) { 
     634 
     635            # remove trailing \r\n 
     636            chop $ret->{$k}; chop $ret->{$k}; 
     637 
     638            $ret->{$k} = Compress::Zlib::memGunzip($ret->{$k}) 
     639                if $HAVE_ZLIB && $flags & F_COMPRESS; 
     640            if ($flags & F_STORABLE) { 
     641                # wrapped in eval in case a perl 5.6 Storable tries to 
     642                # unthaw data from a perl 5.8 Storable.  (5.6 is stupid 
     643                # and dies if the version number changes at all.  in 5.8 
     644                # they made it only die if it unencounters a new feature) 
     645                eval { 
     646                    $ret->{$k} = Storable::thaw($ret->{$k}); 
     647                }; 
     648                # so if there was a problem, just treat it as a cache miss. 
     649                if ($@) { 
     650                    delete $ret->{$k}; 
     651                } 
    644652            } 
    645653        }