result on response error

This commit is contained in:
kremsy 2014-02-15 12:40:08 +01:00 committed by Steffen Schröder
parent 145aa29c17
commit a7213f8c3e
2 changed files with 9 additions and 1 deletions

View File

@ -51,6 +51,14 @@ class AsynchronousFileReader {
$error = self::TIMEOUT_ERROR; $error = self::TIMEOUT_ERROR;
} else if (substr($socket->streamBuffer, 9, 3) != "200") { } else if (substr($socket->streamBuffer, 9, 3) != "200") {
$error = self::RESPONSE_ERROR; $error = self::RESPONSE_ERROR;
$resultArray = explode("\r\n\r\n", $socket->streamBuffer, 2);
if (count($resultArray) < 2) {
$error = self::INVALID_RESULT_ERROR;
} else {
$result = $resultArray[1];
}
} else if ($socket->streamBuffer == '') { } else if ($socket->streamBuffer == '') {
$error = self::NO_DATA_ERROR; $error = self::NO_DATA_ERROR;
} else { } else {

View File

@ -49,7 +49,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
public function load(ManiaControl $maniaControl) { public function load(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl; $this->maniaControl = $maniaControl;
return; //return;
$this->openDedimaniaSession(true); $this->openDedimaniaSession(true);
} }