Update of /cvsroot/popfile/engine/Proxy
In directory sc8-pr-cvs1:/tmp/cvs-serv1807/Proxy
Modified Files:
NNTP.pm POP3.pm Proxy.pm SMTP.pm
Log Message:
ADDITION OF FORCE_FORK PARAMETER FOR PROXIES
Proxy.pm:
Handle the force_fork parameter. If it is 1 then when we get
a connection from a client we fork, if it is 0 then we handle
the connection in line and queue up connections using the standard
TCP mechanism up to the maximum backlog for the platform.
POP3.pm:
NNTP.pm:
Default to not forking
SMTP.pm:
Default to forking
Index: NNTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/NNTP.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** NNTP.pm 31 Jul 2003 16:32:21 -0000 1.15
--- NNTP.pm 10 Sep 2003 04:33:33 -0000 1.16
***************
*** 71,74 ****
--- 71,78 ----
my ( $self ) = @_;
+ # By default we don't fork
+
+ $self->config_( 'force_fork', 0 );
+
# Default ports for NNTP service and the user interface
Index: POP3.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** POP3.pm 1 Aug 2003 02:45:42 -0000 1.72
--- POP3.pm 10 Sep 2003 04:33:33 -0000 1.73
***************
*** 71,74 ****
--- 71,77 ----
my ( $self ) = @_;
+ # By default we don't fork
+ $self->config_( 'force_fork', 0 );
+
# Default ports for POP3 service and the user interface
$self->config_( 'port', 110 );
Index: Proxy.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/Proxy.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Proxy.pm 28 Aug 2003 15:27:56 -0000 1.33
--- Proxy.pm 10 Sep 2003 04:33:33 -0000 1.34
***************
*** 193,197 ****
}
-
# ---------------------------------------------------------------------------------------------
#
--- 193,196 ----
***************
*** 204,208 ****
#
# ---------------------------------------------------------------------------------------------
-
sub read_pipe_
{
--- 203,206 ----
***************
*** 329,346 ****
$self->global_config_( 'download_count', $self->global_config_( 'download_count' ) + 1 );
! my ($pid,$pipe) = &{$self->{forker_}};
binmode( $client );
! # If we are in the parent process then push the pipe handle onto the children list
! if ( ( defined( $pid ) ) && ( $pid != 0 ) ) {
! $self->{children__}{$pid} = $pipe;
! }
! # If we fail to fork, or are in the child process then process this request
! if ( !defined( $pid ) || ( $pid == 0 ) ) {
! $self->{child_}( $self, $client, $self->global_config_( 'download_count' ), $pipe );
! exit(0) if ( defined( $pid ) );
}
}
--- 327,357 ----
$self->global_config_( 'download_count', $self->global_config_( 'download_count' ) + 1 );
!
! # If we have force_fork turned on then we will do a fork, otherwise we will handle this
! # inline, in the inline case we need to create the two ends of a pipe that will be used
! # as if there was a child process
!
binmode( $client );
! if ( $self->config_( 'force_fork' ) ) {
! my ( $pid, $pipe ) = &{$self->{forker_}};
! # If we are in the parent process then push the pipe handle onto the children list
! if ( ( defined( $pid ) ) && ( $pid != 0 ) ) {
! $self->{children__}{$pid} = $pipe;
! }
! # If we fail to fork, or are in the child process then process this request
!
! if ( !defined( $pid ) || ( $pid == 0 ) ) {
! $self->{child_}( $self, $client, $self->global_config_( 'download_count' ), $pipe );
! exit(0) if ( defined( $pid ) );
! }
! } else {
! pipe my $reader, my $writer;
!
! $self->{child_}( $self, $client, $self->global_config_( 'download_count' ), $writer );
! $self->{flush_child_data_}( $self, $reader );
}
}
Index: SMTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/SMTP.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** SMTP.pm 31 Jul 2003 16:32:21 -0000 1.16
--- SMTP.pm 10 Sep 2003 04:33:33 -0000 1.17
***************
*** 71,85 ****
my ( $self ) = @_;
! # Default port for SMTP service
$self->config_( 'port', 25 );
# Where to forward on to
-
$self->config_( 'chain_server', '' );
$self->config_( 'chain_port', 25 );
# Only accept connections from the local machine for smtp
-
$self->config_( 'local', 1 );
--- 71,85 ----
my ( $self ) = @_;
! # By default we do fork
! $self->config_( 'force_fork', 1 );
+ # Default port for SMTP service
$self->config_( 'port', 25 );
# Where to forward on to
$self->config_( 'chain_server', '' );
$self->config_( 'chain_port', 25 );
# Only accept connections from the local machine for smtp
$self->config_( 'local', 1 );
|