mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 05:37:46 +00:00
[dns-client] change SendCopy() to return void (#4941)
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "common/debug.hpp"
|
||||
#include "common/instance.hpp"
|
||||
#include "common/locator-getters.hpp"
|
||||
#include "common/logging.hpp"
|
||||
#include "net/udp6.hpp"
|
||||
#include "thread/thread_netif.hpp"
|
||||
|
||||
@@ -223,7 +224,7 @@ otError Client::SendMessage(Message &aMessage, const Ip6::MessageInfo &aMessageI
|
||||
return mSocket.SendTo(aMessage, aMessageInfo);
|
||||
}
|
||||
|
||||
otError Client::SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
||||
void Client::SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
||||
{
|
||||
otError error;
|
||||
Message *messageCopy = NULL;
|
||||
@@ -237,12 +238,15 @@ otError Client::SendCopy(const Message &aMessage, const Ip6::MessageInfo &aMessa
|
||||
|
||||
exit:
|
||||
|
||||
if (error != OT_ERROR_NONE && messageCopy != NULL)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
messageCopy->Free();
|
||||
}
|
||||
otLogWarnIp6("Failed to send DNS request: %s", otThreadErrorToString(error));
|
||||
|
||||
return error;
|
||||
if (messageCopy != NULL)
|
||||
{
|
||||
messageCopy->Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
otError Client::AppendCompressedHostname(Message &aMessage, const char *aHostname)
|
||||
@@ -435,7 +439,7 @@ void Client::HandleRetransmissionTimer(void)
|
||||
messageInfo.SetPeerPort(queryMetadata.mDestinationPort);
|
||||
messageInfo.SetSockAddr(queryMetadata.mSourceAddress);
|
||||
|
||||
IgnoreError(SendCopy(*message, messageInfo));
|
||||
SendCopy(*message, messageInfo);
|
||||
}
|
||||
|
||||
if (nextTime > queryMetadata.mTransmissionTime)
|
||||
|
||||
@@ -197,7 +197,7 @@ private:
|
||||
Message *CopyAndEnqueueMessage(const Message &aMessage, const QueryMetadata &aQueryMetadata);
|
||||
void DequeueMessage(Message &aMessage);
|
||||
otError SendMessage(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 AppendCompressedHostname(Message &aMessage, const char *aHostname);
|
||||
otError CompareQuestions(Message &aMessageResponse, Message &aMessageQuery, uint16_t &aOffset);
|
||||
|
||||
Reference in New Issue
Block a user