From 5c98fd575b72ea1b80805a38e6b9df1e88a204d4 Mon Sep 17 00:00:00 2001 From: erinn Date: Mon, 8 Oct 2018 20:19:19 -0700 Subject: [PATCH] make local port selection deterministic and detach from the control port to improve performance --- application/ricochetonion.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/ricochetonion.go b/application/ricochetonion.go index 8f52ee7..27cc017 100644 --- a/application/ricochetonion.go +++ b/application/ricochetonion.go @@ -29,7 +29,7 @@ func SetupOnion(torControlAddress string, torControlSocketType string, authentic return c.NewListener(cfg, onionport) } -func SetupOnionV3(torControlAddress string, torControlSocketType string, authentication string, pk ed25519.PrivateKey, onionport uint16) (net.Listener, error) { +func SetupOnionV3(torControlAddress string, torControlSocketType string, authentication string, pk ed25519.PrivateKey, onionstr string, onionport uint16) (net.Listener, error) { c, err := bulb.Dial(torControlSocketType, torControlAddress) if err != nil { return nil, err @@ -56,7 +56,8 @@ func SetupOnionV3(torControlAddress string, torControlSocketType string, authent cfg := &bulb.NewOnionConfig{ DiscardPK: true, PrivateKey: onionPK, + Detach: true, } - return c.NewListener(cfg, onionport) + return c.RecoverListener(cfg, onionstr, onionport) }