PICrypt passwordHash fix hash and return, PICloud repair Server exit, fix PIAuth pass_hash gen
This commit is contained in:
@@ -69,8 +69,8 @@ bool PICloudServer::closeDevice() {
|
||||
eth.stop();
|
||||
clients_mutex.lock();
|
||||
for (auto c : clients_) {
|
||||
c->stop();
|
||||
c->close();
|
||||
c->stop();
|
||||
}
|
||||
clients_mutex.unlock();
|
||||
eth.close();
|
||||
@@ -111,8 +111,8 @@ PICloudServer::Client::~Client() {
|
||||
is_connected = false;
|
||||
cond_buff.notifyOne();
|
||||
}
|
||||
stop();
|
||||
close();
|
||||
stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -167,13 +167,14 @@ void PICloudServer::_readed(PIByteArray & ba) {
|
||||
uint id = tcp.parseConnect(ba);
|
||||
clients_mutex.lock();
|
||||
Client * oc = index_clients.value(id, nullptr);
|
||||
clients_mutex.unlock();
|
||||
if (oc) {
|
||||
clients_mutex.unlock();
|
||||
tcp.sendDisconnected(id);
|
||||
} else {
|
||||
piCoutObj << "new Client" << id;
|
||||
Client * c = new Client(this, id);
|
||||
CONNECTU(c, deleted, this, clientDeleted)
|
||||
CONNECTU(c, deleted, this, clientDeleted);
|
||||
clients_mutex.lock();
|
||||
clients_ << c;
|
||||
index_clients.insert(id, c);
|
||||
clients_mutex.unlock();
|
||||
@@ -184,18 +185,18 @@ void PICloudServer::_readed(PIByteArray & ba) {
|
||||
uint id = tcp.parseDisconnect(ba);
|
||||
clients_mutex.lock();
|
||||
Client * oc = index_clients.value(id, nullptr);
|
||||
clients_mutex.unlock();
|
||||
if (oc) {
|
||||
oc->is_connected = false;
|
||||
oc->close();
|
||||
}
|
||||
clients_mutex.unlock();
|
||||
} break;
|
||||
case PICloud::TCP::Data: {
|
||||
PIPair<uint, PIByteArray> d = tcp.parseDataServer(ba);
|
||||
clients_mutex.lock();
|
||||
Client * oc = index_clients.value(d.first, nullptr);
|
||||
if (oc && !d.second.isEmpty()) oc->pushBuffer(d.second);
|
||||
clients_mutex.unlock();
|
||||
if (oc && !d.second.isEmpty()) oc->pushBuffer(d.second);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user