Block: Make sure SizeX option is added for small sizes with blocks

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2026-09-01 20:46:45 +01:00
1 parent dbeedd59b4
commit 24ae8f2ee8
1 file changed
+13
+13
View File
@@ -1295,6 +1295,19 @@ coap_add_data_large_internal(coap_session_t *session,
option,
coap_encode_var_safe(buf, sizeof(buf),
(0 << 4) | (0 << 3) | blk_size), buf);
if (COAP_PDU_IS_REQUEST(pdu)) {
coap_update_option(pdu,
COAP_OPTION_SIZE1,
coap_encode_var_safe(buf, sizeof(buf),
(unsigned int)length),
buf);
} else {
coap_update_option(pdu,
COAP_OPTION_SIZE2,
coap_encode_var_safe(buf, sizeof(buf),
(unsigned int)length),
buf);
}
}
add_data:
if (get_func) {