Skip to content

Commit

Permalink
Merge branch 'master' into feature/property_path_no_allocs
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmargalef authored Nov 9, 2023
2 parents 89aaf19 + 9b4b4a5 commit 029e157
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,14 @@ impl Dispatcher {
}

fn on_grpc_receive_initial_metadata(&self, token_id: u32, headers: u32) {
let context_id = *self
.grpc_streams
.borrow_mut()
.get(&token_id)
.expect("invalid token_id");
let context_id = match self.grpc_streams.borrow_mut().get(&token_id) {
Some(id) => *id,
None => {
// TODO: change back to a panic once underlying issue is fixed.
trace!("on_grpc_receive_initial_metadata: invalid token_id");
return;
}
};

if let Some(http_stream) = self.http_streams.borrow_mut().get_mut(&context_id) {
self.active_id.set(context_id);
Expand Down Expand Up @@ -480,16 +483,20 @@ impl Dispatcher {
root.on_grpc_stream_message(token_id, response_size);
}
} else {
panic!("invalid token_id")
// TODO: change back to a panic once underlying issue is fixed.
trace!("on_grpc_receive_initial_metadata: invalid token_id");
}
}

fn on_grpc_receive_trailing_metadata(&self, token_id: u32, trailers: u32) {
let context_id = *self
.grpc_streams
.borrow_mut()
.get(&token_id)
.expect("invalid token_id");
let context_id = match self.grpc_streams.borrow_mut().get(&token_id) {
Some(id) => *id,
None => {
// TODO: change back to a panic once underlying issue is fixed.
trace!("on_grpc_receive_trailing_metadata: invalid token_id");
return;
}
};

if let Some(http_stream) = self.http_streams.borrow_mut().get_mut(&context_id) {
self.active_id.set(context_id);
Expand Down

0 comments on commit 029e157

Please sign in to comment.