From d79330119d239c186d4e53bf3fb89a331fd8bd34 Mon Sep 17 00:00:00 2001 From: Jose Luis Marti Date: Wed, 26 Oct 2022 14:43:49 +0200 Subject: DNSNameCache: nmblookup command is no longer needed --- xbmc/network/DNSNameCache.cpp | 44 ------------------------------------------- 1 file changed, 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 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]) -- cgit v1.2.3