[Bps-public-commit] Net-IMAP-Server branch, master, updated. 1.34-3-g8b9c53b

Alex Vandiver alexmv at bestpractical.com
Mon Nov 12 03:24:27 EST 2012


The branch, master has been updated
       via  8b9c53bdfa29f74cd568e2b3bb0a118c60d7f71f (commit)
       via  86260251cce89d9596a6af87615506d6493547ce (commit)
       via  1704f8a25d952a161092159c0233fccb96a884bd (commit)
      from  e3df0b1296c437752f9f6c5369a86e27ec06c998 (commit)

Summary of changes:
 Changes                           |  3 +++
 Makefile.PL                       |  1 +
 lib/Net/IMAP/Server.pm            |  2 +-
 lib/Net/IMAP/Server/Connection.pm | 14 +++++++-------
 t/lib/Net/IMAP/Server/Test.pm     |  2 ++
 5 files changed, 14 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit 1704f8a25d952a161092159c0233fccb96a884bd
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Nov 12 03:19:40 2012 -0500

    Switch from an implicit EV dependency to an explicit AnyEvent dependency
    
    Previously, EV::timer was used to set up the inactivity timers, despite
    EV not being imported explicitly.  With Net::Server::Coro 1.3, EV is no
    longer a dependency; it has switched to the more general AnyEvent
    module.  Follow suit by using AnyEvent for the one explicit timer that
    is needed.

diff --git a/Makefile.PL b/Makefile.PL
index e285d3a..21863e5 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -10,6 +10,7 @@ license('perl');
 readme_from('lib/Net/IMAP/Server.pm');
 sign;
 
+requires('AnyEvent');
 requires('Class::Accessor');
 requires('Coro');
 requires('DateTime');
diff --git a/lib/Net/IMAP/Server/Connection.pm b/lib/Net/IMAP/Server/Connection.pm
index eb6823e..57267cf 100644
--- a/lib/Net/IMAP/Server/Connection.pm
+++ b/lib/Net/IMAP/Server/Connection.pm
@@ -6,6 +6,7 @@ use strict;
 use base 'Class::Accessor';
 
 use Coro;
+use AnyEvent;
 use Scalar::Util qw/weaken/;
 
 use Net::IMAP::Server::Error;
@@ -216,7 +217,6 @@ Updates the inactivity timer.
 
 sub update_timer {
     my $self = shift;
-    $self->timer->stop if $self->timer;
     $self->timer(undef);
     my $weakself = $self;
     weaken($weakself);
@@ -225,15 +225,15 @@ sub update_timer {
         $weakself->coro->ready;
     };
     if ( $self->is_unauth and $self->server->unauth_idle ) {
-        $self->timer( EV::timer $self->server->unauth_idle, 0, $timeout );
+        $self->timer( AnyEvent->timer( after => $self->server->unauth_idle, cb => $timeout ) );
     } elsif ( $self->server->auth_idle ) {
-        $self->timer( EV::timer $self->server->auth_idle, 0, $timeout );
+        $self->timer( AnyEvent->timer( after => $self->server->auth_idle, cb => $timeout ) );
     }
 }
 
-=head2 timer [EV watcher]
+=head2 timer [AnyEvent watcher]
 
-Returns the L<EV> watcher in charge of the inactivity timer.
+Returns the L<AnyEvent> watcher in charge of the inactivity timer.
 
 =head2 commands
 
@@ -343,7 +343,7 @@ sub close {
         $self->io_handle->close;
         $self->io_handle(undef);
     }
-    $self->timer->stop     if $self->timer;
+    $self->timer( undef )  if $self->timer;
     $self->selected->close if $self->selected;
     $self->model->close    if $self->model;
     $self->server->connection(undef);
diff --git a/t/lib/Net/IMAP/Server/Test.pm b/t/lib/Net/IMAP/Server/Test.pm
index 2642ff4..2b95892 100644
--- a/t/lib/Net/IMAP/Server/Test.pm
+++ b/t/lib/Net/IMAP/Server/Test.pm
@@ -5,6 +5,8 @@ use strict;
 use warnings;
 
 use Socket;
+use AnyEvent;
+AnyEvent::detect();
 use IO::Socket::SSL;
 use Time::HiRes qw();
 

commit 86260251cce89d9596a6af87615506d6493547ce
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Nov 12 03:21:45 2012 -0500

    During global destruction, $self->server may be undef

diff --git a/lib/Net/IMAP/Server/Connection.pm b/lib/Net/IMAP/Server/Connection.pm
index 57267cf..dc62f2d 100644
--- a/lib/Net/IMAP/Server/Connection.pm
+++ b/lib/Net/IMAP/Server/Connection.pm
@@ -346,7 +346,7 @@ sub close {
     $self->timer( undef )  if $self->timer;
     $self->selected->close if $self->selected;
     $self->model->close    if $self->model;
-    $self->server->connection(undef);
+    $self->server->connection(undef) if $self->server;
     $self->coro(undef);
 }
 

commit 8b9c53bdfa29f74cd568e2b3bb0a118c60d7f71f
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Nov 12 03:23:23 2012 -0500

    Version 1.35 releng

diff --git a/Changes b/Changes
index f87e7cb..757c37e 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Net-IMAP-Server
 
+1.35   Mon Nov 12 03:22:17 2012
+        * Switch to AnyEvent, from EV
+
 1.34   Sat Jul 28 15:49:17 2012
         * Don't rely on $" being set to the default " " during UID
           SEARCH
diff --git a/lib/Net/IMAP/Server.pm b/lib/Net/IMAP/Server.pm
index e3c2e04..b38b9c4 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.34';
+our $VERSION = '1.35';
 
 =head1 NAME
 

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



More information about the Bps-public-commit mailing list