mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-15 16:36:52 +01:00
Bug fixes from #209
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**************************************************************************************
|
/**************************************************************************************
|
||||||
* Copyright (c) 2016, Tomoaki Yamaguchi
|
* Copyright (c) 2016, 2020 Tomoaki Yamaguchi and others
|
||||||
*
|
*
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
@@ -104,10 +104,14 @@ void MQTTSNConnectionHandler::handleConnect(Client* client, MQTTSNPacket* packet
|
|||||||
connectData->keepAliveTimer = data.duration;
|
connectData->keepAliveTimer = data.duration;
|
||||||
connectData->flags.bits.will = data.willFlag;
|
connectData->flags.bits.will = data.willFlag;
|
||||||
|
|
||||||
if ((const char*) _gateway->getGWParams()->loginId != nullptr && (const char*) _gateway->getGWParams()->password != 0)
|
if ((const char*) _gateway->getGWParams()->loginId != nullptr)
|
||||||
|
{
|
||||||
|
connectData->flags.bits.username = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((const char*) _gateway->getGWParams()->password != 0)
|
||||||
{
|
{
|
||||||
connectData->flags.bits.password = 1;
|
connectData->flags.bits.password = 1;
|
||||||
connectData->flags.bits.username = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
client->setSessionStatus(false);
|
client->setSessionStatus(false);
|
||||||
|
|||||||
@@ -541,6 +541,15 @@ loop:
|
|||||||
case SSL_ERROR_WANT_WRITE:
|
case SSL_ERROR_WANT_WRITE:
|
||||||
readBlockedOnWrite = true;
|
readBlockedOnWrite = true;
|
||||||
break;
|
break;
|
||||||
|
case SSL_ERROR_SYSCALL:
|
||||||
|
SSL_free(_ssl);
|
||||||
|
_ssl = 0;
|
||||||
|
_numOfInstance--;
|
||||||
|
//TCPStack::close();
|
||||||
|
_busy = false;
|
||||||
|
_mutex.unlock();
|
||||||
|
return -1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ERR_error_string_n(ERR_get_error(), errmsg, sizeof(errmsg));
|
ERR_error_string_n(ERR_get_error(), errmsg, sizeof(errmsg));
|
||||||
WRITELOG("Network::recv() %s\n", errmsg);
|
WRITELOG("Network::recv() %s\n", errmsg);
|
||||||
|
|||||||
Reference in New Issue
Block a user