There were two observers of env.Sent, the session mux and the sender. If the sender was the first to read from the channel, this would cause the session mux to be blocked.
In order to support multiple observers, the channels must be treated as semaphores which are signaled when closed.
Don't terminate a session's mux if a transfer wasn't sent due to context cancellation/timeout (this is not terminal).
[ ] The purpose of this PR is explained in this or a referenced issue.
[ ] Tests are included and/or updated for code changes.
There were two observers of env.Sent, the session mux and the sender. If the sender was the first to read from the channel, this would cause the session mux to be blocked. In order to support multiple observers, the channels must be treated as semaphores which are signaled when closed. Don't terminate a session's mux if a transfer wasn't sent due to context cancellation/timeout (this is not terminal).