diff --git a/gamercade_app/src/task_manager/http.rs b/gamercade_app/src/task_manager/http.rs index e19fbc9..e2a5015 100644 --- a/gamercade_app/src/task_manager/http.rs +++ b/gamercade_app/src/task_manager/http.rs @@ -68,7 +68,7 @@ impl TaskRequest for HttpRequest { state: &Arc>, ) { match self { - HttpRequest::DownloadRom(request) => download_file(sender.clone(), request), + HttpRequest::DownloadRom(request) => download_file(sender.clone(), state.clone(), request), HttpRequest::UploadRom(request) => { let WithSession { data: request, @@ -110,7 +110,7 @@ impl TaskRequest for HttpRequest { } // TODO: May want to keep the join handle around -fn download_file(sender: Sender, request: WithSession) { +fn download_file(sender: Sender, state: Arc>, request: WithSession) { tokio::spawn(async move { let WithSession { session, @@ -137,6 +137,7 @@ fn download_file(sender: Sender, request: WithSession { + // TODO: Notify state of downloaded chunks buffer.extend_from_slice(&bytes); } Ok(None) => { @@ -158,6 +159,8 @@ fn download_file(sender: Sender, request: WithSession