This commit is contained in:
2021-06-09 20:08:15 +03:00
parent 411fabb1f5
commit e3c64f6f09
3 changed files with 28 additions and 3 deletions

View File

@@ -60,6 +60,17 @@ abstract class Connection
$response = yield $this->response($stream, $buffer);
$serverConfig = ServerConfig::fromArray($response->toArray());
if ($serverConfig->tls) {
yield $stream->setupTls();
/** @var Response $response */
$response = yield $this->response($stream, $buffer);
if (!$response->isOk()) {
throw new NsqException();
}
}
if ($serverConfig->snappy) {
$stream = new SnappyStream($stream, $buffer->flush());