line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Component::Server::SimpleHTTP::State; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
689
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
927
|
use POE::Wheel::ReadWrite; |
|
1
|
|
|
|
|
159903
|
|
|
1
|
|
|
|
|
39
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '2.18'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
439
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has 'wheel' => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
isa => 'POE::Wheel::ReadWrite', |
14
|
|
|
|
|
|
|
clearer => 'clear_wheel', |
15
|
|
|
|
|
|
|
predicate => 'has_wheel', |
16
|
|
|
|
|
|
|
required => 1, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'response' => ( |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
isa => 'POE::Component::Server::SimpleHTTP::Response', |
22
|
|
|
|
|
|
|
writer => 'set_response', |
23
|
|
|
|
|
|
|
clearer => 'clear_response', |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has 'request' => ( |
27
|
|
|
|
|
|
|
is => 'ro', |
28
|
|
|
|
|
|
|
isa => 'HTTP::Request', |
29
|
|
|
|
|
|
|
writer => 'set_request', |
30
|
|
|
|
|
|
|
clearer => 'clear_request', |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has 'connection' => ( |
34
|
|
|
|
|
|
|
is => 'ro', |
35
|
|
|
|
|
|
|
isa => 'POE::Component::Server::SimpleHTTP::Connection', |
36
|
|
|
|
|
|
|
writer => 'set_connection', |
37
|
|
|
|
|
|
|
clearer => 'clear_connection', |
38
|
|
|
|
|
|
|
init_arg => undef, |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has 'done' => ( |
42
|
|
|
|
|
|
|
is => 'ro', |
43
|
|
|
|
|
|
|
isa => 'Bool', |
44
|
|
|
|
|
|
|
init_arg => undef, |
45
|
|
|
|
|
|
|
default => sub { 0 }, |
46
|
|
|
|
|
|
|
writer => 'set_done', |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
has 'streaming' => ( |
50
|
|
|
|
|
|
|
is => 'ro', |
51
|
|
|
|
|
|
|
isa => 'Bool', |
52
|
|
|
|
|
|
|
init_arg => undef, |
53
|
|
|
|
|
|
|
default => sub { 0 }, |
54
|
|
|
|
|
|
|
writer => 'set_streaming', |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub reset { |
58
|
|
|
|
|
|
|
my $self = shift; |
59
|
|
|
|
|
|
|
$self->clear_response; |
60
|
|
|
|
|
|
|
$self->clear_request; |
61
|
|
|
|
|
|
|
$self->set_streaming(0); |
62
|
|
|
|
|
|
|
$self->set_done(0); |
63
|
|
|
|
|
|
|
$self->wheel->set_output_filter( $self->wheel->get_input_filter ) if $self->has_wheel; |
64
|
|
|
|
|
|
|
return 1; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub close_wheel { |
68
|
|
|
|
|
|
|
my $self = shift; |
69
|
|
|
|
|
|
|
return unless $self->has_wheel; |
70
|
|
|
|
|
|
|
$self->wheel->shutdown_input; |
71
|
|
|
|
|
|
|
$self->wheel->shutdown_output; |
72
|
|
|
|
|
|
|
$self->clear_wheel; |
73
|
|
|
|
|
|
|
return 1; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub wheel_alive { |
77
|
|
|
|
|
|
|
my $self = shift; |
78
|
|
|
|
|
|
|
return unless $self->has_wheel; |
79
|
|
|
|
|
|
|
return unless defined $self->wheel; |
80
|
|
|
|
|
|
|
return unless $self->wheel->get_input_handle(); |
81
|
|
|
|
|
|
|
return 1; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
no Moose; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
'This monkey has gone to heaven'; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |