浏览代码

UDP: Remove removeRay()'s error log (#4936)

From https://github.com/XTLS/Xray-core/pull/4899
风扇滑翔翼 3 月之前
父节点
当前提交
c9cd26d6d3
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      transport/internet/udp/dispatcher.go

+ 1 - 2
transport/internet/udp/dispatcher.go

@@ -70,11 +70,10 @@ func (v *Dispatcher) getInboundRay(ctx context.Context, dest net.Destination) (*
 	removeRay := func() {
 	removeRay := func() {
 		v.Lock()
 		v.Lock()
 		defer v.Unlock()
 		defer v.Unlock()
+		// sometimes the entry is already removed by others, don't close again
 		if entry == v.conn {
 		if entry == v.conn {
 			cancel()
 			cancel()
 			v.removeRay()
 			v.removeRay()
-		} else {
-			errors.LogError(ctx, "removeRay trying to remove a conn that not belongs to it, canceling.")
 		}
 		}
 	}
 	}
 	timer := signal.CancelAfterInactivity(ctx, removeRay, time.Minute)
 	timer := signal.CancelAfterInactivity(ctx, removeRay, time.Minute)