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;