| 213 | } |
| 214 | |
| 215 | void SSU2Session::ConnectAfterIntroduction () |
| 216 | { |
| 217 | if (m_State == eSSU2SessionStateIntroduced) |
| 218 | { |
| 219 | // we are Alice |
| 220 | // keep ConnIDs used for introduction, because Charlie waits for SessionRequest from us |
| 221 | m_State = eSSU2SessionStateTokenReceived; |
| 222 | // move session to pending outgoing |
| 223 | if (m_Server.AddPendingOutgoingSession (shared_from_this ())) |
| 224 | { |
| 225 | m_Server.RemoveSession (GetConnID ()); |
| 226 | // update endpoint in profile because we know it now |
| 227 | auto identity = GetRemoteIdentity (); |
| 228 | if (identity) |
| 229 | { |
| 230 | auto profile = i2p::data::GetRouterProfile (identity->GetIdentHash ()); |
| 231 | if (profile) profile->SetLastEndpoint (m_RemoteEndpoint); |
| 232 | } |
| 233 | // connect |
| 234 | LogPrint (eLogDebug, "SSU2: Connecting after introduction to ", GetIdentHashBase64()); |
| 235 | Connect (); |
| 236 | } |
| 237 | else |
| 238 | { |
| 239 | LogPrint (eLogError, "SSU2: Session ", GetConnID (), " is already pending"); |
| 240 | m_Server.RequestRemoveSession (GetConnID ()); |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | void SSU2Session::SendPeerTest () |
| 246 | { |
no test coverage detected