diff options
author | Mattias Falk <mattias.falk@sonyericsson.com> | 2011-09-06 15:15:06 +0200 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@sonymobile.com> | 2012-05-07 18:04:25 -0700 |
commit | a59cfcfd0821f51ee77f13105099f700ccbf9252 (patch) | |
tree | d7ffc93dc89f31b9a50d6eba201fbfaac9befb9d /libc/netbsd/resolv/res_send.c | |
parent | e3bc7192ec4254bed00eb8b352735665c6072995 (diff) | |
download | android_bionic-a59cfcfd0821f51ee77f13105099f700ccbf9252.tar.gz android_bionic-a59cfcfd0821f51ee77f13105099f700ccbf9252.tar.bz2 android_bionic-a59cfcfd0821f51ee77f13105099f700ccbf9252.zip |
Avoid multiple dns lookups for the same query
If two or more rapid dns requests for the same server are done
from different threads it turns into separate dns reques, if
the response of the request isn't found in the cache.
This patch avoid multiple request for the same server by
letting subsequents request wait until the first request
has finished.
Change-Id: Ic72ea0e7d3964a4164eddf866feb4357ec4dfe54
Diffstat (limited to 'libc/netbsd/resolv/res_send.c')
-rw-r--r-- | libc/netbsd/resolv/res_send.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/netbsd/resolv/res_send.c b/libc/netbsd/resolv/res_send.c index dbad6dda0..2f131f197 100644 --- a/libc/netbsd/resolv/res_send.c +++ b/libc/netbsd/resolv/res_send.c @@ -646,6 +646,9 @@ res_nsend(res_state statp, errno = terrno; return (-1); fail: +#if USE_RESOLV_CACHE + _resolv_cache_query_failed(cache, buf, buflen); +#endif res_nclose(statp); return (-1); } |