Fixed a bug which causes problem when RPC body size is bigger than 4096
- Fetching blobs (size>4k) works now - Updated the image fetching code in examples/test_client.py
This commit is contained in:
committed by
Pedro Ferreira
parent
734fe59663
commit
b26b56632f
@@ -3,6 +3,7 @@ import struct
|
||||
from asyncio import Event, Queue
|
||||
from enum import Enum
|
||||
from time import time
|
||||
from math import ceil
|
||||
|
||||
import simplejson
|
||||
from async_generator import async_generator, yield_
|
||||
@@ -134,8 +135,9 @@ class PacketStream(object):
|
||||
if not header or header == b'\x00' * 9:
|
||||
return
|
||||
flags, length, req = struct.unpack('>BIi', header)
|
||||
logger.debug('flags=%s length=%s req=%s', flags, length, req)
|
||||
|
||||
n_packets = length // 4096 + 1
|
||||
n_packets = ceil(length / 4096)
|
||||
|
||||
body = b''
|
||||
for n in range(n_packets):
|
||||
|
Reference in New Issue
Block a user