Add c-ares support (#1655)

* Replace udns with c-ares

* Get IO loop work

* Clean up

* Avoid initializing nameservers each query

* Add ARES_OPT_SERVERS

* Refine resolv_cancel

* Fix a memory leak

* Replace udns.h with ares.h

* Fix all inet_* fucntions

* Clean up

* Enable servers_ports when VERSION_MINOR >= 11

* Avoid ares_inet_XtoX

* Handle multipe nameservers correctly

* Use ares_set_servers for IPv4 and IPv6 mixed list

* Refine c-ares for udprelay

* Refine ares_set_servers()

* Refine the timer based on ares_timeout

* Avoid resolv_cancel

* Fix an issue of null pointer

* Fix another null pointer issue

* Refine the order of resolv_shutdown

* Fix the corrupted ev io
This commit is contained in:
Max Lv
2017-08-31 09:16:07 +08:00
committed by GitHub
parent 9c26318459
commit ede744ae7c
14 changed files with 413 additions and 373 deletions
+3 -1
View File
@@ -67,6 +67,8 @@ struct dscptracker {
#endif
struct query;
typedef struct server {
int fd;
int stage;
@@ -81,7 +83,7 @@ typedef struct server {
struct listen_ctx *listen_ctx;
struct remote *remote;
struct ResolvQuery *query;
struct query *query;
struct cork_dllist_item entries;
#ifdef USE_NFCONNTRACK_TOS