Skip to content
Commit 4fbf7213 authored by Robert Chou's avatar Robert Chou Committed by Jukka Rissanen
Browse files

net: sample: correct coap-server ETSI TD_COAP_BLOCK_03/04 testcases



When testing against etsi_coaptest.sh, test cases TD_COAP_BLOCK_03/04
will get stuck. This is because these testcases send out a blockwise
transfer but with an empty payload. Although this should be a legit
request, large-update/create handlers did not check "MORE" flag in
block1 option and always return an error when request comes with empty
payload.

Corrected as below
1. Initialize coap_block_context when first block arrives.
   (SIZE1 option is not always available. In the case that SIZE1 is
    unavailable, the zoap_block_context will be re-initialized each time
    a new block has arrived)
2. Check "MORE" flag of block1 option. If it's the last block, then
   an empty payload should be allowed.
3. Response w/ 2.04 CHANGED when the last block has arrived for
   large-update
4. Response w/ 2.02 CREATE when the last block has arrived for
   large-create
5. Remove adding block2 option to the response since we are not sending
   back any data to the caller

Signed-off-by: default avatarRobert Chou <robert.ch.chou@acer.com>
parent 7f04af8f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment