From 893c27404516eefc2776e7db4b3f102f89867e09 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 16 May 2013 18:28:22 +0200 Subject: Fix Net_Socket bug with no timeout (failed connection in managesieve plugin) --- program/lib/Net/Socket.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'program/lib/Net') diff --git a/program/lib/Net/Socket.php b/program/lib/Net/Socket.php index e8a22d014..669700c1d 100644 --- a/program/lib/Net/Socket.php +++ b/program/lib/Net/Socket.php @@ -267,7 +267,12 @@ class Net_Socket extends PEAR $this->timeout = $seconds + $microseconds/1000000; } - return stream_set_timeout($this->fp, (int) $seconds, (int) $microseconds); + if ($this->timeout > 0) { + return stream_set_timeout($this->fp, (int) $seconds, (int) $microseconds); + } + else { + return false; + } } /** -- cgit v1.2.3