Improve debug information

If we're ignoring an ssl issue, at least show it.
On connected show whether the socket is valid, otherwise we get remote
devices disconnected without any message. (In this case HostNameMismatch)
Also fixes a typo

CCBUG: 381542
This commit is contained in:
Aleix Pol 2017-07-07 17:26:55 +02:00
parent a4c0a8fb96
commit 29888cb78b
2 changed files with 4 additions and 3 deletions

View file

@ -230,9 +230,9 @@ void LanLinkProvider::connectError()
//We received a UDP package and answered by connecting to them by TCP. This gets called on a succesful connection.
void LanLinkProvider::connected()
{
qCDebug(KDECONNECT_CORE) << "Socket connected";
QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
qCDebug(KDECONNECT_CORE) << "Socket connected" << socket;
if (!socket) return;
disconnect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected);
disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError()));
@ -334,6 +334,7 @@ void LanLinkProvider::sslErrors(const QList<QSslError>& errors)
break;
}
default:
qCDebug(KDECONNECT_CORE) << "Ignoring ssl issue:" << int(error.error()) << error.errorString();
continue;
}
}

View file

@ -46,7 +46,7 @@ void Server::incomingConnection(qintptr socketDescriptor) {
}
QSslSocket* Server::nextPendingConnection() {
qDebug() << "nextPendingConnection (emtpy:" << pendingConnections.isEmpty() << ")";
qDebug() << "nextPendingConnection (pending:" << pendingConnections.count() << ")";
if (pendingConnections.isEmpty()) {
return Q_NULLPTR;
} else {