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