From de663bfc39d13515eb549e70d59329eb83892aa0 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 15 May 2014 11:41:28 +0300 Subject: [PATCH] plugins/policy: Remove reconnect timer in reconnect_reset() In the case that the remote starts connecting to us while we're waiting for the timeout to discover we shouldn't just reset the basic time keeping variables but also remove the timer. --- plugins/policy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/policy.c b/plugins/policy.c index b72467e7d..9a275daf8 100644 --- a/plugins/policy.c +++ b/plugins/policy.c @@ -429,6 +429,11 @@ static void reconnect_reset(struct reconnect_data *reconnect) { reconnect->start = 0; reconnect->timeout = 1; + + if (reconnect->timer > 0) { + g_source_remove(reconnect->timer); + reconnect->timer = 0; + } } static bool reconnect_match(const char *uuid) -- 2.47.3