--- trunk/lib/Frey/Server.pm 2008/12/24 13:50:55 886 +++ trunk/lib/Frey/Server.pm 2009/04/24 15:31:28 1058 @@ -55,7 +55,16 @@ } my $path = $url->path; - my $content_type = 'text/plain'; + + if ( $path =~ m{^/(favicon.ico|__history__.html)$} ) { + warn "INFO: $path ignored"; + return { code => 404, content_type => 'text/plain' }; + } + + my $request = { + content_type => 'text/html', + code => 200, + }; eval { @@ -145,18 +154,20 @@ confess "# can't call request on nothing!"; } - $content_type = $f->content_type; + $request->{content_type} = $f->content_type; }; if ( $@ ) { warn "SERVER ERROR: $@"; -# $req->conn->send_error( 404 ); # FIXME this should probably be 500, but we can't ship page with it - $content_type = 'text/html'; - $self->print( qq{
$@\r\n\r\n} ); + $self->print( qq|$@| ); # Carp::REPL::repl; + return { + content_type => 'text/html', + code => 404, + } } - return $content_type; + return $request; } sub refresh { @@ -177,4 +188,16 @@ |; # XXX newlines at end are important to flush content to browser } +my $timestamp_interval = 3; +my $output_tell = 0; + +$SIG{ALRM} = sub { + if ( tell(STDERR) != $output_tell ) { + warn "\nTIMESTAMP: " . localtime() . "\n\n"; + $output_tell = tell(STDERR); + } + alarm $timestamp_interval; +}; +alarm $timestamp_interval; + 1;