mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-07-01 10:14:36 +02:00
send actual version in SetDate
This commit is contained in:
parent
31b6f07b78
commit
0445a5d775
1 changed files with 6 additions and 9 deletions
|
@ -624,17 +624,14 @@ namespace client
|
||||||
|
|
||||||
void I2CPSession::GetDateMessageHandler (const uint8_t * buf, size_t len)
|
void I2CPSession::GetDateMessageHandler (const uint8_t * buf, size_t len)
|
||||||
{
|
{
|
||||||
// get version
|
constexpr std::string_view version(I2P_VERSION);
|
||||||
auto version = ExtractString (buf, len);
|
std::array<uint8_t, version.size() + 8> payload;
|
||||||
auto l = version.length () + 1 + 8;
|
|
||||||
uint8_t * payload = new uint8_t[l];
|
|
||||||
// set date
|
// set date
|
||||||
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
||||||
htobe64buf (payload, ts);
|
htobe64buf (payload.data(), ts);
|
||||||
// echo vesrion back
|
// send our version back
|
||||||
PutString (payload + 8, l - 8, version);
|
PutString (payload.data() + 8, payload.size() - 8, version);
|
||||||
SendI2CPMessage (I2CP_SET_DATE_MESSAGE, payload, l);
|
SendI2CPMessage (I2CP_SET_DATE_MESSAGE, payload.data(), payload.size());
|
||||||
delete[] payload;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2CPSession::CreateSessionMessageHandler (const uint8_t * buf, size_t len)
|
void I2CPSession::CreateSessionMessageHandler (const uint8_t * buf, size_t len)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue