Confirm relay readiness after reconstructing first FEC batch
This commit is contained in:
1 parent
ad20f954c5
commit
60aaa16327
2 files changed
+7
-2
No files matched your search
@@ -1466,7 +1466,7 @@ static void relay_tick(struct stream_network *net, uint64_t now) {
|
||||
if (local.finished && local.last == UINT64_MAX) {
|
||||
memcpy(r->end, local.end, STREAM_END_SIZE);
|
||||
relay_finish(net, r, STREAM_RELAY_ENDED, STREAM_REASON_STOPPED, now);
|
||||
} else {
|
||||
} else if (local.decoded) {
|
||||
uint8_t info[STREAM_INFO_SIZE + STREAM_PATH_MAX * 8] = {0};
|
||||
int available = 0;
|
||||
for (unsigned sub = 0; sub < local.descriptor.n && !available; sub++)
|
||||
@@ -1474,6 +1474,10 @@ static void relay_tick(struct stream_network *net, uint64_t now) {
|
||||
if (available) {
|
||||
r->status = STREAM_RELAY_READY; r->deadline_ms = now + STREAM_RELAY_HANDOFF_MS;
|
||||
r->dirty = r->urgent = 1;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "relay ready after FEC source=%llx peer=%llx id=%llx start=%llu k=%u",
|
||||
(unsigned long long)r->descriptor.source_node_id, (unsigned long long)r->peer,
|
||||
(unsigned long long)r->id, (unsigned long long)local.start,
|
||||
(unsigned)(local.descriptor.n - local.descriptor.r));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1144,13 +1144,14 @@ static void test_supernode_relay(void) {
|
||||
while (relay_data[2] < 3 && get_time_tb() < deadline) test_clock_poll(ua, 100);
|
||||
CHECK(relay_data[2] == 3 && relay_requests_seen && !relay_data[1]);
|
||||
CHECK(get_time_tb() - started < 10000 && relay_race.request_tb - started >= 990);
|
||||
uint64_t connected_ms = (get_time_tb() - started) / 10;
|
||||
test_clock_run_for(ua, 1000); CHECK(relay_race.accepted == 255);
|
||||
CHECK(relay_race.helper_subscribes && !relay_race.source_subscribes);
|
||||
relay_release_info(); test_clock_run_for(ua, 1000);
|
||||
CHECK(!relay_race.source_subscribes && relay_data[2] == 3);
|
||||
relay_race.check_starts = 0;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "[PASS] bootstrap helper wins: elapsed_ms=%llu, n=8 r=2, common_start=%llu, stale direct INFO ignored",
|
||||
(unsigned long long)((get_time_tb() - started) / 10), (unsigned long long)relay_race.start);
|
||||
(unsigned long long)connected_ms, (unsigned long long)relay_race.start);
|
||||
CHECK(stream_local_get(nodes[1], &origin.descriptor, &local) == STREAM_OK && local.relay_only);
|
||||
/* Поздний обычный подписчик также удерживает раздачу, даже без собственного запроса помощи. */
|
||||
CHECK(stream_subscribe_open(nodes[0], GROUP2, nodes[3]->node_id, &viewers[0]) == STREAM_OK);
|
||||
|
||||
Reference in new issue
Block a user