upd: compelete IO

This commit is contained in:
2023-12-12 07:47:58 +00:00
parent ffb1a5f788
commit a0150ec6fb
4 changed files with 38 additions and 15 deletions

View File

@ -28,8 +28,10 @@ void BookStoreBackEndClass::Run() {
new_session.SessionToken = new_SessionToken;
new_session.OuthorizationKey = new_AuthenticationKey;
session_map[new_SessionToken] = new_session;
(*output_ptr).readlock();
(*output_ptr) << TempChannelID << " IinitialOpt 1\n"
<< new_SessionToken << ' ' << new_AuthenticationKey << '\n';
(*output_ptr).unreadlock();
} else if (request_data[1] == 'C') {
;
} else if (request_data[1] == '_') {
@ -45,14 +47,15 @@ void BookStoreBackEndClass::Run() {
ss >> cmd >> SessionToken >> OperationToken >> OuthenticationKey;
ss.get();
std::getline(ss, cmd);
debugPrint("SessionToken=", SessionToken,
" OperationToken=", OperationToken,
" OuthenticationKey=", OuthenticationKey, " cmd=", cmd);
// (*output_ptr) << SessionToken << ' ' << OperationToken << " 0\n";
(*output_ptr) << SessionToken << ' ' << OperationToken
<< " 1\nECHO: " << cmd << '\n';
// debugPrint("SessionToken=", SessionToken,
// " OperationToken=", OperationToken,
// " OuthenticationKey=", OuthenticationKey, " cmd=", cmd);
// std::cerr << "[]" << SessionToken << ' ' << OperationToken
// << " 1\nECHO: " << cmd << '\n';
(*output_ptr).readlock();
(*output_ptr) << SessionToken << ' ' << OperationToken
<< " 1\nECHO: " << cmd << '\n';
(*output_ptr).unreadlock();
}
}
}