Skip to content

Commit 91a609d

Browse files
authored
fix: improve error logging for connection retrieval failures in TCP and UDP loops
1 parent 708311d commit 91a609d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/common.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ func (c *Common) commonTCPLoop() {
419419
// 从连接池获取连接
420420
id, remoteConn := c.tunnelPool.ServerGet()
421421
if remoteConn == nil {
422-
c.logger.Error("Get failed: %v", id)
422+
c.logger.Error("Get failed: %v not found", id)
423423
c.tunnelPool.AddError()
424424
return
425425
}
@@ -477,6 +477,7 @@ func (c *Common) commonUDPLoop() {
477477
// 从连接池获取连接
478478
id, remoteConn := c.tunnelPool.ServerGet()
479479
if remoteConn == nil {
480+
c.logger.Error("Get failed: %v not found", id)
480481
c.tunnelPool.AddError()
481482
continue
482483
}
@@ -574,7 +575,7 @@ func (c *Common) commonTCPOnce(id string) {
574575
// 从连接池获取连接
575576
remoteConn := c.tunnelPool.ClientGet(id)
576577
if remoteConn == nil {
577-
c.logger.Error("Get failed: %v", id)
578+
c.logger.Error("Get failed: %v not found", id)
578579
return
579580
}
580581

@@ -615,7 +616,7 @@ func (c *Common) commonUDPOnce(id string) {
615616
// 从连接池获取连接
616617
remoteConn := c.tunnelPool.ClientGet(id)
617618
if remoteConn == nil {
618-
c.logger.Error("Get failed: %v", id)
619+
c.logger.Error("Get failed: %v not found", id)
619620
return
620621
}
621622

0 commit comments

Comments
 (0)