소스 검색

fix mux conn read after Stop() method invoked will panic

ffdfgdfg 5 년 전
부모
커밋
6703a98419
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      lib/mux/conn.go

+ 1 - 0
lib/mux/conn.go

@@ -293,6 +293,7 @@ copyData:
 		// reset to 60s if timeout and data still available
 		Self.off = 0
 		if err != nil {
+		    Self.CloseWindow() // also close the window, to avoid read twice
 			return // queue receive stop or time out, break the loop and return
 		}
 		//logs.Warn("pop element", Self.element.l, Self.element.part)