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;
}
bool PacketDecoder::verify_encryption_client_packet(const pipes::buffer_view &buffer) {
ClientPacketParser packet_parser{buffer};
if(!packet_parser.valid() || !packet_parser.is_encrypted()) {
bool PacketDecoder::verify_encryption_client_packet(const protocol::ClientPacketParser& packet_parser) {
if(!packet_parser.is_encrypted()) {
return false;
}
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() {

View File

@ -62,7 +62,7 @@ namespace ts::protocol {
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 */
PacketProcessResult process_incoming_data(protocol::PacketParser &/* packet */, std::string& /* error detail */);