From 8b48b31f60c1acd63fbe9f35207377209faac012 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sat, 16 Feb 2013 13:17:40 +0100
Subject: [PATCH] HTTPclient: print number of received bytes on error

---
 inc/HTTPClient.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index 6f00d6d91..772b580b2 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -628,8 +628,8 @@ class HTTPClient {
             $time_used = $this->_time() - $this->start;
             if ($time_used > $this->timeout)
                 throw new HTTPClientException(
-                        sprintf('Timeout while reading %s (%.3fs)', $message, $time_used),
-                        -100);
+                        sprintf('Timeout while reading %s after %d bytes (%.3fs)', $message,
+                                strlen($r_data), $time_used), -100);
             if(feof($socket)) {
                 if(!$ignore_eof)
                     throw new HTTPClientException("Premature End of File (socket) while reading $message");
-- 
GitLab