소스 검색

fix data race in kcp connection

Darien Raymond 8 년 전
부모
커밋
2a04819582
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      transport/internet/kcp/receiving.go

+ 1 - 1
transport/internet/kcp/receiving.go

@@ -256,7 +256,7 @@ func (v *ReceivingWorker) Write(seg Segment) error {
 	ackSeg.Conv = v.conn.conv
 	ackSeg.ReceivingNext = v.nextNumber
 	ackSeg.ReceivingWindow = v.nextNumber + v.windowSize
-	if v.conn.state == StateReadyToClose {
+	if v.conn.State() == StateReadyToClose {
 		ackSeg.Option = SegmentOptionClose
 	}
 	return v.conn.output.Write(ackSeg)