Skip to content

Commit

Permalink
Merge pull request #490 from evanlinjin/bug/fix-app-panics
Browse files Browse the repository at this point in the history
Fix various panics.
  • Loading branch information
志宇 authored Jul 19, 2019
2 parents 1d4b619 + ccaf5d9 commit 96cb88e
Show file tree
Hide file tree
Showing 21 changed files with 1,008 additions and 57 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/prometheus/client_golang v1.0.0
github.com/prometheus/common v0.4.1
github.com/sirupsen/logrus v1.4.2
github.com/skycoin/dmsg v0.0.0-20190708174832-eb49a4b802f7
github.com/skycoin/dmsg v0.0.0-20190719095515-52043626400c
github.com/skycoin/skycoin v0.26.0
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.3.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ github.com/skycoin/dmsg v0.0.0-20190628092537-e69f75132be9 h1:Y7CZdMtd5HxkgIaAIL
github.com/skycoin/dmsg v0.0.0-20190628092537-e69f75132be9/go.mod h1:AwwGhHjvXpbYVz8oYFaXKWHwscc5nHyHjssQBtQgmZg=
github.com/skycoin/dmsg v0.0.0-20190708174832-eb49a4b802f7 h1:4LjXC4C+RJtsyJKlmtaDPhK7uaCImPZTvmVNkVHR2io=
github.com/skycoin/dmsg v0.0.0-20190708174832-eb49a4b802f7/go.mod h1:obZYZp8eKR7Xqz+KNhJdUE6Gvp6rEXbDO8YTlW2YXgU=
github.com/skycoin/dmsg v0.0.0-20190719095515-52043626400c h1:ZEE/nDdNWKDoBPAtCZAejJHaaopMbR/+4owT1U+Xa48=
github.com/skycoin/dmsg v0.0.0-20190719095515-52043626400c/go.mod h1:obZYZp8eKR7Xqz+KNhJdUE6Gvp6rEXbDO8YTlW2YXgU=
github.com/skycoin/skycoin v0.26.0 h1:xDxe2r8AclMntZ550Y/vUQgwgLtwrf9Wu5UYiYcN5/o=
github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
Expand Down
5 changes: 4 additions & 1 deletion pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ func (app *App) closeConn(data []byte) error {
delete(app.conns, loop)
app.mu.Unlock()

return conn.Close()
if conn != nil {
return conn.Close()
}
return nil
}

func (app *App) confirmLoop(data []byte) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/transport/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (tm *Manager) acceptTransport(ctx context.Context, factory Factory) (*Manag
entry, err := settlementResponderHandshake().Do(tm, tr, 30*time.Second)
if err != nil {
go func() {
if err = tr.Close(); err != nil {
if err := tr.Close(); err != nil {
tm.Logger.Warnf("Failed to close transport: %s", err)
}
}()
Expand Down
8 changes: 2 additions & 6 deletions vendor/github.com/skycoin/dmsg/.golangci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/github.com/skycoin/dmsg/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 27 additions & 8 deletions vendor/github.com/skycoin/dmsg/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 25 additions & 6 deletions vendor/github.com/skycoin/dmsg/disc/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 25 additions & 14 deletions vendor/github.com/skycoin/dmsg/disc/entry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/skycoin/dmsg/ioutil/ack_waiter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/github.com/skycoin/dmsg/ioutil/buf_read.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/github.com/skycoin/dmsg/ioutil/logging.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vendor/github.com/skycoin/dmsg/noise/noise.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 96cb88e

Please sign in to comment.