Fix binary data length in debug output
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 29 Apr 2010 21:09:07 +0000 (15:09 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Apr 2010 17:07:34 +0000 (11:07 -0600)
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index e57d2a4..a2141f5 100644 (file)
@@ -3881,6 +3881,8 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 return $data;
             }
 
+            $old_len = $len;
+
             // Add data to a stream, if desired.
             if (!empty($this->_temp['literalstream']) &&
                 in_array(end($this->_temp['token']['ptr'][$this->_temp['token']['paren']]), $this->_temp['literalstream'])) {
@@ -3918,7 +3920,7 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 rewind($data);
             }
 
-            fwrite($this->_debug, '(' . microtime(true) . ') S: ' . ($binary ? '[BINARY DATA - ' . $len . ' bytes]' : rtrim($stream ? stream_get_contents($data): $data)) . "\n");
+            fwrite($this->_debug, '(' . microtime(true) . ') S: ' . ($binary ? '[BINARY DATA - ' . $old_len . ' bytes]' : rtrim($stream ? stream_get_contents($data): $data)) . "\n");
         }
 
         return is_null($len) ? rtrim($data) : $data;