From b513b69e0c76424fff4e537d68c45ab22cdf9d00 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Wed, 4 Sep 2024 16:52:32 +0200 Subject: [PATCH] [refactor] Wiring up with the new API Signed-off-by: dd di cesare --- src/filter/http_context.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/filter/http_context.rs b/src/filter/http_context.rs index 1d2a140b..2290266d 100644 --- a/src/filter/http_context.rs +++ b/src/filter/http_context.rs @@ -39,26 +39,22 @@ impl Filter { return Action::Continue; } - // Build Actions from config actions self.operation_dispatcher.build_operations(rlp, descriptors); - // populate actions in the dispatcher - // call the next on the match - if let Some(result) = self.operation_dispatcher.next() { - match result { - (_state, Ok(call_id)) => { + if let Some(operation) = self.operation_dispatcher.next() { + match operation.get_result() { + Ok(call_id) => { debug!( "#{} initiated gRPC call (id# {}) to Limitador", self.context_id, call_id ); Action::Pause } - (_state, Err(e)) => { + Err(e) => { warn!("gRPC call to Limitador failed! {e:?}"); - // TODO(didierofrivia): Get the failure_mode - /*if let FailureMode::Deny = rls.failure_mode() { + if let FailureMode::Deny = operation.get_failure_mode() { self.send_http_response(500, vec![], Some(b"Internal Server Error.\n")) - } */ + } Action::Continue } }