Skip to content

Commit

Permalink
Merge pull request #620 from libp2p/fix/readcleanup
Browse files Browse the repository at this point in the history
clean up a channel that was dangling
  • Loading branch information
willscott authored Apr 30, 2020
2 parents d935620 + 106dc40 commit f006c07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dht_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ func (ms *messageSender) writeMsg(pmes *pb.Message) error {
func (ms *messageSender) ctxReadMsg(ctx context.Context, mes *pb.Message) error {
errc := make(chan error, 1)
go func(r msgio.ReadCloser) {
defer close(errc)
bytes, err := r.ReadMsg()
defer r.ReleaseMsg(bytes)
if err != nil {
Expand Down

0 comments on commit f006c07

Please sign in to comment.