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; } } }
public void DecrementCurrentMessageSize(long smtpSessionId) { ThrottleSession throttleSession = DeliveryThrottling.sessionMap.TryGetSession(smtpSessionId); if (throttleSession != null) { lock (DeliveryThrottling.syncMessageSize) { DeliveryThrottling.DecrementSessionMessageSize(throttleSession); } } }
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; } }