return "DNSSD_ERROR_SERVICE_NOT_RUNNING";//LCOV_EXCL_LINE
case DNSSD_ERROR_OPERATION_FAILED:
return "DNSSD_ERROR_OPERATION_FAILED"; //LCOV_EXCL_LINE
- default :
+ default:
return "UNSUPPORTED_ERROR";
}
}
return DNSSD_ERROR_NONE;
}
+//LCOV_EXCL_START
+static gboolean __remove_service_getaddrinfo_socket(gpointer user_data)
+{
+ DNSSD_LOGD("Remove DNSServiceGetAddrInfo socket");
+ dnssd_handle_s *local_handle = user_data;
+ if (local_handle->watch_id > 0)
+ g_source_remove(local_handle->watch_id);
+ DNSServiceRefDeallocate(local_handle->sd_ref);
+ local_handle->watch_id = 0;
+ local_handle->sd_ref = NULL;
+ return FALSE;
+}
+//LCOV_EXCL_STOP
+
//LCOV_EXCL_START
static void __dnssd_getaddrinfo_reply_cb(DNSServiceRef sd_ref,
unsigned int flags, unsigned int if_index,
DNSSD_LOGD("Finished executing Browse %s callback",
(flags & kDNSServiceFlagsAdd) ? "Available" : "Unavailable");
}
-
+ g_idle_add_full(G_PRIORITY_HIGH, __remove_service_getaddrinfo_socket,
+ local_handle, NULL);
}
//LCOV_EXCL_STOP
}
//LCOV_EXCL_STOP
+//LCOV_EXCL_START
+static gboolean __remove_service_resolve_socket(gpointer user_data)
+{
+ DNSSD_LOGD("Remove DNSServiceResolve socket");
+ resolve_reply_data *resolve_data = user_data;
+ if (resolve_data->watch_id > 0)
+ g_source_remove(resolve_data->watch_id);
+ DNSServiceRefDeallocate(resolve_data->sd_ref);
+ resolve_data->watch_id = 0;
+ resolve_data->sd_ref = NULL;
+ return FALSE;
+}
+//LCOV_EXCL_STOP
+
//LCOV_EXCL_START
static void __dnssd_resolve_reply_cb(DNSServiceRef sd_ref, unsigned int flags,
unsigned int if_index, DNSServiceErrorType error_code,
__dnssd_getaddrinfo(resolve_data->dnssd_handle, flags, if_index,
host_name, fullname, (const char *) txt_record,
txt_len, port);
+ g_idle_add_full(G_PRIORITY_HIGH, __remove_service_resolve_socket,
+ resolve_data, NULL);
}
//LCOV_EXCL_STOP
dnssd_handle_list = g_slist_remove(dnssd_handle_list,
found_handle);
- if (found_handle->watch_id > 0)
- g_source_remove(found_handle->watch_id);
-
- DNSServiceRefDeallocate(found_handle->sd_ref);
-
g_free(found_handle->service_type);
g_free(found_data->service_name);
g_free(found_data->host);
if (resolve_data->dnssd_handle == local_handle) {
resolve_handle_list = g_slist_remove(resolve_handle_list,
resolve_data);
-
- if (resolve_data->watch_id > 0)
- g_source_remove(resolve_data->watch_id);
-
- DNSServiceRefDeallocate(resolve_data->sd_ref);
g_free(resolve_data);
}
//LCOV_EXCL_STOP