Represent closed in either end as closed in ADT #26493 (#26554)

This commit is contained in:
Johan Andrén 2019-03-28 17:40:31 +01:00 committed by Arnout Engelen
parent 65ccada280
commit 63aefb0b5e

View file

@ -668,10 +668,15 @@ import akka.stream.snapshot._
logicSnapshots(logicIndexes(connection.inOwner)),
logicSnapshots(logicIndexes(connection.outOwner)),
connection.portState match {
case InReady => ConnectionSnapshot.ShouldPull
case OutReady => ConnectionSnapshot.ShouldPush
case x if (x | InClosed | OutClosed) == (InClosed | OutClosed) =>
case InReady => ConnectionSnapshot.ShouldPull
case OutReady => ConnectionSnapshot.ShouldPush
case x if (x & (InClosed | OutClosed)) == (InClosed | OutClosed) =>
// At least one side of the connection is closed: we show it as closed
ConnectionSnapshot.Closed
case _ =>
// This should not be possible: connection alive and both push and pull enqueued but not received
throw new IllegalStateException(s"Unexpected connection state for $connection: ${connection.portState}")
})
}