projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ssl: Use Pending Connections mechanism for SslServer
[quassel.git]
/
src
/
core
/
sslserver.cpp
diff --git
a/src/core/sslserver.cpp
b/src/core/sslserver.cpp
index
9fceddd
..
f7d35c3
100644
(file)
--- a/
src/core/sslserver.cpp
+++ b/
src/core/sslserver.cpp
@@
-57,28
+57,19
@@
SslServer::SslServer(QObject* parent)
}
}
}
}
-QTcpSocket* SslServer::nextPendingConnection()
-{
- if (_pendingConnections.isEmpty())
- return nullptr;
- else
- return _pendingConnections.takeFirst();
-}
-
void SslServer::incomingConnection(qintptr socketDescriptor)
{
void SslServer::incomingConnection(qintptr socketDescriptor)
{
- auto* s
erverS
ocket = new QSslSocket(this);
- if (s
erverS
ocket->setSocketDescriptor(socketDescriptor)) {
+ auto* socket = new QSslSocket(this);
+ if (socket->setSocketDescriptor(socketDescriptor)) {
if (isCertValid()) {
if (isCertValid()) {
- s
erverS
ocket->setLocalCertificate(_cert);
- s
erverS
ocket->setPrivateKey(_key);
- s
erverS
ocket->addCaCertificates(_ca);
+ socket->setLocalCertificate(_cert);
+ socket->setPrivateKey(_key);
+ socket->addCaCertificates(_ca);
}
}
- _pendingConnections << serverSocket;
- emit newConnection();
+ addPendingConnection(socket);
}
else {
}
else {
- delete s
erverS
ocket;
+ delete socket;
}
}
}
}