line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::AnyUA::Middleware; |
2
|
|
|
|
|
|
|
# ABSTRACT: A base class for HTTP::AnyUA middleware |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
1362
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
92
|
|
6
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
971
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.903'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
0
|
|
|
0
|
|
0
|
sub _croak { require Carp; Carp::croak(@_) } |
|
0
|
|
|
|
|
0
|
|
11
|
0
|
|
|
0
|
|
0
|
sub _usage { _croak("Usage: @_\n") } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
4
|
|
|
4
|
1
|
8
|
my $class = shift; |
17
|
4
|
50
|
|
|
|
11
|
my $backend = shift or die 'Backend is required'; |
18
|
4
|
|
|
|
|
10
|
my $self = bless {backend => $backend}, $class; |
19
|
4
|
|
|
|
|
30
|
$self->init(@_); |
20
|
4
|
|
|
|
|
11
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
2
|
1
|
|
sub init {} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub wrap { |
28
|
4
|
|
|
4
|
1
|
8
|
my $self = shift; |
29
|
4
|
50
|
|
|
|
14
|
my $backend = shift or _usage($self . q{->wrap($backend, %args)}); |
30
|
|
|
|
|
|
|
|
31
|
4
|
50
|
|
|
|
14
|
if (ref $self) { |
32
|
0
|
|
|
|
|
0
|
$self->{backend} = $backend; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else { |
35
|
4
|
|
|
|
|
20
|
$self = $self->new($backend, @_); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
|
|
|
16
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
1
|
0
|
sub request { shift->backend->request(@_) } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
27
|
|
|
27
|
1
|
70
|
sub backend { shift->{backend} } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
1
|
0
|
sub ua { shift->backend->ua(@_) } |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
19
|
|
|
19
|
1
|
45
|
sub response_is_future { shift->backend->response_is_future(@_) } |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |