改名
This commit is contained in:
+16
-2
@@ -116,6 +116,16 @@ class AsyncClient extends ClientAbstracts
|
||||
$this->client->send(implode("\r\n", $array) . "\r\n\r\n" . $content);
|
||||
$revice = $this->client->recv();
|
||||
|
||||
if (!str_ends_with($revice, "\r\n\r\n")) {
|
||||
while (true) {
|
||||
$next = $this->client->recv();
|
||||
$revice .= $next;
|
||||
if (str_ends_with($next, "\r\n\r\n")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[$header, $body] = explode("\r\n\r\n", $revice);
|
||||
|
||||
$header = explode("\r\n", $header);
|
||||
@@ -124,8 +134,12 @@ class AsyncClient extends ClientAbstracts
|
||||
$this->setStatusCode(intval(explode(' ', $status)[1]));
|
||||
$this->parseResponseHeaders($header);
|
||||
$this->setBody($body);
|
||||
}
|
||||
|
||||
|
||||
private function chunked()
|
||||
{
|
||||
|
||||
var_dump($body);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +153,7 @@ class AsyncClient extends ClientAbstracts
|
||||
foreach ($headers as $header) {
|
||||
[$key, $value] = explode(': ', $header);
|
||||
|
||||
$array[$key] = $value;
|
||||
$array[$key] = trim($value);
|
||||
}
|
||||
$this->setResponseHeader($array);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user