Skip to content

Commit

Permalink
Merge pull request #21 from ilyatau/master
Browse files Browse the repository at this point in the history
Change answer reader script in Socket.php
  • Loading branch information
ins0 committed Mar 4, 2015
2 parents 8f4ee2e + 7323652 commit 2f10e42
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Racecore/GATracking/Client/Adapter/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,13 @@ private function readConnection(Request\TrackingRequest $request)
return false;
}

$payloadString = http_build_query($request->getPayload());
$payloadLength = strlen($payloadString);

// response
$response = '';

// receive response
$read = 0;
do {
$buf = fread($this->connection, $payloadLength - $read);
$read += strlen($buf);
$response .= $buf;
} while ($read < $payloadLength);
while (!feof($this->connection)) {
$response .= fread($this->connection, 8192);
}

// response
$responseContainer = explode("\r\n\r\n", $response, 2);
Expand Down

0 comments on commit 2f10e42

Please sign in to comment.