Fix host unix socket to not swallow EOF incorrectly.
Fixes an error where in case of a receive buffer larger than the host send buffer size for a host backed unix dgram socket we would end up swallowing EOF from recvmsg syscall causing the read() to block forever. PiperOrigin-RevId: 331192810
This commit is contained in:
parent
964447c8ce
commit
831ab2dd99
|
@ -11,9 +11,7 @@ go_library(
|
|||
"seq_unsafe.go",
|
||||
],
|
||||
visibility = ["//:sandbox"],
|
||||
deps = [
|
||||
"//pkg/safecopy",
|
||||
],
|
||||
deps = ["//pkg/safecopy"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
|
|
|
@ -65,10 +65,10 @@ func fdReadVec(fd int, bufs [][]byte, control []byte, peek bool, maxlen int64) (
|
|||
controlTrunc = msg.Flags&syscall.MSG_CTRUNC == syscall.MSG_CTRUNC
|
||||
|
||||
if n > length {
|
||||
return length, n, msg.Controllen, controlTrunc, err
|
||||
return length, n, msg.Controllen, controlTrunc, nil
|
||||
}
|
||||
|
||||
return n, n, msg.Controllen, controlTrunc, err
|
||||
return n, n, msg.Controllen, controlTrunc, nil
|
||||
}
|
||||
|
||||
// fdWriteVec sends from bufs to fd.
|
||||
|
|
|
@ -63,10 +63,10 @@ func fdReadVec(fd int, bufs [][]byte, control []byte, peek bool, maxlen int64) (
|
|||
controlTrunc = msg.Flags&syscall.MSG_CTRUNC == syscall.MSG_CTRUNC
|
||||
|
||||
if n > length {
|
||||
return length, n, msg.Controllen, controlTrunc, err
|
||||
return length, n, msg.Controllen, controlTrunc, nil
|
||||
}
|
||||
|
||||
return n, n, msg.Controllen, controlTrunc, err
|
||||
return n, n, msg.Controllen, controlTrunc, nil
|
||||
}
|
||||
|
||||
// fdWriteVec sends from bufs to fd.
|
||||
|
|
Loading…
Reference in New Issue