line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Apache2::ScoreboardIsFull; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
43909
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
399
|
use Apache2::RequestRec; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Apache2::RequestUtil; |
8
|
|
|
|
|
|
|
use Apache2::Const -compile => qw( OK ); |
9
|
|
|
|
|
|
|
use Apache::Scoreboard; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub handler { |
15
|
|
|
|
|
|
|
my $r = shift; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $image = Apache::Scoreboard->image( $r->pool ); |
18
|
|
|
|
|
|
|
my $servers_left = $image->server_limit - scalar( @{ $image->pids } ); |
19
|
|
|
|
|
|
|
if ( $servers_left == 0 ) { |
20
|
|
|
|
|
|
|
$r->pnotes( 'scoreboard_is_full' => 1 ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
return Apache2::Const::DECLINED; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
__END__ |