line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::HTTP2::PartialResponse; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::HTTP2::PartialResponse - Partial HTTP/2 Response |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This class represents a partial (i.e., in-progress) HTTP/2 response. |
15
|
|
|
|
|
|
|
It extends L with a control to cancel the |
16
|
|
|
|
|
|
|
request. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
6
|
use parent 'Net::HTTP2::Response'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my %CANCEL_SR; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 METHODS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Not called publicly. |
33
|
|
|
|
|
|
|
sub new { |
34
|
0
|
|
|
0
|
0
|
|
my ($class, $sr) = splice @_, 0, 2; |
35
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
36
|
0
|
|
|
|
|
|
$CANCEL_SR{ $self } = $sr; |
37
|
0
|
|
|
|
|
|
return $self; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 I->cancel() |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Call this to cancel the in-progress request that I represents. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub cancel { |
47
|
0
|
|
|
0
|
1
|
|
${ $CANCEL_SR{$_[0]} } = 1; |
|
0
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub DESTROY { |
51
|
0
|
|
|
0
|
|
|
delete $CANCEL_SR{ $_[0] }; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |