From 996dd420554f738ccdd133c4b047e02e3d9aae1b Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 4 May 2020 18:46:51 +0700 Subject: [PATCH] move deadlineTimer declaration out of the Read loop --- receive_stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receive_stream.go b/receive_stream.go index 040e067c..ce00cc46 100644 --- a/receive_stream.go +++ b/receive_stream.go @@ -104,6 +104,7 @@ func (s *receiveStream) readImpl(p []byte) (bool /*stream completed */, int, err } bytesRead := 0 + var deadlineTimer *utils.Timer for bytesRead < len(p) { if s.currentFrame == nil || s.readPosInFrame >= len(s.currentFrame) { s.dequeueNextFrame() @@ -112,7 +113,6 @@ func (s *receiveStream) readImpl(p []byte) (bool /*stream completed */, int, err return false, bytesRead, s.closeForShutdownErr } - var deadlineTimer *utils.Timer for { // Stop waiting on errors if s.closedForShutdown {