Fix a bug

This commit is contained in:
Igor Katson 2024-04-29 18:26:36 +01:00
parent 867785422c
commit 6a9578cc0b
2 changed files with 30 additions and 11 deletions

View file

@ -14,7 +14,7 @@ use std::net::SocketAddr;
use std::str::FromStr;
use std::time::Duration;
use tokio::io::AsyncSeekExt;
use tracing::{debug, info};
use tracing::{debug, info, trace};
use axum::Router;
@ -167,6 +167,9 @@ impl HttpApi {
let mut output_headers = HeaderMap::new();
output_headers.insert("Accept-Ranges", HeaderValue::from_static("bytes"));
let range_header = headers.get(http::header::RANGE);
trace!(torrent_id=idx, file_id=file_id, range=?range_header, "request for HTTP stream");
if let Some(range) = headers.get(http::header::RANGE) {
let offset: Option<u64> = range
.to_str()