瀏覽代碼

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)