The docs for AcceptedAlert::write() say "Send the alert to the client." Under the hood it calls ChunkVecBuffer::write_to, and returns the usize.
The problem is, &mut dyn Write is allowed to return short writes. So it's possible that write_to writes less than all of the ChunkVecBuffer's contents.
I think the correct user behavior is to call AcceptedAlert::write() in a loop until it returns Ok(0) or an error. Is that right? If so, examples/src/bin/server_acceptor.rs should be updated. And the docs should say "Send alert bytes to the client. Call this repeatedly until it returns Ok(0) or an error, to ensure all bytes are sent."
The docs for AcceptedAlert::write() say "Send the alert to the client." Under the hood it calls ChunkVecBuffer::write_to, and returns the
usize.The problem is,
&mut dyn Writeis allowed to return short writes. So it's possible thatwrite_towrites less than all of the ChunkVecBuffer's contents.I think the correct user behavior is to call
AcceptedAlert::write()in a loop until it returnsOk(0)or an error. Is that right? If so, examples/src/bin/server_acceptor.rs should be updated. And the docs should say "Send alert bytes to the client. Call this repeatedly until it returnsOk(0)or an error, to ensure all bytes are sent."