stream: Improve half-closing of outgoing TCP connections (#28624)

Notably fixes the case where upstream finished before the connection
was successfully established, and avoids RSTing the incoming stream
when the outgoing stream is done (which is now possible due to the
cancellation reason being propagated).
This commit is contained in:
Arnout Engelen 2020-02-20 13:28:21 +01:00 committed by GitHub
parent cff15cf40d
commit 8a354ec3f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 31 deletions

View file

@ -142,6 +142,7 @@ private[io] abstract class TcpConnection(val tcp: TcpExt, val channel: SocketCha
case SuspendReading => suspendReading(info)
case ResumeReading => resumeReading(info)
case ChannelReadable => doRead(info, closeCommander)
case Close => doCloseConnection(info.handler, closeCommander, Close.event)
case Abort => handleClose(info, Some(sender()), Aborted)
}