Skip to content

Commit

Permalink
extra logs
Browse files Browse the repository at this point in the history
  • Loading branch information
abtink committed Sep 9, 2023
1 parent 7867f5c commit cdf2bec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/mdns/mdns_mdnssd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ otbrError PublisherMDnsSd::Start(void)
{
DNSServiceErrorType dnsError;

otbrLogInfo("ABTIN -> Start()");

SuccessOrExit(dnsError = DNSServiceCreateConnection(&mHostsRef));
otbrLogDebug("Created new shared DNSServiceRef: %p", mHostsRef);

Expand Down Expand Up @@ -267,6 +269,8 @@ void PublisherMDnsSd::Stop(void)

mState = State::kIdle;

otbrLogInfo("ABTIN -> Stop()");

exit:
return;
}
Expand Down Expand Up @@ -345,6 +349,7 @@ void PublisherMDnsSd::Process(const MainloopContext &aMainloop)
}
if (error == kDNSServiceErr_ServiceNotRunning)
{
otbrLogInfo("ABTIN Need to reconnedt");
otbrLogWarning("Need to reconnect to mdnsd");
Stop();
Start();
Expand Down Expand Up @@ -414,6 +419,8 @@ otbrError PublisherMDnsSd::DnssdServiceRegistration::Register(void)
/* domain */ nullptr, hostNameCString, htons(mPort), mTxtData.size(), mTxtData.data(),
HandleRegisterResult, this);

otbrLogInfo("ABTIN DNSServiceRegister(), ref=%p, error:%s", mServiceRef, DNSErrorToString(dnsError));

if (dnsError != kDNSServiceErr_NoError)
{
HandleRegisterResult(/* aFlags */ 0, dnsError);
Expand All @@ -424,6 +431,8 @@ otbrError PublisherMDnsSd::DnssdServiceRegistration::Register(void)

void PublisherMDnsSd::DnssdServiceRegistration::Unregister(void)
{
otbrLogInfo("ABTIN DnssdServiceRegistration::Unregister %p", mServiceRef);

if (mServiceRef != nullptr)
{
DNSServiceRefDeallocate(mServiceRef);
Expand Down Expand Up @@ -495,6 +504,9 @@ void PublisherMDnsSd::DnssdHostRegistration::Unregister(void)
{
DNSServiceErrorType dnsError;

otbrLogInfo("ABTIN DnssdHostRegistration::Unregister()");


VerifyOrExit(GetPublisher().mHostsRef != nullptr);

for (size_t index = 0; index < mAddrRecordRefs.size(); index++)
Expand Down

0 comments on commit cdf2bec

Please sign in to comment.