mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-06 16:14:11 +00:00
EncryptedWriter.poll_write_encrypted keeps the encrypted buffer and its on-wire offset across Poll::Pending, but returned the length of the buffer passed on the *retried* call instead of the plaintext length that was actually assembled into the pending frame. Tokio's copy/copy_bidirectional may append freshly read data to the input slice while the writer is Pending, so the reported count could exceed what was actually encrypted and sent, silently dropping the appended bytes. Fixes #2175