diff options
| author | Fuwn <[email protected]> | 2023-04-06 00:02:11 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-06 00:02:11 -0700 |
| commit | 039acf58ac5a4b16fdb896634affb637b1bdeaad (patch) | |
| tree | 46caa813e140c5baae75a48268f6a997a5e9951c /src/modules/router/module.rs | |
| parent | fix(docker): copy syntax warning (diff) | |
| download | locus-039acf58ac5a4b16fdb896634affb637b1bdeaad.tar.xz locus-039acf58ac5a4b16fdb896634affb637b1bdeaad.zip | |
deps(windmark): bump 0.2.5 -> 0.3.1
Diffstat (limited to 'src/modules/router/module.rs')
| -rw-r--r-- | src/modules/router/module.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/router/module.rs b/src/modules/router/module.rs index dc9dae8..34d20db 100644 --- a/src/modules/router/module.rs +++ b/src/modules/router/module.rs @@ -16,8 +16,10 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only +use windmark::context::HookContext; + pub fn module(router: &mut windmark::Router) { - router.set_pre_route_callback(Box::new(|context| { + router.set_pre_route_callback(move |context: HookContext<'_>| { info!( "accepted connection from {} to {}", context.tcp.peer_addr().unwrap().ip(), @@ -25,9 +27,9 @@ pub fn module(router: &mut windmark::Router) { ); super::ticker::module(&context); - })); - router.set_post_route_callback(Box::new({ - |context, response| { + }); + router.set_post_route_callback({ + |context: HookContext<'_>, response: &mut windmark::Response| { info!( "closed connection from {} to {}", context.tcp.peer_addr().unwrap().ip(), @@ -50,5 +52,5 @@ pub fn module(router: &mut windmark::Router) { } } } - })); + }); } |