mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Don't track localAddr in conns as it is irrelevant
This commit is contained in:
		
							parent
							
								
									cb4495902b
								
							
						
					
					
						commit
						80c9a1bc12
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
					@ -53,8 +53,8 @@ type tcpInterface struct {
 | 
				
			||||||
type tcpInfo struct {
 | 
					type tcpInfo struct {
 | 
				
			||||||
	box        crypto.BoxPubKey
 | 
						box        crypto.BoxPubKey
 | 
				
			||||||
	sig        crypto.SigPubKey
 | 
						sig        crypto.SigPubKey
 | 
				
			||||||
	localAddr  string
 | 
					 | 
				
			||||||
	remoteAddr string
 | 
						remoteAddr string
 | 
				
			||||||
 | 
						remotePort string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Wrapper function to set additional options for specific connection types.
 | 
					// Wrapper function to set additional options for specific connection types.
 | 
				
			||||||
| 
						 | 
					@ -313,8 +313,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// Check if we already have a connection to this node, close and block if yes
 | 
						// Check if we already have a connection to this node, close and block if yes
 | 
				
			||||||
	info.localAddr, _, _ = net.SplitHostPort(sock.LocalAddr().String())
 | 
						info.remoteAddr, info.remotePort, _ = net.SplitHostPort(sock.RemoteAddr().String())
 | 
				
			||||||
	info.remoteAddr, _, _ = net.SplitHostPort(sock.RemoteAddr().String())
 | 
					 | 
				
			||||||
	iface.mutex.Lock()
 | 
						iface.mutex.Lock()
 | 
				
			||||||
	if blockChan, isIn := iface.conns[info]; isIn {
 | 
						if blockChan, isIn := iface.conns[info]; isIn {
 | 
				
			||||||
		iface.mutex.Unlock()
 | 
							iface.mutex.Unlock()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue