mirror of
https://github.com/nostar/urfd.git
synced 2026-11-08 12:26:46 +00:00
more fixes with interlink
This commit is contained in:
1 parent
385da379cc
commit
b3d2a00533
3 files changed
+6
-7
No files matched your search
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# One line per entry.
|
||||
# Each entry specifies a remote URF to peer with.
|
||||
# If no Port is specified, 17000 will be used.
|
||||
# If no Port is specified, 10017 will be used.
|
||||
# If DHT is enabled and the target is also DHT-enabled, then you only
|
||||
# need to specify the URF-Callsign and the Shared-Modules
|
||||
# format:
|
||||
|
||||
@@ -69,6 +69,8 @@ bool CInterlinkMap::LoadFromFile(const std::string &filename)
|
||||
{
|
||||
CCallsign callsign(token[0]);
|
||||
// read remaining tokens
|
||||
// 1=IP 2=Modules 3=Port Port is optional and defaults to 10017
|
||||
// OR... 1=Modules and the dht will be used
|
||||
for (int i=1; i<4; i++)
|
||||
{
|
||||
token[i] = strtok(nullptr, delim);
|
||||
@@ -85,12 +87,8 @@ bool CInterlinkMap::LoadFromFile(const std::string &filename)
|
||||
std::cout << token[0] << " Port " << port << " is out of range, resetting to 10017." << std::endl;
|
||||
port = 10017;
|
||||
}
|
||||
m_InterlinkMap[token[0]] = CInterlinkMapItem(token[1], token[3], (uint16_t)port);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_InterlinkMap[token[0]] = CInterlinkMapItem(token[1], token[2], (uint16_t)port);
|
||||
}
|
||||
m_InterlinkMap[token[0]] = CInterlinkMapItem(token[1], token[2], (uint16_t)port);
|
||||
}
|
||||
#ifndef NO_DHT
|
||||
else if (token[1])
|
||||
|
||||
@@ -65,6 +65,7 @@ void CURFProtocol::Task(void)
|
||||
if ( Receive4(Buffer, Ip, 20) )
|
||||
#endif
|
||||
{
|
||||
Buffer.Dump("Received buffer");
|
||||
// crack the packet
|
||||
if ( IsValidDvFramePacket(Buffer, Frame) )
|
||||
{
|
||||
@@ -348,7 +349,7 @@ void CURFProtocol::HandlePeerLinks(void)
|
||||
// send connect packet to re-initiate peer link
|
||||
EncodeConnectPacket(&buffer, it->second.GetModules().c_str());
|
||||
Send(buffer, it->second.GetIp(), it->second.GetPort());
|
||||
std::cout << "Sent connect packet to URF peer " << cs << " @ " << it->second.GetIp() << " for modules " << it->second.GetModules() << std::endl;
|
||||
std::cout << "Sent connect packet to URF peer " << cs << " @ " << it->second.GetIp() << " for modules " << it->second.GetModules() << " to port " << it->second.GetPort() << std::endl;
|
||||
#ifndef NO_DHT
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user