allow re-handshake in NodeList after domain refresh

This commit is contained in:
Stephen Birarda 2014-04-04 15:56:02 -07:00
parent c015fdd212
commit 45d796e8f3
5 changed files with 6 additions and 3 deletions

View file

@ -652,7 +652,6 @@ void DomainServer::readAvailableDTLSDatagrams() {
DTLSServerSession* existingSession = _dtlsSessions.value(senderHifiSockAddr);
if (existingSession) {
qDebug() << "There is an existing session for" << senderHifiSockAddr;
if (!existingSession->completedHandshake()) {
// check if we have completed handshake with this user
int handshakeReturn = gnutls_handshake(*existingSession->getGnuTLSSession());

View file

@ -61,6 +61,7 @@ signals:
void hostnameChanged(const QString& hostname);
void connectedToDomain(const QString& hostname);
void completedDTLSHandshake();
void DTLSConnectionLost();
private:
void reset();

View file

@ -15,7 +15,7 @@
#include "HifiSockAddr.h"
#define DTLS_VERBOSE_DEBUG 1
#define DTLS_VERBOSE_DEBUG 0
class DummyDTLSSession : public QObject {
Q_OBJECT

View file

@ -426,7 +426,7 @@ void LimitedNodeList::removeSilentNodes() {
node->getMutex().lock();
if ((usecTimestampNow() - node->getLastHeardMicrostamp()) > (NODE_SILENCE_THRESHOLD_MSECS * 1)) {
if ((usecTimestampNow() - node->getLastHeardMicrostamp()) > (NODE_SILENCE_THRESHOLD_MSECS * 1000)) {
// call our private method to kill this node (removes it and emits the right signal)
nodeItem = killNodeAtHashIterator(nodeItem);
} else {

View file

@ -196,6 +196,9 @@ void NodeList::reset() {
// clear the domain connection information
_domainHandler.clearConnectionInfo();
// also disconnect from the DTLS socket readyRead() so it can handle handshaking
disconnect(_dtlsSocket, 0, this, 0);
}
void NodeList::addNodeTypeToInterestSet(NodeType_t nodeTypeToAdd) {