Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create HeaderResolver once #98

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/filter/root_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ pub struct FilterRoot {
impl RootContext for FilterRoot {
fn on_vm_start(&mut self, _vm_configuration_size: usize) -> bool {
let full_version: &'static str = formatcp!(
"v{} ({}) {} {}",
WASM_SHIM_VERSION,
WASM_SHIM_GIT_HASH,
WASM_SHIM_FEATURES,
WASM_SHIM_PROFILE,
"v{WASM_SHIM_VERSION} ({WASM_SHIM_GIT_HASH}) {WASM_SHIM_FEATURES} {WASM_SHIM_PROFILE}"
);

info!(
Expand All @@ -40,6 +36,7 @@ impl RootContext for FilterRoot {
fn create_http_context(&self, context_id: u32) -> Option<Box<dyn HttpContext>> {
debug!("#{} create_http_context", context_id);
let mut service_handlers: HashMap<String, Rc<GrpcServiceHandler>> = HashMap::new();
let header_resolver = Rc::new(HeaderResolver::new());
self.config
.services
.iter()
Expand All @@ -48,7 +45,7 @@ impl RootContext for FilterRoot {
.entry(extension.clone())
.or_insert(Rc::from(GrpcServiceHandler::new(
Rc::clone(service),
Rc::new(HeaderResolver::new()),
Rc::clone(&header_resolver),
)));
});
Some(Box::new(Filter {
Expand Down
Loading