summaryrefslogtreecommitdiffstats
path: root/src/server/net/sslserver.cpp
diff options
context:
space:
mode:
authorChristian Klinger2016-09-29 15:40:18 +0200
committerChristian Klinger2016-09-29 15:40:18 +0200
commit3d82bfc698165bb20f3c38d42f2b77ab855c1edf (patch)
tree2c170bcdd5c89259bb0b530fa11fdfe701c99850 /src/server/net/sslserver.cpp
parentadded an information dialog that displays ip and hostname. (diff)
downloadpvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.tar.gz
pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.tar.xz
pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.zip
astyle.
Diffstat (limited to 'src/server/net/sslserver.cpp')
-rw-r--r--src/server/net/sslserver.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/server/net/sslserver.cpp b/src/server/net/sslserver.cpp
index ffbf262..3d8f924 100644
--- a/src/server/net/sslserver.cpp
+++ b/src/server/net/sslserver.cpp
@@ -46,15 +46,12 @@ void SslServer::incomingConnection(int socketDescriptor)
serverSocket->setPeerVerifyMode(QSslSocket::VerifyNone);
serverSocket->setProtocol(QSsl::TlsV1SslV3);
//printf("Keylen %d\n", serverSocket->privateKey().length());
- if (serverSocket->setSocketDescriptor(socketDescriptor))
- {
+ if (serverSocket->setSocketDescriptor(socketDescriptor)) {
// Once the connection is successfully encrypted, raise our newConnection event
connect(serverSocket, SIGNAL(encrypted()), this, SIGNAL(newConnection()));
serverSocket->startServerEncryption();
_pending.push_back(serverSocket);
- }
- else
- {
+ } else {
serverSocket->deleteLater();
}
}
@@ -67,8 +64,7 @@ void SslServer::sslErrors(const QList<QSslError> & errors)
void SslServer::timerEvent(QTimerEvent* event)
{
// Remove all sockets marked for deletion
- while (!_delete.isEmpty())
- {
+ while (!_delete.isEmpty()) {
QSslSocket *sock = _delete.takeFirst();
sock->blockSignals(true);
sock->deleteLater();
@@ -79,8 +75,7 @@ void SslServer::timerEvent(QTimerEvent* event)
bool SslServer::hasPendingConnections()
{
- for (QList<QSslSocket*>::iterator it(_pending.begin()); it != _pending.end(); it++)
- {
+ for (QList<QSslSocket*>::iterator it(_pending.begin()); it != _pending.end(); it++) {
qDebug("State: %d - Encrypted: %d", (int)(*it)->state(), (*it)->isEncrypted());
if ((*it)->state() == QAbstractSocket::ConnectedState && (*it)->isEncrypted())
return true;
@@ -90,10 +85,8 @@ bool SslServer::hasPendingConnections()
QTcpSocket* SslServer::nextPendingConnection()
{
- for (QList<QSslSocket*>::iterator it(_pending.begin()); it != _pending.end(); it++)
- {
- if ((*it)->state() == QAbstractSocket::ConnectedState && (*it)->isEncrypted())
- {
+ for (QList<QSslSocket*>::iterator it(_pending.begin()); it != _pending.end(); it++) {
+ if ((*it)->state() == QAbstractSocket::ConnectedState && (*it)->isEncrypted()) {
QSslSocket *sock = *it;
QObject::disconnect(sock, SIGNAL(encrypted()), this, SIGNAL(newConnection()));
_pending.removeAll(sock);
@@ -101,10 +94,8 @@ QTcpSocket* SslServer::nextPendingConnection()
return sock;
}
}
- for (QList<QSslSocket*>::iterator it(_delete.begin()); it != _delete.end(); it++)
- {
- if ((*it)->state() == QAbstractSocket::ConnectedState && (*it)->isEncrypted())
- {
+ for (QList<QSslSocket*>::iterator it(_delete.begin()); it != _delete.end(); it++) {
+ if ((*it)->state() == QAbstractSocket::ConnectedState && (*it)->isEncrypted()) {
QSslSocket *sock = *it;
QObject::disconnect(sock, SIGNAL(encrypted()), this, SIGNAL(newConnection()));
_pending.removeAll(sock);