From 893c27404516eefc2776e7db4b3f102f89867e09 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Thu, 16 May 2013 12:28:22 -0400 Subject: [PATCH] Fix Net_Socket bug with no timeout (failed connection in managesieve plugin) --- program/lib/Net/Socket.php | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/program/lib/Net/Socket.php b/program/lib/Net/Socket.php index e8a22d0..669700c 100644 --- a/program/lib/Net/Socket.php +++ b/program/lib/Net/Socket.php @@ -267,7 +267,12 @@ $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; + } } /** -- Gitblit v1.9.1