Skip Menu |

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 78830
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: SKA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.006
Fixed in: (no value)



Subject: uninitialized value in subtraction (-) at Net/Server/HTTP.pm line 427.
Use of uninitialized value in subtraction (-) at Net/Server/HTTP.pm line 427. Use of uninitialized value in localtime at Net/Server/HTTP.pm line 497. When the access is denied through allow/deny rules, Net::Server::HTTP::_init_http_request_info is never called, but Net::Server::HTTP::post_process_request and log_http_request rely on $info->{'begin'}, which is set by _init_http_request_info(). As workaround I initialize $info->{'begin'} = time in post_process_request, see attachment.
Subject: Net-Server-2.006_workaround_unef_begin-prop.diff
diff -r 42639e024a2e Net/Server/HTTP.pm --- a/Net/Server/HTTP.pm Tue Aug 07 10:50:07 2012 +0200 +++ b/Net/Server/HTTP.pm Tue Aug 07 11:08:09 2012 +0200 @@ -424,6 +424,7 @@ sub post_process_request { my $self = shift; my $info = $self->{'request_info'}; + $info->{begin} = time unless defined $info->{begin}; $info->{'elapsed'} = time - $info->{'begin'}; $self->SUPER::post_process_request(@_); $self->log_http_request($info);
Fixed in the just uploaded 2.007