|
|
@ -1282,13 +1282,20 @@ namespace transport |
|
|
|
uint64_t connID; |
|
|
|
uint64_t connID; |
|
|
|
memcpy (&connID, buf, 8); |
|
|
|
memcpy (&connID, buf, 8); |
|
|
|
connID ^= CreateHeaderMask (i2p::context.GetSSU2IntroKey (), buf + (len - 24)); |
|
|
|
connID ^= CreateHeaderMask (i2p::context.GetSSU2IntroKey (), buf + (len - 24)); |
|
|
|
auto it = m_Sessions.find (connID); |
|
|
|
if (!m_LastSession || m_LastSession->GetConnID () != connID) |
|
|
|
if (it != m_Sessions.end ()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (it->second->IsEstablished ()) |
|
|
|
auto it = m_Sessions.find (connID); |
|
|
|
it->second->ProcessData (buf, len); |
|
|
|
if (it != m_Sessions.end ()) |
|
|
|
|
|
|
|
m_LastSession = it->second; |
|
|
|
else |
|
|
|
else |
|
|
|
it->second->ProcessSessionConfirmed (buf, len); |
|
|
|
m_LastSession = nullptr; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (m_LastSession) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (m_LastSession->IsEstablished ()) |
|
|
|
|
|
|
|
m_LastSession->ProcessData (buf, len); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
m_LastSession->ProcessSessionConfirmed (buf, len); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1388,6 +1395,8 @@ namespace transport |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (it->second->IsEstablished ()) |
|
|
|
if (it->second->IsEstablished ()) |
|
|
|
it->second->TerminateByTimeout (); |
|
|
|
it->second->TerminateByTimeout (); |
|
|
|
|
|
|
|
if (it->second == m_LastSession) |
|
|
|
|
|
|
|
m_LastSession = nullptr; |
|
|
|
it = m_Sessions.erase (it); |
|
|
|
it = m_Sessions.erase (it); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|