Commit 70e7ce8e authored by Jozef Kralik's avatar Jozef Kralik

Fix: preserve ContentFormat for blockwise

Content format was dropped by commit:
 - coap:send last block2 response/block1 ACK as CON
   e5092dff
parent aa83bea8
Pipeline #146 failed with stage
in 42 seconds
......@@ -316,10 +316,15 @@ coap_receive(oc_message_t *msg)
goto send_message;
} else {
OC_DBG("received all blocks for payload");
unsigned int cf = 0;
int cf_was_set = coap_get_header_content_format(response, &cf);
coap_udp_init_message(response, COAP_TYPE_CON, CONTENT_2_05,
response->mid);
coap_set_header_block1(response, block1_num, block1_more,
block1_size);
if (cf_was_set) {
coap_set_header_content_format(response, cf);
}
request_buffer->payload_size =
request_buffer->next_block_offset;
request_buffer->ref_count = 0;
......@@ -359,8 +364,13 @@ coap_receive(oc_message_t *msg)
? 1
: 0;
if (more == 0) {
unsigned int cf = 0;
int cf_was_set = coap_get_header_content_format(response, &cf);
coap_udp_init_message(response, COAP_TYPE_CON, CONTENT_2_05,
response->mid);
if (cf_was_set) {
coap_set_header_content_format(response, cf);
}
}
coap_set_payload(response, payload, payload_size);
coap_set_header_block2(response, block2_num, more, block2_size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment