mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
stop the deadline timer in Stream.Read and Write
This commit is contained in:
parent
c0b6d4e141
commit
93cee1e07b
2 changed files with 2 additions and 0 deletions
|
@ -132,6 +132,7 @@ func (s *receiveStream) readImpl(p []byte) (bool /*stream completed */, int, err
|
||||||
}
|
}
|
||||||
if deadlineTimer == nil {
|
if deadlineTimer == nil {
|
||||||
deadlineTimer = utils.NewTimer()
|
deadlineTimer = utils.NewTimer()
|
||||||
|
defer deadlineTimer.Stop()
|
||||||
}
|
}
|
||||||
deadlineTimer.Reset(deadline)
|
deadlineTimer.Reset(deadline)
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,7 @@ func (s *sendStream) Write(p []byte) (int, error) {
|
||||||
}
|
}
|
||||||
if deadlineTimer == nil {
|
if deadlineTimer == nil {
|
||||||
deadlineTimer = utils.NewTimer()
|
deadlineTimer = utils.NewTimer()
|
||||||
|
defer deadlineTimer.Stop()
|
||||||
}
|
}
|
||||||
deadlineTimer.Reset(deadline)
|
deadlineTimer.Reset(deadline)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue