Do not restrict writing of block option to Block2, only.

Note that coap_write_block_opt() is not very useful for Block1 as
it sets the M bit according to the data length and block number.
This commit is contained in:
Olaf Bergmann committed 2014-03-06 15:43:00 +00:00
1 parent 37699fd058
commit 1b3aa704e6
1 file changed
-6
-6
View File
@@ -64,12 +64,6 @@ coap_write_block_opt(coap_block_t *block, unsigned short type,
assert(pdu);
/* Block2 */
if (type != COAP_OPTION_BLOCK2) {
warn("coap_write_block_opt: skipped unknown option\n");
return -1;
}
start = block->num << (block->szx + 4);
if (data_length <= start) {
debug("illegal block requested\n");