mirror of
https://github.com/deployphp/deployer.git
synced 2025-04-22 14:21:56 +02:00
Fix issue where stream read is terminated prematurely (#4032)
* Update Server.php * Update Server.php * Update Server.php * Fix issue where stream read is terminated prematurely
This commit is contained in:
parent
7b108897ba
commit
5f69a2e0a4
@ -149,16 +149,10 @@ class Server
|
||||
|
||||
private function readClientRequest($clientSocket)
|
||||
{
|
||||
$request = '';
|
||||
while (($chunk = @fread($clientSocket, 1024)) !== false) {
|
||||
$request .= $chunk;
|
||||
if (strpos($request, "\r\n\r\n") !== false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$request = stream_get_contents($clientSocket);
|
||||
|
||||
if ($chunk === false && !feof($clientSocket)) {
|
||||
throw new Exception("Socket read failed");
|
||||
if ($request === false) {
|
||||
throw new Exception('Socket read failed');
|
||||
}
|
||||
|
||||
return $request;
|
||||
|
Loading…
x
Reference in New Issue
Block a user