feat: added upload file capability

This commit is contained in:
Andrew Rioux
2023-09-06 14:56:21 -04:00
parent 231108f2c3
commit 50b5c1a921
9 changed files with 277 additions and 5 deletions

View File

@@ -4,6 +4,8 @@ pub const CONFIG_SEPARATOR: &'static [u8] =
pub mod messages {
pub const CONNECT_MESSAGE: &'static [u8] = b"CONNECT";
pub const CONNECTED_MESSAGE: &'static [u8] = b"CONNECTED";
pub const FILE_TRANSFER_PACKET_SIZE: usize = 1024;
pub const FILE_BUFFER_BUFFER_SIZE: usize = 512;
use std::{ffi::OsString, path::PathBuf};
@@ -25,9 +27,10 @@ pub mod messages {
StartUploadFile(PathBuf, u64),
SendFileSegment(u64, u64, Vec<u8>),
GetUploadStatus(u64, u64),
StartDownloadFile(PathBuf),
DownloadFileStatus(u64, Result<(), Vec<u64>>),
DownloadFileStatus(u64, Vec<u64>),
Disconnect,
}
@@ -74,7 +77,7 @@ pub mod messages {
SendTTYData(u64, Vec<u64>),
UploadFileID(u64),
UploadFileStatus(u64, Result<(), Vec<u64>>),
UploadFileStatus(u64, Vec<u64>),
StartDownloadFile(u64),
DownloadFileSegment(u64, u64, Vec<u64>),