ssb: Don't send EBT clocks that weren't asked for. Fixes more replication-related warnings.
Some checks failed
Build Tilde Friends / Build-All (push) Failing after 2m36s

This commit is contained in:
Cory McWilliams 2025-03-04 12:19:52 -05:00
parent 7a79534ca8
commit ee33f54745

View File

@ -1040,6 +1040,12 @@ static void _tf_ssb_rpc_createHistoryStream(
static void _tf_ssb_rpc_ebt_replicate_send_messages(tf_ssb_connection_t* connection) static void _tf_ssb_rpc_ebt_replicate_send_messages(tf_ssb_connection_t* connection)
{ {
int32_t request_number = tf_ssb_connection_get_ebt_request_number(connection);
if (!request_number)
{
return;
}
tf_ssb_ebt_t* ebt = tf_ssb_connection_get_ebt(connection); tf_ssb_ebt_t* ebt = tf_ssb_connection_get_ebt(connection);
tf_ssb_ebt_clock_t* clock = tf_ssb_ebt_get_messages_to_send(ebt); tf_ssb_ebt_clock_t* clock = tf_ssb_ebt_get_messages_to_send(ebt);
if (clock) if (clock)
@ -1047,7 +1053,6 @@ static void _tf_ssb_rpc_ebt_replicate_send_messages(tf_ssb_connection_t* connect
for (int i = 0; i < clock->count; i++) for (int i = 0; i < clock->count; i++)
{ {
tf_ssb_ebt_clock_entry_t* entry = &clock->entries[i]; tf_ssb_ebt_clock_entry_t* entry = &clock->entries[i];
int32_t request_number = tf_ssb_connection_get_ebt_request_number(connection);
bool live = (tf_ssb_connection_get_flags(connection) & k_tf_ssb_connect_flag_one_shot) == 0; bool live = (tf_ssb_connection_get_flags(connection) & k_tf_ssb_connect_flag_one_shot) == 0;
_tf_ssb_connection_send_history_stream(connection, request_number, entry->id, entry->value, false, live, false); _tf_ssb_connection_send_history_stream(connection, request_number, entry->id, entry->value, false, live, false);
} }
@ -1119,8 +1124,9 @@ static void _tf_ssb_rpc_ebt_schedule_send_clock(tf_ssb_connection_t* connection)
{ {
tf_ssb_ebt_t* ebt = tf_ssb_connection_get_ebt(connection); tf_ssb_ebt_t* ebt = tf_ssb_connection_get_ebt(connection);
int pending = tf_ssb_ebt_get_send_clock_pending(ebt) + 1; int pending = tf_ssb_ebt_get_send_clock_pending(ebt) + 1;
int32_t request_number = tf_ssb_connection_get_ebt_request_number(connection);
tf_ssb_ebt_set_send_clock_pending(ebt, pending); tf_ssb_ebt_set_send_clock_pending(ebt, pending);
if (pending == 1) if (pending == 1 && request_number)
{ {
resend_clock_t* resend = tf_malloc(sizeof(resend_clock_t)); resend_clock_t* resend = tf_malloc(sizeof(resend_clock_t));
*resend = (resend_clock_t) { *resend = (resend_clock_t) {