mirror of https://github.com/cbeuw/Cloak
writeFrame returns error
This commit is contained in:
parent
a131af3439
commit
3f532ae065
|
|
@ -151,8 +151,7 @@ func (sesh *Session) recvDataFromRemote(data []byte) error {
|
|||
defer sesh.streamsM.Unlock()
|
||||
stream, existing := sesh.streams[frame.StreamID]
|
||||
if existing {
|
||||
stream.writeFrame(*frame)
|
||||
return nil
|
||||
return stream.writeFrame(*frame)
|
||||
} else {
|
||||
if frame.Closing == 1 {
|
||||
// If the stream has been closed and the current frame is a closing frame, we do noop
|
||||
|
|
@ -166,8 +165,7 @@ func (sesh *Session) recvDataFromRemote(data []byte) error {
|
|||
// we ignore the error here. If the switchboard is broken, it will be reflected upon stream.Write
|
||||
stream = makeStream(sesh, frame.StreamID, connId)
|
||||
sesh.acceptCh <- stream
|
||||
stream.writeFrame(*frame)
|
||||
return nil
|
||||
return stream.writeFrame(*frame)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,8 @@ func makeStream(sesh *Session, id uint32, assignedConnId uint32) *Stream {
|
|||
|
||||
func (s *Stream) isClosed() bool { return atomic.LoadUint32(&s.closed) == 1 }
|
||||
|
||||
func (s *Stream) writeFrame(frame Frame) {
|
||||
// TODO: Return error
|
||||
s.recvBuf.Write(frame)
|
||||
func (s *Stream) writeFrame(frame Frame) error {
|
||||
return s.recvBuf.Write(frame)
|
||||
}
|
||||
|
||||
// Read implements io.Read
|
||||
|
|
|
|||
Loading…
Reference in New Issue