Track client-initiated shutdown for any pipe type by bgrainger · Pull Request #2814 · StackExchange/StackExchange.Redis
Fixes #2652
Previously, RecordQuit only recorded a client-initiated QUIT if _ioPipe was a SocketConnection, which is not true when using SSL.
Since there is a 1-1 relationship between PhysicalConnection and _ioPipe, store whether the client initiated the shutdown on the PhysicalConnection object instead of (only) delegating it to SocketConnection.
The line var pipe = connectingPipe ?? _ioPipe seems irrelevant to this PR because connectingPipe is only set once, in ConnectedAsync, and would be relevant only if an exception were thrown between when pipe is set and when its value is assigned to _ioPipe (i.e., between lines 1612-15).