From b9d0a843fc22f1828d689f6affc5ec87dc013607 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 20 Apr 2022 16:23:56 -0700 Subject: [PATCH] Disable Circuit Info for now --- go.sum | 2 -- protocol/connections/engine.go | 28 ++++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/go.sum b/go.sum index f6a2b68..0257603 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,6 @@ git.openprivacy.ca/cwtch.im/tapir v0.5.2 h1:7qJlUGY8RZbI7905BzVEEVB0hxP2GzI3lGiP git.openprivacy.ca/cwtch.im/tapir v0.5.2/go.mod h1:vVEu3CbXdyeMI5s1RkbROe1TBboNroGyJfODw8Ujlo8= git.openprivacy.ca/openprivacy/bine v0.0.4 h1:CO7EkGyz+jegZ4ap8g5NWRuDHA/56KKvGySR6OBPW+c= git.openprivacy.ca/openprivacy/bine v0.0.4/go.mod h1:13ZqhKyqakDsN/ZkQkIGNULsmLyqtXc46XBcnuXm/mU= -git.openprivacy.ca/openprivacy/connectivity v1.8.2 h1:uCFnrJXsTh3ne4GcgvamoxomQ6fMishD3C2nQGpgdMY= -git.openprivacy.ca/openprivacy/connectivity v1.8.2/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw= git.openprivacy.ca/openprivacy/connectivity v1.8.3 h1:bWM8aQHqHIpobYQcLQ9OsNPoIl+H+4JFWbYGdG0nHlg= git.openprivacy.ca/openprivacy/connectivity v1.8.3/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw= git.openprivacy.ca/openprivacy/log v1.0.2/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw= diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index 70fe120..8ab87dd 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -403,16 +403,24 @@ func (e *engine) peerAuthed(onion string) { e.authorizations.Store(onion, model.AuthUnknown) } - details, err := e.acn.GetInfo(onion) - if err == nil { - if hops, exists := details["circuit"]; exists { - e.eventManager.Publish(event.NewEvent(event.ACNInfo, map[event.Field]string{ - event.Handle: onion, - event.Key: "circuit", - event.Data: hops, - })) - } - } + // FIXME: This call uses WAY too much memory, and was responsible for the vast majority + // of allocations in the UI + // This is because Bine ends up reading the entire response into memory and then passes that back + // into Connectivity which eventually extracts just what it needs. + // Ideally we would just read from the control stream directly into reusable buffers. + + //details, err := e.acn.GetInfo(onion) + //if err == nil { + // if hops, exists := details["circuit"]; exists { + // e.eventManager.Publish(event.NewEvent(event.ACNInfo, map[event.Field]string{ + // event.Handle: onion, + // event.Key: "circuit", + // event.Data: hops, + // })) + // } + //} else { + // log.Errorf("error getting info for onion %v", err) + //} e.eventManager.Publish(event.NewEvent(event.PeerStateChange, map[event.Field]string{ event.RemotePeer: string(onion),