small filereader fix
This commit is contained in:
parent
b956230cda
commit
fd0790fc71
@ -46,7 +46,7 @@ class AsynchronousFileReader {
|
|||||||
fclose($socket->socket);
|
fclose($socket->socket);
|
||||||
unset($this->sockets[$key]);
|
unset($this->sockets[$key]);
|
||||||
|
|
||||||
$result = array();
|
$result = "";
|
||||||
$error = 0;
|
$error = 0;
|
||||||
if (time() > ($socket->creationTime + self::SOCKET_TIMEOUT)) {
|
if (time() > ($socket->creationTime + self::SOCKET_TIMEOUT)) {
|
||||||
$error = self::TIMEOUT_ERROR;
|
$error = self::TIMEOUT_ERROR;
|
||||||
@ -55,14 +55,15 @@ class AsynchronousFileReader {
|
|||||||
} else if ($socket->streamBuffer == '') {
|
} else if ($socket->streamBuffer == '') {
|
||||||
$error = self::NO_DATA_ERROR;
|
$error = self::NO_DATA_ERROR;
|
||||||
} else {
|
} else {
|
||||||
$result = explode("\r\n\r\n", $socket->streamBuffer, 2);
|
$resultArray = explode("\r\n\r\n", $socket->streamBuffer, 2);
|
||||||
|
|
||||||
if (count($result) < 2) {
|
if (count($resultArray) < 2) {
|
||||||
$error = self::INVALID_RESULT_ERROR;
|
$error = self::INVALID_RESULT_ERROR;
|
||||||
|
} else {
|
||||||
|
$result = $resultArray[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
call_user_func($socket->function, $result, $error);
|
||||||
call_user_func($socket->function, $result[1], $error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ class ManiaExchangeManager {
|
|||||||
|
|
||||||
$success = $this->maniaControl->fileReader->loadFile($url, function ($mapInfo, $error) use ($titlePrefix, $url) {
|
$success = $this->maniaControl->fileReader->loadFile($url, function ($mapInfo, $error) use ($titlePrefix, $url) {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
trigger_error($error);
|
trigger_error($error . " " . $url);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user