From d6071aa6e5f93cf9f9dd42c0c49d56416cfdabbe Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 11 Aug 2009 08:43:53 -0400 Subject: [PATCH] Windows: Avoid unnecessary DNS lookups Windows will attempt to open connections to a broad range of pipe service (share) names which do not contain a dot in them. Attempts to search for these names as cell names in DNS result in timeouts and sluggish behavior when browsing \\AFS in the Explorer Shell. To avoid this problem, do not perform a DNS lookup for a cellname that doesn't not contain a dot in it. LICENSE MIT Reviewed-on: http://gerrit.openafs.org/302 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_config.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index eaaba81b3..e525a1790 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -689,8 +689,16 @@ long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl, #ifdef CELLSERV_DEBUG osi_Log1(afsd_logp,"SearchCellDNS-Doing search for [%s]", osi_LogSaveString(afsd_logp,cellNamep)); #endif - if ( IsWindowsModule(cellNamep) ) + /* + * Do not perform a DNS lookup if the name is + * either a well-known Windows DLL or directory, + * or if the name does not contain a top-level + * domain. + */ + if ( IsWindowsModule(cellNamep) || + cm_FsStrChr(cellNamep, '.') == NULL) return -1; + rc = getAFSServer(cellNamep, cellHostAddrs, cellHostNames, ipRanks, &numServers, ttl); if (rc == 0 && numServers > 0) { /* found the cell */ for (i = 0; i < numServers; i++) { -- 2.39.5