diff options
author | Jose Luis Marti <joseluis.marti@gmail.com> | 2022-10-26 14:43:49 +0200 |
---|---|---|
committer | Jose Luis Marti <joseluis.marti@gmail.com> | 2022-10-26 14:43:49 +0200 |
commit | d79330119d239c186d4e53bf3fb89a331fd8bd34 (patch) | |
tree | 74b25ddb98526f66ee303458d70e6f9edaf448ef | |
parent | d1723bbe6b7feb04de8dbf2d3f210c80840e36b8 (diff) |
DNSNameCache: nmblookup command is no longer needed
-rw-r--r-- | xbmc/network/DNSNameCache.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/xbmc/network/DNSNameCache.cpp b/xbmc/network/DNSNameCache.cpp index 70ec280437..af2ac1ad1f 100644 --- a/xbmc/network/DNSNameCache.cpp +++ b/xbmc/network/DNSNameCache.cpp @@ -52,50 +52,6 @@ bool CDNSNameCache::Lookup(const std::string& strHostName, std::string& strIpAdd if(g_DNSCache.GetCached(strHostName, strIpAddress)) return true; -#if !defined(TARGET_WINDOWS) && defined(HAS_FILESYSTEM_SMB) - // perform netbios lookup (win32 is handling this via gethostbyname) - char nmb_ip[100]; - char line[200]; - std::vector<std::string> addresses; - - std::string cmd = "nmblookup " + strHostName; - FILE* fp = popen(cmd.c_str(), "r"); - if (fp) - { - while (fgets(line, sizeof line, fp)) - { - if (sscanf(line, "%99s *<00>\n", nmb_ip)) - { - if (inet_addr(nmb_ip) != INADDR_NONE) - addresses.emplace_back(nmb_ip); - } - } - pclose(fp); - } - - for (const auto& ip : addresses) - { - cmd = "nmblookup -A " + ip; - fp = popen(cmd.c_str(), "r"); - if (fp) - { - while (fgets(line, sizeof line, fp)) - ; - if (pclose(fp) == 0) - { - strIpAddress = ip; - break; - } - } - } - - if (!strIpAddress.empty()) - { - g_DNSCache.Add(strHostName, strIpAddress); - return true; - } -#endif - // perform dns lookup struct hostent *host = gethostbyname(strHostName.c_str()); if (host && host->h_addr_list[0]) |