mirror of
https://github.com/espressif/openthread.git
synced 2026-08-31 22:39:54 +00:00
CoAP: enable response handler for CoAP response messages (#1719)
This is needed for detecting a canceled CoAP observe session.
This commit is contained in:
@@ -189,7 +189,7 @@ ThreadError Coap::SendMessage(Message &aMessage, const Ip6::MessageInfo &aMessag
|
||||
// Create a copy of entire message and enqueue it.
|
||||
copyLength = aMessage.GetLength();
|
||||
}
|
||||
else if (header.IsNonConfirmable() && header.IsRequest() && (aHandler != NULL))
|
||||
else if (header.IsNonConfirmable() && (aHandler != NULL))
|
||||
{
|
||||
// As we do not retransmit non confirmable messages, create a copy of header only, for token information.
|
||||
copyLength = header.GetLength();
|
||||
@@ -466,7 +466,9 @@ Message *Coap::FindRelatedRequest(const Header &aResponseHeader, const Ip6::Mess
|
||||
aCoapMetadata.mDestinationAddress.IsAnycastRoutingLocator()) &&
|
||||
(aCoapMetadata.mDestinationPort == aMessageInfo.GetPeerPort()))
|
||||
{
|
||||
assert(aRequestHeader.FromMessage(*message, sizeof(CoapMetadata)) == kThreadError_None);
|
||||
// FromMessage can return kThreadError_Parse if only partial message was stored (header only),
|
||||
// but payload marker is present. Assume, that stored messages are always valid.
|
||||
aRequestHeader.FromMessage(*message, sizeof(CoapMetadata));
|
||||
|
||||
switch (aResponseHeader.GetType())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user