session: clear prefix on lookup

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2018-02-23 10:52:55 -08:00
parent cd110f6b10
commit b7424f41fd
1 changed files with 6 additions and 0 deletions

View File

@ -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()