line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Body::OctetStream; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$HTTP::Body::OctetStream::VERSION = '1.19'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
38
|
use strict; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
375
|
|
7
|
7
|
|
|
7
|
|
39
|
use base 'HTTP::Body'; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
904
|
|
8
|
7
|
|
|
7
|
|
7609
|
use bytes; |
|
7
|
|
|
|
|
70
|
|
|
7
|
|
|
|
|
37
|
|
9
|
|
|
|
|
|
|
|
10
|
7
|
|
|
7
|
|
29481
|
use File::Temp 0.14; |
|
7
|
|
|
|
|
192197
|
|
|
7
|
|
|
|
|
1737
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
HTTP::Body::OctetStream - HTTP Body OctetStream Parser |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use HTTP::Body::OctetStream; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
HTTP Body OctetStream Parser. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 METHODS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=over 4 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=item spin |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub spin { |
33
|
8
|
|
|
8
|
1
|
11
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
8
|
100
|
|
|
|
23
|
unless ( $self->body ) { |
36
|
3
|
|
|
|
|
17
|
$self->body( File::Temp->new( DIR => $self->tmpdir ) ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
8
|
100
|
|
|
|
49
|
if ( my $length = length( $self->{buffer} ) ) { |
40
|
7
|
|
|
|
|
16
|
$self->body->write( substr( $self->{buffer}, 0, $length, '' ), $length ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
8
|
100
|
|
|
|
112
|
if ( $self->length == $self->content_length ) { |
44
|
3
|
|
|
|
|
9
|
seek( $self->body, 0, 0 ); |
45
|
3
|
|
|
|
|
14
|
$self->state('done'); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=back |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Christian Hansen, C |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 LICENSE |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This library is free software . You can redistribute it and/or modify |
58
|
|
|
|
|
|
|
it under the same terms as perl itself. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |