line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Request::FromLog::Engine::Default; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
5
|
1
|
|
|
1
|
|
5
|
use base qw(HTTP::Request::FromLog::Engine::Base); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
540
|
|
6
|
1
|
|
|
1
|
|
780
|
use Parse::AccessLogEntry; |
|
1
|
|
|
|
|
369
|
|
|
1
|
|
|
|
|
13
|
|
7
|
1
|
|
|
1
|
|
27
|
use HTTP::Headers; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
8
|
1
|
|
|
1
|
|
895
|
use List::MoreUtils qw(all); |
|
1
|
|
|
|
|
1134
|
|
|
1
|
|
|
|
|
273
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
12
|
1
|
|
|
|
|
4
|
my %args = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
6
|
$args{parser} = Parse::AccessLogEntry->new(); |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
13
|
return $class->SUPER::new(%args); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub parse { |
20
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
21
|
2
|
|
|
|
|
4
|
my $log_record = shift; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
13
|
my $record = $self->{parser}->parse($log_record); |
24
|
|
|
|
|
|
|
|
25
|
2
|
50
|
|
2
|
|
110
|
return undef if all { !defined $_ } values %$record; |
|
2
|
|
|
|
|
9
|
|
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
7
|
my $method = $record->{rtype}; |
28
|
2
|
|
|
|
|
7
|
my $uri = $self->{scheme} . '://' . $self->{host} . $record->{file}; |
29
|
2
|
|
|
|
|
18
|
my $header = HTTP::Headers->new(); |
30
|
2
|
|
|
|
|
24
|
$header->header( host => $self->{host} ); |
31
|
2
|
100
|
|
|
|
107
|
$header->header( user_agent => $record->{agent} ) if $record->{agent}; |
32
|
2
|
100
|
|
|
|
34
|
$header->header( referer => $record->{refer} ) if $record->{refer}; |
33
|
|
|
|
|
|
|
|
34
|
2
|
|
|
|
|
40
|
return ( { method => $method, uri => $uri, header => $header } ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |