| 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__ | ||