From 803c8101a2cea6f2d2a837ee6595ac236ae14881 Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Wed, 11 May 2016 19:25:51 +0900 Subject: [PATCH] Prevent unexpected mdns termination Change-Id: I7eefd94221d5a2e3d5c432c467ce6781d7a9d57a Signed-off-by: cheoleun --- packaging/capi-network-nsd.spec | 2 +- src/dns-sd/dns-sd.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packaging/capi-network-nsd.spec b/packaging/capi-network-nsd.spec index b937deb..85caaa2 100644 --- a/packaging/capi-network-nsd.spec +++ b/packaging/capi-network-nsd.spec @@ -1,6 +1,6 @@ Name: capi-network-nsd Summary: A Network Service Discovery libraries in Native API -Version: 0.0.2 +Version: 0.0.3 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/dns-sd/dns-sd.c b/src/dns-sd/dns-sd.c index e9d9d6a..dd6b68a 100644 --- a/src/dns-sd/dns-sd.c +++ b/src/dns-sd/dns-sd.c @@ -664,6 +664,9 @@ int dnssd_service_unset_record(dnssd_service_h local_service, dnssd_register_data_s *reg; DNSServiceRef sd_ref; DNSRecordRef record_client; + int dnssd_err = 0; + uint32_t version = 0; + uint32_t size = sizeof(version); CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE); @@ -696,6 +699,13 @@ int dnssd_service_unset_record(dnssd_service_h local_service, return DNSSD_ERROR_INVALID_PARAMETER; } + dnssd_err = DNSServiceGetProperty(kDNSServiceProperty_DaemonVersion, &version, &size); + if (!dnssd_err){ + DNSSD_LOGD("Daemon is running ver. %d.%d", version / 10000, version / 100 % 100); + } else { + DNSSD_LOGE("Daemon is not running"); + } + ret = DNSServiceRemoveRecord(sd_ref, record_client, local_handle->flags); if (ret < 0) { -- 2.7.4