Update of /cvsroot/popfile/engine/Proxy
In directory sc8-pr-cvs1:/tmp/cvs-serv22859/Proxy
Modified Files:
Proxy.pm
Log Message:
Clean up code for tee_ and flush_extra_
Index: Proxy.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/Proxy.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Proxy.pm 21 Jul 2003 19:06:14 -0000 1.23
--- Proxy.pm 21 Jul 2003 19:53:56 -0000 1.24
***************
*** 325,332 ****
# Send the message to the debug output and then send it to the appropriate socket
$self->log_( $text );
! print $socket $text if $socket->connected;
}
-
# ---------------------------------------------------------------------------------------------
#
--- 325,331 ----
# Send the message to the debug output and then send it to the appropriate socket
$self->log_( $text );
! print $socket $text;
}
# ---------------------------------------------------------------------------------------------
#
***************
*** 357,361 ****
print $client $_;
} else {
! $self->tee_($client, $_);
}
} else {
--- 356,360 ----
print $client $_;
} else {
! $self->tee_( $client, $_ );
}
} else {
***************
*** 405,424 ****
my ( $self, $mail, $client, $discard ) = @_;
! if ( $mail ) {
! if ( $mail->connected ) {
! my $selector = new IO::Select( $mail );
! my $buf = '';
! my $max_length = 8192;
! while( 1 ) {
! last unless () = $selector->can_read(0.01);
! last unless ( my $n = sysread( $mail, $buf, $max_length, length $buf ) );
! $self->tee_( $client, $buf ) if ( $discard != 1 );
! return $buf;
! }
! }
}
! return '';
}
--- 404,424 ----
my ( $self, $mail, $client, $discard ) = @_;
! $discard = 0 if ( !defined( $discard ) );
! my $selector = new IO::Select( $mail );
! my $buf = '';
! my $max_length = 8192;
! my ( $ready ) = $selector->can_read(0.01);
!
! if ( $ready == $mail ) {
! my $n = sysread( $mail, $buf, $max_length, length $buf );
!
! if ( $n > 0 ) {
! $self->tee_( $client, $buf ) if ( $discard != 1 );
! }
}
!
! return $buf;
}
|