Protocol padding fixes
This commit is contained in:
parent
79f7d92767
commit
a0bc08b33e
@ -152,7 +152,7 @@ class ReadLoop extends SignalLoop
|
|||||||
if ($left) {
|
if ($left) {
|
||||||
$API->logger->logger('Padded unencrypted message', \danog\MadelineProto\Logger::ULTRA_VERBOSE);
|
$API->logger->logger('Padded unencrypted message', \danog\MadelineProto\Logger::ULTRA_VERBOSE);
|
||||||
if ($left < (-$message_length & 15)) {
|
if ($left < (-$message_length & 15)) {
|
||||||
throw new \danog\MadelineProto\SecurityException('padding is too small');
|
$API->logger->logger('Protocol padded unencrypted message', \danog\MadelineProto\Logger::ULTRA_VERBOSE);
|
||||||
}
|
}
|
||||||
yield $buffer->bufferRead($left);
|
yield $buffer->bufferRead($left);
|
||||||
}
|
}
|
||||||
|
@ -62,9 +62,7 @@ class WriteLoop extends ResumableSignalLoop
|
|||||||
} else {
|
} else {
|
||||||
$res = $this->encryptedWriteLoopAsync();
|
$res = $this->encryptedWriteLoopAsync();
|
||||||
}
|
}
|
||||||
if ($res instanceof \Generator) {
|
yield $res;
|
||||||
yield new Coroutine($res);
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
$this->exitedLoop();
|
$this->exitedLoop();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user