blob: dee3931cfba483dfe729694643de7409cb3c12db (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
use std::str::from_utf8;
use bytes::BytesMut;
use crate::server::cmd::session::SessionInitializationCommand;
pub fn parse_session_initialization_command(command: BytesMut) -> SessionInitializationCommand {
SessionInitializationCommand {
// protocol: command.get(4..4 + command.get(4)).unwrap().to_owned() as usize,
// client: "".to_string(),
username: from_utf8(
command
.get(25..(24 + command.get(24).unwrap().to_owned() as usize + 1))
.unwrap(),
)
.unwrap()
.to_string(),
// password: "".to_string()
}
}
|