Ensure all bytes are written to TcpStream

Fixes #22
This commit is contained in:
Aram 🍐 2022-01-09 22:52:48 -05:00
parent def5f22d3c
commit 11f86c49d6
2 changed files with 21 additions and 5 deletions

View file

@ -164,6 +164,7 @@ impl VirtualInterfacePoll for TcpVirtualInterface {
if client_socket.can_recv() {
match client_socket.recv(|buffer| (buffer.len(), buffer.to_vec())) {
Ok(data) => {
debug!("[{}] Received {} bytes from virtual server", virtual_port, data.len());
if !data.is_empty() {
endpoint.send(Event::RemoteData(*virtual_port, data));
}