* disconnect fixes

git-svn-id: svn://netflint.net/xmpphp@11 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
fritzy
2008-04-02 19:48:52 +00:00
parent 98234cdc2c
commit 9bcf030bc6
3 changed files with 26 additions and 5 deletions

View File

@@ -99,7 +99,14 @@ class XMLStream {
$updated = stream_select($read, $write, $except, 1);
if ($updated > 0) {
$buff = fread($this->socket, 1024);
if(!$buff and $this->reconnect) $this->doReconnect();
if(!$buff) {
if($this->reconnect) {
$this->doReconnect();
} else {
fclose($this->socket);
return False;
}
}
$this->log->log("RECV: $buff", LOGGING_VERBOSE);
xml_parse($this->parser, $buff, False);
}
@@ -116,7 +123,14 @@ class XMLStream {
$updated = stream_select($read, $write, $except, 1);
if ($updated > 0) {
$buff = fread($this->socket, 1024);
if(!$buff and $this->reconnect) $this->doReconnect();
if(!$buff) {
if($this->reconnect) {
$this->doReconnect();
} else {
fclose($this->socket);
return False;
}
}
$this->log->log("RECV: $buff", LOGGING_VERBOSE);
xml_parse($this->parser, $buff, False);
}
@@ -136,7 +150,14 @@ class XMLStream {
$updated = stream_select($read, $write, $except, 1);
if ($updated > 0) {
$buff = fread($this->socket, 1024);
if(!$buff and $this->reconnect) $this->doReconnect();
if(!$buff) {
if($this->reconnect) {
$this->doReconnect();
} else {
fclose($this->socket);
return False;
}
}
$this->log->log("RECV: $buff", LOGGING_VERBOSE);
xml_parse($this->parser, $buff, False);
}