Skip to content

Commit

Permalink
fix(stream): set writeDeadline when cleanup and forceClose
Browse files Browse the repository at this point in the history
fixes libp2p#11
  • Loading branch information
terryding77 committed Jan 19, 2020
1 parent 736c1cb commit 48208ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ func (s *Stream) forceClose() {
s.notifyWaiting()

s.readDeadline.set(time.Time{})
s.readDeadline.set(time.Time{})
s.writeDeadline.set(time.Time{})
}

// called when fully closed to release any system resources.
func (s *Stream) cleanup() {
s.session.closeStream(s.id)
s.readDeadline.set(time.Time{})
s.readDeadline.set(time.Time{})
s.writeDeadline.set(time.Time{})
}

// processFlags is used to update the state of the stream
Expand Down

0 comments on commit 48208ae

Please sign in to comment.