Revert "改名"
This reverts commit fdf58326
This commit is contained in:
+19
-9
@@ -108,21 +108,14 @@ class AsyncClient extends ClientAbstracts
|
|||||||
private function execute(string $path, string $content)
|
private function execute(string $path, string $content)
|
||||||
{
|
{
|
||||||
$array = [];
|
$array = [];
|
||||||
$array[] = strtoupper($this->getMethod()) . ' ' . $path . ' HTTP/1.0';
|
$array[] = strtoupper($this->getMethod()) . ' ' . $path . ' HTTP/1.1';
|
||||||
if (!empty($this->getHeader())) {
|
if (!empty($this->getHeader())) {
|
||||||
foreach ($this->getHeader() as $key => $value) {
|
foreach ($this->getHeader() as $key => $value) {
|
||||||
$array[] = sprintf('%s: %s', $key, $value);
|
$array[] = sprintf('%s: %s', $key, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->client->send(implode("\r\n", $array) . "\r\n\r\n" . $content);
|
$this->client->send(implode("\r\n", $array) . "\r\n\r\n" . $content);
|
||||||
$receive = '';
|
$receive = $this->waite();
|
||||||
while (true) {
|
|
||||||
$_tmp = $this->client->recv();
|
|
||||||
if (empty($_tmp)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$receive .= $_tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
Kiri::getDi()->get(Logger::class)->debug($receive);
|
Kiri::getDi()->get(Logger::class)->debug($receive);
|
||||||
|
|
||||||
@@ -137,6 +130,23 @@ class AsyncClient extends ClientAbstracts
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function waite(): string
|
||||||
|
{
|
||||||
|
$receive = '';
|
||||||
|
while (true) {
|
||||||
|
$_tmp = $this->client->recv();
|
||||||
|
if (empty($_tmp)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$receive .= $_tmp;
|
||||||
|
}
|
||||||
|
return $receive;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private function chunked()
|
private function chunked()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user