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
This commit is contained in:
Mattias Falk
2011-09-06 15:15:06 +02:00
committed by Bjorn Andersson
parent e3bc7192ec
commit a59cfcfd08
3 changed files with 135 additions and 1 deletions

View File

@@ -95,4 +95,10 @@ _resolv_cache_add( struct resolv_cache* cache,
const void* answer,
int answerlen );
/* Notify the cache a request failed */
extern void
_resolv_cache_query_failed( struct resolv_cache* cache,
const void* query,
int querylen);
#endif /* _RESOLV_CACHE_H_ */