server: fix regression in handling persistent connection requesrts
This commit fixes a bug that was introduced when the concurrent connection handling logic was re-written: if we don’t properly add the persistent outbound connection to the persistent conn reqs map. The fix is easy: add the pending conn req to the proper map.
This commit is contained in:
parent
28e607b6ae
commit
f335250512
11
server.go
11
server.go
@ -1125,10 +1125,17 @@ func (s *server) handleConnectPeer(msg *connectPeerMsg) {
|
||||
// persistent connection to the peer.
|
||||
srvrLog.Debugf("Connecting to %v", addr)
|
||||
if msg.persistent {
|
||||
go s.connMgr.Connect(&connmgr.ConnReq{
|
||||
connReq := &connmgr.ConnReq{
|
||||
Addr: addr,
|
||||
Permanent: true,
|
||||
})
|
||||
}
|
||||
|
||||
s.pendingConnMtx.Lock()
|
||||
s.persistentConnReqs[targetPub] = append(s.persistentConnReqs[targetPub],
|
||||
connReq)
|
||||
s.pendingConnMtx.Unlock()
|
||||
|
||||
go s.connMgr.Connect(connReq)
|
||||
msg.err <- nil
|
||||
} else {
|
||||
// If we're not making a persistent connection, then we'll
|
||||
|
Loading…
Reference in New Issue
Block a user