summaryrefslogtreecommitdiff
path: root/src/bonjour-self.c
diff options
context:
space:
mode:
authorSiraj Razick <siraj.razick@collabora.co.uk>2012-03-22 01:06:11 -0400
committerSiraj Razick <siraj.razick@collabora.co.uk>2012-03-26 10:31:34 -0400
commit62717a3a7bd417187ee445c755e06ded1ee6bc15 (patch)
tree79e38ae72c82c79e337d17a743aebdaf19db82e9 /src/bonjour-self.c
parentbd8a37c7b3e29babe683a1f1bb65419be1cc3fdc (diff)
downloadtelepathy-salut-62717a3a7bd417187ee445c755e06ded1ee6bc15.tar.gz
bonjour-self: Remove duplicate Socket processing method
bonjour-discovery-client now takes care of socket processing and cleaning them up, we remove the duplicate socket handling from bonjour-self with this patch.
Diffstat (limited to 'src/bonjour-self.c')
-rw-r--r--src/bonjour-self.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/bonjour-self.c b/src/bonjour-self.c
index 601ce66f..9178612d 100644
--- a/src/bonjour-self.c
+++ b/src/bonjour-self.c
@@ -267,25 +267,6 @@ _bonjour_self_init_txt_record_presence (SalutBonjourSelf *self,
return kDNSServiceErr_NoError;
}
-static gboolean
-_bonjour_socket_process_cb (GIOChannel *source,
- GIOCondition condition,
- gpointer data)
-{
- DNSServiceRef service_ref = data;
- DNSServiceErrorType error_type = kDNSServiceErr_NoError;
-
- error_type = DNSServiceProcessResult (service_ref);
-
- if (error_type != kDNSServiceErr_NoError)
- {
- DEBUG ("Socket processing failed with : (%d)", error_type);
- return FALSE;
- }
-
- return TRUE;
-}
-
static void DNSSD_API
_bonjour_service_register_cb (DNSServiceRef service_ref,
DNSServiceFlags service_flags,
@@ -304,6 +285,8 @@ _bonjour_service_register_cb (DNSServiceRef service_ref,
if (!self || error_type != kDNSServiceErr_NoError)
{
DEBUG ("Service Registration Failed with : (%d)", error_type);
+ salut_bonjour_discovery_client_drop_svc_ref (priv->discovery_client,
+ &priv->bonjour_service);
}
else
{
@@ -336,7 +319,6 @@ salut_bonjour_self_announce (SalutSelf *_self,
SalutBonjourSelf *self = SALUT_BONJOUR_SELF (_self);
SalutBonjourSelfPrivate *priv = self->priv;
DNSServiceErrorType error_type = kDNSServiceErr_NoError;
- GIOChannel *bonjour_service_channel = NULL;
const gchar *dnssd_name;
dnssd_name =
@@ -358,11 +340,8 @@ salut_bonjour_self_announce (SalutSelf *_self,
RETURN_ERROR_IF_FAIL (error_type, error);
- bonjour_service_channel = g_io_channel_win32_new_socket (
- DNSServiceRefSockFD (priv->bonjour_service));
-
- g_io_add_watch (bonjour_service_channel, G_IO_IN, _bonjour_socket_process_cb,
- priv->bonjour_service);
+ salut_bonjour_discovery_client_watch_svc_ref (priv->discovery_client,
+ &priv->bonjour_service);
return TRUE;
}
@@ -565,6 +544,9 @@ salut_bonjour_self_dispose (GObject *object)
priv->dispose_has_run = TRUE;
+ salut_bonjour_discovery_client_drop_svc_ref (priv->discovery_client,
+ &priv->bonjour_service);
+
if (priv->discovery_client != NULL)
{
g_object_unref (priv->discovery_client);