Skip to content

Commit

Permalink
Merge branch 'feature/dmsg' of https://github.com/evanlinjin/skywire
Browse files Browse the repository at this point in the history
…into feature/dmsg-tests
  • Loading branch information
Darkren committed Jun 21, 2019
2 parents ca82d62 + e9e11d0 commit a9685d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ test: ## Run tests
#${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/app/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/cipher/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/dmsg/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/manager/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/messaging-discovery/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/node/...
Expand Down
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 a9685d3

Please sign in to comment.