@@ -1796,7 +1796,8 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
1796
1796
1797
1797
if (src_coap_blockwise_ack_msg_ptr -> options_list_ptr ) {
1798
1798
src_coap_blockwise_ack_msg_ptr -> options_list_ptr -> block1 = COAP_OPTION_BLOCK_NONE ;
1799
- src_coap_blockwise_ack_msg_ptr -> options_list_ptr -> block2 = COAP_OPTION_BLOCK_NONE ;
1799
+ // Do not clear block2 as it might have been set in the original request to request
1800
+ // specific size blocks
1800
1801
} else {
1801
1802
if (!sn_coap_parser_alloc_options (handle , src_coap_blockwise_ack_msg_ptr )) {
1802
1803
tr_error ("sn_coap_handle_blockwise_message - (send block1) failed to allocate ack message!" );
@@ -1823,6 +1824,7 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
1823
1824
src_coap_blockwise_ack_msg_ptr -> payload_len = block_size ;
1824
1825
src_coap_blockwise_ack_msg_ptr -> payload_ptr = src_coap_blockwise_ack_msg_ptr -> payload_ptr + (block_size * block_number );
1825
1826
}
1827
+
1826
1828
/* Build and send block message */
1827
1829
dst_packed_data_needed_mem = sn_coap_builder_calc_needed_packet_data_size_2 (src_coap_blockwise_ack_msg_ptr , handle -> sn_coap_block_data_size );
1828
1830
@@ -2245,7 +2247,8 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
2245
2247
2246
2248
if (src_coap_blockwise_ack_msg_ptr -> options_list_ptr ) {
2247
2249
src_coap_blockwise_ack_msg_ptr -> options_list_ptr -> block1 = COAP_OPTION_BLOCK_NONE ;
2248
- src_coap_blockwise_ack_msg_ptr -> options_list_ptr -> block2 = COAP_OPTION_BLOCK_NONE ;
2250
+ // Do not clear block2 as it might have been set in the original request to request
2251
+ // specific size blocks
2249
2252
} else {
2250
2253
if (sn_coap_parser_alloc_options (handle , src_coap_blockwise_ack_msg_ptr ) == NULL ) {
2251
2254
tr_error ("sn_coap_handle_blockwise_message - (recv block2) failed to allocate options!" );
0 commit comments