[Bps-public-commit] Net-IMAP-Server branch, master, updated. 1.35-3-g1d5cfb8

Alex Vandiver alexmv at bestpractical.com
Thu Jan 17 17:30:34 EST 2013


The branch, master has been updated
       via  1d5cfb867b21c47e7b3113daa0b38b90b350561b (commit)
       via  e3d7c8ec6294af4572e1ad76ab6b097f16616113 (commit)
       via  44a798c83808c453baedb3b370ceecbc31a639c2 (commit)
      from  8b9c53bdfa29f74cd568e2b3bb0a118c60d7f71f (commit)

Summary of changes:
 Changes                                     | 4 ++++
 lib/Net/IMAP/Server.pm                      | 2 +-
 lib/Net/IMAP/Server/Command/Authenticate.pm | 3 ++-
 lib/Net/IMAP/Server/Connection.pm           | 6 ++++--
 4 files changed, 11 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 44a798c83808c453baedb3b370ceecbc31a639c2
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jan 17 08:00:06 2013 -0500

    Revert "Always trim newlines from commands, even continuations"
    
    Removing newlines broke character counts on literals, leading to APPEND
    statements and the like hanging.
    
    This reverts commit 38943296dcd37cdab343bb8c377bf994b3bed68d.

diff --git a/lib/Net/IMAP/Server/Command/Authenticate.pm b/lib/Net/IMAP/Server/Command/Authenticate.pm
index c8cc006..ece9552 100644
--- a/lib/Net/IMAP/Server/Command/Authenticate.pm
+++ b/lib/Net/IMAP/Server/Command/Authenticate.pm
@@ -53,7 +53,7 @@ sub continue {
     $self->connection->pending(undef);
 
     return $self->bad_command("Login cancelled")
-        if not defined $line or $line =~ /^\*$/;
+        if not defined $line or $line =~ /^\*[\r\n]+$/;
 
     my $decoded = decode_base64($line);
     return $self->bad_command("Invalid base64")
diff --git a/lib/Net/IMAP/Server/Connection.pm b/lib/Net/IMAP/Server/Connection.pm
index dc62f2d..49df6ec 100644
--- a/lib/Net/IMAP/Server/Connection.pm
+++ b/lib/Net/IMAP/Server/Connection.pm
@@ -259,9 +259,10 @@ sub handle_command {
     my $self    = shift;
     my $content = shift;
 
-    $content =~ s/[\r\n]+$//;
+    my $output = $content;
+    $output =~ s/[\r\n]+$//;
     $self->log( 4,
-        "C(@{[$self]},@{[$self->auth ? $self->auth->user : '???']},@{[$self->is_selected ? $self->selected->full_path : 'unselected']}): $content"
+        "C(@{[$self]},@{[$self->auth ? $self->auth->user : '???']},@{[$self->is_selected ? $self->selected->full_path : 'unselected']}): $output"
     );
 
     if ( $self->pending ) {
@@ -360,6 +361,7 @@ undef if parsing fails for some reason.
 sub parse_command {
     my $self = shift;
     my $line = shift;
+    $line =~ s/[\r\n]+$//;
     my $TAG = qr/([^\(\)\{ \*\%"\\\+}]+)/;
     unless ( $line =~ /^$TAG\s+(\w+)(?:\s+(.+?))?$/ ) {
         if ( $line !~ /^$TAG\s+/ ) {

commit e3d7c8ec6294af4572e1ad76ab6b097f16616113
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jan 17 08:07:25 2013 -0500

    Trim newlines before decoding base64 date
    
    3894329 was overzealous, and removed newlines from all continuations,
    including inline literals; however, the need to ensure newlines are
    removed before decoding base64 data is still present.  Explicitly strip
    newlines before decoding base64'd AUTHENTICATE data.

diff --git a/lib/Net/IMAP/Server/Command/Authenticate.pm b/lib/Net/IMAP/Server/Command/Authenticate.pm
index ece9552..c6de31f 100644
--- a/lib/Net/IMAP/Server/Command/Authenticate.pm
+++ b/lib/Net/IMAP/Server/Command/Authenticate.pm
@@ -55,6 +55,7 @@ sub continue {
     return $self->bad_command("Login cancelled")
         if not defined $line or $line =~ /^\*[\r\n]+$/;
 
+    $line =~ s/[\r\n]+$//;
     my $decoded = decode_base64($line);
     return $self->bad_command("Invalid base64")
         if encode_base64($decoded, "") ne $line;

commit 1d5cfb867b21c47e7b3113daa0b38b90b350561b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jan 17 08:10:55 2013 -0500

    Version 1.36 releng

diff --git a/Changes b/Changes
index 757c37e..8f8938b 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Net-IMAP-Server
 
+1.36   Thu Jan 17 08:09:17 2012
+        * Fix string literals (such as for APPEND), which have counted
+          characters incorrectly since 1.32 due to newline trimming.
+
 1.35   Mon Nov 12 03:22:17 2012
         * Switch to AnyEvent, from EV
 
diff --git a/lib/Net/IMAP/Server.pm b/lib/Net/IMAP/Server.pm
index b38b9c4..bac9d3b 100644
--- a/lib/Net/IMAP/Server.pm
+++ b/lib/Net/IMAP/Server.pm
@@ -9,7 +9,7 @@ use UNIVERSAL::require;
 use Coro;
 use 5.008_008;
 
-our $VERSION = '1.35';
+our $VERSION = '1.36';
 
 =head1 NAME
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list