summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2018-12-02 13:52:23 +0100
committerYves Fischer <yvesf-git@xapek.org>2018-12-02 13:52:23 +0100
commitf098fdc99de724f53f7f129b6a5bde50b73fd797 (patch)
treedab4645ee420a7d6373818c44c6a5f7439dc7726 /src/main.rs
parentcf40041946626b105102e3dab2515d2ef2fb0506 (diff)
downloadnginx-auth-totp-master.tar.gz
nginx-auth-totp-master.zip
request slowdown on login failureHEADmaster
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index a025e69..6cdf77a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,4 @@
-#![feature(test)]
-#![feature(duration_as_u128)]
-
+#![feature(test,integer_atomics,duration_as_u128)]
use std::sync::Arc;
use std::thread;
use std::sync::atomic;
@@ -50,6 +48,7 @@ pub struct ApplicationState {
cookie_store: CookieStore,
cookie_max_age: Duration,
debug: bool,
+ request_slowdown: Arc<atomic::AtomicU64>,
}
#[derive(Debug, StructOpt)]
@@ -72,6 +71,7 @@ fn main() {
cookie_store: CookieStore::new(),
cookie_max_age: Duration::days(1),
debug: opt.debug,
+ request_slowdown: Arc::new(atomic::AtomicU64::new(0)),
};
let server_shutdown_condvar = Arc::new(atomic::AtomicBool::new(false));