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