AC-Yenta

 view release on metacpan or  search on metacpan

lib/AC/Yenta/Protocol.pm  view on Meta::CPAN

    my $p = $io->{proto_header};
    return unless $p; 	# read more

    # do we have everything?
    return unless length($io->{rbuffer}) >= ($p->{auth_length} + $p->{data_length} + $p->{content_length} + $HDRSIZE);

    my $auth    = substr($io->{rbuffer}, $HDRSIZE,  $p->{auth_length});
    my $data    = substr($io->{rbuffer}, $HDRSIZE + $p->{auth_length},  $p->{data_length});
    my $content = substr($io->{rbuffer}, $HDRSIZE + $p->{auth_length} + $p->{data_length}, $p->{content_length});

    # RSN - validate auth

    if( $p->{data_encrypted} && $data ){
        $data = $me->_decrypt_data( $io, $auth, $data );
        return unless $data;
    }

    if( $p->{content_encrypted} && $content ){
        $content = $me->_decrypt_data( $io, $auth, $content );
        return unless $content;
    }

lib/AC/Yenta/Store/File.pm  view on Meta::CPAN

    local $/ = undef;
    my $content = <$f>;
    return \$content;
}

sub put {
    my $me   = shift;
    my $name = shift;
    my $cont = shift;	# reference

    # validate filename
    return if $name =~ m%(^\.\./)|(/\.\./)%;

    my $cf   = $me->{conf};
    my $base = $cf->{basedir};
    return 1 unless $base;

    # split name into dir / file
    my($dir, $file) = $name =~ m|(.*)/([^/]+)$|;

    # create directory

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.292 second using v1.00-cache-2.02-grep-82fe00e-cpan-24a475fd873 )