connection->logger->tinc(l_msgr_running_fast_dispatch_time,
connection->recv_start_time - fast_dispatch_time);
connection->lock.lock();
+ // we might have been reused by another connection
+ // let's check if that is the case
+ if (state != READY) {
+ // yes, that was the case, let's do nothing
+ return nullptr;
+ }
} else {
connection->dispatch_queue->enqueue(message, message->get_priority(),
connection->conn_id);
handle_message_ack(current_header.ack_seq);
- // we might have been reused by another connection
- // let's check if that is the case
- if (state != READY) {
- // yes, that was the case, let's do nothing
- return nullptr;
- }
if (need_dispatch_writer && connection->is_connected()) {
connection->center->dispatch_event_external(connection->write_handler);