From 264167e3d1ab2e9dd703bf62fe46c50e7b4cb502 Mon Sep 17 00:00:00 2001 From: Matthieu BRIEDA Date: Wed, 14 Mar 2018 17:24:57 +0100 Subject: [PATCH] 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. --- coapthon/layers/blocklayer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coapthon/layers/blocklayer.py b/coapthon/layers/blocklayer.py index 451ba3c..8f698a3 100644 --- a/coapthon/layers/blocklayer.py +++ b/coapthon/layers/blocklayer.py @@ -141,10 +141,10 @@ class BlockLayer(object): item.num += 1 item.byte += item.size if len(item.payload) <= item.byte: - m = 0 + item.m = 0 else: - m = 1 - request.block1 = (item.num, m, item.size) + item.m = 1 + request.block1 = (item.num, item.m, item.size) elif transaction.response.block2 is not None: num, m, size = transaction.response.block2