Skip to content

Commit

Permalink
Merge pull request #1128 from sozu-proxy/remove-router-trie
Browse files Browse the repository at this point in the history
remove sozu_lib::router::trie and replace use with pattern_trie
  • Loading branch information
Keksoj authored Aug 19, 2024
2 parents 3474b9c + 2ed27e9 commit 409af59
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 713 deletions.
2 changes: 1 addition & 1 deletion command/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl FromStr for TlsVersion {

//FIXME: make fixed size depending on hash algorithm
/// A TLS certificates, encoded in bytes
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Default)]
pub struct Fingerprint(pub Vec<u8>);

impl FromStr for Fingerprint {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/https.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ mod tests {
proto::command::{CustomHttpAnswers, SocketAddress},
};

use crate::router::{trie::TrieNode, MethodRule, PathRule, Route, Router};
use crate::router::{pattern_trie::TrieNode, MethodRule, PathRule, Route, Router};

/*
#[test]
Expand Down
1 change: 0 additions & 1 deletion lib/src/router/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod pattern_trie;
pub mod trie;

use std::{str::from_utf8, time::Instant};

Expand Down
2 changes: 1 addition & 1 deletion lib/src/router/pattern_trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn find_last_slash(input: &[u8]) -> Option<usize> {
/// A leaf node (leftmost label) can be a wildcard, a regex pattern or a plain string.
/// Leaves also store a value associated with the complete domain.
/// For Sozu it is a list of (PathRule, MethodRule, ClusterId). See the Router strucure.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct TrieNode<V> {
key_value: Option<KeyValue<Key, V>>,
wildcard: Option<KeyValue<Key, V>>,
Expand Down
Loading

0 comments on commit 409af59

Please sign in to comment.