Browse Source

don't publish intrducers with zero tag

pull/1960/head
orignal 1 year ago
parent
commit
8447822c35
  1. 3
      libi2pd/RouterInfo.cpp
  2. 2
      libi2pd/SSU2.cpp

3
libi2pd/RouterInfo.cpp

@ -1321,6 +1321,7 @@ namespace data @@ -1321,6 +1321,7 @@ namespace data
int i = 0;
for (const auto& introducer: address.ssu->introducers)
{
if (!introducer.iTag) continue;
if (introducer.iExp) // expiration is specified
{
WriteString ("iexp" + boost::lexical_cast<std::string>(i), properties);
@ -1333,6 +1334,7 @@ namespace data @@ -1333,6 +1334,7 @@ namespace data
i = 0;
for (const auto& introducer: address.ssu->introducers)
{
if (!introducer.iTag) continue;
WriteString ("ih" + boost::lexical_cast<std::string>(i), properties);
properties << '=';
char value[64];
@ -1345,6 +1347,7 @@ namespace data @@ -1345,6 +1347,7 @@ namespace data
i = 0;
for (const auto& introducer: address.ssu->introducers)
{
if (!introducer.iTag) continue;
WriteString ("itag" + boost::lexical_cast<std::string>(i), properties);
properties << '=';
WriteString (boost::lexical_cast<std::string>(introducer.iTag), properties);

2
libi2pd/SSU2.cpp

@ -995,7 +995,7 @@ namespace transport @@ -995,7 +995,7 @@ namespace transport
session = it1->second;
excluded.insert (it);
}
if (session && session->IsEstablished ())
if (session && session->IsEstablished () && session->GetRelayTag () && session->IsOutgoing ()) // still session with introducer?
{
if (ts < session->GetCreationTime () + SSU2_TO_INTRODUCER_SESSION_EXPIRATION)
{

Loading…
Cancel
Save