line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Body::OctetStream; |
2
|
|
|
|
|
|
|
$HTTP::Body::OctetStream::VERSION = '1.20'; |
3
|
8
|
|
|
8
|
|
34
|
use strict; |
|
8
|
|
|
|
|
10
|
|
|
8
|
|
|
|
|
289
|
|
4
|
8
|
|
|
8
|
|
36
|
use base 'HTTP::Body'; |
|
8
|
|
|
|
|
651
|
|
|
8
|
|
|
|
|
845
|
|
5
|
8
|
|
|
8
|
|
3781
|
use bytes; |
|
8
|
|
|
|
|
53
|
|
|
8
|
|
|
|
|
32
|
|
6
|
|
|
|
|
|
|
|
7
|
8
|
|
|
8
|
|
5501
|
use File::Temp 0.14; |
|
8
|
|
|
|
|
130700
|
|
|
8
|
|
|
|
|
1391
|
|
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
|
6
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
8
|
100
|
|
|
|
19
|
unless ( $self->body ) { |
33
|
3
|
|
|
|
|
10
|
$self->body( File::Temp->new( DIR => $self->tmpdir ) ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
8
|
100
|
|
|
|
40
|
if ( my $length = length( $self->{buffer} ) ) { |
37
|
7
|
|
|
|
|
12
|
$self->body->write( substr( $self->{buffer}, 0, $length, '' ), $length ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
8
|
100
|
|
|
|
88
|
if ( $self->length == $self->content_length ) { |
41
|
3
|
|
|
|
|
4
|
seek( $self->body, 0, 0 ); |
42
|
3
|
|
|
|
|
10
|
$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; |