Emit a denial event from a borrowed sender reference. Used by `handle_forward_proxy` which borrows `Option<&Sender>`.
(
tx: Option<&mpsc::UnboundedSender<DenialEvent>>,
host: &str,
port: u16,
binary: &str,
decision: &ConnectDecision,
reason: &str,
stage: &str,
)
| 507 | /// Emit a denial event from a borrowed sender reference. |
| 508 | /// Used by `handle_forward_proxy` which borrows `Option<&Sender>`. |
| 509 | fn emit_denial_simple( |
| 510 | tx: Option<&mpsc::UnboundedSender<DenialEvent>>, |
| 511 | host: &str, |
| 512 | port: u16, |
| 513 | binary: &str, |
| 514 | decision: &ConnectDecision, |
| 515 | reason: &str, |
| 516 | stage: &str, |
| 517 | ) { |
| 518 | if let Some(tx) = tx { |
| 519 | let _ = tx.send(DenialEvent { |
| 520 | host: host.to_string(), |
| 521 | port, |
| 522 | binary: binary.to_string(), |
| 523 | ancestors: decision |
| 524 | .ancestors |
| 525 | .iter() |
| 526 | .map(|p| p.display().to_string()) |
| 527 | .collect(), |
| 528 | deny_reason: reason.to_string(), |
| 529 | denial_stage: stage.to_string(), |
| 530 | l7_method: None, |
| 531 | l7_path: None, |
| 532 | }); |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | // Many distinct, non-related context parameters are required for a CONNECT |
| 537 | // dispatch; bundling them into a struct would just shift the noise into call |
no outgoing calls
no test coverage detected