App-phoebe
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/App/Phoebe.pm view on Meta::CPAN
result($stream, "59", "Received more than the promised $size bytes");
$stream->close_gracefully();
return;
}
$log->debug("Waiting for " . ($size - $actual) . " more bytes");
}
sub process_titan {
my ($stream, $request, $upload, $buffer, $size) = @_;
eval {
local $SIG{'ALRM'} = sub { $log->error("Timeout processing upload $request") };
alarm(10); # timeout
save_page($stream, $upload->{host}, $upload->{space}, $upload->{id},
$upload->{params}->{mime}, $buffer, $size);
alarm(0);
};
return unless $@;
$log->error("Error: $@");
$stream->close_gracefully();
}
lib/App/Phoebe/Spartan.pm view on Meta::CPAN
});
}
}
}
}
sub serve_spartan {
my ($stream, $host, $path, $length, $buffer) = @_;
eval {
local $SIG{'ALRM'} = sub {
$log->error("Timeout processing $host $path $length via Spartan");
};
alarm(10); # timeout
my $spaces = space_regex();
# note that path always starts with a slash!
$log->info("Looking at $host $path $length via Spartan");
my ($space, $id, $n);
no warnings 'redefine';
# we cannot import these subroutines and modify them, otherwise the
# App::Phoebe code remains unchanged
local *gemini_to_url = \&App::Phoebe::to_url;
lib/App/Phoebe/Web.pm view on Meta::CPAN
$log->debug("Received $actual/$length bytes");
}
sub process_http {
my $stream = shift;
my $request = shift;
my $headers = shift;
my $buffer = shift;
eval {
local $SIG{'ALRM'} = sub {
$log->error("Timeout processing $request");
};
alarm(10); # timeout
my $hosts = host_regex();
my $port = port($stream);
my $spaces = space_regex();
$log->info("Looking at $request");
my ($host, $space, $id, $n, $filter);
if (run_extensions($stream, $request, $headers, $buffer)) {
# config file goes first
} elsif ($request =~ m!^GET /default.css HTTP/1\.[01]$!
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.462 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )