Remove the DNS TCP listener watch when the socket is closed
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 24 Sep 2010 15:18:34 +0000 (17:18 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 24 Sep 2010 15:18:34 +0000 (17:18 +0200)
plugins/dnsproxy.c

index 28c8ef0..1b7cd32 100644 (file)
@@ -862,8 +862,12 @@ static gboolean tcp_listener_event(GIOChannel *channel, GIOCondition condition,
        DBG("condition 0x%x", condition);
 
        if (condition & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
-               connman_error("Error with TCP listener channel");
+               if (tcp_listener_watch > 0)
+                       g_source_remove(tcp_listener_watch);
                tcp_listener_watch = 0;
+
+               connman_error("Error with TCP listener channel");
+
                return FALSE;
        }