mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-06 01:42:53 +03:00
Add in new COAP_BLOCK_NOT_RANDOM_BLOCK1 option for coap_context_set_block_mode(). This disables receipt of any Block1 packet (but not Q-BLock1) if the block numbers are not sequentially received starting with 0. A 4.08 code is returned for every packet out of order and its data is ignored. If COAP_BLOCK_SINGLE_BODY is set in coap_context_set_block_mode(), but not COAP_BLOCK_NOT_RANDOM_BLOCK1, then all Block1 packets are assembled in the correct order before passing the body up to the application. The receive logic will timeout after MAX_TRANSMIT_WAIT (93 seconds) if there are any missing blocks, or 10 seconds if the last block is seen. If COAP_BLOCK_SINGLE_BODY is not set in coap_context_set_block_mode(), and not COAP_BLOCK_NOT_RANDOM_BLOCK1, then the random order packets are passed up to the application layer where it is the application's responsibility to decide what to do with the randomly ordered packets, and what response code to send.