Skip to content

Commit acf5e57

Browse files
committed
fixup
1 parent edafe8e commit acf5e57

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.github/python-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12
1+
3.10

mitmproxy-linux/src/main2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ async fn main() -> anyhow::Result<()> {
142142
};
143143

144144
packet.encode(&mut ipc_buf)?;
145-
146-
info!("Sending packet: {} {:?}", ipc_buf.len(), &ipc_buf);
147145
let encoded = ipc_buf.split();
148-
ipc.send(encoded.as_ref()).await?;
146+
147+
info!("Sending packet to proxy: {} {:?}", encoded.len(), &encoded);
148+
ipc.send(&encoded).await?;
149149
},
150150
}
151151
}

src/packet_sources/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async fn forward_packets<T: AsyncRead + AsyncWrite + Unpin>(
7272
msg.encode(&mut buf.as_mut_slice())?;
7373
let len = msg.encoded_len();
7474

75-
info!("Sending IPC message: {len} {:?}", &buf[..len]);
75+
info!("Sending IPC message to redirector: {len} {:?}", &buf[..len]);
7676

7777
channel.write_all(&buf[..len]).await.context("failed to propagate interception config update")?;
7878
},
@@ -93,8 +93,8 @@ async fn forward_packets<T: AsyncRead + AsyncWrite + Unpin>(
9393
warn!("Receiving packet: {} {:?}", len, &buf[..len]);
9494

9595
let mut cursor = Cursor::new(&buf[..len]);
96-
let Ok(PacketWithMeta { data, tunnel_info: Some(ipc::TunnelInfo { pid, process_name })}) = PacketWithMeta::decode(&mut cursor) else {
97-
return Err(anyhow!("Received invalid IPC message: {:?}", &buf[..len]));
96+
let Ok(PacketWithMeta { data, tunnel_info}) = PacketWithMeta::decode(&mut cursor) else {
97+
return Err(anyhow!("Received invalid IPC message from redirector: {:?}", &buf[..len]));
9898
};
9999
assert_eq!(cursor.position(), len as u64);
100100

@@ -112,8 +112,8 @@ async fn forward_packets<T: AsyncRead + AsyncWrite + Unpin>(
112112
let event = NetworkEvent::ReceivePacket {
113113
packet,
114114
tunnel_info: TunnelInfo::LocalRedirector {
115-
pid,
116-
process_name,
115+
pid: tunnel_info.as_ref().and_then(|t| t.pid),
116+
process_name: tunnel_info.and_then(|t| t.process_name),
117117
remote_endpoint: None,
118118
},
119119
};

0 commit comments

Comments
 (0)