Skip to content

Commit

Permalink
Revert "Add mDNS shutdown (#9621)" (#9640)
Browse files Browse the repository at this point in the history
This reverts commit 3da26cf.

Tizen builds seem broken since this change:

```
2021-09-13 15:22:31 INFO
/__w/connectedhomeip/connectedhomeip/out/tizen-arm-light/../../examples/lighting-app/linux/third_party/connectedhomeip/src/lib/mdns/Discovery_ImplPlatform.h:46:
undefined reference to `chip::Mdns::ChipMdnsShutdown()'
409
2021-09-13 15:22:31 INFO    collect2: error: ld returned 1 exit status
```
  • Loading branch information
andy31415 authored and pull[bot] committed Oct 13, 2021
1 parent 26829d6 commit 5638705
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 25 deletions.
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

0 comments on commit 5638705

Please sign in to comment.