From b7424f41fdf60b178c5227abdd54cb615161123d Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Fri, 23 Feb 2018 10:52:55 -0800 Subject: [PATCH] session: clear prefix on lookup Signed-off-by: Tonis Tiigi --- session/manager.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/session/manager.go b/session/manager.go index af779db5..f401c7fb 100644 --- a/session/manager.go +++ b/session/manager.go @@ -150,6 +150,12 @@ func (sm *Manager) handleConn(ctx context.Context, conn net.Conn, opts map[strin // Get returns a session by ID func (sm *Manager) Get(ctx context.Context, id string) (Caller, error) { + // session prefix is used to identify vertexes with different contexts so + // they would not collide, but for lookup we don't need the prefix + if p := strings.SplitN(id, ":", 2); len(p) == 2 && len(p[1]) > 0 { + id = p[1] + } + ctx, cancel := context.WithCancel(ctx) defer cancel()