mirror of
https://github.com/espressif/openthread.git
synced 2026-07-31 16:17:47 +00:00
[coap] block2 fix PrepareNextBlockRequest to provide token from next request (#12097)
This commit is contained in:
@@ -640,6 +640,8 @@ Error CoapBase::PrepareNextBlockRequest(Message::BlockType aType,
|
||||
blockOption = (aType == Message::kBlockType1) ? kOptionBlock1 : kOptionBlock2;
|
||||
|
||||
aRequest.Init(kTypeConfirmable, static_cast<ot::Coap::Code>(aRequestOld.GetCode()));
|
||||
// Per RFC 7959, all requests in a block-wise transfer MUST use the same token.
|
||||
IgnoreError(aRequest.SetTokenFromMessage(aRequestOld));
|
||||
SuccessOrExit(error = iterator.Init(aRequestOld));
|
||||
|
||||
// Copy options from last response to next message
|
||||
|
||||
Reference in New Issue
Block a user