Skip to content

Commit d056cc6

Browse files
committed
mitm: pkt_debug(): add proxy_type parameter
1 parent c2903c3 commit d056cc6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mitm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl fmt::Display for Packet {
202202
}
203203

204204
/// shows packet/message contents as pretty string for debug
205-
pub async fn pkt_debug(pkt: &Packet) -> Result<()> {
205+
pub async fn pkt_debug(proxy_type: ProxyType, pkt: &Packet) -> Result<()> {
206206
// don't run further if we are not in Debug mode
207207
if !log_enabled!(Level::Debug) {
208208
return Ok(());
@@ -479,7 +479,7 @@ pub async fn proxy<A: Endpoint<A> + 'static>(
479479
if proxy_type == ProxyType::HeadUnit {
480480
// waiting for initial version frame (HU is starting transmission)
481481
let pkt = rxr.recv().await.ok_or("reader channel hung up")?;
482-
let _ = pkt_debug(&pkt).await;
482+
let _ = pkt_debug(proxy_type, &pkt).await;
483483
// sending to the MD
484484
tx.send(pkt).await?;
485485
// waiting for MD reply
@@ -509,7 +509,7 @@ pub async fn proxy<A: Endpoint<A> + 'static>(
509509
pkt.transmit(&mut device).await?;
510510
// waiting for MD reply
511511
let pkt = rxr.recv().await.ok_or("reader channel hung up")?;
512-
let _ = pkt_debug(&pkt).await;
512+
let _ = pkt_debug(proxy_type, &pkt).await;
513513
// sending reply back to the HU
514514
tx.send(pkt).await?;
515515

@@ -559,7 +559,7 @@ pub async fn proxy<A: Endpoint<A> + 'static>(
559559
if let Ok(mut pkt) = rxr.try_recv() {
560560
match pkt.decrypt_payload(&mut mem_buf, &mut server).await {
561561
Ok(_) => {
562-
let _ = pkt_debug(&pkt).await;
562+
let _ = pkt_debug(proxy_type, &pkt).await;
563563
tx.send(pkt).await?;
564564
}
565565
Err(e) => error!("decrypt_payload: {:?}", e),

0 commit comments

Comments
 (0)