Skip to content

Commit 0f72acb

Browse files
committed
Add sent bytes logging
1 parent 5c5ff54 commit 0f72acb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/protocol/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,10 +1041,22 @@ impl Conn {
10411041
}
10421042

10431043
pub fn write_packet<T: PacketType>(&mut self, packet: T) -> Result<(), Error> {
1044+
let network_debug = unsafe { NETWORK_DEBUG };
1045+
1046+
/* TODO: debug printing packets to send
1047+
if network_debug {
1048+
println!("about to send {:?}", packet);
1049+
}
1050+
*/
1051+
10441052
let mut buf = Vec::new();
10451053
VarInt(packet.packet_id(self.protocol_version)).write_to(&mut buf)?;
10461054
packet.write(&mut buf)?;
10471055

1056+
if network_debug {
1057+
println!("sent bytes {:?}", buf);
1058+
}
1059+
10481060
let mut extra = if self.compression_threshold >= 0 {
10491061
1
10501062
} else {

0 commit comments

Comments
 (0)