mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-08 08:54:54 +07:00
Fix ignoring DhcpNameServer
PUBLISHED_FROM=73d6767e4aaa7249eeb5d76f9e7160be041292ca
This commit is contained in:
committed by
Cesanta Bot
parent
7f20c41dd5
commit
7632a5e4af
+6
-7
@@ -10952,10 +10952,12 @@ static int mg_get_ip_address_of_nameserver(char *name, size_t name_len) {
|
||||
break;
|
||||
}
|
||||
if (RegOpenKeyExW(hKey, subkey, 0, KEY_READ, &hSub) == ERROR_SUCCESS &&
|
||||
(RegQueryValueExW(hSub, L"NameServer", 0, &type, (void *) value,
|
||||
&len) == ERROR_SUCCESS ||
|
||||
RegQueryValueExW(hSub, L"DhcpNameServer", 0, &type, (void *) value,
|
||||
&len) == ERROR_SUCCESS)) {
|
||||
((RegQueryValueExW(hSub, L"NameServer", 0, &type, (void *) value,
|
||||
&len) == ERROR_SUCCESS &&
|
||||
value[0] != '\0') ||
|
||||
(RegQueryValueExW(hSub, L"DhcpNameServer", 0, &type, (void *) value,
|
||||
&len) == ERROR_SUCCESS &&
|
||||
value[0] != '\0'))) {
|
||||
/*
|
||||
* See https://github.com/cesanta/mongoose/issues/176
|
||||
* The value taken from the registry can be empty, a single
|
||||
@@ -10964,9 +10966,6 @@ static int mg_get_ip_address_of_nameserver(char *name, size_t name_len) {
|
||||
* If it's multiple IP addresses, take the first one.
|
||||
*/
|
||||
wchar_t *comma = wcschr(value, ',');
|
||||
if (value[0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
if (comma != NULL) {
|
||||
*comma = '\0';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user