line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Proxy::Engine::NoFork; |
2
|
|
|
|
|
|
|
$HTTP::Proxy::Engine::NoFork::VERSION = '0.303'; |
3
|
1
|
|
|
1
|
|
893
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
116
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our @ISA = qw( HTTP::Proxy::Engine ); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->make_accessors( 'select' ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub start { |
10
|
0
|
|
|
0
|
1
|
|
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
|
|
|
|
|
|
|
sub run { |
20
|
0
|
|
|
0
|
1
|
|
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; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |