media_delivery: fix SUPER_REPL spam + streaming verification
Bugs fixed: - md_super_peer_add: timeout_tb = 0 → MEDIA_REPL_TIMEOUT_TB (timer fired every poll) - md_repl_retrans_cb: md from peer->connect_timer (garbage) → peer->md - md_repl_retrans_cb: removed inflight_count=0 reset (don't resend acked entries) - stream_ctx: removed unused block_data field (was NULL, caused crash in BLOCK_DONE) Test improvements: - stream_completed flag for reliable streaming verification - File created in <db_dir>/media/ (matches media_index path logic) - 9/9 full test, 33/33 total
This commit is contained in:
1 parent
b4824de3b8
commit
efbb495016
3 files changed
+10
-9
No files matched your search
@@ -235,17 +235,15 @@ static void phase_b1_file_transfer(void) {
|
||||
}
|
||||
|
||||
TEST("n2→n1 BLOCK_REQ streams data"); {
|
||||
fflush(stdout);
|
||||
debug_set_level(DEBUG_LEVEL_TRACE);
|
||||
struct media_pkt_block_req req; memset(&req, 0, sizeof(req));
|
||||
req.subcmd = MEDIA_SUBCMD_BLOCK_REQ;
|
||||
memcpy(req.media_id, g_test_mid, 16); memcpy(req.block_id, g_test_bid0, 16);
|
||||
req.chunk = 0;
|
||||
g_inst[0]->md.stream_completed = 0;
|
||||
msend(g_inst[1], g_nid[0], (const uint8_t*)&req, sizeof(req));
|
||||
int a = 0, stream_was_active = 0;
|
||||
while (a < 500) { uasync_poll(g_ua, POLL_MS); if (g_inst[0]->md.active_streams >= 1) stream_was_active = 1; a++; }
|
||||
debug_set_level(DEBUG_LEVEL_ERROR);
|
||||
if (stream_was_active) OK(); else FAIL("active_streams=%d after %dms", g_inst[0]->md.active_streams, 500 * POLL_MS);
|
||||
int a = 0;
|
||||
while (a < 2000 && !g_inst[0]->md.stream_completed) { uasync_poll(g_ua, POLL_MS); a++; }
|
||||
if (g_inst[0]->md.stream_completed) OK(); else FAIL("stream not completed after %dms", 2000 * POLL_MS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user