Closed dnastrain closed 5 years ago
@dnastrain
Thanks for reporting.
The issue is with the return value of srt->Read(…)
. It actually returns true
/false
, while I was expecting it to return the number of bytes actually read (like srt_recv(s, buf.data(), ::g_buffer_size);
, that was previously used instead. Issue introduced by PR #598.
n = src->Read(cfg.chunk_size, buf, out_stats);
if (n == SRT_ERROR)
{
cerr << "Download: SRT error: " << srt_getlasterror_str() << endl;
goto exit;
}
if (n == 0)
{
result = true;
cerr << "Download COMPLETE.";
break;
}
Is there a way to catch problems like this in future using CI?
Cool question! :) I am writing a python script that starts two subprocesses of srt-*-transmit, transmits generated data on a local host, and validates the data received. I hope it will work correctly in CI.
@zerodefect Drafted a PR #663. Feel free to contribute.
Brilliant! Been on leave for a number of days, but this looks very promising and a welcome addition!
Issue seems to coincide with commit 9e48f03 about 6 days ago, that
srt-file-transmit
no longer works correctly.Running both Source and Target sides with "-v" reveals data loss -- Source sending 1316 bytes per chunk sent, and the Target receiving 1 byte per chunk sent.
Source-side: sends a file size 134,232 bytes input3.txt
Target-side: receives file size 100 bytes output3.txt
@Howlowck also observed this behavior -- we've reproduced on both Linux and Windows builds this week.