From 9bc492cf6cd90c70f626bf0fafdf15251e513064 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 4 Mar 2019 16:16:39 -0800 Subject: [PATCH] add SslError --- actix-server/CHANGES.md | 2 ++ actix-server/src/builder.rs | 2 +- actix-server/src/ssl/mod.rs | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index 32a62691..0183271d 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -6,6 +6,8 @@ * Add `ServerBuilder::maxconnrate` sets the maximum per-worker number of concurrent connections +* Add helper ssl error `SslError` + ### Changed diff --git a/actix-server/src/builder.rs b/actix-server/src/builder.rs index b23a174c..bafaa6b7 100644 --- a/actix-server/src/builder.rs +++ b/actix-server/src/builder.rs @@ -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 } diff --git a/actix-server/src/ssl/mod.rs b/actix-server/src/ssl/mod.rs index f91e2377..136da81f 100644 --- a/actix-server/src/ssl/mod.rs +++ b/actix-server/src/ssl/mod.rs @@ -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 { + Ssl(E1), + Service(E2), +}