| File | /usr/lib/perl5/vendor_perl/5.10.1/HTTP/Body/OctetStream.pm |
| Statements Executed | 13 |
| Statement Execution Time | 1.25ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 9.93ms | 28.0ms | HTTP::Body::OctetStream::BEGIN@7 |
| 1 | 1 | 1 | 447µs | 454µs | HTTP::Body::OctetStream::BEGIN@5 |
| 1 | 1 | 1 | 30µs | 39µs | HTTP::Body::OctetStream::BEGIN@3 |
| 1 | 1 | 1 | 25µs | 203µs | HTTP::Body::OctetStream::BEGIN@4 |
| 0 | 0 | 0 | 0s | 0s | HTTP::Body::OctetStream::spin |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package HTTP::Body::OctetStream; | ||||
| 2 | |||||
| 3 | 3 | 266µs | 2 | 48µs | # spent 39µs (30+9) within HTTP::Body::OctetStream::BEGIN@3 which was called
# once (30µs+9µs) by Catalyst::Engine::BEGIN@10 at line 3 # spent 39µs making 1 call to HTTP::Body::OctetStream::BEGIN@3
# spent 9µs making 1 call to strict::import |
| 4 | 3 | 51µs | 2 | 381µs | # spent 203µs (25+178) within HTTP::Body::OctetStream::BEGIN@4 which was called
# once (25µs+178µs) by Catalyst::Engine::BEGIN@10 at line 4 # spent 203µs making 1 call to HTTP::Body::OctetStream::BEGIN@4
# spent 178µs making 1 call to base::import |
| 5 | 3 | 471µs | 2 | 460µs | # spent 454µs (447+7) within HTTP::Body::OctetStream::BEGIN@5 which was called
# once (447µs+7µs) by Catalyst::Engine::BEGIN@10 at line 5 # spent 454µs making 1 call to HTTP::Body::OctetStream::BEGIN@5
# spent 7µs making 1 call to bytes::import |
| 6 | |||||
| 7 | 3 | 457µs | 3 | 28.3ms | # spent 28.0ms (9.93+18.1) within HTTP::Body::OctetStream::BEGIN@7 which was called
# once (9.93ms+18.1ms) by Catalyst::Engine::BEGIN@10 at line 7 # spent 28.0ms making 1 call to HTTP::Body::OctetStream::BEGIN@7
# spent 119µs making 1 call to Exporter::import
# spent 100µs making 1 call to UNIVERSAL::VERSION |
| 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 | my $self = shift; | ||||
| 31 | |||||
| 32 | unless ( $self->body ) { | ||||
| 33 | $self->body( File::Temp->new( DIR => $self->tmpdir ) ); | ||||
| 34 | } | ||||
| 35 | |||||
| 36 | if ( my $length = length( $self->{buffer} ) ) { | ||||
| 37 | $self->body->write( substr( $self->{buffer}, 0, $length, '' ), $length ); | ||||
| 38 | } | ||||
| 39 | |||||
| 40 | if ( $self->length == $self->content_length ) { | ||||
| 41 | seek( $self->body, 0, 0 ); | ||||
| 42 | $self->state('done'); | ||||
| 43 | } | ||||
| 44 | } | ||||
| 45 | |||||
| 46 | =back | ||||
| 47 | |||||
| 48 | =head1 AUTHOR | ||||
| 49 | |||||
| 50 | Christian Hansen, C<ch@ngmedia.com> | ||||
| 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 | 4µs | 1; |