Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/perl5/vendor_perl/HTTP/Body/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/perl5/vendor_perl/HTTP/Body/OctetStream.pm
package HTTP::Body::OctetStream;
$HTTP::Body::OctetStream::VERSION = '1.22';
use strict;
use base 'HTTP::Body';
use bytes;

use File::Temp 0.14;

=head1 NAME

HTTP::Body::OctetStream - HTTP Body OctetStream Parser

=head1 SYNOPSIS

    use HTTP::Body::OctetStream;

=head1 DESCRIPTION

HTTP Body OctetStream Parser.

=head1 METHODS

=over 4

=item spin

=cut

sub spin {
    my $self = shift;

    unless ( $self->body ) {
        $self->body( File::Temp->new( DIR => $self->tmpdir ) );
    }

    if ( my $length = length( $self->{buffer} ) ) {
        $self->body->write( substr( $self->{buffer}, 0, $length, '' ), $length );
    }

    if ( $self->length == $self->content_length ) {
        seek( $self->body, 0, 0 );
        $self->state('done');
    }
}

=back

=head1 AUTHOR

Christian Hansen, C<ch@ngmedia.com>

=head1 LICENSE

This library is free software . You can redistribute it and/or modify 
it under the same terms as perl itself.

=cut

1;

Hry