fix multiple packet in single handle_buffer call, set server as stopped when proxy connection failed and container can't be found

This commit is contained in:
2026-06-11 18:33:38 +02:00
parent 5ccac4f3d4
commit 0bbb8b3245
8 changed files with 79 additions and 28 deletions

View File

@ -63,23 +63,18 @@ pub async fn extract_archive(archive_path: String, output: String) -> Result<(),
pub fn move_all_elements(src: &Path, dst: &Path) -> io::Result<()> {
// 1. Ensure the destination directory exists; if not, create it
if !dst.exists() {
fs::create_dir_all(dst)?;
println!("Created destination directory: {:?}", dst);
}
// 2. Read the contents of the source directory
for entry in fs::read_dir(src)? {
let entry = entry?;
let file_name = entry.file_name();
// 3. Construct the new path (destination + filename)
let old_path = entry.path();
let new_path = dst.join(file_name);
// 4. Perform the move
// fs::rename works for both files and directories
fs::rename(&old_path, &new_path)?;
println!("Moved: {:?} -> {:?}", old_path, new_path);
}