Fixed missing generation estimator reset within the packet decoder

This commit is contained in:
WolverinDEV 2021-04-19 19:11:43 +02:00
parent 7a7a24ee2c
commit 444dea13c5

View File

@ -28,12 +28,21 @@ PacketDecoder::~PacketDecoder() {
} }
void PacketDecoder::reset() { void PacketDecoder::reset() {
{
std::lock_guard buffer_lock(this->packet_buffer_lock); std::lock_guard buffer_lock(this->packet_buffer_lock);
for(auto& buffer : this->_command_fragment_buffers) { for(auto& buffer : this->_command_fragment_buffers) {
buffer.reset(); buffer.reset();
} }
} }
{
std::lock_guard estimator_lock{this->incoming_generation_estimator_lock};
for(auto& estimator : this->incoming_generation_estimators) {
estimator.reset();
}
}
}
PacketProcessResult PacketDecoder::process_incoming_data(PacketParser &packet_parser, std::string& error) { PacketProcessResult PacketDecoder::process_incoming_data(PacketParser &packet_parser, std::string& error) {
#ifdef FUZZING_TESTING_INCOMMING #ifdef FUZZING_TESTING_INCOMMING
if(rand() % 100 < 20) { if(rand() % 100 < 20) {