Skip Menu |

This queue is for tickets about the LWPx-TimedHTTP CPAN distribution.

Report information
The Basics
Id: 32835
Status: resolved
Priority: 0/
Queue: LWPx-TimedHTTP

People
Owner: simonw [...] cpan.org
Requestors: TONVOON [...] cpan.org
Cc:
AdminCc:

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



Subject: Possible zero values in Client-Response-Server-Time
On my build servers, sometimes the Client-Response-Server-Time can be zero (maybe a VM issue?). In this case, there are two headers created because the if statement doesn't cater for a 0 value. The patch attached changes the "if !" to an "if ! defined".
Subject: LWPx-TimedHTTP_zero_client_response_server_time.patch
diff -ur LWPx-TimedHTTP-1.4.original/lib/LWPx/TimedHTTP.pm LWPx-TimedHTTP-1.4/lib/LWPx/TimedHTTP.pm --- LWPx-TimedHTTP-1.4.original/lib/LWPx/TimedHTTP.pm 2005-02-21 20:59:16.000000000 +0000 +++ LWPx-TimedHTTP-1.4/lib/LWPx/TimedHTTP.pm 2008-01-31 14:07:54.000000000 +0000 @@ -366,7 +366,7 @@ { $n = $socket->read_entity_body($buf, $size); die "Can't read entity body: $!" unless defined $n; - if (! $response->header('Client-Response-Server-Time') ) { + if (! defined $response->header('Client-Response-Server-Time') ) { $this_time = [gettimeofday]; $response->push_header('Client-Response-Server-Time', tv_interval($prev_time, $this_time)); $prev_time = $this_time;
Fixed in 1.5. Thanks for the patch.
Fixed in 1.5. Thanks for the patch.