示例#1
0
        public int IsLocalHome(string otherhome, bool withResolveCheck)
        {
            OSHHTPHost tmp = new OSHHTPHost(otherhome, false);

            if (!tmp.IsValidHost)
            {
                return(-1);
            }
            if (tmp.Equals(m_homeURL))
            {
                return(1);
            }
            if (m_homeURLAlias != null && m_homeURLAlias.Contains(tmp))
            {
                return(1);
            }

            if (withResolveCheck)
            {
                if (tmp.IsResolvedHost)
                {
                    return(0);
                }
                return(tmp.ResolveDNS() ? 0 : -2);
            }
            return(0);
        }
示例#2
0
        public int IsLocalGrid(string othergatekeeper, bool withResolveCheck)
        {
            OSHHTPHost tmp = new OSHHTPHost(othergatekeeper, false);

            if (!tmp.IsValidHost)
            {
                return(((tmp.Flags & OSHTTPURIFlags.Empty) == 0) ? -1 : 1);
            }
            if (tmp.Equals(m_gateKeeperURL))
            {
                return(1);
            }
            if (m_gateKeeperAlias != null && m_gateKeeperAlias.Contains(tmp))
            {
                return(1);
            }
            if (withResolveCheck)
            {
                if (tmp.IsResolvedHost)
                {
                    return(0);
                }
                return(tmp.ResolveDNS() ? 0 : -2);
            }
            return(0);
        }
示例#3
0
        // -2 dns failed
        // -1 if bad url
        // 0 if not local
        // 1 if local
        public int IsLocalGrid(string othergatekeeper, bool withResolveCheck = false)
        {
            OSHHTPHost tmp = new OSHHTPHost(othergatekeeper, false);

            if (tmp.HostType == UriHostNameType.Unknown)
            {
                return(-1);
            }
            if (tmp.Equals(m_gateKeeperURL))
            {
                return(1);
            }
            if (m_gateKeeperAlias != null && m_gateKeeperAlias.Contains(tmp))
            {
                return(1);
            }
            if (withResolveCheck)
            {
                return(tmp.ResolveDNS() ? 0 : -2);
            }
            return(0);
        }