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