dnsproxy: Remove TCP connection lookup from create_server()
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 10 Nov 2010 10:58:33 +0000 (11:58 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 10 Nov 2010 10:58:33 +0000 (11:58 +0100)
The TCP connections are opened and closed for each DNS over TCP request,
no need to try to find an already opened one.

plugins/dnsproxy.c

index 1c4a9e8..448c7a5 100644 (file)
@@ -634,16 +634,6 @@ static struct server_data *create_server(const char *interface,
                return NULL;
        }
 
-       data = find_server(interface, domain, server, protocol);
-       if (data) {
-               if (data->watch > 0)
-                       g_source_remove(data->watch);
-               data->watch = g_io_add_watch(data->channel,
-                       G_IO_OUT | G_IO_IN | G_IO_HUP | G_IO_NVAL | G_IO_ERR,
-                                               tcp_server_event, data);
-               return data;
-       }
-
        sk = socket(AF_INET, type, protocol);
        if (sk < 0) {
                connman_error("Failed to create server %s socket", server);