diff options
author | Paulo Pizarro <paulo.pizarro@gmail.com> | 2012-06-17 23:22:38 -0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-06-18 13:32:32 +0300 |
commit | 97e278e2cff460d6729de96c732374a6dc93e3fa (patch) | |
tree | 5986609de2451e8676bd0e941888805ac1e0a720 /src | |
parent | 335e7562aafe49d4f91184ebe4d84d1aa99b9ca7 (diff) | |
download | connman-97e278e2cff460d6729de96c732374a6dc93e3fa.tar.gz connman-97e278e2cff460d6729de96c732374a6dc93e3fa.tar.bz2 connman-97e278e2cff460d6729de96c732374a6dc93e3fa.zip |
dnsproxy: Avoid duplication of domains in the TCP server domain list
The domain list is created in the tcp_server_event function
at connection time (G_IO_OUT event), so it is not necessary
to create it here too.
Diffstat (limited to 'src')
-rw-r--r-- | src/dnsproxy.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/dnsproxy.c b/src/dnsproxy.c index 58d1bfe2..5adede5c 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -2368,7 +2368,6 @@ static gboolean tcp_listener_event(GIOChannel *channel, GIOCondition condition, unsigned char buf[768]; char query[512]; struct request_data *req; - struct server_data *server; int sk, client_sk, len, err; struct sockaddr_in6 client_addr; socklen_t client_addr_len = sizeof(client_addr); @@ -2432,26 +2431,14 @@ static gboolean tcp_listener_event(GIOChannel *channel, GIOCondition condition, for (list = server_list; list; list = list->next) { struct server_data *data = list->data; - GList *domains; if (data->protocol != IPPROTO_UDP || data->enabled == FALSE) continue; - server = create_server(data->interface, NULL, - data->server, IPPROTO_TCP); - if (server == NULL) + if(create_server(data->interface, NULL, + data->server, IPPROTO_TCP) == NULL) continue; - for (domains = data->domains; domains; - domains = domains->next) { - char *dom = domains->data; - - DBG("Adding domain %s to %s", dom, server->server); - - server->domains = g_list_append(server->domains, - g_strdup(dom)); - } - waiting_for_connect = TRUE; } |