Avoid issues with non-connected DCs

This commit is contained in:
Daniil Gentili 2019-12-31 12:12:58 +00:00
parent 01304a39fc
commit 0f50f565cf
3 changed files with 12 additions and 1 deletions

2
docs

@ -1 +1 @@
Subproject commit dfec70a8c5a6a6eca9e9d47e582141bc8a86aba8
Subproject commit 4ed3a8447cf21c69322bcdaf149eb3ce0befe8c0

View File

@ -360,6 +360,16 @@ class DataCenterConnection implements JsonSerializable
return $this->ctx;
}
/**
* Has connection context?
*
* @return bool
*/
public function hasCtx(): bool
{
return isset($this->ctx);
}
/**
* Connect function.
*

View File

@ -663,6 +663,7 @@ trait AuthKeyHandler
$dcs = [];
$postpone = [];
foreach ($this->datacenter->getDataCenterConnections() as $id => $socket) {
if (!$socket->hasCtx()) continue;
if ($socket->isMedia()) {
$oid = \intval($id);
if (isset($dcs[$oid])) {