Fix patch status delivery to consoles and downstream FNE replicas. Replaces writePeer with writePeerCommand in writePatchStatusPayload(). Removes a metadata dependency in writePatchStatusReplicationPayload() (#142)

r05a06_dev
Lorenzo L. Romero 3 days ago committed by GitHub
parent c306061e38
commit bc93d41c16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2644,14 +2644,16 @@ bool TrafficNetwork::writePatchStatusPayload(FNEPeerConnection* connection, json
uint8_t buffer[DATA_PACKET_LENGTH];
::memset(buffer, 0x00U, DATA_PACKET_LENGTH);
::memcpy(buffer + 11U, payload.c_str(), len);
// writePeerCommand adds six reserved bytes; keep JSON at wire offset 11.
::memcpy(buffer + 5U, payload.c_str(), len);
if (m_debug) {
LogDebug(LOG_MASTER, "PEER %u (%s) sending patch status registry, len = %u", connection->id(), connection->identWithQualifier().c_str(), len);
}
return m_host->m_mdNetwork->writePeerMetadata(connection, m_peerId,
{ NET_FUNC::TRANSFER, NET_SUBFUNC::TRANSFER_SUBFUNC_PATCH_STATUS }, buffer, len + 11U, RTP_END_OF_CALL_SEQ, createStreamId());
return writePeerCommand(connection->id(),
{ NET_FUNC::TRANSFER, NET_SUBFUNC::TRANSFER_SUBFUNC_PATCH_STATUS },
buffer, len + 5U, createStreamId(), false);
}
/* Helper to serialize and queue a patch status replication payload. */
@ -2662,8 +2664,6 @@ bool TrafficNetwork::writePatchStatusReplicationPayload(FNEPeerConnection* conne
return false;
if (!m_patchStatusEnabled)
return false;
if (m_host->m_mdNetwork == nullptr)
return false;
if (!connection->connected())
return false;
if (connection->peerClass() != PEER_CONN_CLASS_NEIGHBOR || !connection->isReplica())
@ -2687,7 +2687,7 @@ bool TrafficNetwork::writePatchStatusReplicationPayload(FNEPeerConnection* conne
connection->identWithQualifier().c_str(), pkt.fragments.size(), streamId);
if (pkt.fragments.size() > 0U) {
for (auto frag : pkt.fragments) {
m_host->m_mdNetwork->writePeerMetadata(connection, m_peerId, { NET_FUNC::REPL, NET_SUBFUNC::REPL_PATCH_STATUS },
writePeer(connection->id(), m_peerId, { NET_FUNC::REPL, NET_SUBFUNC::REPL_PATCH_STATUS },
frag.second->data, FRAG_SIZE, RTP_END_OF_CALL_SEQ, streamId);
Thread::sleep(60U); // pace block transmission
}

Loading…
Cancel
Save

Powered by TurnKey Linux.