Fix an inaccurate comment.

This commit is contained in:
whitequark 2017-01-26 22:04:05 +00:00
parent ca1146995f
commit 4267ad2635
1 changed files with 3 additions and 2 deletions

View File

@ -509,8 +509,9 @@ impl<'a> TcpSocket<'a> {
/// there are not enough octets queued in the receive buffer, down to
/// an empty slice.
pub fn recv(&mut self, size: usize) -> Result<&[u8], ()> {
// We may have received some data inside the initial SYN ("TCP Fast Open"),
// but until the connection is fully open we refuse to dequeue any data.
// We may have received some data inside the initial SYN, but until the connection
// is fully open we must not dequeue any data, as it may be overwritten by e.g.
// another (stale) SYN.
if !self.may_recv() { return Err(()) }
#[cfg(any(test, feature = "verbose"))]