diff --git a/app/app.go b/app/app.go index 2a0ced1..381efb0 100644 --- a/app/app.go +++ b/app/app.go @@ -18,7 +18,7 @@ import ( type application struct { peers map[string]peer.CwtchPeer - mn connectivity.Mixnet + mn connectivity.ACN directory string mutex sync.Mutex primaryonion string @@ -41,7 +41,7 @@ type Application interface { } // NewApp creates a new app with some environment awareness and initializes a Tor Manager -func NewApp(mn connectivity.Mixnet, appDirectory string) Application { +func NewApp(mn connectivity.ACN, appDirectory string) Application { log.Printf("NewApp(%v)\n", appDirectory) app := &application{peers: make(map[string]peer.CwtchPeer), storage: make(map[string]storage.ProfileStore), directory: appDirectory, mn: mn} os.Mkdir(path.Join(app.directory, "profiles"), 0700) diff --git a/peer/connections/connectionsmanager.go b/peer/connections/connectionsmanager.go index d1a8de6..8380fed 100644 --- a/peer/connections/connectionsmanager.go +++ b/peer/connections/connectionsmanager.go @@ -15,11 +15,11 @@ type Manager struct { serverConnections map[string]*PeerServerConnection lock sync.Mutex breakChannel chan bool - mn connectivity.Mixnet + mn connectivity.ACN } // NewConnectionsManager creates a new instance of Manager. -func NewConnectionsManager(mn connectivity.Mixnet) *Manager { +func NewConnectionsManager(mn connectivity.ACN) *Manager { m := new(Manager) m.mn = mn m.peerConnections = make(map[string]*PeerPeerConnection) diff --git a/peer/connections/peerpeerconnection.go b/peer/connections/peerpeerconnection.go index 384fb22..7db1cea 100644 --- a/peer/connections/peerpeerconnection.go +++ b/peer/connections/peerpeerconnection.go @@ -23,11 +23,11 @@ type PeerPeerConnection struct { profile *model.Profile dataHandler func(string, []byte) []byte aif application.ApplicationInstanceFactory - mn connectivity.Mixnet + mn connectivity.ACN } // NewPeerPeerConnection creates a new peer connection for the given hostname and profile. -func NewPeerPeerConnection(mn connectivity.Mixnet, peerhostname string, profile *model.Profile, dataHandler func(string, []byte) []byte, aif application.ApplicationInstanceFactory) *PeerPeerConnection { +func NewPeerPeerConnection(mn connectivity.ACN, peerhostname string, profile *model.Profile, dataHandler func(string, []byte) []byte, aif application.ApplicationInstanceFactory) *PeerPeerConnection { ppc := new(PeerPeerConnection) ppc.mn = mn ppc.PeerHostname = peerhostname diff --git a/peer/connections/peerserverconnection.go b/peer/connections/peerserverconnection.go index 0af48d3..baf65d4 100644 --- a/peer/connections/peerserverconnection.go +++ b/peer/connections/peerserverconnection.go @@ -23,13 +23,13 @@ type PeerServerConnection struct { Server string state ConnectionState connection *connection.Connection - mn connectivity.Mixnet + mn connectivity.ACN GroupMessageHandler func(string, *protocol.GroupMessage) } // NewPeerServerConnection creates a new Peer->Server outbound connection -func NewPeerServerConnection(mn connectivity.Mixnet, serverhostname string) *PeerServerConnection { +func NewPeerServerConnection(mn connectivity.ACN, serverhostname string) *PeerServerConnection { psc := new(PeerServerConnection) psc.mn = mn psc.Server = serverhostname diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 59ac9a1..7af5f29 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -28,7 +28,7 @@ type cwtchPeer struct { connection.AutoConnectionHandler Profile *model.Profile app *application.RicochetApplication - mn connectivity.Mixnet + mn connectivity.ACN mutex sync.Mutex connectionsManager *connections.Manager dataHandler func(string, []byte) []byte @@ -40,7 +40,7 @@ type cwtchPeer struct { // CwtchPeer provides us with a way of testing systems built on top of cwtch without having to // directly implement a cwtchPeer. type CwtchPeer interface { - Init(connectivity.Mixnet) + Init(connectivity.ACN) PeerWithOnion(string) *connections.PeerPeerConnection InviteOnionToGroup(string, string) error @@ -90,7 +90,7 @@ func FromProfile(profile *model.Profile) CwtchPeer { } // Init instantiates a cwtchPeer -func (cp *cwtchPeer) Init(mn connectivity.Mixnet) { +func (cp *cwtchPeer) Init(mn connectivity.ACN) { cp.mn = mn cp.connectionsManager = connections.NewConnectionsManager(cp.mn) go cp.connectionsManager.AttemptReconnections() diff --git a/server/server.go b/server/server.go index 9f476c4..16f48cb 100644 --- a/server/server.go +++ b/server/server.go @@ -23,7 +23,7 @@ type Server struct { // TODO: surface errors // TODO: handle HUP/KILL signals to exit and close Tor gracefully // TODO: handle user input to exit -func (s *Server) Run(mn connectivity.Mixnet, serverConfig Config) { +func (s *Server) Run(mn connectivity.ACN, serverConfig Config) { s.config = serverConfig cwtchserver := new(application.RicochetApplication) s.metricsPack.Start(cwtchserver, serverConfig.ConfigDir, s.config.ServerReporting.LogMetricsToFile)