change path name and server name to specific stract to find longest prefix and exact matching in hashtables
This commit is contained in:
parent
7bd9040637
commit
1a70869227
5 changed files with 89 additions and 20 deletions
|
|
@ -19,7 +19,7 @@ impl ReverseProxy {
|
|||
pub fn get<'a>(&self, path_str: impl Into<Cow<'a, str>>) -> Option<&UpstreamGroup> {
|
||||
// trie使ってlongest prefix match させてもいいけどルート記述は少ないと思われるので、
|
||||
// コスト的にこの程度で十分
|
||||
let path_bytes = &(path_str.to_path_name_vec())[..];
|
||||
let path_bytes = &path_str.to_path_name_vec();
|
||||
|
||||
let matched_upstream = self
|
||||
.upstream
|
||||
|
|
@ -40,7 +40,7 @@ impl ReverseProxy {
|
|||
if let Some((_path, u)) = matched_upstream {
|
||||
debug!(
|
||||
"Found upstream: {:?}",
|
||||
String::from_utf8(_path.to_vec()).unwrap_or_else(|_| "<none>".to_string())
|
||||
String::from_utf8(_path.0.clone()).unwrap_or_else(|_| "<none>".to_string())
|
||||
);
|
||||
Some(u)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue