1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 11:18:59 +01:00

Avoid issues while reconnecting

This commit is contained in:
Daniil Gentili 2021-12-14 00:00:12 +01:00
parent ba6c3850a5
commit 12363911d9
2 changed files with 7 additions and 1 deletions

2
docs

@ -1 +1 @@
Subproject commit 0b0c17a38bf999b500d0865230d547e28b3aefa0
Subproject commit 8c066db91f33b544e0822aeaae778989c0527d94

View File

@ -589,6 +589,9 @@ class DataCenterConnection implements JsonSerializable
*/
public function reading(bool $reading, int $x)
{
if (!isset($this->availableConnections[$x])) {
return;
}
$this->availableConnections[$x] += $reading ? -$this->decRead : $this->decRead;
}
/**
@ -601,6 +604,9 @@ class DataCenterConnection implements JsonSerializable
*/
public function writing(bool $writing, int $x)
{
if (!isset($this->availableConnections[$x])) {
return;
}
$this->availableConnections[$x] += $writing ? -$this->decWrite : $this->decWrite;
}
/**