Don't retry resolving in DNS_Name2IPAddress

Instead of retrying to resolve it in the function and blocking for a
long time, return a TryAgain status and let the caller retry it later if
necessary.
This commit is contained in:
Miroslav Lichvar
2010-04-26 16:05:56 +02:00
parent 2458325c09
commit 3d260d41b3
5 changed files with 36 additions and 33 deletions

View File

@@ -34,12 +34,20 @@
#include "addressing.h"
typedef enum {
DNS_Success,
DNS_TryAgain,
DNS_Failure
} DNS_Status;
/* Resolve names only to selected address family */
extern void DNS_SetAddressFamily(int family);
extern int DNS_Name2IPAddress(const char *name, IPAddr *addr, int retry);
extern DNS_Status DNS_Name2IPAddress(const char *name, IPAddr *addr);
extern int DNS_IPAddress2Name(IPAddr *ip_addr, char *name, int len);
extern void DNS_Reload(void);
#endif /* GOT_NAMESERV_H */