Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove openvpn session manager #377

Merged

Conversation

Projects
None yet
4 participants
@Waldz
Copy link
Member

commented Sep 17, 2018

Updates #382

@Waldz Waldz requested review from tadovas, zolia, vkuznecovas, mysteriumnetwork/core and soffokl Sep 17, 2018

@@ -45,7 +45,7 @@ func (manager *MockSessionManager) Create(peerID identity.Identity) (sessionInst
return session.Session{}, nil
}

// FindSession returns mocked session
// FindClientSession returns mocked session
func (manager *MockSessionManager) FindSession(sessionID session.SessionID) (session.Session, bool) {

This comment has been minimized.

Copy link
@soffokl

soffokl Sep 18, 2018

Member

Comment and function name does not match.

This comment has been minimized.

Copy link
@Waldz

Waldz Sep 18, 2018

Author Member

Fixed

@@ -58,7 +58,7 @@ func (manager *manager) Create(peerID identity.Identity) (sessionInstance Sessio
return sessionInstance, nil
}

// FindSession returns underlying session instance
// FindClientSession returns underlying session instance

This comment has been minimized.

Copy link
@soffokl

soffokl Sep 18, 2018

Member

Comment and function name does not match.

This comment has been minimized.

Copy link
@Waldz

Waldz Sep 18, 2018

Author Member

Fixed

@@ -35,7 +35,7 @@ func (manager *ManagerFake) Create(peerID identity.Identity) (Session, error) {
return Session{"new-id", fakeConfig, peerID}, nil
}

// FindSession always returns empty session and signals that session is not found
// FindClientSession always returns empty session and signals that session is not found

This comment has been minimized.

Copy link
@soffokl

soffokl Sep 18, 2018

Member

Comment and function name does not match.

This comment has been minimized.

Copy link
@Waldz

Waldz Sep 18, 2018

Author Member

Fixed

Waldz added some commits Sep 17, 2018

@Waldz Waldz force-pushed the Waldz:feature/remove-openvpn-session-manager branch from 50bb68d to 86c8859 Sep 18, 2018


// FindClientSession returns OpenVPN session instance by given session id
func (cm *clientMap) FindClientSession(clientID int, id session.SessionID) (session.Session, bool, error) {
sessionInstance, foundSession := cm.sessionManager.FindSession(id)

This comment has been minimized.

Copy link
@vkuznecovas

vkuznecovas Sep 18, 2018

Contributor

rename "foundSession" to "sessionExists"

This comment has been minimized.

Copy link
@Waldz

Waldz Sep 18, 2018

Author Member

Renamed

return session.Session{}, false, errors.New("no underlying session exists, possible break-in attempt")
}

sessionClientID, clientIDFound := cm.sessionClientIDs[id]

This comment has been minimized.

Copy link
@vkuznecovas

vkuznecovas Sep 18, 2018

Contributor

Decide on either clientIDFound or foundClientID, not both.

This comment has been minimized.

Copy link
@Waldz

Waldz Sep 18, 2018

Author Member

Renamed

cm.sessionMapLock.Lock()
defer cm.sessionMapLock.Unlock()

_, foundClientID := cm.sessionClientIDs[id]

This comment has been minimized.

Copy link
@vkuznecovas

vkuznecovas Sep 18, 2018

Contributor

Decide on either clientIDFound or foundClientID, not both.

This comment has been minimized.

Copy link
@Waldz

Waldz Sep 18, 2018

Author Member

Renamed

@tadovas
Copy link
Member

left a comment

LGTM

@Waldz Waldz merged commit 1101096 into mysteriumnetwork:master Sep 18, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Waldz Waldz deleted the Waldz:feature/remove-openvpn-session-manager branch Sep 18, 2018

@Waldz Waldz referenced this pull request Sep 19, 2018

Closed

Make Openvpn plugable transport #382

10 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.