Beispiel #1
0
        bool _Update()
        {
            string url = HttpDns.GetUrl(cRequest.url);  // get dsn ip

            if (string.IsNullOrEmpty(url))
            {
                return(true); //wait for ip
            }

            if (url != cRequest.url)
            {
                var headers = cRequest.head;
                if (headers == null)
                {
                    headers       = new WebHeaderCollection();
                    cRequest.head = headers;
                }

                if (string.IsNullOrEmpty(headers.Get("host")))
                {
                    headers.Add("host", new System.Uri(cRequest.url).Host);
                }
                // Debug.LogFormat("request ip {0}  override host {1} ",url,cRequest.overrideHost);
                ResourcesLoader.UnityWebRequest(cRequest);
            }
            else if (originalOperation != null)
            {
                Debug.LogFormat(" dns resolve fail request url {0}   ", url);
                ResourcesLoader.ProcessFinishedOperation(originalOperation);
            }
            else
            {
                Debug.LogFormat("dns resolve fail , complete request url {0} ", url);

                cRequest.DispatchEnd();

                if (cRequest.group != null)
                {
                    cRequest.group.Complete(cRequest, true);
                }

                cRequest.ReleaseToPool();
            }

            return(false);
        }
        bool _Update()
        {
            string url = HttpDns.GetUrl(cRequest.url); // get dsn ip

            if (string.IsNullOrEmpty(url))
            {
                return(true); //wait for ip
            }

            if (url != cRequest.url)
            {
                cRequest.overrideHost = cRequest.uri.Host;// set host
                cRequest.overrideUrl  = url;
                // request
                Debug.LogFormat("request ip {0}  override host {1} ", url, cRequest.overrideHost);
                ResourcesLoader.HttpRequest(cRequest);
            }
            else if (originalOperation != null)
            {
                Debug.LogFormat(" dns resolve fail request url {0}   ", url);
                ResourcesLoader.ProcessFinishedOperation(originalOperation);
            }
            else
            {
                Debug.LogFormat("dns resolve fail , complete request url {0} ", url);

                cRequest.DispatchEnd();

                if (cRequest.group != null)
                {
                    cRequest.group.Complete(cRequest, true);
                }

                cRequest.ReleaseToPool();
            }

            return(false);
        }