Remove stuff that is not needed with new ConnectionMaker approach

This commit is contained in:
Bryan Boreham committed 2014-09-10 12:29:21 +01:00
1 parent 84aeaf340a
commit 26f8a68a82
4 files changed
+1 -16

No files matched your search

-4
View File
@@ -277,10 +277,6 @@ func (conn *LocalConnection) handleShutdown() {
// blank out the forwardChan so that the router processes don't // blank out the forwardChan so that the router processes don't
// try to send any more // try to send any more
conn.stopForwarders() conn.stopForwarders()
if conn.remote != nil {
conn.Router.ConnectionMaker.EnsureConnection(conn.remoteTCPAddr)
}
} }
func (conn *LocalConnection) handshake(acceptNewPeer bool) error { func (conn *LocalConnection) handshake(acceptNewPeer bool) error {
+1 -6
View File
@@ -37,14 +37,9 @@ func StartConnectionMaker(router *Router) *ConnectionMaker {
func (cm *ConnectionMaker) InitiateConnection(address string) { func (cm *ConnectionMaker) InitiateConnection(address string) {
cm.queryChan <- &ConnectionMakerInteraction{ cm.queryChan <- &ConnectionMakerInteraction{
Interaction: Interaction{code: CMInitiate}, Interaction: Interaction{code: CMInitiate},
isCmdLine: true,
address: address} address: address}
} }
func (cm *ConnectionMaker) EnsureConnection(address string) {
// Do nothing - we will figure out what to do later
}
func (cm *ConnectionMaker) String() string { func (cm *ConnectionMaker) String() string {
resultChan := make(chan interface{}, 0) resultChan := make(chan interface{}, 0)
cm.queryChan <- &ConnectionMakerInteraction{ cm.queryChan <- &ConnectionMakerInteraction{
@@ -74,7 +69,7 @@ func (cm *ConnectionMaker) queryLoop(queryChan <-chan *ConnectionMakerInteractio
} }
switch { switch {
case query.code == CMInitiate: case query.code == CMInitiate:
cm.addToTargets(query.isCmdLine, query.address) cm.addToTargets(true, query.address)
tickNow() tickNow()
case query.code == CMStatus: case query.code == CMStatus:
query.resultChan <- cm.status() query.resultChan <- cm.status()
-5
View File
@@ -121,11 +121,6 @@ func (peer *Peer) SetVersionAndConnections(version uint64, connections map[PeerN
defer peer.Unlock() defer peer.Unlock()
peer.version = version peer.version = version
peer.connections = connections peer.connections = connections
for remoteName, conn := range connections {
if remoteName != peer.Router.Ourself.Name {
peer.Router.ConnectionMaker.EnsureConnection(conn.RemoteTCPAddr())
}
}
} }
func (peer *Peer) Forward(dstPeer *Peer, df bool, frame []byte, dec *EthernetDecoder) error { func (peer *Peer) Forward(dstPeer *Peer, df bool, frame []byte, dec *EthernetDecoder) error {
-1
View File
@@ -155,7 +155,6 @@ type Topology struct {
type ConnectionMakerInteraction struct { type ConnectionMakerInteraction struct {
Interaction Interaction
isCmdLine bool
address string address string
} }