refactor(src/app.rs): update file handling and byte range parsing with Tokio streams #31
wandabastyle
commented 2026-04-30 23:08:17 +02:00
(Migrated from github.com)
- Updated `src/app.rs` to use asynchronous file handling with Tokio, enhancing performance and responsiveness.
- Refactored the `play_recording_file` function to handle byte ranges asynchronously using `futures_util::stream::unfold`, improving efficiency for large files.
- Introduced a `max_open_ended_range` parameter in `parse_byte_range` to limit the size of open-ended byte ranges, preventing potential abuse.
- Replaced synchronous file operations with asynchronous ones, using `TokioFile` instead of `std::fs::File`, to support non-blocking I/O.
- Updated response body construction to use `Body::from_stream` for asynchronous data streaming.
- Updated \`src/app.rs\` to use asynchronous file handling with Tokio, enhancing performance and responsiveness.
- Refactored the \`play_recording_file\` function to handle byte ranges asynchronously using \`futures_util::stream::unfold\`, improving efficiency for large files.
- Introduced a \`max_open_ended_range\` parameter in \`parse_byte_range\` to limit the size of open-ended byte ranges, preventing potential abuse.
- Replaced synchronous file operations with asynchronous ones, using \`TokioFile\` instead of \`std::fs::File\`, to support non-blocking I/O.
- Updated response body construction to use \`Body::from_stream\` for asynchronous data streaming.
No reviewers
Labels
No labels
bug
codex
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
wandabastyle/twitch_relay!31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "pvr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?