1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-23 22:51:07 +01:00

add SslError

This commit is contained in:
Nikolay Kim 2019-03-04 16:16:39 -08:00
parent d2a223e69e
commit 9bc492cf6c
3 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,8 @@
* Add `ServerBuilder::maxconnrate` sets the maximum per-worker number of concurrent connections
* Add helper ssl error `SslError`
### Changed

View File

@ -87,7 +87,7 @@ impl ServerBuilder {
/// can be used to limit the global SSL CPU usage.
///
/// By default max connections is set to a 256.
pub fn maxconnrate(mut self, num: usize) -> Self {
pub fn maxconnrate(self, num: usize) -> Self {
ssl::max_concurrent_ssl_connect(num);
self
}

View File

@ -33,3 +33,9 @@ pub(crate) static MAX_CONN: AtomicUsize = AtomicUsize::new(256);
thread_local! {
static MAX_CONN_COUNTER: Counter = Counter::new(MAX_CONN.load(Ordering::Relaxed));
}
/// Ssl error combinded with service error.
pub enum SslError<E1, E2> {
Ssl(E1),
Service(E2),
}