fix data race in kcp connection

pull/642/merge
Darien Raymond 2017-10-20 23:30:14 +02:00
parent 5ae8bfbda1
commit 2a04819582
1 changed files with 1 additions and 1 deletions

View File

@ -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)