File-RsyBak

 view release on metacpan or  search on metacpan

script/rsybak  view on Meta::CPAN

21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
#    if ( defined $args->{content} ) {
#        if (ref $args->{content} eq 'CODE') {
#            $request->{headers}{'content-type'} ||= "application/octet-stream";
#            $request->{headers}{'transfer-encoding'} = 'chunked'
#              unless $request->{headers}{'content-length'}
#                  || $request->{headers}{'transfer-encoding'};
#            $request->{cb} = $args->{content};
#        }
#        elsif ( length $args->{content} ) {
#            my $content = $args->{content};
#            if ( $] ge '5.008' ) {
#                utf8::downgrade($content, 1)
#                    or die(qq/Wide character in request message body\n/);
#            }
#            $request->{headers}{'content-type'} ||= "application/octet-stream";
#            $request->{headers}{'content-length'} = length $content
#              unless $request->{headers}{'content-length'}
#                  || $request->{headers}{'transfer-encoding'};
#            $request->{cb} = sub { substr $content, 0, length $content, '' };
#        }
#        $request->{trailer_cb} = $args->{trailer_callback}

script/rsybak  view on Meta::CPAN

21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
#        $t < 0 ? undef : $t;
#    };
#}
#
#my %escapes = map { chr($_) => sprintf("%%%02X", $_) } 0..255;
#$escapes{' '}="+";
#my $unsafe_char = qr/[^A-Za-z0-9\-\._~]/;
#
#sub _uri_escape {
#    my ($self, $str) = @_;
#    if ( $] ge '5.008' ) {
#        utf8::encode($str);
#    }
#    else {
#        $str = pack("U*", unpack("C*", $str))
#            if ( length $str == do { use bytes; length $str } );
#        $str = pack("C*", unpack("C*", $str));
#    }
#    $str =~ s/($unsafe_char)/$escapes{$1}/ge;
#    return $str;
#}

script/rsybak  view on Meta::CPAN

21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
#    @_ == 1 || die(q/Usage: $handle->close()/ . "\n");
#    my ($self) = @_;
#    CORE::close($self->{fh})
#      or die(qq/Could not close socket: '$!'\n/);
#}
#
#sub write {
#    @_ == 2 || die(q/Usage: $handle->write(buf)/ . "\n");
#    my ($self, $buf) = @_;
#
#    if ( $] ge '5.008' ) {
#        utf8::downgrade($buf, 1)
#            or die(qq/Wide character in write()\n/);
#    }
#
#    my $len = length $buf;
#    my $off = 0;
#
#    local $SIG{PIPE} = 'IGNORE';
#
#    while () {

script/rsybak  view on Meta::CPAN

22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
#    @_ == 2 || die(q/Usage: $handle->write_content_body(request)/ . "\n");
#    my ($self, $request) = @_;
#
#    my ($len, $content_length) = (0, $request->{headers}{'content-length'});
#    while () {
#        my $data = $request->{cb}->();
#
#        defined $data && length $data
#          or last;
#
#        if ( $] ge '5.008' ) {
#            utf8::downgrade($data, 1)
#                or die(qq/Wide character in write_content()\n/);
#        }
#
#        $len += $self->write($data);
#    }
#
#    $len == $content_length
#      or die(qq/Content-Length mismatch (got: $len expected: $content_length)\n/);
#

script/rsybak  view on Meta::CPAN

22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
#    @_ == 2 || die(q/Usage: $handle->write_chunked_body(request)/ . "\n");
#    my ($self, $request) = @_;
#
#    my $len = 0;
#    while () {
#        my $data = $request->{cb}->();
#
#        defined $data && length $data
#          or last;
#
#        if ( $] ge '5.008' ) {
#            utf8::downgrade($data, 1)
#                or die(qq/Wide character in write_chunked_body()\n/);
#        }
#
#        $len += length $data;
#
#        my $chunk  = sprintf '%X', length $data;
#           $chunk .= "\x0D\x0A";
#           $chunk .= $data;
#           $chunk .= "\x0D\x0A";



( run in 0.469 second using v1.01-cache-2.11-cpan-94b05bcf43c )