func (r *sessionRegistry) PartyForConnection(sconn *ssh.ServerConn) *party {
	r.Lock()
	defer r.Unlock()

	for _, session := range r.sessions {
		session.Lock()
		defer session.Unlock()
		parties := session.parties
		for _, party := range parties {
			if party.sconn == sconn {
				return party
			}
		}
	}
	return nil
}
// PartyForConnection finds an existing party which owns the given connection
PartyForConnection finds an existing party which owns the given connection
// PartyForConnection finds an existing party which owns the given connection
func (r *sessionRegistry) PartyForConnection(sconn *ssh.ServerConn) *party {
	r.Lock()
	defer r.Unlock()
	for _, session := range r.sessions {
		session.Lock()
		defer session.Unlock()
		parties := session.parties
		for _, party := range parties {
			if party.sconn == sconn {
				return party
			}
		}
	}
	return nil
}
func ( r * sessionRegistry ) PartyForConnection ( sconn * ssh . ServerConn ) * party { r . Lock ( ) defer r . Unlock ( ) for _ , session := range r . sessions { session . Lock ( ) defer session . Unlock ( ) parties := session . parties for _ , party := range parties { if party . sconn == sconn { return party } } } return nil }
PartyForConnection finds an existing party which owns the given connection
PartyForConnection finds an existing party which owns the given connection