Open Bug 1755663 Opened 3 years ago

Add enter_sync_mode() helper

Categories

(Testing :: Mozbase Rust, enhancement, P3)

Default
enhancement

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

(Blocks 1 open bug)

Details

As suggested by James in https://phabricator.services.mozilla.com/D131012#inline-760281 it would be good to have a helper that helps to enter sync mode in the following way:

enter_sync_mode(stream: &mut TcpStream, mode: SyncCommand, path: &UnixPath) -> ... {
        let message = encode_message(&format!("host:transport:{}", self.serial))?;
        stream.write_all(message.as_bytes())?;
        let _bytes = read_response(&mut stream, false, true)?;

        // Send "sync:" command to initialize file transfer
        let message = encode_message("sync:")?;
        stream.write_all(message.as_bytes())?;
        let _bytes = read_response(&mut stream, false, true)?;
}
You need to log in before you can comment on or make changes to this bug.