Up socket timeout in IMAP socket driver to 30 seconds by default
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Jun 2009 20:34:54 +0000 (14:34 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Jun 2009 22:57:06 +0000 (16:57 -0600)
10 seconds is too short for certain tasks, such as searching a large
mailbox.
Add a bit more thorough error message.

framework/Imap_Client/lib/Horde/Imap/Client.php
framework/Imap_Client/lib/Horde/Imap/Client/Base.php
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index 599ef0d..295f534 100644 (file)
@@ -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/)
  *
index 724ab5a..4a14500 100644 (file)
@@ -112,7 +112,7 @@ abstract class Horde_Imap_Client_Base
         }
 
         if (empty($params['timeout'])) {
-            $params['timeout'] = 10;
+            $params['timeout'] = 30;
         }
 
         if (empty($params['cache'])) {
index 6405b2d..cab2524 100644 (file)
@@ -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) {