support old format of 93 command

This commit is contained in:
Martin Michelsen
2022-05-11 23:08:31 -07:00
parent 2d3cd17692
commit ea94c38598
5 changed files with 39 additions and 25 deletions
+2 -3
View File
@@ -236,7 +236,7 @@ static bool process_server_bb_03(shared_ptr<ServerState>,
if (!session.detector_crypt.get()) {
throw runtime_error("BB linked session has no detector crypt");
}
if (!session.login_command_bb.username.len()) {
if (session.login_command_bb.empty()) {
throw logic_error("linked BB session does not have a saved login command");
}
@@ -251,8 +251,7 @@ static bool process_server_bb_03(shared_ptr<ServerState>,
session.detector_crypt, cmd.client_key.data(), sizeof(cmd.client_key), false));
// Forward the login command we saved during the unlinked session.
session.send_to_end(true, 0x93, 0x00, &session.login_command_bb,
sizeof(session.login_command_bb));
session.send_to_end(true, 0x93, 0x00, session.login_command_bb);
return false;
}