fix(chain): Copy returns wrong pointer, connection leaks in Connect/Handshake, deferred cancel accumulation in retry loops
- transport.go: Copy() returned original pointer instead of the allocated copy, causing data races and incorrect routing for multiplexed chains. - route.go: Connect and Handshake failures in intermediate nodes leaked the returned connection. Handshake fix preserves the original Connect result (guaranteed non-nil) and closes both the Handshake return value and input. - router.go: defer cancel() inside retry loops accumulated context timers across iterations. Wrapped each loop body in an IIFE so defer scopes per-iteration and timers are released immediately.
This commit is contained in:
+1
-1
@@ -102,5 +102,5 @@ func (tr *Transport) Options() *chain.TransportOptions {
|
||||
func (tr *Transport) Copy() chain.Transporter {
|
||||
tr2 := &Transport{}
|
||||
*tr2 = *tr
|
||||
return tr
|
||||
return tr2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user