mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-28 11:44:16 +00:00
allow versions 2,3,4,5 in v param of address
This commit is contained in:
@@ -307,13 +307,16 @@ namespace data
|
||||
}
|
||||
else if (key == "v")
|
||||
{
|
||||
if (value == "2")
|
||||
if (value.size () == 1 && value[0] >= '2' && value[0] <= '5') // only 2,3,4,5 allowed
|
||||
{
|
||||
address->v = value[0] - '0';
|
||||
isV2 = true;
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
LogPrint (eLogWarning, "RouterInfo: Unexpected value ", value, " for v");
|
||||
address->transportStyle = eTransportUnknown; // invalid address
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (key[0] == 'i')
|
||||
{
|
||||
@@ -1437,7 +1440,7 @@ namespace data
|
||||
WriteString ("s", properties); properties << '=';
|
||||
WriteString (address.s.ToBase64 (), properties); properties << ';';
|
||||
WriteString ("v", properties); properties << '=';
|
||||
WriteString ("2", properties); properties << ';';
|
||||
WriteString (std::to_string(address.v), properties); properties << ';';
|
||||
}
|
||||
|
||||
uint16_t size = htobe16 (properties.str ().size ());
|
||||
|
||||
@@ -151,6 +151,7 @@ namespace data
|
||||
TransportStyle transportStyle;
|
||||
boost::asio::ip::address host;
|
||||
Tag<32> s, i; // keys, i is first 16 bytes for NTCP2 and 32 bytes intro key for SSU
|
||||
int v = 2; // version
|
||||
int port;
|
||||
uint64_t date;
|
||||
uint8_t caps;
|
||||
|
||||
Reference in New Issue
Block a user