From d15e614bb197ec195d2486da301be3134354bc09 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 21 May 2020 01:17:12 +0300 Subject: [PATCH] Fix streams decoding in BMProto.bm_command_version() --- src/network/bmproto.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index 64bde74c..ed8e5924 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -512,9 +512,11 @@ class BMProto(AdvancedDispatcher, ObjectTracker): Incoming version. Parse and log, remember important things, like streams, bitfields, etc. """ + decoded = self.decode_payload_content("IQQiiQlslv") (self.remoteProtocolVersion, self.services, self.timestamp, - self.sockNode, self.peerNode, self.nonce, self.userAgent, - self.streams) = self.decode_payload_content("IQQiiQlsLv") + self.sockNode, self.peerNode, self.nonce, self.userAgent + ) = decoded[:7] + self.streams = decoded[7:] self.nonce = struct.pack('>Q', self.nonce) self.timeOffset = self.timestamp - int(time.time()) logger.debug('remoteProtocolVersion: %i', self.remoteProtocolVersion)