Honor DNS server from DHCP

PUBLISHED_FROM=10772301ef115c31ada3521ff4235c33a421b782
This commit is contained in:
Alexander Alashkin authored and Cesanta Bot committed 2017-03-20 09:53:12 +00:00
1 parent e9a7a2af18
commit 380e87ddfa
8 files changed
+54 -18

No files matched your search

+7 -1
View File
@@ -3274,6 +3274,7 @@ struct mg_mgr {
#if MG_ENABLE_JAVASCRIPT
struct v7 *v7;
#endif
const char *nameserver; /* DNS server to use */
};
/*
@@ -3368,6 +3369,7 @@ struct mg_mgr_init_opts {
const struct mg_iface_vtable *main_iface;
int num_ifaces;
const struct mg_iface_vtable **ifaces;
const char *nameserver;
};
/*
@@ -3538,6 +3540,7 @@ struct mg_connect_opts {
unsigned int flags; /* Extra connection flags */
const char **error_string; /* Placeholder for the error string */
struct mg_iface *iface; /* Interface instance */
const char *nameserver; /* DNS server to use, NULL for default */
#if MG_ENABLE_SSL
/*
* SSL settings.
@@ -5609,7 +5612,7 @@ typedef void (*mg_resolve_callback_t)(struct mg_dns_message *dns_message,
/* Options for `mg_resolve_async_opt`. */
struct mg_resolve_async_opts {
const char *nameserver_url;
const char *nameserver;
int max_retries; /* defaults to 2 if zero */
int timeout; /* in seconds; defaults to 5 if zero */
int accept_literal; /* pseudo-resolve literal ipv4 and ipv6 addrs */
@@ -5621,6 +5624,9 @@ struct mg_resolve_async_opts {
int mg_resolve_async(struct mg_mgr *mgr, const char *name, int query,
mg_resolve_callback_t cb, void *data);
/* Set default DNS server */
void mg_set_nameserver(struct mg_mgr *mgr, const char *nameserver);
/*
* Resolved a DNS name asynchronously.
*