summaryrefslogtreecommitdiff
path: root/python/qpid/peer.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-01-18 17:32:55 +0000
committerRafael H. Schloming <rhs@apache.org>2008-01-18 17:32:55 +0000
commitb43036056e0dc7ad8fb919bd1f5b065ff01502c5 (patch)
treeaf43d5182aa8c7d0675738b5c613f0fdf5e4553b /python/qpid/peer.py
parent4af4ec466428accc35320c2f307709d6545924f8 (diff)
downloadqpid-python-b43036056e0dc7ad8fb919bd1f5b065ff01502c5.tar.gz
fixed python dependence on the content-length attribute (bz 419371)
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@613211 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/peer.py')
-rw-r--r--python/qpid/peer.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/python/qpid/peer.py b/python/qpid/peer.py
index 376d81e184..c7f56b49b2 100644
--- a/python/qpid/peer.py
+++ b/python/qpid/peer.py
@@ -226,13 +226,12 @@ class Channel:
self.write_content(frame.method_type.klass, content)
def write_content(self, klass, content):
- size = content.size()
- header = Header(klass, content.weight(), size, content.properties)
+ header = Header(klass, content.weight(), content.size(), content.properties)
self.write(header)
for child in content.children:
self.write_content(klass, child)
# should split up if content.body exceeds max frame size
- if size > 0:
+ if content.body:
self.write(Body(content.body))
def receive(self, frame, work):
@@ -360,14 +359,13 @@ def read_content(queue):
children = []
for i in range(header.weight):
children.append(read_content(queue))
- size = header.size
- read = 0
buf = StringIO()
- while read < size:
+ eof = header.eof
+ while not eof:
body = queue.get()
+ eof = body.eof
content = body.content
buf.write(content)
- read += len(content)
return Content(buf.getvalue(), children, header.properties.copy())
class Future: