diff --git a/lib/src/protocol/pipe.rs b/lib/src/protocol/pipe.rs index d6ad6283c..e5e63d1c4 100644 --- a/lib/src/protocol/pipe.rs +++ b/lib/src/protocol/pipe.rs @@ -513,6 +513,8 @@ impl Pipe { if self.frontend_buffer.available_data() == 0 { self.frontend_readiness.interest.insert(Ready::READABLE); self.backend_readiness.interest.remove(Ready::WRITABLE); + count!("back_bytes_out", sz as i64); + metrics.backend_bout += sz; return SessionResult::Continue; } @@ -531,6 +533,7 @@ impl Pipe { } } + count!("back_bytes_out", sz as i64); metrics.backend_bout += sz; if !self.check_connections() { diff --git a/lib/src/socket.rs b/lib/src/socket.rs index 1a494264e..a3227a19d 100644 --- a/lib/src/socket.rs +++ b/lib/src/socket.rs @@ -287,9 +287,7 @@ impl SocketHandler for FrontRustls { } match self.session.writer().write(&buf[buffered_size..]) { - Ok(0) => { - break; - } + Ok(0) => {} // zero byte written means that the Rustls buffers are full, we will try to write on the socket and try again Ok(sz) => { buffered_size += sz; } @@ -363,7 +361,7 @@ impl SocketHandler for FrontRustls { let mut is_closed = false; match self.session.writer().write_vectored(bufs) { - Ok(0) => {} + Ok(0) => {} // zero byte written means that the Rustls buffers are full, we will try to write on the socket and try again Ok(sz) => { buffered_size += sz; }