|
From: <jgr...@us...> - 2003-07-26 17:14:45
|
Update of /cvsroot/popfile/engine/Proxy
In directory sc8-pr-cvs1:/tmp/cvs-serv1930/Proxy
Modified Files:
NNTP.pm Proxy.pm
Log Message:
Completed test suite for Proxy::Proxy, now have 100% line coverage
Index: NNTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/NNTP.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** NNTP.pm 9 Jul 2003 21:15:39 -0000 1.13
--- NNTP.pm 26 Jul 2003 17:14:42 -0000 1.14
***************
*** 290,294 ****
if ( $ command =~ /^ *$/ ) {
if ( $news && $news->connected ) {
! $self->get_response_($news, $client, $command, '',1);
$self->flush_extra_( $news, $client, 0 );
next;
--- 290,294 ----
if ( $ command =~ /^ *$/ ) {
if ( $news && $news->connected ) {
! $self->get_response_($news, $client, $command, 1);
$self->flush_extra_( $news, $client, 0 );
next;
Index: Proxy.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/Proxy.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** Proxy.pm 26 Jul 2003 15:40:19 -0000 1.26
--- Proxy.pm 26 Jul 2003 17:14:42 -0000 1.27
***************
*** 94,98 ****
my $port = $self->config_( 'port' );
my $name = $self->name();
! print STDERR <<EOM;
\nCouldn't start the $name proxy because POPFile could not bind to the
--- 94,98 ----
my $port = $self->config_( 'port' );
my $name = $self->name();
! print STDERR <<EOM; # PROFILE BLOCK START
\nCouldn't start the $name proxy because POPFile could not bind to the
***************
*** 103,107 ****
EOM
!
return 0;
}
--- 103,107 ----
EOM
! # PROFILE BLOCK STOP
return 0;
}
***************
*** 432,436 ****
# $client The local mail client (created with IO::) that needs the response
# $command The text of the command to send (we add an EOL)
- # $error The error string if the response fails
# $null_resp Allow a null response
#
--- 432,435 ----
***************
*** 440,451 ****
# ---------------------------------------------------------------------------------------------
- #TODO: Implement or remove $error as defined in interface above
sub get_response_
{
! my ( $self, $mail, $client, $command, $error, $null_resp ) = @_;
$null_resp = 0 if (!defined $null_resp);
! unless ( $mail ) {
# $mail is undefined - return an error intead of crashing
$self->tee_( $client, "$self->{connection_timeout_error_}$eol" );
--- 439,449 ----
# ---------------------------------------------------------------------------------------------
sub get_response_
{
! my ( $self, $mail, $client, $command, $null_resp ) = @_;
$null_resp = 0 if (!defined $null_resp);
! unless ( defined($mail) && $mail->connected ) {
# $mail is undefined - return an error intead of crashing
$self->tee_( $client, "$self->{connection_timeout_error_}$eol" );
***************
*** 459,487 ****
# Retrieve a single string containing the response
- if ( $mail->connected ) {
- my $selector = new IO::Select( $mail );
- my ($ready) = $selector->can_read( (!$null_resp?$self->global_config_( 'timeout' ):.5) );
! if ( ( defined( $ready ) ) && ( $ready == $mail ) ) {
! $response = <$mail>;
! if ( $response ) {
! # Echo the response up to the mail client
! $self->tee_( $client, $response );
! return $response;
! }
! }
! if (!$null_resp) {
! # An error has occurred reading from the mail server
! $self->tee_( $client, "$self->{connection_timeout_error_}$eol" );
! return $self->{connection_timeout_error_};
! } else {
! $self->tee_($client, "");
! return "";
}
}
! return $response;
}
--- 457,483 ----
# Retrieve a single string containing the response
! my $selector = new IO::Select( $mail );
! my ($ready) = $selector->can_read( (!$null_resp?$self->global_config_( 'timeout' ):.5) );
! if ( ( defined( $ready ) ) && ( $ready == $mail ) ) {
! $response = <$mail>;
! if ( $response ) {
! # Echo the response up to the mail client
! $self->tee_( $client, $response );
! return $response;
}
}
! if ( !$null_resp ) {
! # An error has occurred reading from the mail server
!
! $self->tee_( $client, "$self->{connection_timeout_error_}$eol" );
! return $self->{connection_timeout_error_};
! } else {
! $self->tee_($client, "");
! return "";
! }
}
|