From 84784738139ef0cb609a731fb07d5acae3cc95d8 Mon Sep 17 00:00:00 2001 From: fritzy Date: Wed, 2 Apr 2008 20:19:55 +0000 Subject: [PATCH] * printing option should now work if set to False * ignore read errors git-svn-id: svn://netflint.net/xmpphp@13 ef36c318-a008-4979-b6e8-6b496270793b --- xmlstream.php | 10 +++++----- xmpp.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xmlstream.php b/xmlstream.php index 8982f77..d9fcdbc 100644 --- a/xmlstream.php +++ b/xmlstream.php @@ -79,13 +79,13 @@ class XMLStream { $this->disconnected = False; $this->sent_disconnect = False; if($persistent) { - $conflag = STREAM_CLIENT_PERSISTENT; + $conflag = STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT; } else { $conflag = STREAM_CLIENT_CONNECT; } $this->log->log("Connecting to tcp://{$this->host}:{$this->port}"); $this->socket = stream_socket_client("tcp://{$this->host}:{$this->port}", $flags=$conflag); - stream_set_blocking($this-socket, 1); + stream_set_blocking($this->socket, 1); if($sendinit) $this->send($this->stream_start); } @@ -101,7 +101,7 @@ class XMLStream { $except = NULL; $updated = stream_select($read, $write, $except, 1); if ($updated > 0) { - $buff = fread($this->socket, 1024); + $buff = @fread($this->socket, 1024); if(!$buff) { if($this->reconnect) { $this->doReconnect(); @@ -125,7 +125,7 @@ class XMLStream { $except = NULL; $updated = stream_select($read, $write, $except, 1); if ($updated > 0) { - $buff = fread($this->socket, 1024); + $buff = @fread($this->socket, 1024); if(!$buff) { if($this->reconnect) { $this->doReconnect(); @@ -152,7 +152,7 @@ class XMLStream { $except = NULL; $updated = stream_select($read, $write, $except, 1); if ($updated > 0) { - $buff = fread($this->socket, 1024); + $buff = @fread($this->socket, 1024); if(!$buff) { if($this->reconnect) { $this->doReconnect(); diff --git a/xmpp.php b/xmpp.php index c170fb7..c8194a1 100644 --- a/xmpp.php +++ b/xmpp.php @@ -30,7 +30,7 @@ class XMPP extends XMLStream { var $fulljid; function XMPP($host, $port, $user, $password, $resource, $server=Null, $printlog=False, $loglevel=Null) { - $this->XMLStream($host, $port, $loglevel, $loglevel); + $this->XMLStream($host, $port, $printlog, $loglevel); $this->user = $user; $this->password = $password; $this->resource = $resource;