Commit cfc0f60
fix(rtmp): chunk decoder multi-chunk reassembly and MSRV compat
The chunk decoder's decode_message() returned Ok(None) after decoding
each individual chunk of a multi-chunk message, causing the caller's
while-let loop to exit before continuation chunks were processed.
When the server sent messages exceeding 128 bytes (the default chunk
size) — such as YouTube's _result response to the connect command
(~191 bytes, split into two chunks) — the second chunk was stranded
in the decoder buffer, the _result was never processed, and the
connection timed out.
Fix: wrap decode_message() in an internal loop that keeps consuming
continuation chunks from the buffer until the message is complete
or there truly isn't enough data for the next chunk.
Also:
- Replace is_multiple_of() with % N == 0 for MSRV < 1.85 compat
- Add full_youtube_server_simulation integration test covering
the complete Handshaking → Publishing state machine flow
Signed-off-by: Devin AI <devin@cognition.ai>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>1 parent 70fd90c commit cfc0f60
2 files changed
+319
-167
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | | - | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
935 | 937 | | |
936 | 938 | | |
937 | 939 | | |
| |||
1013 | 1015 | | |
1014 | 1016 | | |
1015 | 1017 | | |
1016 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1017 | 1021 | | |
1018 | 1022 | | |
1019 | 1023 | | |
| |||
0 commit comments