Proxy/Engine/NoFork.pm

filter: Statementstmt 43.7% 7 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 100% 2 / 2 totaltotal 47.6% 10 / 21 CC 2 SCAR 13.2
CC
2
Cov
44%
run
6.0
start
2.0
BEGIN
1.0
CRAP 3.8
« Proxy/Engine.pm ↑ Summary Proxy/Engine/Threaded.pm »
1 package HTTP::Proxy::Engine::NoFork;
2 1 $HTTP::Proxy::Engine::NoFork::VERSION = '0.304';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our @ISA = qw( HTTP::Proxy::Engine );
6  
7 1 __PACKAGE__->make_accessors( 'select' );
8  
9 0 ▶sub start {
Subroutine start: not called CC=1 SCAR=6.9
Pod documented
10 0 my $self = shift;
11 0 my $proxy = $self->proxy;
12  
13 0 $self->select( IO::Select->new( $proxy->daemon ) );
14  
15 # clients will not block the proxy by keeping the connection open
16 0 $proxy->max_keep_alive_requests( 1 );
17 }
18  
19 0 ▶sub run {
Subroutine run: not called CC=2 SCAR=17.9
Pod documented
20 0 my $self = shift;
21 0 my $proxy = $self->proxy;
22  
23 # check for new connections
24 0 for my $fh ( $self->select->can_read() ) { # there's only one, anyway
25  
26 # single-process proxy
27 0 $proxy->serve_connections( $fh->accept );
28 0 $proxy->new_connection;
29 }
30 }
31  
32 1 1;
33  
34 __END__
« Proxy/Engine.pm ↑ Summary Proxy/Engine/Threaded.pm »