Skip to content
Snippets Groups Projects
Commit 302f743f authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

incorrect assertion

parent dadb2f7e
No related branches found
No related tags found
No related merge requests found
......@@ -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())
......
......@@ -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')),
......
......@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment