Using one global event loop for the query and web client

This commit is contained in:
WolverinDEV 2021-04-15 12:54:52 +02:00
parent 2747c67f44
commit 0726cd6c95
2 changed files with 4 additions and 5 deletions

View File

@ -197,14 +197,13 @@ PacketProcessResult PacketDecoder::decrypt_incoming_packet(std::string& error, P
return PacketProcessResult::SUCCESS; return PacketProcessResult::SUCCESS;
} }
bool PacketDecoder::verify_encryption_client_packet(const pipes::buffer_view &buffer) { bool PacketDecoder::verify_encryption_client_packet(const protocol::ClientPacketParser& packet_parser) {
ClientPacketParser packet_parser{buffer}; if(!packet_parser.is_encrypted()) {
if(!packet_parser.valid() || !packet_parser.is_encrypted()) {
return false; return false;
} }
assert(packet_parser.type() >= 0 && packet_parser.type() < this->incoming_generation_estimators.size()); assert(packet_parser.type() >= 0 && packet_parser.type() < this->incoming_generation_estimators.size());
return this->crypt_handler_->verify_encryption(buffer, packet_parser.packet_id(), this->incoming_generation_estimators[packet_parser.type()].generation()); return this->crypt_handler_->verify_encryption(packet_parser.buffer(), packet_parser.packet_id(), this->incoming_generation_estimators[packet_parser.type()].generation());
} }
void PacketDecoder::register_initiv_packet() { void PacketDecoder::register_initiv_packet() {

View File

@ -62,7 +62,7 @@ namespace ts::protocol {
void reset(); void reset();
bool verify_encryption_client_packet(const pipes::buffer_view& /* full packet */); bool verify_encryption_client_packet(const protocol::ClientPacketParser& /* packet */);
/* true if commands might be pending */ /* true if commands might be pending */
PacketProcessResult process_incoming_data(protocol::PacketParser &/* packet */, std::string& /* error detail */); PacketProcessResult process_incoming_data(protocol::PacketParser &/* packet */, std::string& /* error detail */);