diff --git a/src/common/client.rs b/src/common/client.rs index 73062a2..12f2c8c 100644 --- a/src/common/client.rs +++ b/src/common/client.rs @@ -101,9 +101,11 @@ impl Client where let pkt_data = self.incoming_data.drain(..pkt_len).collect::>(); + println!("[recv: buf] {:?}", pkt_data); let pkt = R::from_bytes(&pkt_data[..pkt_size]) .map_err(|err| -> PacketNetworkError { err.into() })?; + println!("[recv] {:?}", pkt); result.push(pkt); } Ok(result) @@ -112,7 +114,12 @@ impl Client where pub fn send_pkt(&mut self, pkt: S) { println!("[send] {:?}", pkt); let buf = pkt.as_bytes(); - println!("[send: buf] {:?}", buf); + if buf.len() < 1024*2 { + println!("[send: buf] {:?}", buf); + } + else { + println!("[send: buf] [...large buffer...]"); + } let mut cbuf = self.cipher_out.encrypt(&buf).unwrap(); self.send_buffer.append(&mut cbuf); self.send_data();