From: Michael M Slusarz Date: Thu, 18 Jun 2009 20:34:54 +0000 (-0600) Subject: Up socket timeout in IMAP socket driver to 30 seconds by default X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7fde2c390be04da35200cee22da70ced87d99852;p=horde.git Up socket timeout in IMAP socket driver to 30 seconds by default 10 seconds is too short for certain tasks, such as searching a large mailbox. Add a bit more thorough error message. --- diff --git a/framework/Imap_Client/lib/Horde/Imap/Client.php b/framework/Imap_Client/lib/Horde/Imap/Client.php index 599ef0de1..295f53450 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client.php @@ -57,7 +57,7 @@ * statuscache - (boolean) Cache STATUS responses? * DEFAULT: False * timeout - (integer) Connection timeout, in seconds. - * DEFAULT: 10 seconds + * DEFAULT: 30 seconds * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php index 724ab5ab5..4a14500ed 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php @@ -112,7 +112,7 @@ abstract class Horde_Imap_Client_Base } if (empty($params['timeout'])) { - $params['timeout'] = 10; + $params['timeout'] = 30; } if (empty($params['cache'])) { diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php index 6405b2dca..cab25241b 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php @@ -3237,9 +3237,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base if (!strlen($data)) { if ($this->_debug) { - fwrite($this->_debug, '[ERROR: IMAP read error.]' . "\n"); + fwrite($this->_debug, '[ERROR: IMAP read/timeout error.]' . "\n"); } - throw new Horde_Imap_Client_Exception('IMAP read error.', Horde_Imap_Client_Exception::SERVER_READERROR); + throw new Horde_Imap_Client_Exception('IMAP read error or IMAP connection timed out.', Horde_Imap_Client_Exception::SERVER_READERROR); } if ($this->_debug) {