Update Blocklayer to deal with Block1 option
On the last block answer, the Client still sent another empty message, it didn't take into account the fact that the previous block was sent with m=0. This commit fixed that for me.
This commit is contained in:
parent
6b74876f66
commit
264167e3d1
1 changed files with 3 additions and 3 deletions
|
@ -141,10 +141,10 @@ class BlockLayer(object):
|
||||||
item.num += 1
|
item.num += 1
|
||||||
item.byte += item.size
|
item.byte += item.size
|
||||||
if len(item.payload) <= item.byte:
|
if len(item.payload) <= item.byte:
|
||||||
m = 0
|
item.m = 0
|
||||||
else:
|
else:
|
||||||
m = 1
|
item.m = 1
|
||||||
request.block1 = (item.num, m, item.size)
|
request.block1 = (item.num, item.m, item.size)
|
||||||
elif transaction.response.block2 is not None:
|
elif transaction.response.block2 is not None:
|
||||||
|
|
||||||
num, m, size = transaction.response.block2
|
num, m, size = transaction.response.block2
|
||||||
|
|
Loading…
Reference in a new issue