diff --git a/go.mod b/go.mod index c1620df..c36ffc8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go go 1.17 require ( - cwtch.im/cwtch v0.18.4 + cwtch.im/cwtch v0.18.5 git.openprivacy.ca/cwtch.im/server v1.4.5 git.openprivacy.ca/openprivacy/connectivity v1.8.6 git.openprivacy.ca/openprivacy/log v1.0.3 @@ -28,4 +28,4 @@ require ( golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect golang.org/x/tools v0.1.10 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect -) +) \ No newline at end of file diff --git a/go.sum b/go.sum index 83ea5cb..dc621ab 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ cwtch.im/cwtch v0.18.3 h1:3zBvC4buII6pWQ+OOVUR6WuAwQDKCxSrj0ZOYKEeB6I= cwtch.im/cwtch v0.18.3/go.mod h1:StheazFFY7PKqBbEyDVLhzWW6WOat41zV0ckC240c5Y= cwtch.im/cwtch v0.18.4 h1:Oht7rEDVJjVWDOKg0xqDgXvY/H059HMJlOPt/nBGqxk= cwtch.im/cwtch v0.18.4/go.mod h1:h8S7EgEM+8pE1k+XLB5jAFdIPlOzwoXEY0GH5mQye5A= +cwtch.im/cwtch v0.18.5 h1:yqDns4flbowsbaWjMiUm7Em4IAlM8kkgm79CCcXV1GE= +cwtch.im/cwtch v0.18.5/go.mod h1:h8S7EgEM+8pE1k+XLB5jAFdIPlOzwoXEY0GH5mQye5A= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/lib.go b/lib.go index fb6dd5a..20a7d37 100644 --- a/lib.go +++ b/lib.go @@ -238,6 +238,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn } torrc := tor.NewTorrc().WithSocksPort(socksPort).WithOnionTrafficOnly().WithControlPort(controlPort).WithHashedPassword(base64.StdEncoding.EncodeToString(key)) + // torrc.WithLog(path.Join(appDir, "tor", "tor.log"), tor.TorLogLevelNotice) if settings.UseCustomTorrc { customTorrc := settings.CustomTorrc torrc.WithCustom(strings.Split(customTorrc, "\n")) diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 68f4644..68fbb1a 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -100,15 +100,11 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { if newAcnStatus == 100 { if acnStatus != 100 { // just came online - for _, onion := range eh.app.ListProfiles() { - // launch a listen thread (internally this does a check that the protocol engine is not listening) - // and as such is safe to call. - doServers := false - if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil { - doServers = true - } - eh.app.ActivePeerEngine(onion, true, true, doServers) + doServers := false + if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil { + doServers = true } + eh.app.ActivateEngines(true, true, doServers) eh.api.LaunchServers() } } else { @@ -144,8 +140,8 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { } profile.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline, event.False) - eh.app.AddPeerPlugin(onion, plugins.CONNECTIONRETRY) - eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK) + // disabeling network check for connection attempt reservation, needs rework + //eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK) eh.app.AddPeerPlugin(onion, plugins.ANTISPAM) // If the user has chosen to block unknown profiles @@ -164,7 +160,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil { doServers = true } - eh.app.ActivePeerEngine(onion, true, true, doServers) + eh.app.ActivatePeerEngine(onion, true, true, doServers) } online, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline)