aboutsummaryrefslogtreecommitdiffstats
path: root/libc/netbsd/resolv
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-01-28 14:54:11 -0800
committerElliott Hughes <enh@google.com>2014-01-28 14:54:11 -0800
commit908e8c24ab4ac6c37524e2286d6e0c69249bd358 (patch)
treec057b37b0a40dffff1cb73d85d4ef67b38d2b4dd /libc/netbsd/resolv
parent4ea434e5d22c8e257de3ff517fdda1175917b3ec (diff)
downloadandroid_bionic-908e8c24ab4ac6c37524e2286d6e0c69249bd358.tar.gz
android_bionic-908e8c24ab4ac6c37524e2286d6e0c69249bd358.tar.bz2
android_bionic-908e8c24ab4ac6c37524e2286d6e0c69249bd358.zip
Remove a __system_property_get call from the DNS code.
Change-Id: I48082ad9eb1b56349c6746ab2c371728c8571a81
Diffstat (limited to 'libc/netbsd/resolv')
-rw-r--r--libc/netbsd/resolv/res_cache.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/libc/netbsd/resolv/res_cache.c b/libc/netbsd/resolv/res_cache.c
index 1b32c597c..5e2bb5cea 100644
--- a/libc/netbsd/resolv/res_cache.c
+++ b/libc/netbsd/resolv/res_cache.c
@@ -137,10 +137,6 @@
*
* As such, a value of 64 should be relatively comfortable at the moment.
*
- * The system property ro.net.dns_cache_size can be used to override the default
- * value with a custom value
- *
- *
* ******************************************
* * NOTE - this has changed.
* * 1) we've added IPv6 support so each dns query results in 2 responses
@@ -153,7 +149,6 @@
*/
#define CONFIG_MAX_ENTRIES 64 * 2 * 5
/* name of the system property that can be used to set the cache size */
-#define DNS_CACHE_SIZE_PROP_NAME "ro.net.dns_cache_size"
/****************************************************************************/
/****************************************************************************/
@@ -1397,37 +1392,19 @@ _cache_flush_locked( Cache* cache )
"*************************");
}
-/* Return max number of entries allowed in the cache,
- * i.e. cache size. The cache size is either defined
- * by system property ro.net.dns_cache_size or by
- * CONFIG_MAX_ENTRIES if system property not set
- * or set to invalid value. */
static int
_res_cache_get_max_entries( void )
{
- int result = -1;
- char cache_size[PROP_VALUE_MAX];
+ int cache_size = CONFIG_MAX_ENTRIES;
const char* cache_mode = getenv("ANDROID_DNS_MODE");
-
if (cache_mode == NULL || strcmp(cache_mode, "local") != 0) {
- // Don't use the cache in local mode. This is used by the
- // proxy itself.
- XLOG("setup cache for non-cache process. size=0, %s", cache_mode);
- return 0;
+ // Don't use the cache in local mode. This is used by the proxy itself.
+ cache_size = 0;
}
- if (__system_property_get(DNS_CACHE_SIZE_PROP_NAME, cache_size) > 0) {
- result = atoi(cache_size);
- }
-
- // ro.net.dns_cache_size not set or set to negative value
- if (result <= 0) {
- result = CONFIG_MAX_ENTRIES;
- }
-
- XLOG("cache size: %d", result);
- return result;
+ XLOG("cache size: %d", cache_size);
+ return cache_size;
}
static struct resolv_cache*