App-cdnget
view release on metacpan or search on metacpan
lib/App/cdnget/Downloader.pm view on Meta::CPAN
cond_signal($self);
};
eval
{
my $max_size = undef;
if ($self->hook)
{
$max_size = 20*1024*1024;
}
$fh->binmode(":bytes") or $self->throw($!);
my $ua = LWP::UserAgent->new(agent => "p5-cdnget/${App::cdnget::VERSION}",
max_redirect => 1,
max_size => $max_size,
requests_redirectable => [],
timeout => 5);
my $response_header = sub
{
my ($response, $ua) = @_;
local ($/, $\) = ("\r\n")x2;
my $status = $response->{_rc};
lib/App/cdnget/Worker.pm view on Meta::CPAN
{
lock(%App::cdnget::Downloader::uids);
$fh = FileHandle->new($path, "<");
unless ($fh)
{
return unless App::cdnget::Downloader->new($uid, $path, $url, $hook);
$fh = FileHandle->new($path, "<") or $self->throw($!);
}
$downloader = $App::cdnget::Downloader::uids{$uid};
};
$fh->binmode(":bytes") or $self->throw($!);
do
{
local ($/, $\) = ("\r\n")x2;
my $line;
my $buf;
my $empty = 1;
while (not $self->terminating)
{
threads->yield();
( run in 1.334 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )