DTLS Enhancement #90 complete.
OpenSSL version 1.1.1k 25 Mar. 2021 is required.
This fix does not work with version 1.1.1 11 sep. 2018

Merge branch 'dtls' into develop
This commit is contained in:
tomoaki
2021-08-11 18:44:39 +09:00
52 changed files with 4945 additions and 1381 deletions

View File

@@ -58,6 +58,7 @@ ClientList::~ClientList()
void ClientList::initialize(bool aggregate)
{
_maxClients = _gateway->getGWParams()->maxClients;
_clientsPool->allocate(_gateway->getGWParams()->maxClients);
if (_gateway->getGWParams()->clientAuthentication)
@@ -416,7 +417,7 @@ Client* ClientList::createPredefinedTopic(MQTTSNString* clientId, string topicNa
}
else
{
Client* client = getClient(clientId);
Client *client = getClient(clientId);
if (_authorize && client == nullptr)
{
@@ -424,6 +425,7 @@ Client* ClientList::createPredefinedTopic(MQTTSNString* clientId, string topicNa
}
client = createClient(NULL, clientId, aggregate);
if (client == nullptr)
{
return nullptr;
@@ -491,15 +493,17 @@ void ClientsPool::allocate(int maxClients)
Client* ClientsPool::getClient(void)
{
Client *cl = nullptr;
while (_firstClient != nullptr)
{
Client* cl = _firstClient;
cl = _firstClient;
_firstClient = cl->_nextClient;
cl->_nextClient = nullptr;
_clientCnt--;
return cl;
break;
}
return nullptr;
return cl;
}
void ClientsPool::setClient(Client* client)