diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-10-16 14:41:43 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-16 14:41:43 -0700 |
commit | d22f0534c07a2b1a21cecb88db80cbc662bbd5af (patch) | |
tree | c7b084b23f6ce46486fec70c49baa1968f1afa0f /pkg/sentry/socket/unix/transport/connectioned.go | |
parent | de9a8e0eb7d66e75c4367be3437c4eb36a080f67 (diff) | |
parent | 2c3e2ed2bf4aa61bf317545fe428ff3adac95f92 (diff) |
Merge pull request #736 from tanjianfeng:fix-unix
PiperOrigin-RevId: 275114157
Diffstat (limited to 'pkg/sentry/socket/unix/transport/connectioned.go')
-rw-r--r-- | pkg/sentry/socket/unix/transport/connectioned.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/socket/unix/transport/connectioned.go b/pkg/sentry/socket/unix/transport/connectioned.go index 4bd15808a..dea11e253 100644 --- a/pkg/sentry/socket/unix/transport/connectioned.go +++ b/pkg/sentry/socket/unix/transport/connectioned.go @@ -220,6 +220,11 @@ func (e *connectionedEndpoint) Close() { case e.Connected(): e.connected.CloseSend() e.receiver.CloseRecv() + // Still have unread data? If yes, we set this into the write + // end so that the peer can get ECONNRESET) when it does read. + if e.receiver.RecvQueuedSize() > 0 { + e.connected.CloseUnread() + } c = e.connected r = e.receiver e.connected = nil |