mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
recv() on a closed TCP socket returns ENOTCONN
From RFC 793 s3.9 p58 Event Processing: If RECEIVE Call arrives in CLOSED state and the user has access to such a connection, the return should be "error: connection does not exist" Fixes #1598 PiperOrigin-RevId: 293494287
This commit is contained in:
@@ -2229,11 +2229,16 @@ func (s *SocketOperations) coalescingRead(ctx context.Context, dst usermem.IOSeq
|
||||
var copied int
|
||||
|
||||
// Copy as many views as possible into the user-provided buffer.
|
||||
for dst.NumBytes() != 0 {
|
||||
for {
|
||||
// Always do at least one fetchReadView, even if the number of bytes to
|
||||
// read is 0.
|
||||
err = s.fetchReadView()
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
if dst.NumBytes() == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
var n int
|
||||
var e error
|
||||
|
||||
Reference in New Issue
Block a user