refactor(src/app.rs): update file handling and byte range parsing with Tokio streams #31

Merged
wandabastyle merged 4 commits from pvr into main 2026-04-30 23:25:12 +02:00
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.
Sign in to join this conversation.
No description provided.