Browse Source

proper update of own RouterInfo

pull/93/head
orignal 11 years ago
parent
commit
1fc41e2fa9
  1. 2
      RouterContext.cpp
  2. 2
      RouterInfo.cpp

2
RouterContext.cpp

@ -40,7 +40,7 @@ namespace i2p
routerInfo.SetProperty ("start_uptime", "90m"); routerInfo.SetProperty ("start_uptime", "90m");
routerInfo.CreateBuffer (); routerInfo.CreateBuffer ();
m_RouterInfo = routerInfo; m_RouterInfo.Update (routerInfo.GetBuffer (), routerInfo.GetBufferLen ());
} }
void RouterContext::OverrideNTCPAddress (const char * host, int port) void RouterContext::OverrideNTCPAddress (const char * host, int port)

2
RouterInfo.cpp

@ -340,6 +340,8 @@ namespace data
std::stringstream s; std::stringstream s;
WriteToStream (s); WriteToStream (s);
m_BufferLen = s.str ().size (); m_BufferLen = s.str ().size ();
if (!m_Buffer)
m_Buffer = new uint8_t[MAX_RI_BUFFER_SIZE];
memcpy (m_Buffer, s.str ().c_str (), m_BufferLen); memcpy (m_Buffer, s.str ().c_str (), m_BufferLen);
// signature // signature
i2p::context.Sign ((uint8_t *)m_Buffer, m_BufferLen, (uint8_t *)m_Buffer + m_BufferLen); i2p::context.Sign ((uint8_t *)m_Buffer, m_BufferLen, (uint8_t *)m_Buffer + m_BufferLen);

Loading…
Cancel
Save