Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add mDNS shutdown (#9621)" #9640

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,6 @@ CHIP_ERROR DeviceController::Shutdown()
// manager.
app::InteractionModelEngine::GetInstance()->Shutdown();

#if CHIP_DEVICE_CONFIG_ENABLE_MDNS
Mdns::Resolver::Instance().ShutdownResolver();
#endif // CHIP_DEVICE_CONFIG_ENABLE_MDNS

// TODO(#6668): Some exchange has leak, shutting down ExchangeManager will cause a assert fail.
// if (mExchangeMgr != nullptr)
// {
Expand Down
1 change: 0 additions & 1 deletion src/controller/tests/TestCommissionableNodeController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class MockResolver : public Resolver
public:
CHIP_ERROR SetResolverDelegate(ResolverDelegate *) override { return SetResolverDelegateStatus; }
CHIP_ERROR StartResolver(chip::Inet::InetLayer * inetLayer, uint16_t port) override { return StartResolverStatus; }
void ShutdownResolver() override {}
CHIP_ERROR ResolveNodeId(const PeerId & peerId, Inet::IPAddressType type) override { return ResolveNodeIdStatus; }
CHIP_ERROR FindCommissioners(DiscoveryFilter filter = DiscoveryFilter()) override { return FindCommissionersStatus; }
CHIP_ERROR FindCommissionableNodes(DiscoveryFilter filter = DiscoveryFilter()) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
Expand Down
1 change: 0 additions & 1 deletion src/lib/mdns/Discovery_ImplPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class DiscoveryImplPlatform : public ServiceAdvertiser, public Resolver

/// Starts the service resolver if not yet started
CHIP_ERROR StartResolver(Inet::InetLayer * inetLayer, uint16_t port) override { return Init(); }
void ShutdownResolver() override { ChipMdnsShutdown(); }

/// Advertises the CHIP node as an operational node
CHIP_ERROR Advertise(const OperationalAdvertisingParameters & params) override;
Expand Down
5 changes: 0 additions & 5 deletions src/lib/mdns/MinimalMdnsServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,5 @@ CHIP_ERROR GlobalMinimalMdnsServer::StartServer(chip::Inet::InetLayer * inetLaye
return GlobalMinimalMdnsServer::Server().Listen(inetLayer, &allInterfaces, port);
}

void GlobalMinimalMdnsServer::ShutdownServer()
{
GlobalMinimalMdnsServer::Server().Shutdown();
}

} // namespace Mdns
} // namespace chip
1 change: 0 additions & 1 deletion src/lib/mdns/MinimalMdnsServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class GlobalMinimalMdnsServer : public mdns::Minimal::ServerDelegate

/// Calls Server().Listen() on all available interfaces
CHIP_ERROR StartServer(chip::Inet::InetLayer * inetLayer, uint16_t port);
void ShutdownServer();

void SetQueryDelegate(MdnsPacketDelegate * delegate) { mQueryDelegate = delegate; }
void SetResponseDelegate(MdnsPacketDelegate * delegate) { mResponseDelegate = delegate; }
Expand Down
1 change: 0 additions & 1 deletion src/lib/mdns/Resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ class Resolver
///
/// Unsual name to allow base MDNS classes to implement both Advertiser and Resolver interfaces.
virtual CHIP_ERROR StartResolver(chip::Inet::InetLayer * inetLayer, uint16_t port) = 0;
virtual void ShutdownResolver() = 0;

/// Registers a resolver delegate if none has been registered before
virtual CHIP_ERROR SetResolverDelegate(ResolverDelegate * delegate) = 0;
Expand Down
6 changes: 0 additions & 6 deletions src/lib/mdns/Resolver_ImplMinimalMdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ class MinMdnsResolver : public Resolver, public MdnsPacketDelegate

///// Resolver implementation
CHIP_ERROR StartResolver(chip::Inet::InetLayer * inetLayer, uint16_t port) override;
void ShutdownResolver() override;
CHIP_ERROR SetResolverDelegate(ResolverDelegate * delegate) override;
CHIP_ERROR ResolveNodeId(const PeerId & peerId, Inet::IPAddressType type) override;
CHIP_ERROR FindCommissionableNodes(DiscoveryFilter filter = DiscoveryFilter()) override;
Expand Down Expand Up @@ -395,11 +394,6 @@ CHIP_ERROR MinMdnsResolver::StartResolver(chip::Inet::InetLayer * inetLayer, uin
return GlobalMinimalMdnsServer::Instance().StartServer(inetLayer, port);
}

void MinMdnsResolver::ShutdownResolver()
{
GlobalMinimalMdnsServer::Instance().ShutdownServer();
}

CHIP_ERROR MinMdnsResolver::SetResolverDelegate(ResolverDelegate * delegate)
{
mDelegate = delegate;
Expand Down
1 change: 0 additions & 1 deletion src/lib/mdns/Resolver_ImplNone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class NoneResolver : public Resolver
CHIP_ERROR SetResolverDelegate(ResolverDelegate *) override { return CHIP_NO_ERROR; }

CHIP_ERROR StartResolver(chip::Inet::InetLayer * inetLayer, uint16_t port) override { return CHIP_NO_ERROR; }
void ShutdownResolver() override {}

CHIP_ERROR ResolveNodeId(const PeerId & peerId, Inet::IPAddressType type) override
{
Expand Down
5 changes: 0 additions & 5 deletions src/platform/fake/MdnsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ CHIP_ERROR ChipMdnsInit(MdnsAsyncReturnCallback initCallback, MdnsAsyncReturnCal
return CHIP_NO_ERROR;
}

CHIP_ERROR ChipMdnsShutdown()
{
return CHIP_NO_ERROR;
}

CHIP_ERROR ChipMdnsPublishService(const MdnsService * service)
{
return test::CheckExpected(test::CallType::kStart, service);
Expand Down