Add two interruption points in dnsseed thread to make shutdown in early stage quickly

Signed-off-by: Huang Le <4tarhl@gmail.com>
Use the async getaddrinfo_a() instead of getaddrinfo() to improve the responsiveness of net threads, typically the dnsseed thread

Signed-off-by: Huang Le <4tarhl@gmail.com>
Add -lanl (asynchronous name lookup library) checking in configure script, and modify corresponding conditional directive in netbase.cpp to ensure we can use the lib properly.

Signed-off-by: Huang Le <4tarhl@gmail.com>
In configure script check for getaddrinfo_a() directly instead of libanl, for better compatibility with other libc implementations different from glibc

Signed-off-by: Huang Le <4tarhl@gmail.com>
Remove two unnecessary modifications

1. The _GNU_SOURCE macro definition checking in netbase.cpp, the HAVE_GETADDRINFO_A is enough for using getaddrinfo_a();
2. The interruption points added in net.cpp::ThreadDNSAddressSeed(), using getaddrinfo_a() instead of getaddrinfo() is enough to make the dnsseed thread responsive.

Signed-off-by: Huang Le <4tarhl@gmail.com>
Merge branch 'master' of https://github.com/bitcoin/bitcoin
Use inet_pton() in LookupIntern() first

In LookupIntern(), the getaddrinfo_a() call would be issued if it's avaiable, which in turn would kick off a new thread for async name resolving job.  In our code, most calls go to LookupIntern() are just trying to convert a text ip address into a struct but not a real name resolving request, so we should do that first to avoid extra thread overhead.

Signed-off-by: Huang Le <4tarhl@gmail.com>
Explicitly include <arpa/inet.h> for windows building

Signed-off-by: Huang Le <4tarhl@gmail.com>
Search for inet_pton() in configure

Looks like mingw env doesn't define this function yet, so we have to search it first to avoid breaking building in mingw env.

Signed-off-by: Huang Le <4tarhl@gmail.com>
Add "nsl resolve" to the search lib list for inet_pton()

Signed-off-by: Huang Le <4tarhl@gmail.com>
Merge branch 'master' of https://github.com/4tar/bitcoin
Pull upstream master

Signed-off-by: Huang Le <4tarhl@gmail.com>