mirror of
https://github.com/espressif/openthread.git
synced 2026-08-02 00:57:47 +00:00
[coap] change SendCopy() to return void (#4941)
This commit is contained in:
@@ -375,7 +375,7 @@ void CoapBase::HandleRetransmissionTimer(void)
|
||||
messageInfo.SetPeerPort(metadata.mDestinationPort);
|
||||
messageInfo.SetSockAddr(metadata.mSourceAddress);
|
||||
|
||||
IgnoreError(SendCopy(*message, messageInfo));
|
||||
SendCopy(*message, messageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ void CoapBase::DequeueMessage(Message &aMessage)
|
||||
// the timer would just shoot earlier and then it'd be setup again.
|
||||
}
|
||||
|
||||
otError CoapBase::SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
||||
void CoapBase::SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
||||
{
|
||||
otError error;
|
||||
Message *messageCopy = NULL;
|
||||
@@ -478,12 +478,15 @@ otError CoapBase::SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMes
|
||||
|
||||
exit:
|
||||
|
||||
if (error != OT_ERROR_NONE && messageCopy != NULL)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
messageCopy->Free();
|
||||
}
|
||||
otLogWarnCoap("Failed to send copy: %s", otThreadErrorToString(error));
|
||||
|
||||
return error;
|
||||
if (messageCopy != NULL)
|
||||
{
|
||||
messageCopy->Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Message *CoapBase::FindRelatedRequest(const Message & aResponse,
|
||||
|
||||
@@ -561,7 +561,7 @@ private:
|
||||
void ProcessReceivedRequest(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
void ProcessReceivedResponse(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
otError SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
void SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
otError SendEmptyMessage(Message::Type aType, const Message &aRequest, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
otError Send(ot::Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
Reference in New Issue
Block a user