// Token: 0x0600120F RID: 4623 RVA: 0x0006DBB4 File Offset: 0x0006BDB4
 private void GetResponseCallback(IAsyncResult asyncResult)
 {
     lock (this)
     {
         if (!this.requestTimedOut)
         {
             try
             {
                 if (this.timeoutWaitHandle != null)
                 {
                     this.timeoutWaitHandle.Unregister(null);
                     this.timeoutWaitHandle = null;
                 }
                 this.proxyResponse = ProxyUtilities.EndGetResponse(this.proxyRequest, asyncResult, this.requestClock);
                 ProxyUtilities.UpdateProxyUserContextIdFromResponse(this.proxyResponse, this.owaContext.UserContext);
             }
             catch (Exception exception)
             {
                 this.asyncResult.CompleteRequest(false, exception);
                 return;
             }
             this.asyncResult.CompleteRequest(false);
         }
     }
 }
Exemplo n.º 2
0
 // Token: 0x060011F2 RID: 4594 RVA: 0x0006C9A8 File Offset: 0x0006ABA8
 private void GetProxyResponseCallback(IAsyncResult asyncResult)
 {
     ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "ProxyEventHandler.GetProxyResponseCallback");
     lock (this)
     {
         if (!this.requestTimedOut)
         {
             try
             {
                 if (this.timeoutWaitHandle != null)
                 {
                     this.timeoutWaitHandle.Unregister(null);
                     this.timeoutWaitHandle = null;
                 }
                 HttpWebResponse response = ProxyUtilities.EndGetResponse(this.proxyRequest, asyncResult, this.requestClock);
                 this.CopyProxyResponse(response);
             }
             catch (WebException ex)
             {
                 if (!this.CheckAndHandleConnectionFailure(ex))
                 {
                     if (ex.Status == WebExceptionStatus.ProtocolError)
                     {
                         if (!this.CheckAndHandleWebException40X(ex))
                         {
                             HttpWebResponse httpWebResponse = (HttpWebResponse)ex.Response;
                             int             statusCode      = (int)httpWebResponse.StatusCode;
                             if (statusCode == 441)
                             {
                                 ExTraceGlobals.ProxyTracer.TraceDebug((long)this.GetHashCode(), "The proxy returned 441, this means we need to attempt to do a proxy logon");
                                 try
                                 {
                                     this.SendProxyLogonRequest();
                                     return;
                                 }
                                 catch (Exception exception)
                                 {
                                     this.asyncResult.CompleteRequest(false, exception);
                                     return;
                                 }
                             }
                             if (statusCode == 442)
                             {
                                 ExTraceGlobals.ProxyTracer.TraceDebug((long)this.GetHashCode(), "The proxy returned 442, this means the user's language or timezone are invalid");
                                 this.OriginalResponse.Redirect(OwaUrl.LanguagePage.GetExplicitUrl(this.OriginalRequest), false);
                                 base.OwaContext.HttpContext.ApplicationInstance.CompleteRequest();
                                 this.asyncResult.CompleteRequest(false);
                             }
                             else
                             {
                                 this.HandleProtocolExceptionDefault(ex);
                             }
                         }
                     }
                     else
                     {
                         this.HandleWebExceptionDefault(ex);
                     }
                 }
             }
             catch (Exception exception2)
             {
                 this.asyncResult.CompleteRequest(false, exception2);
             }
         }
     }
 }