mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
publish introducer cap for SSU2 address
This commit is contained in:
parent
40340cf9c2
commit
78b1afcc8c
|
@ -338,6 +338,10 @@ namespace i2p
|
|||
{
|
||||
address->port = port;
|
||||
address->published = publish;
|
||||
if (publish)
|
||||
address->caps |= i2p::data::RouterInfo::eSSUIntroducer;
|
||||
else
|
||||
address->caps &= ~i2p::data::RouterInfo::eSSUIntroducer;
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1205,17 +1205,23 @@ namespace data
|
|||
else if (address.transportStyle == eTransportSSU2)
|
||||
{
|
||||
WriteString ("SSU2", s);
|
||||
// caps
|
||||
std::string caps;
|
||||
if (address.published)
|
||||
{
|
||||
isPublished = true;
|
||||
if (address.IsIntroducer ()) caps += CAPS_FLAG_SSU_INTRODUCER;
|
||||
}
|
||||
else
|
||||
{
|
||||
// caps
|
||||
WriteString ("caps", properties);
|
||||
properties << '=';
|
||||
std::string caps;
|
||||
if (address.IsV4 ()) caps += CAPS_FLAG_V4;
|
||||
if (address.IsV6 ()) caps += CAPS_FLAG_V6;
|
||||
if (caps.empty ()) caps += CAPS_FLAG_V4;
|
||||
}
|
||||
if (!caps.empty ())
|
||||
{
|
||||
WriteString ("caps", properties);
|
||||
properties << '=';
|
||||
WriteString (caps, properties);
|
||||
properties << ';';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue