// Token: 0x0600121B RID: 4635 RVA: 0x0006E21C File Offset: 0x0006C41C
        internal void BeginSend(OwaContext owaContext, AsyncCallback callback, object extraData)
        {
            ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "ProxyPingRequest.BeginSend");
            Uri uri = new UriBuilder(owaContext.SecondCasUri.Uri)
            {
                Path = OwaUrl.ProxyPing.GetExplicitUrl(owaContext)
            }.Uri;
            HttpWebRequest httpWebRequest = ProxyUtilities.CreateHttpWebRequestForProxying(owaContext, uri);

            httpWebRequest.Method    = "GET";
            httpWebRequest.UserAgent = "OwaProxy";
            this.request             = httpWebRequest;
            this.asyncResult         = new OwaAsyncResult(callback, extraData);
            this.requestTimedOut     = false;
            IAsyncResult asyncResult = ProxyUtilities.BeginGetResponse(this.request, new AsyncCallback(this.GetResponseCallback), this, out this.requestClock);

            this.timeoutWaitHandle = ThreadPool.RegisterWaitForSingleObject(asyncResult.AsyncWaitHandle, new WaitOrTimerCallback(this.RequestTimeoutCallback), asyncResult, (long)owaContext.HttpContext.Server.ScriptTimeout * 1000L, true);
        }
示例#2
0
 // Token: 0x060011F1 RID: 4593 RVA: 0x0006C8E4 File Offset: 0x0006AAE4
 private void CopyOriginalRequestStreamCallback(IAsyncResult result)
 {
     try
     {
         this.proxyStreamCopy.EndCopy(result);
         this.copyingOriginalRequestComplete = true;
         this.requestTimedOut = false;
         IAsyncResult asyncResult = ProxyUtilities.BeginGetResponse(this.proxyRequest, new AsyncCallback(this.GetProxyResponseCallback), this, out this.requestClock);
         this.timeoutWaitHandle = ThreadPool.RegisterWaitForSingleObject(asyncResult.AsyncWaitHandle, new WaitOrTimerCallback(this.RequestTimeoutCallback), asyncResult, (long)this.HttpContext.Server.ScriptTimeout * 1000L, true);
     }
     catch (WebException webException)
     {
         if (!this.CheckAndHandleConnectionFailure(webException))
         {
             this.HandleWebExceptionDefault(webException);
         }
     }
     catch (Exception exception)
     {
         this.asyncResult.CompleteRequest(false, exception);
     }
 }
示例#3
0
        // Token: 0x060011EB RID: 4587 RVA: 0x0006C3FC File Offset: 0x0006A5FC
        private void SendProxyRequest()
        {
            ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "ProxyEventHandler.SendProxyRequest");
            if (base.OwaContext.SecondCasUri.ProxyPingResult == ProxyPingResult.Unknown)
            {
                this.SendProxyPingRequest();
                return;
            }
            HttpWebRequest proxyRequestInstance = ProxyUtilities.GetProxyRequestInstance(this.OriginalRequest, base.OwaContext, this.proxyRequestUrl);

            proxyRequestInstance.Method = ((base.Verb == OwaEventVerb.Post) ? "POST" : "GET");
            this.proxyRequest           = proxyRequestInstance;
            if (base.Verb == OwaEventVerb.Post)
            {
                this.proxyRequest.BeginGetRequestStream(new AsyncCallback(this.GetProxyRequestStreamCallback), this);
                return;
            }
            this.requestTimedOut = false;
            IAsyncResult asyncResult = ProxyUtilities.BeginGetResponse(this.proxyRequest, new AsyncCallback(this.GetProxyResponseCallback), this, out this.requestClock);

            this.timeoutWaitHandle = ThreadPool.RegisterWaitForSingleObject(asyncResult.AsyncWaitHandle, new WaitOrTimerCallback(this.RequestTimeoutCallback), asyncResult, (long)this.HttpContext.Server.ScriptTimeout * 1000L, true);
        }