Subject: | panic: Can't call method "fromDisk" on an undefined value at /usr/lib/perl5/site_perl/5.14/Any/Daemon/HTTP/VirtualHost.pm line 163. |
Running:
perl -MAny::Daemon::HTTP -e 'Any::Daemon::HTTP->new(host=>"localhost:3331")->run(background=>0)'
and connecting to http://localhost:3331 results in the browser attemping to load 'www.localhost.com:3331' (due to no response on the socket), and the following console output:
panic: Can't call method "fromDisk" on an undefined value at /usr/lib/perl5/site_perl/5.14/Any/Daemon/HTTP/VirtualHost.pm line 163.
at /usr/lib/perl5/site_perl/5.14/Any/Daemon.pm line 130
Log::Report::panic("Can't call method \"fromDisk\" on an undefined value at /usr/lib/perl5/site_perl/5.14/Any/Daemon/HTTP/VirtualHost.pm line 163.") at /usr/lib/perl5/site_perl/5.14/Any/Daemon.pm line 130
Any::Daemon::__ANON__() at /usr/lib/perl5/site_perl/5.14/Any/Daemon.pm line 232
Any::Daemon::_child_died(10, "CODE(0x806a8e80)") at /usr/lib/perl5/site_perl/5.14/Any/Daemon.pm line 167
Any::Daemon::run("Any::Daemon::HTTP=HASH(0x8002bf20)", "new_connection", "CODE(0x806a2f18)", "background", 0, "child_task", "CODE(0x806a8a48)") at /usr/lib/perl5/site_perl/5.14/Any/Daemon/HTTP.pm line 228
Any::Daemon::HTTP::run("Any::Daemon::HTTP=HASH(0x8002bf20)", "background", 0) at -e line 1
This typically occurs when custom handlers are installed, in which case there are no directories configured.
Patch:
--- lib/Any/Daemon/HTTP/VirtualHost.pm (original)
+++ lib/Any/Daemon/HTTP/VirtualHost.pm (patched)
@@ -160,7 +160,7 @@
my $tree = $self->directoryOf(@path);
# static content?
- my $resp = $tree and $tree->fromDisk($session, $req, $uri);
+ my $resp = $tree->fromDisk($session, $req, $uri);
return $resp if $resp;
# dynamic content