Skip to content

Commit

Permalink
Fix dmsg transport.HandleFrame logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
林志宇 committed Jun 21, 2019
1 parent 3896594 commit e9e11d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/dmsg/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,18 @@ func (tp *Transport) Type() string {

// HandleFrame allows 'tp.Serve' to handle the frame (typically from 'ClientConn').
func (tp *Transport) HandleFrame(f Frame) error {
if tp.IsClosed() {
return io.ErrClosedPipe
}

tp.inMx.RLock()
defer tp.inMx.RUnlock()

handleFrame:
select {
case <-tp.done:
return io.ErrClosedPipe
case tp.inCh <- f:
return nil
default:
if tp.IsClosed() {
return io.ErrClosedPipe
}
goto handleFrame
}
}

Expand Down

0 comments on commit e9e11d0

Please sign in to comment.