|
|
@ -1749,12 +1749,19 @@ namespace transport |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SSU2Session::HandleRouterInfo (const uint8_t * buf, size_t len) |
|
|
|
void SSU2Session::HandleRouterInfo (const uint8_t * buf, size_t len) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (len < 2) return; |
|
|
|
|
|
|
|
// not from SessionConfirmed, we must add it instantly to use in next block
|
|
|
|
|
|
|
|
std::shared_ptr<const i2p::data::RouterInfo> newRi; |
|
|
|
|
|
|
|
if (buf[0] & SSU2_ROUTER_INFO_FLAG_GZIP) // compressed?
|
|
|
|
{ |
|
|
|
{ |
|
|
|
auto ri = ExtractRouterInfo (buf, len); |
|
|
|
auto ri = ExtractRouterInfo (buf, len); |
|
|
|
if (ri) |
|
|
|
if (ri) |
|
|
|
{ |
|
|
|
newRi = i2p::data::netdb.AddRouterInfo (ri->GetBuffer (), ri->GetBufferLen ()); |
|
|
|
// not from SessionConfirmed, we must add it instantly to use in next block
|
|
|
|
} |
|
|
|
auto newRi = i2p::data::netdb.AddRouterInfo (ri->GetBuffer (), ri->GetBufferLen ()); // TODO: add ri
|
|
|
|
else // use buffer directly. TODO: handle frag
|
|
|
|
|
|
|
|
newRi = i2p::data::netdb.AddRouterInfo (buf + 2, len - 2); |
|
|
|
|
|
|
|
|
|
|
|
if (newRi) |
|
|
|
if (newRi) |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto remoteIdentity = GetRemoteIdentity (); |
|
|
|
auto remoteIdentity = GetRemoteIdentity (); |
|
|
@ -1772,7 +1779,6 @@ namespace transport |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SSU2Session::HandleAck (const uint8_t * buf, size_t len) |
|
|
|
void SSU2Session::HandleAck (const uint8_t * buf, size_t len) |
|
|
|
{ |
|
|
|
{ |
|
|
|