summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordiscomfitor <michael.blumenkrantz@gmail.com>2013-12-20 22:16:29 -0500
committerdiscomfitor <michael.blumenkrantz@gmail.com>2013-12-20 22:16:29 -0500
commit2a143393f96aefc4469d8c2c33fb94974be676b5 (patch)
tree276a336cd80960b26213d282735d31f928fe7217 /src
parent0808259effc05487177a3251681369af945dd610 (diff)
split ecore_con_dns free functions into one that removes from list and one that does the freeing
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_con/ecore_con_dns.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/ecore_con/ecore_con_dns.c b/src/lib/ecore_con/ecore_con_dns.c
index 5f602a8c05..0ed0536f27 100644
--- a/src/lib/ecore_con/ecore_con_dns.c
+++ b/src/lib/ecore_con/ecore_con_dns.c
@@ -47,7 +47,6 @@ static dns_hosts *hosts = NULL;
47static void 47static void
48_ecore_con_dns_free(Ecore_Con_DNS *dns) 48_ecore_con_dns_free(Ecore_Con_DNS *dns)
49{ 49{
50 if (dns->svr->infos) dns->svr->infos = eina_list_remove(dns->svr->infos, dns);
51 if (dns->timer) ecore_timer_del(dns->timer); 50 if (dns->timer) ecore_timer_del(dns->timer);
52 if (dns->fdh) ecore_main_fd_handler_del(dns->fdh); 51 if (dns->fdh) ecore_main_fd_handler_del(dns->fdh);
53 if (dns->ai) dns_ai_close(dns->ai); 52 if (dns->ai) dns_ai_close(dns->ai);
@@ -55,6 +54,13 @@ _ecore_con_dns_free(Ecore_Con_DNS *dns)
55 free(dns); 54 free(dns);
56} 55}
57 56
57static void
58_ecore_con_dns_del(Ecore_Con_DNS *dns)
59{
60 if (dns->svr && dns->svr->infos) dns->svr->infos = eina_list_remove(dns->svr->infos, dns);
61 _ecore_con_dns_free(dns);
62}
63
58static Eina_Bool 64static Eina_Bool
59_dns_addrinfo_get(Ecore_Con_DNS *dns, const char *addr, int port) 65_dns_addrinfo_get(Ecore_Con_DNS *dns, const char *addr, int port)
60{ 66{
@@ -102,13 +108,13 @@ _ecore_con_dns_check(Ecore_Con_DNS *dns)
102 dns->fdh = NULL; 108 dns->fdh = NULL;
103 dns->done_cb(dns->data, &result); 109 dns->done_cb(dns->data, &result);
104 free(ent); 110 free(ent);
105 _ecore_con_dns_free(dns); 111 _ecore_con_dns_del(dns);
106 } 112 }
107 113
108 return 0; 114 return 0;
109error: 115error:
110 dns->done_cb(dns->data, NULL); 116 dns->done_cb(dns->data, NULL);
111 _ecore_con_dns_free(dns); 117 _ecore_con_dns_del(dns);
112 return -1; 118 return -1;
113} 119}
114 120
@@ -130,7 +136,7 @@ static Eina_Bool
130_dns_timer_cb(Ecore_Con_DNS *dns) 136_dns_timer_cb(Ecore_Con_DNS *dns)
131{ 137{
132 dns->done_cb(dns->data, NULL); 138 dns->done_cb(dns->data, NULL);
133 _ecore_con_dns_free(dns); 139 _ecore_con_dns_del(dns);
134 return EINA_FALSE; 140 return EINA_FALSE;
135} 141}
136 142