blob: 8e8fbb74e7ad9ab51ffe804969d04f091fc9a0f2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
use crate::server::cmd::session::SessionInitializationCommand;
use bytes::BytesMut;
use std::str::from_utf8;
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(
21..(20 + command.get(20).unwrap().to_owned() as usize + 1)
).unwrap()
).unwrap().to_string(),
// password: "".to_string()
}
}
|