diff --git a/coolamqp/uplink/connection/recv_framer.py b/coolamqp/uplink/connection/recv_framer.py index 1a7054621efc9a25d5469c84dcbfb89997af2e72..58aab46fe3d0d181ea41057c564376d44e1a2d0e 100644 --- a/coolamqp/uplink/connection/recv_framer.py +++ b/coolamqp/uplink/connection/recv_framer.py @@ -69,6 +69,8 @@ class ReceivingFramer(object): self.chunks[0] = self.chunks[0][up_to:] self.total_data_len -= len(q) + assert len(q) <= up_to, 'extracted %s but %s was requested' % (len(q), up_to) + print('Returning %s bytes - %s' % (len(q), repr(q))) return q def _statemachine(self): @@ -82,6 +84,8 @@ class ReceivingFramer(object): if self.frame_type not in (FRAME_HEARTBEAT, FRAME_HEADER, FRAME_METHOD, FRAME_BODY): raise ValueError('Invalid frame') + print('Rolling with', self.frame_type) + return True # state rule 2 @@ -107,6 +111,8 @@ class ReceivingFramer(object): self.frame_channel, self.frame_size = struct.unpack('!HI',hdr) + print('Regarding', self.frame_channel, 'size', self.frame_size) + return True # state rule 4 @@ -121,7 +127,7 @@ class ReceivingFramer(object): while payload.tell() < self.frame_size: payload.write(self._extract(self.frame_size - payload.tell())) - assert payload.tell() <= self.total_data_len + assert payload.tell() <= self.frame_size payload = memoryview(payload.getvalue()) diff --git a/coolamqp/uplink/handshake.py b/coolamqp/uplink/handshake.py index 4fe0b66528eefc1809c97de058477c20b575e0b7..8544cdbc290cb887cbc838ee94d73ad2fe926cfb 100644 --- a/coolamqp/uplink/handshake.py +++ b/coolamqp/uplink/handshake.py @@ -22,7 +22,7 @@ CLIENT_DATA = [ # because RabbitMQ is some kind of a fascist and does not allow # these fields to be of type short-string (b'product', (b'CoolAMQP', 'S')), - (b'version', (b'0.84', 'S')), + (b'version', (b'0.85', 'S')), (b'copyright', (b'Copyright (C) 2016-2017 DMS Serwis', 'S')), (b'information', (b'Licensed under the MIT License.\nSee https://github.com/smok-serwis/coolamqp for details', 'S')), (b'capabilities', ([(capa, (True, 't')) for capa in SUPPORTED_EXTENSIONS], 'F')), diff --git a/setup.py b/setup.py index 5d940b37300c91b06262014c0ec150303a45c9c6..b2c3afb086b3562ba563fa54109c389b55b7146d 100644 --- a/setup.py +++ b/setup.py @@ -4,12 +4,12 @@ from setuptools import setup setup(name=u'CoolAMQP', - version='0.84', + version='0.85', description=u'The fastest AMQP client', author=u'DMS Serwis s.c.', author_email=u'piotrm@smok.co', url=u'https://github.com/smok-serwis/coolamqp', - download_url='https://github.com/smok-serwis/coolamqp/archive/v0.84.zip', + download_url='https://github.com/smok-serwis/coolamqp/archive/v0.85.zip', keywords=['amqp', 'rabbitmq', 'client', 'network', 'ha', 'high availability'], packages=[ 'coolamqp',