libs/libc/netdb/lib_dnsbind.c: Make DNS recevie timeout configurable.

This commit is contained in:
ligd 2018-11-08 08:33:13 -06:00 committed by Gregory Nutt
parent 71a6244198
commit ec00670eb7
2 changed files with 8 additions and 1 deletions

View File

@ -54,6 +54,13 @@ menuconfig NETDB_DNSCLIENT
if NETDB_DNSCLIENT
config NETDB_DNSCLIENT_RECV_TIMEOUT
int "DNS receive tiemout"
default 30
---help---
This the timeout value when DNS receive response after
dns_send_query, unit: seconds
config NETDB_DNSCLIENT_ENTRIES
int "Number of DNS resolver entries"
default 0 if DEFAULT_SMALL

View File

@ -107,7 +107,7 @@ int dns_bind(void)
/* Set up a receive timeout */
tv.tv_sec = 30;
tv.tv_sec = CONFIG_NETDB_DNSCLIENT_RECV_TIMEOUT;
tv.tv_usec = 0;
ret = setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval));