line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Apache2::ASP::HTTPContext::SubContext; |
3
|
|
|
|
|
|
|
|
4
|
23
|
|
|
23
|
|
87
|
use strict; |
|
23
|
|
|
|
|
31
|
|
|
23
|
|
|
|
|
640
|
|
5
|
23
|
|
|
23
|
|
82
|
use warnings 'all'; |
|
23
|
|
|
|
|
37
|
|
|
23
|
|
|
|
|
615
|
|
6
|
23
|
|
|
23
|
|
88
|
use base 'Apache2::ASP::HTTPContext'; |
|
23
|
|
|
|
|
24
|
|
|
23
|
|
|
|
|
15268
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#============================================================================== |
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
0
|
|
|
0
|
0
|
|
my ($class, %args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
die "Required param 'parent' was not provided" |
15
|
0
|
0
|
|
|
|
|
unless $args{parent}; |
16
|
|
|
|
|
|
|
die "Param 'parent' isn't a Apache2::ASP::HTTPContext" |
17
|
0
|
0
|
|
|
|
|
unless $args{parent}->isa( 'Apache2::ASP::HTTPContext' ); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
0
|
|
|
|
$class = ref($class) || $class; |
20
|
0
|
|
|
|
|
|
my $s = bless \%args, $class; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
$Apache2::ASP::HTTPContext::instance = $s; |
23
|
0
|
|
|
|
|
|
return $s; |
24
|
|
|
|
|
|
|
}# end new() |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#============================================================================== |
28
|
|
|
|
|
|
|
sub setup_request |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
0
|
|
my ($s, $requestrec, $cgi) = @_; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$s->{r} = $requestrec; |
33
|
0
|
|
|
|
|
|
$s->{cgi} = $cgi; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$s->{connection} = $s->r->connection; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $resolver = $s->config->web->handler_resolver; |
38
|
0
|
|
|
|
|
|
$s->_load_class( $resolver ); |
39
|
0
|
|
|
|
|
|
$s->{handler} = $resolver->new()->resolve_request_handler( $s->r->uri ); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return 1; |
42
|
|
|
|
|
|
|
}# end setup_request() |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#============================================================================== |
46
|
|
|
|
|
|
|
sub execute |
47
|
|
|
|
|
|
|
{ |
48
|
0
|
|
|
0
|
0
|
|
my ($s, $args) = @_; |
49
|
|
|
|
|
|
|
# local $SIG{__DIE__} = \&Carp::confess; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$s->_load_class( $s->config->web->handler_runner ); |
52
|
0
|
|
|
|
|
|
eval { |
53
|
0
|
|
|
|
|
|
$s->_load_class( $s->handler ); |
54
|
0
|
|
|
|
|
|
$s->config->web->handler_runner->new()->run_handler( $s->handler, $args ); |
55
|
|
|
|
|
|
|
}; |
56
|
0
|
0
|
|
|
|
|
if( $@ ) |
57
|
|
|
|
|
|
|
{ |
58
|
0
|
|
|
|
|
|
$s->server->{LastError} = $@; |
59
|
0
|
|
|
|
|
|
return $s->handle_error; |
60
|
|
|
|
|
|
|
}# end if() |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
$s->response->Flush; |
63
|
0
|
0
|
|
|
|
|
my $res = $s->{parent} ? $s->response->Status : $s->end_request(); |
64
|
0
|
0
|
0
|
|
|
|
if( $s->page && $s->page->directives->{OutputCache} && defined($s->{_cache_buffer}) ) |
|
|
|
0
|
|
|
|
|
65
|
|
|
|
|
|
|
{ |
66
|
0
|
0
|
0
|
|
|
|
if( $res == 200 || $res == 0 ) |
67
|
|
|
|
|
|
|
{ |
68
|
0
|
|
|
|
|
|
$s->page->_write_cache( \$s->{_cache_buffer} ); |
69
|
|
|
|
|
|
|
}# end if() |
70
|
|
|
|
|
|
|
}# end if() |
71
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
$res = 0 if $res =~ m/^200/; |
73
|
0
|
|
|
|
|
|
return $res; |
74
|
|
|
|
|
|
|
}# end execute() |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
#============================================================================== |
78
|
|
|
|
|
|
|
sub get_prop |
79
|
|
|
|
|
|
|
{ |
80
|
0
|
|
|
0
|
0
|
|
my ($s, $prop) = @_; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
$s->{parent}->get_prop($prop); |
83
|
|
|
|
|
|
|
}# end get_prop() |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
#============================================================================== |
87
|
|
|
|
|
|
|
sub set_prop |
88
|
|
|
|
|
|
|
{ |
89
|
0
|
|
|
0
|
0
|
|
my ($s) = shift; |
90
|
0
|
|
|
|
|
|
my $prop = shift; |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
$s->{parent}->set_prop($prop, @_); |
93
|
|
|
|
|
|
|
}# end set_prop() |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
0
|
1
|
|
sub config { shift->get_prop('config') } |
96
|
0
|
|
|
0
|
1
|
|
sub session { shift->get_prop('session') } |
97
|
0
|
|
|
0
|
1
|
|
sub server { shift->get_prop('server') } |
98
|
0
|
|
|
0
|
1
|
|
sub request { shift->get_prop('request') } |
99
|
0
|
|
|
0
|
1
|
|
sub response { shift->get_prop('response') } |
100
|
0
|
|
|
0
|
1
|
|
sub application { shift->get_prop('application') } |
101
|
0
|
|
|
0
|
0
|
|
sub stash { shift->get_prop('stash') } |
102
|
0
|
|
|
0
|
0
|
|
sub global_asa { shift->get_prop('global_asa') } |
103
|
0
|
|
|
0
|
|
|
sub _is_setup { shift->get_prop('_is_setup') } |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
#============================================================================== |
107
|
|
|
|
|
|
|
sub rflush |
108
|
|
|
|
|
|
|
{ |
109
|
0
|
|
|
0
|
0
|
|
my $s = shift; |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
$s->{r}->rflush(); |
112
|
|
|
|
|
|
|
}# end rflush() |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
#============================================================================== |
116
|
|
|
|
|
|
|
sub DESTROY |
117
|
|
|
|
|
|
|
{ |
118
|
0
|
|
|
0
|
|
|
my $s = shift; |
119
|
|
|
|
|
|
|
|
120
|
0
|
0
|
|
|
|
|
if( my $parent = $s->{parent} ) |
121
|
|
|
|
|
|
|
{ |
122
|
0
|
|
|
|
|
|
$Apache2::ASP::HTTPContext::instance = $parent; |
123
|
|
|
|
|
|
|
}# end if() |
124
|
|
|
|
|
|
|
|
125
|
0
|
|
|
|
|
|
undef(%$s); |
126
|
|
|
|
|
|
|
}# end DESTROY() |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
1;# return true: |
129
|
|
|
|
|
|
|
|