Exemplo n.º 1
0
        public void ResetSession(long smtpSessionId)
        {
            ThrottleSession throttleSession = DeliveryThrottling.sessionMap.TryGetSession(smtpSessionId);

            if (throttleSession != null)
            {
                if (throttleSession.Recipients != null)
                {
                    IList <RoutingAddress> list = throttleSession.Recipients.Keys.ToList <RoutingAddress>();
                    foreach (RoutingAddress routingAddress in list)
                    {
                        int num = throttleSession.Recipients[routingAddress];
                        for (int i = 0; i < num; i++)
                        {
                            this.DecrementRecipient(smtpSessionId, routingAddress);
                        }
                    }
                }
                lock (DeliveryThrottling.syncMessageSize)
                {
                    DeliveryThrottling.DecrementSessionMessageSize(throttleSession);
                }
                if (throttleSession.Mdb != null)
                {
                    DeliveryThrottling.deliveryDatabaseThreadMap.Decrement(throttleSession.Mdb.ToString());
                    throttleSession.Mdb = null;
                }
            }
        }
Exemplo n.º 2
0
        public void DecrementCurrentMessageSize(long smtpSessionId)
        {
            ThrottleSession throttleSession = DeliveryThrottling.sessionMap.TryGetSession(smtpSessionId);

            if (throttleSession != null)
            {
                lock (DeliveryThrottling.syncMessageSize)
                {
                    DeliveryThrottling.DecrementSessionMessageSize(throttleSession);
                }
            }
        }
Exemplo n.º 3
0
        public void SetSessionMessageSize(long messageSize, long smtpSessionId)
        {
            ThrottleSession throttleSession = DeliveryThrottling.sessionMap.TryGetSession(smtpSessionId);

            if (throttleSession != null)
            {
                DeliveryThrottling.DecrementSessionMessageSize(throttleSession);
                if (messageSize < 0L)
                {
                    messageSize = 0L;
                }
                throttleSession.MessageSize = messageSize;
            }
        }