From: <ssc...@us...> - 2003-03-18 00:03:27
|
Update of /cvsroot/popfile/engine/Proxy In directory sc8-pr-cvs1:/tmp/cvs-serv24818 Modified Files: Proxy.pm Log Message: Allow for the possibility of a null server response to a command Index: Proxy.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/Proxy.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Proxy.pm 7 Mar 2003 02:59:38 -0000 1.4 --- Proxy.pm 18 Mar 2003 00:03:23 -0000 1.5 *************** *** 340,344 **** print $client $_; ! # The termination has to be a single line with exactly a dot on it and nothing # else other than line termination characters. This is vital so that we do --- 340,345 ---- print $client $_; ! #$self->tee_($client, $_); ! # The termination has to be a single line with exactly a dot on it and nothing # else other than line termination characters. This is vital so that we do *************** *** 391,394 **** --- 392,396 ---- # $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 # # Send $command to $mail, receives the response and echoes it to the $client and the debug *************** *** 396,402 **** # # --------------------------------------------------------------------------------------------- sub get_response_ { ! my ( $self, $mail, $client, $command, $error ) = @_; unless ( $mail ) { --- 398,408 ---- # # --------------------------------------------------------------------------------------------- + + #TODO: Implement or remove $error as defined in interface above sub get_response_ { ! my ( $self, $mail, $client, $command, $error, $use_timeout ) = @_; ! ! $null_resp = 0 if (!defined $use_timeout); unless ( $mail ) { *************** *** 414,418 **** if ( $mail->connected ) { my $selector = new IO::Select( $mail ); ! my ($ready) = $selector->can_read($self->global_config_( 'timeout' )); if ( ( defined( $ready ) ) && ( $ready == $mail ) ) { --- 420,424 ---- 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 ) ) { *************** *** 425,432 **** } } ! ! # An error has occurred reading from the mail server ! $self->tee_( $client, "$self->{connection_timeout_error_}$eol" ); ! return $self->{connection_timeout_error_}; } --- 431,443 ---- } } ! ! 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 ""; ! } } |