Refresh matching active path RTT through probes and isolate integration event counters

This commit is contained in:
evgeny committed 2026-10-12 00:01:39 +02:00
1 parent 7db3008e5c
commit 2d9616eca5
2 files changed
+14

No files matched your search

+11
View File
@@ -736,6 +736,15 @@ static void dispatch(struct stream_network *net, uint64_t sender, const uint8_t
p->other_epoch = m.sender_epoch; f->info_ready = f->info.info_ready = 1; peer_schedule(p);
uint64_t rtt = get_time_tb() / 10 - f->probe_sent_ms;
f->info.rtt_valid = f->probe_sent_ms != 0; f->info.rtt_ms = rtt > UINT32_MAX ? UINT32_MAX : (uint32_t)rtt;
for (struct STREAM_RECEIVE *active = p->flows; active; active = active->next) {
if (active == f || !active->outgoing || active->info.probe_only || active->info.state != STREAM_RECEIVE_ACTIVE
|| active->subblock != f->subblock || !same_stream(&active->descriptor, &f->descriptor)
|| active->info.path.count != f->info.path.count
|| memcmp(active->info.path.nodes, f->info.path.nodes, f->info.path.count * sizeof(uint64_t))) continue;
active->info.rtt_ms = f->info.rtt_ms; active->info.rtt_valid = f->info.rtt_valid;
active->info.path_rtt_ms = f->info.path_rtt_ms; active->info.path_rtt_valid = f->info.path_rtt_valid;
active->info.info_ms = f->info.info_ms;
}
} else flow_close(f, STREAM_REASON_PROTOCOL, 0);
} else if (m.command == STREAM_CMD_SUBSCRIBE) {
if (!authorized(net, sender, &m, &local)) {
@@ -766,6 +775,8 @@ static void dispatch(struct stream_network *net, uint64_t sender, const uint8_t
if (result == STREAM_OK || result == STREAM_DUPLICATE || result == STREAM_EXPIRED) {
stream_metrics_observe(&f->metrics, seq, (uint16_t)stream_read_be(block + STREAM_BLOCK_TIMESTAMP_OFF, 2),
block[STREAM_BLOCK_FLAGS_OFF], (uint32_t)stream_block_size(&f->descriptor), get_time_tb() / 10);
if (f->info.path.count != path.count || memcmp(f->info.path.nodes, path.nodes, path.count * sizeof(uint64_t)))
f->info.path_rtt_valid = 0;
f->info.next = seq + 1; f->info.blocks++; f->info.path = path; f->deadline = get_time_tb() + STREAM_LEASE_TB;
} else flow_close(f, STREAM_REASON_PROTOCOL, 1);
}