v2ray преди 9 години
родител
ревизия
2f0d602833
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      transport/internet/kcp/sending.go

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

@@ -165,7 +165,7 @@ func (this *SendingWindow) Flush(current uint32, resend uint32, rto uint32, maxI
 		}
 	}
 
-	if inFlightSize > 0 && this.totalInFlightSize != 0 {
+	if this.onPacketLoss != nil && inFlightSize > 0 && this.totalInFlightSize != 0 {
 		rate := lost * 100 / this.totalInFlightSize
 		this.onPacketLoss(rate)
 	}