Change-Id: Ia94540e131ce424e6306886861598f7f24f7577f
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
disconnect(pTcpSocket, SIGNAL(readyRead()), this, SLOT(handshakeReceived()));
+ if (m_pendingConnections.length() >= maxPendingConnections()) {
+ pTcpSocket->close();
+ qWarning() << tr("Too many pending connections: new websocket connection not accepted.");
+ setError(QWebSocketProtocol::CC_ABNORMAL_DISCONNECTION, tr("Too many pending connections."));
+ return;
+ }
+
QWebSocketHandshakeRequest request(pTcpSocket->peerPort(), isSecure);
QTextStream textStream(pTcpSocket);
textStream >> request;