|
|
@ -56,6 +56,7 @@ type Session struct {
|
|
|
|
// Switchboard manages all connections to remote
|
|
|
|
// Switchboard manages all connections to remote
|
|
|
|
sb *switchboard
|
|
|
|
sb *switchboard
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Used for LocalAddr() and RemoteAddr() etc.
|
|
|
|
addrs atomic.Value
|
|
|
|
addrs atomic.Value
|
|
|
|
|
|
|
|
|
|
|
|
// For accepting new streams
|
|
|
|
// For accepting new streams
|
|
|
@ -150,8 +151,8 @@ func (sesh *Session) recvDataFromRemote(data []byte) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sesh.streamsM.Lock()
|
|
|
|
sesh.streamsM.Lock()
|
|
|
|
defer sesh.streamsM.Unlock()
|
|
|
|
|
|
|
|
stream, existing := sesh.streams[frame.StreamID]
|
|
|
|
stream, existing := sesh.streams[frame.StreamID]
|
|
|
|
|
|
|
|
sesh.streamsM.Unlock()
|
|
|
|
if existing {
|
|
|
|
if existing {
|
|
|
|
return stream.writeFrame(*frame)
|
|
|
|
return stream.writeFrame(*frame)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|