Fix payload transmitted in Block2 transfer.

Previosly the CoAP server transmitted the first block of data for Block2
transfer, even when a client requested in Block2 request following
block. This patch changes server operation to transmit the payload
block requested by the client.

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
This commit is contained in:
Hubert Miś 2020-12-22 13:19:12 +01:00
parent 89d51737a9
commit 3dc7e5c8d6

View file

@ -58,7 +58,7 @@ class BlockLayer(object):
del transaction.request.block2
else:
# early negotiation
byte = 0
byte = num * size
self._block2_receive[key_token] = BlockItem(byte, num, m, size)
del transaction.request.block2