Shortcut pending hook activation on first data

This commit is contained in:
Michael Mikovsky
2026-04-25 23:45:17 -06:00
parent e50ebb1e35
commit a043d9747d
2 changed files with 26 additions and 5 deletions
+12 -2
View File
@@ -60,8 +60,18 @@ impl ProtocolEndpoint {
pending.caller_src_path == header.src_path
&& pending.procedure_id == message.procedure_id
}) {
self.hooks.activate_pending(&host_key);
host_key
let local_ended = self
.hooks
.activate_pending_with_peer_end(&host_key, message.end_hook)
.expect("pending hook was checked above");
if message.end_hook && local_ended {
self.hooks.remove_active(&host_key);
}
return Ok(EndpointOutcome::Local(LocalEvent::Data {
header,
message,
hook_key: host_key,
}));
} else {
return Ok(EndpointOutcome::Dropped);
};