Browse Source

don't save RouterInfo buffer if invalid

pull/1879/head
orignal 1 year ago
parent
commit
88f19f551d
  1. 6
      libi2pd/RouterInfo.cpp

6
libi2pd/RouterInfo.cpp

@ -99,13 +99,13 @@ namespace data @@ -99,13 +99,13 @@ namespace data
m_Caps = 0;
// don't clean up m_Addresses, it will be replaced in ReadFromStream
ClearProperties ();
// copy buffer
UpdateBuffer (buf, len);
// skip identity
size_t identityLen = m_RouterIdentity->GetFullLen ();
// read new RI
std::stringstream str (std::string ((char *)m_Buffer->data () + identityLen, m_BufferLen - identityLen));
std::stringstream str (std::string ((char *)buf + identityLen, len - identityLen));
ReadFromStream (str);
if (!m_IsUnreachable)
UpdateBuffer (buf, len); // save buffer
// don't delete buffer until saved to the file
}
else

Loading…
Cancel
Save