Skip to content

Commit

Permalink
Fix regression caused by crash fix
Browse files Browse the repository at this point in the history
The fix caused the connack and publish packets of persistent sessions to
be sent in the wrong order.
  • Loading branch information
halfgaar committed Nov 5, 2024
1 parent be07c03 commit d1f366f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ void Client::sendConnackSuccess()
}

ConnAck &connAck = *this->stagedConnack.get();
setAuthenticated(true);
MqttPacket response(connAck);
writeMqttPacket(response);
logger->logf(LOG_NOTICE, "Client '%s' logged in successfully", repr().c_str());
Expand Down
3 changes: 2 additions & 1 deletion threaddata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,9 @@ void ThreadData::continuationOfAuthentication(std::shared_ptr<Client> &client, A
client->setWillFromStaged();
}

subscriptionStore->registerClientAndKickExistingOne(client);
client->sendConnackSuccess();
subscriptionStore->registerClientAndKickExistingOne(client);
client->setAuthenticated(true);
}
else // Reauth (to authenticated clients) sends AUTH on success.
{
Expand Down

0 comments on commit d1f366f

Please sign in to comment.