summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap_generic.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-05-28 13:54:32 +0000
committeralecpl <alec@alec.pl>2010-05-28 13:54:32 +0000
commitf07d238b1b4d75b34639be873dcc1b1627404ae7 (patch)
treea3da2442d4f23e6c68802341413d874d74423fe4 /program/include/rcube_imap_generic.php
parentde9f799a39645e581c7e9c8f54082a4ebf77aa09 (diff)
- Add 'imap_timeout' option (#1486760)
Diffstat (limited to 'program/include/rcube_imap_generic.php')
-rw-r--r--program/include/rcube_imap_generic.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index d159b903c..7796e0a11 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -611,14 +611,21 @@ class rcube_imap_generic
$host = $this->prefs['ssl_mode'] . '://' . $host;
}
- $this->fp = @fsockopen($host, $this->prefs['port'], $errno, $errstr, 10);
+ // Connect
+ if ($this->prefs['timeout'] > 0)
+ $this->fp = @fsockopen($host, $this->prefs['port'], $errno, $errstr, $this->prefs['timeout']);
+ else
+ $this->fp = @fsockopen($host, $this->prefs['port'], $errno, $errstr);
+
if (!$this->fp) {
$this->error = sprintf("Could not connect to %s:%d: %s", $host, $this->prefs['port'], $errstr);
$this->errornum = -2;
return false;
}
- stream_set_timeout($this->fp, 10);
+ if ($this->prefs['timeout'] > 0)
+ stream_set_timeout($this->fp, $this->prefs['timeout']);
+
$line = trim(fgets($this->fp, 8192));
if ($this->prefs['debug_mode'] && $line) {