mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
correct caps for SSU address without host
This commit is contained in:
parent
876973f071
commit
fa5e4d57fd
|
@ -522,7 +522,7 @@ namespace data
|
||||||
if (address.IsNTCP2 ())
|
if (address.IsNTCP2 ())
|
||||||
{
|
{
|
||||||
WriteString ("NTCP2", s);
|
WriteString ("NTCP2", s);
|
||||||
if (address.IsPublishedNTCP2 ())
|
if (address.IsPublishedNTCP2 () && !address.host.is_unspecified ())
|
||||||
isPublished = true;
|
isPublished = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -546,12 +546,23 @@ namespace data
|
||||||
WriteString ("caps", properties);
|
WriteString ("caps", properties);
|
||||||
properties << '=';
|
properties << '=';
|
||||||
std::string caps;
|
std::string caps;
|
||||||
if (address.IsPeerTesting ()) caps += CAPS_FLAG_SSU_TESTING;
|
if (address.host.is_v4 ())
|
||||||
if (address.IsIntroducer ()) caps += CAPS_FLAG_SSU_INTRODUCER;
|
{
|
||||||
if (IsReachable ())
|
if (IsReachable ())
|
||||||
|
isPublished = true;
|
||||||
|
else
|
||||||
|
caps += CAPS_FLAG_V4;
|
||||||
|
}
|
||||||
|
else if (address.host.is_v6 ())
|
||||||
isPublished = true;
|
isPublished = true;
|
||||||
else
|
else
|
||||||
caps += CAPS_FLAG_V4;
|
{
|
||||||
|
if (address.caps & AddressCaps::eV4) caps += CAPS_FLAG_V4;
|
||||||
|
if (address.caps & AddressCaps::eV6) caps += CAPS_FLAG_V6;
|
||||||
|
if (caps.empty ()) caps += CAPS_FLAG_V4;
|
||||||
|
}
|
||||||
|
if (address.IsPeerTesting ()) caps += CAPS_FLAG_SSU_TESTING;
|
||||||
|
if (address.IsIntroducer ()) caps += CAPS_FLAG_SSU_INTRODUCER;
|
||||||
WriteString (caps, properties);
|
WriteString (caps, properties);
|
||||||
properties << ';';
|
properties << ';';
|
||||||
}
|
}
|
||||||
|
@ -640,7 +651,7 @@ namespace data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (address.IsPublishedNTCP2 ())
|
if (address.IsNTCP2 () && isPublished)
|
||||||
{
|
{
|
||||||
// publish i for NTCP2
|
// publish i for NTCP2
|
||||||
WriteString ("i", properties); properties << '=';
|
WriteString ("i", properties); properties << '=';
|
||||||
|
|
Loading…
Reference in a new issue