[Bps-public-commit] r9461 - in Net-Server-IMAP: lib/Net/Server/IMAP
alexmv at bestpractical.com
alexmv at bestpractical.com
Thu Oct 25 14:55:42 EDT 2007
Author: alexmv
Date: Thu Oct 25 14:55:41 2007
New Revision: 9461
Modified:
Net-Server-IMAP/ (props changed)
Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm
Log:
r24009 at zoq-fot-pik: chmrr | 2007-10-25 14:52:20 -0400
* Don't spin-wait when connections close
Modified: Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm (original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm Thu Oct 25 14:55:41 2007
@@ -23,19 +23,21 @@
sub handle_lines {
my $self = shift;
- $self->handle_command($_) while $_ = $self->io_handle->getline();
-}
-
-sub handle_command {
- my $self = shift;
- my $content = shift;
+ my $i = 0;
+ ++$i and $self->handle_command($_) while $_ = $self->io_handle->getline();
- unless ( defined $content ) {
+ if ( not $i ) {
$self->log("Connection closed by remote host");
$self->close;
return;
}
+}
+
+sub handle_command {
+ my $self = shift;
+ my $content = shift;
+
$self->log("C(@{[$self->io_handle->peerport]},@{[$self->auth ? $self->auth->user : '???']},@{[$self->is_selected ? $self->selected->full_path : 'unselected']}): $content");
if ( $self->pending ) {
More information about the Bps-public-commit
mailing list