Update of /cvsroot/popfile/engine/Proxy
In directory sc8-pr-cvs1:/tmp/cvs-serv18823
Modified Files:
POP3.pm
Log Message:
servers are given a timeout period to return a newline on their banners
Index: POP3.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** POP3.pm 17 Feb 2003 22:40:06 -0000 1.34
--- POP3.pm 17 Feb 2003 22:43:37 -0000 1.35
***************
*** 743,754 ****
my $buf = '';
my $max_length = 8192;
! my $n = sysread( $mail, $buf, $max_length, length $buf );
- debug( $self, "Connection returned: $buf" );
if ( !( $buf =~ /[\r\n]/ ) ) {
! for my $i ( 0..4 ) {
! flush_extra( $self, $mail, $client, 1 );
}
}
return $mail;
}
--- 743,772 ----
my $buf = '';
my $max_length = 8192;
! my $n = sysread( $mail, $buf, $max_length, length $buf );
if ( !( $buf =~ /[\r\n]/ ) ) {
! my $hit_newline = 0;
! my $temp_buf;
!
! # Read until timeout or a newline (newline _should_ be immediate)
!
! for my $i ( 0..($self->{configuration}->{configuration}{timeout} * 100) ) {
! if ( !$hit_newline ) {
! $temp_buf = flush_extra( $self, $mail, $client, 1 );
! $hit_newline = ( $temp_buf =~ /[\r\n]/ );
! $buf .= $temp_buf;
! } else {
! last;
! }
}
}
+ debug( $self, "Connection returned: $buf" );
+
+ # Clean up junk following a newline
+
+ for my $i ( 0..4 ) {
+ flush_extra( $self, $mail, $client, 1 );
+ }
+
return $mail;
}
***************
*** 767,770 ****
--- 785,790 ----
# debug messages!
#
+ # Returns the extra data flushed
+ #
# $mail The handle of the real mail server
# $client The mail client talking to us
***************
*** 787,792 ****
--- 807,814 ----
tee( $self, $client, $buf ) if ( $discard != 1 );
+ return $buf;
}
}
}
+ return '';
}
|