mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 19:58:22 +08:00
Optimized
This commit is contained in:
parent
e66bfef473
commit
9d897a656a
@ -47,6 +47,9 @@ class JsonLengthPacker implements PackerInterface
|
||||
public function unpack(string $data)
|
||||
{
|
||||
$data = substr($data, $this->length);
|
||||
if (! $data) {
|
||||
return null;
|
||||
}
|
||||
return json_decode($data, true);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ trait RecvTrait
|
||||
throw new RecvException('Connection is closed.');
|
||||
}
|
||||
if ($data === false) {
|
||||
throw new RecvException('Error receiving data, errno=' . $client->errCode);
|
||||
throw new RecvException('Error receiving data, errno=' . $client->errCode . ' errmsg=' . swoole_strerror($client->errCode));
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
Loading…
Reference in New Issue
Block a user