Browse Source

handle iexp

pull/883/head
orignal 8 years ago
parent
commit
a4e6d8120b
  1. 14
      libi2pd/RouterInfo.cpp
  2. 2
      libi2pd/RouterInfo.h

14
libi2pd/RouterInfo.cpp

@ -264,6 +264,8 @@ namespace data @@ -264,6 +264,8 @@ namespace data
introducer.iTag = boost::lexical_cast<uint32_t>(value);
else if (!strcmp (key, "ikey"))
Base64ToByteStream (value, strlen (value), introducer.iKey, 32);
else if (!strcmp (key, "iexp"))
introducer.iExp = boost::lexical_cast<uint32_t>(value);
}
if (!s) return;
}
@ -478,6 +480,18 @@ namespace data @@ -478,6 +480,18 @@ namespace data
properties << ';';
i++;
}
i = 0;
for (const auto& introducer: address.ssu->introducers)
{
if (introducer.iExp) // expiration is specified
{
WriteString ("iexp" + boost::lexical_cast<std::string>(i), properties);
properties << '=';
WriteString (boost::lexical_cast<std::string>(introducer.iExp), properties);
properties << ';';
}
i++;
}
}
// write intro key
WriteString ("key", properties);

2
libi2pd/RouterInfo.h

@ -73,10 +73,12 @@ namespace data @@ -73,10 +73,12 @@ namespace data
typedef Tag<32> IntroKey; // should be castable to MacKey and AESKey
struct Introducer
{
Introducer (): iExp (0) {};
boost::asio::ip::address iHost;
int iPort;
IntroKey iKey;
uint32_t iTag;
uint32_t iExp;
};
struct SSUExt

Loading…
Cancel
Save