remove deprecated options; ensure we check if a peer is enabled on the FNE before attempting to read/write to it; silence BUGBUG UDP write message;

pull/55/head
Bryan Biedenkapp 2 years ago
parent ce9534b81f
commit 70600d3fd7

@ -114,10 +114,6 @@ peers:
- name: EXAMPLEPEER
# Flag indicating whether or not the peer is enabled.
enabled: true
# Hostname/IP address to listen on (blank for all).
address: 127.0.0.1
# Port number to listen on.
port: 32091
# Hostname/IP address of the FNE master to connect to.
masterAddress: 127.0.0.1
# Port number of the FNE master to connect to.

@ -295,7 +295,7 @@ bool Socket::write(const uint8_t* buffer, uint32_t length, const sockaddr_storag
*lenWritten = -1;
}
LogError(LOG_NET, "tried to write datagram with no file descriptor? this shouldn't happen BUGBUG");
//LogError(LOG_NET, "tried to write datagram with no file descriptor? this shouldn't happen BUGBUG");
return false;
}

@ -237,6 +237,11 @@ int HostFNE::run()
if (peerNetwork != nullptr) {
peerNetwork->clock(ms);
// skip peer if it isn't enabled
if (!peerNetwork->isEnabled()) {
continue;
}
// process peer network traffic
processPeer(peerNetwork);
}

@ -304,6 +304,11 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
continue;
}
// skip peer if it isn't enabled
if (!peer.second->isEnabled()) {
continue;
}
uint8_t outboundPeerBuffer[len];
::memset(outboundPeerBuffer, 0x00U, len);
::memcpy(outboundPeerBuffer, buffer, len);

@ -269,6 +269,11 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
continue;
}
// skip peer if it isn't enabled
if (!peer.second->isEnabled()) {
continue;
}
uint8_t outboundPeerBuffer[len];
::memset(outboundPeerBuffer, 0x00U, len);
::memcpy(outboundPeerBuffer, buffer, len);

@ -337,6 +337,11 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
continue;
}
// skip peer if it isn't enabled
if (!peer.second->isEnabled()) {
continue;
}
uint8_t outboundPeerBuffer[len];
::memset(outboundPeerBuffer, 0x00U, len);
::memcpy(outboundPeerBuffer, buffer, len);

@ -66,6 +66,8 @@ namespace network
/// <summary>Closes connection to the network.</summary>
void close() override;
/// <summary>Flat indicating if this network connection enabled.</summary>
bool isEnabled() const { return m_enabled; }
/// <summary>Sets flag enabling network communication.</summary>
void enable(bool enabled);

Loading…
Cancel
Save

Powered by TurnKey Linux.