summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2008-02-01 11:27:14 +0000
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2008-02-01 11:27:14 +0000
commit40a4c17f02c721bb0d7bd5e460710ae15c9f03da (patch)
treee027c004e97a6b8944699fcc94379ffb384c490d /lib
parent1d159cc9380bcbcec563a9c113b7a1f3e490b2ae (diff)
downloadtelepathy-salut-40a4c17f02c721bb0d7bd5e460710ae15c9f03da.tar.gz
Always fully stop whois recovery process if a WHOIS_REPLY was received
20080201112714-b58c9-863339e58eefca776a940199499e135791dcc91c.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/gibber/gibber-r-multicast-sender.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/gibber/gibber-r-multicast-sender.c b/lib/gibber/gibber-r-multicast-sender.c
index 5cc88f57..5c9044f9 100644
--- a/lib/gibber/gibber-r-multicast-sender.c
+++ b/lib/gibber/gibber-r-multicast-sender.c
@@ -816,7 +816,7 @@ schedule_progress_timer (GibberRMulticastSender *self)
}
static void
-name_discovered (GibberRMulticastSender *self, const gchar *name)
+stop_whois_discovery (GibberRMulticastSender *self)
{
GibberRMulticastSenderPrivate *priv =
GIBBER_R_MULTICAST_SENDER_GET_PRIVATE (self);
@@ -833,6 +833,13 @@ name_discovered (GibberRMulticastSender *self, const gchar *name)
priv->fail_timer = 0;
}
+}
+
+static void
+name_discovered (GibberRMulticastSender *self, const gchar *name)
+{
+ stop_whois_discovery (self);
+
self->name = g_strdup(name);
DEBUG_SENDER(self, "Name discovered");
g_signal_emit(self, signals[NAME_DISCOVERED], 0, self->name);
@@ -944,8 +951,6 @@ do_whois_reply(gpointer data) {
static gboolean
do_whois_request(gpointer data) {
GibberRMulticastSender *sender = GIBBER_R_MULTICAST_SENDER(data);
- GibberRMulticastSenderPrivate *priv =
- GIBBER_R_MULTICAST_SENDER_GET_PRIVATE(sender);
schedule_whois_request(sender, TRUE);
@@ -1754,12 +1759,9 @@ gibber_r_multicast_sender_whois_push (GibberRMulticastSender *sender,
name_discovered (sender, packet->data.whois_reply.sender_name);
} else {
/* FIXME: collision detection */
+ stop_whois_discovery (sender);
}
- if (priv->whois_timer != 0) {
- DEBUG_SENDER(sender, "Cancelled scheduled whois packet");
- g_source_remove(priv->whois_timer);
- priv->whois_timer = 0;
- }
+
pop_packets(sender);
break;
default: