diff --git a/tokio-native-tls/src/lib.rs b/tokio-native-tls/src/lib.rs index 8ce19c0..4636bd8 100644 --- a/tokio-native-tls/src/lib.rs +++ b/tokio-native-tls/src/lib.rs @@ -147,7 +147,14 @@ where S: AsyncWrite + Unpin, { fn write(&mut self, buf: &[u8]) -> io::Result { - self.with_context(|ctx, stream| stream.poll_write(ctx, buf)) + let n = self.with_context(|ctx, stream| stream.poll_write(ctx, buf))?; + + #[cfg(target_os = "macos")] + { + self.flush()?; + } + + Ok(n) } fn flush(&mut self) -> io::Result<()> {