コード例 #1
0
 // Token: 0x060000B5 RID: 181 RVA: 0x00004E9E File Offset: 0x0000309E
 public AnchoredRoutingTarget(ServerInfoAnchorMailbox serverInfoAnchorMailbox)
 {
     if (serverInfoAnchorMailbox == null)
     {
         throw new ArgumentNullException("serverAnchorMailbox");
     }
     this.AnchorMailbox = serverInfoAnchorMailbox;
     this.BackEndServer = serverInfoAnchorMailbox.BackEndServer;
 }
コード例 #2
0
 // Token: 0x060004DF RID: 1247 RVA: 0x0001B03C File Offset: 0x0001923C
 private static bool IsServerMailboxReachable(ServerInfoAnchorMailbox mailbox)
 {
     try
     {
         mailbox.TryDirectBackEndCalculation();
     }
     catch (ServerNotFoundException)
     {
         return(false);
     }
     return(true);
 }
コード例 #3
0
        // Token: 0x060004DB RID: 1243 RVA: 0x0001ABB0 File Offset: 0x00018DB0
        protected override AnchorMailbox ResolveAnchorMailbox()
        {
            if (E4eProxyRequestHandler.IsAnonymousErrorPageRequest(base.ClientRequest) || E4eProxyRequestHandler.IsAnonymousAppRedirectPageRequest(base.ClientRequest) || E4eProxyRequestHandler.IsAnonymousAppFeedbackRequest(base.ClientRequest))
            {
                return(new AnonymousAnchorMailbox(this));
            }
            if (E4eProxyRequestHandler.IsE4eInvalidStoreRequest(base.ClientRequest))
            {
                this.ThrowRedirectException(E4eProxyRequestHandler.GetErrorUrl(E4eProxyRequestHandler.E4eErrorType.InvalidStoreRequest));
            }
            bool flag  = E4eProxyRequestHandler.IsE4ePostOrRetrievePayloadRequest(base.ClientRequest);
            bool flag2 = this.IsWACRequest();

            this.GetSenderInfo(flag, flag2);
            string text = this.routingEmailAddress;

            if (E4eProxyRequestHandler.IsRESTAPIUploadRequset(base.ClientRequest) && string.IsNullOrEmpty(text))
            {
                return(new AnonymousAnchorMailbox(this));
            }
            if (string.IsNullOrEmpty(text) || !SmtpAddress.IsValidSmtpAddress(text))
            {
                if (BEResourceRequestHandler.IsResourceRequest(base.ClientRequest.Url.LocalPath))
                {
                    return(new AnonymousAnchorMailbox(this));
                }
                string text2 = string.Format("The routing email address is not valid. Email={0}", text);
                base.Logger.AppendGenericError("Invalid routing email address", text2);
                throw new HttpProxyException(HttpStatusCode.NotFound, 3001, text2);
            }
            else
            {
                if (flag)
                {
                    string recipientEmailAddress = base.ClientRequest.QueryString["RecipientEmailAddress"];
                    if (E4eBackoffListCache.Instance.ShouldBackOff(this.senderEmailAddress, recipientEmailAddress))
                    {
                        PerfCounters.HttpProxyCountersInstance.RejectedConnectionCount.Increment();
                        this.ThrowRedirectException(E4eProxyRequestHandler.GetErrorUrl(E4eProxyRequestHandler.E4eErrorType.ThrottlingRestriction));
                    }
                    else
                    {
                        PerfCounters.HttpProxyCountersInstance.AcceptedConnectionCount.Increment();
                    }
                }
                if (!this.IsBackEndCookieAndHeaderFlightEnabled())
                {
                    return(this.GetAnchorMailbox());
                }
                if (flag)
                {
                    string text3 = base.ClientRequest.Headers["X-E4ePostToBackEnd"];
                    if (!string.IsNullOrEmpty(text3))
                    {
                        return(new ServerInfoAnchorMailbox(text3, this));
                    }
                    return(this.GetAnchorMailbox());
                }
                else if (flag2)
                {
                    string text4;
                    string text5;
                    if (!this.GetRoutingInformationForWac(out text4, out text5))
                    {
                        base.Logger.AppendGenericError("E4EWacRequest", "Invalid routing information for request coming from WAC server, url:" + base.ClientRequest.Url);
                        return(this.GetAnchorMailbox());
                    }
                    AnchorMailbox result = new ServerInfoAnchorMailbox(text4, this);
                    base.Logger.AppendGenericInfo("E4eBEServerCookieHint", string.Format("Using BE server cookie hint. Cookie value [{0}]", text4));
                    return(result);
                }
                else
                {
                    if (!E4eProxyRequestHandler.IsRequestBoundToBEServer(base.ClientRequest))
                    {
                        return(this.GetAnchorMailbox());
                    }
                    string backendFqdnFromE4eCookie = E4eProxyRequestHandler.GetBackendFqdnFromE4eCookie(base.ClientRequest, base.Logger);
                    if (string.IsNullOrEmpty(backendFqdnFromE4eCookie))
                    {
                        return(this.GetAnchorMailbox());
                    }
                    AnchorMailbox result2 = new ServerInfoAnchorMailbox(backendFqdnFromE4eCookie, this);
                    base.Logger.AppendGenericInfo("E4eBEServerCookieHint", string.Format("Using BE server cookie hint. Cookie value [{0}]", backendFqdnFromE4eCookie));
                    return(result2);
                }
            }
        }