|
|
@ -219,16 +219,23 @@ namespace transport |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (m_State == eSSU2SessionStateIntroduced) |
|
|
|
if (m_State == eSSU2SessionStateIntroduced) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// create new connID
|
|
|
|
// we are Alice
|
|
|
|
uint64_t oldConnID = GetConnID (); |
|
|
|
// keep ConnIDs used for introduction, because Charlie waits for SessionRequest from us
|
|
|
|
RAND_bytes ((uint8_t *)&m_DestConnID, 8); |
|
|
|
|
|
|
|
RAND_bytes ((uint8_t *)&m_SourceConnID, 8); |
|
|
|
|
|
|
|
// connect
|
|
|
|
|
|
|
|
m_State = eSSU2SessionStateTokenReceived; |
|
|
|
m_State = eSSU2SessionStateTokenReceived; |
|
|
|
m_Server.AddPendingOutgoingSession (shared_from_this ()); |
|
|
|
// move session to pending outgoing
|
|
|
|
m_Server.RequestRemoveSession (oldConnID); |
|
|
|
if (m_Server.AddPendingOutgoingSession (shared_from_this ())) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
m_Server.RemoveSession (GetConnID ()); |
|
|
|
|
|
|
|
// connect
|
|
|
|
|
|
|
|
LogPrint (eLogDebug, "SSU2: Connecting after introduction to ", GetIdentHashBase64()); |
|
|
|
Connect (); |
|
|
|
Connect (); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrint (eLogError, "SSU2: Session ", GetConnID (), " is already pending"); |
|
|
|
|
|
|
|
m_Server.RequestRemoveSession (GetConnID ()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SSU2Session::SendPeerTest () |
|
|
|
void SSU2Session::SendPeerTest () |
|
|
|