Skip to content

Commit

Permalink
Merge pull request #5833 from anttiylitokola/get_req_change
Browse files Browse the repository at this point in the history
Add token to every GET(block2) request
  • Loading branch information
0xc0170 authored Jan 15, 2018
2 parents f1ecb51 + 3e5a4f0 commit 945d75f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions features/FEATURE_COMMON_PAL/mbed-coap/source/sn_coap_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,6 +1903,16 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
}
memcpy(src_coap_blockwise_ack_msg_ptr->uri_path_ptr, previous_blockwise_msg_ptr->coap_msg_ptr->uri_path_ptr, previous_blockwise_msg_ptr->coap_msg_ptr->uri_path_len);
}
if (previous_blockwise_msg_ptr->coap_msg_ptr->token_ptr) {
src_coap_blockwise_ack_msg_ptr->token_len = previous_blockwise_msg_ptr->coap_msg_ptr->token_len;
src_coap_blockwise_ack_msg_ptr->token_ptr = handle->sn_coap_protocol_malloc(previous_blockwise_msg_ptr->coap_msg_ptr->token_len);
if (!src_coap_blockwise_ack_msg_ptr->token_ptr) {
sn_coap_parser_release_allocated_coap_msg_mem(handle, src_coap_blockwise_ack_msg_ptr);
tr_error("sn_coap_handle_blockwise_message - failed to allocate for token ptr!");
return NULL;
}
memcpy(src_coap_blockwise_ack_msg_ptr->token_ptr, previous_blockwise_msg_ptr->coap_msg_ptr->token_ptr, previous_blockwise_msg_ptr->coap_msg_ptr->token_len);
}
}

ns_list_remove(&handle->linked_list_blockwise_sent_msgs, previous_blockwise_msg_ptr);
Expand Down

0 comments on commit 945d75f

Please sign in to comment.