[Bps-public-commit] r9427 - in Net-Server-IMAP: . lib/Net/Server/IMAP
alexmv at bestpractical.com
alexmv at bestpractical.com
Tue Oct 23 19:42:02 EDT 2007
Author: alexmv
Date: Tue Oct 23 19:42:02 2007
New Revision: 9427
Modified:
Net-Server-IMAP/ (props changed)
Net-Server-IMAP/lib/Net/Server/IMAP.pm
Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm
Log:
r23883 at zoq-fot-pik: chmrr | 2007-10-23 19:39:25 -0400
* We can have multiple lines to read at once
Modified: Net-Server-IMAP/lib/Net/Server/IMAP.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP.pm (original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP.pm Tue Oct 23 19:42:02 2007
@@ -76,7 +76,7 @@
local $self->{connection} = $self->connections->{ $fh->fileno };
local $self->{auth} = $self->connections->{ $fh->fileno }->auth;
local $SIG{PIPE} = sub { warn "Broken pipe\n"; $self->connections->{ $fh->fileno}->close };
- $self->connections->{ $fh->fileno }->handle_command;
+ $self->connections->{ $fh->fileno }->handle_lines;
}
}
}
@@ -112,6 +112,7 @@
sub accept_connection {
my $self = shift;
my $handle = shift;
+ $handle->blocking(0);
$self->select->add($handle);
my $conn = Net::Server::IMAP::Connection->new(
io_handle => $handle,
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 Tue Oct 23 19:42:02 2007
@@ -21,9 +21,14 @@
$self->out( '* OK IMAP4rev1 Server' . "\r\n" );
}
-sub handle_command {
+sub handle_lines {
my $self = shift;
- my $content = $self->io_handle->getline();
+ $self->handle_command($_) while $_ = $self->io_handle->getline();
+}
+
+sub handle_command {
+ my $self = shift;
+ my $content = shift;
unless ( defined $content ) {
$self->log("Connection closed by remote host");
More information about the Bps-public-commit
mailing list