X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.cpp;h=f413bbf20d61d9a4819c47365e5f170195a47894;hp=1af89261d2ea4973dd846d16f95d5dff51fc0c57;hb=018d1d001bf3c051b55525f523d933a8d694e071;hpb=fd1833906d6d9d3a67c9aa92bffa35d1024e41a9 diff --git a/src/core/core.cpp b/src/core/core.cpp index 1af89261..f413bbf2 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -401,9 +401,16 @@ void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) { #else bool supportSsl = false; #endif + +#ifndef QT_NO_COMPRESS + bool supportsCompression = true; +#else + bool supportsCompression = false; +#endif reply["SupportSsl"] = supportSsl; - // switch to ssl after client has been informed about our capabilities (see below) + reply["SupportsCompression"] = supportsCompression; + // switch to ssl/compression after client has been informed about our capabilities (see below) reply["LoginEnabled"] = true; @@ -439,12 +446,19 @@ void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) { #ifndef QT_NO_OPENSSL // after we told the client that we are ssl capable we switch to ssl mode if(supportSsl && msg["UseSsl"].toBool()) { - qDebug() << "Starting TLS for Client:" << qPrintable(socket->peerAddress().toString()); + qDebug() << "Starting TLS for Client:" << qPrintable(socket->peerAddress().toString()); connect(sslSocket, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); sslSocket->startServerEncryption(); } #endif +#ifndef QT_NO_COMPRESS + if(supportsCompression && msg["UseCompression"].toBool()) { + socket->setProperty("UseCompression", true); + qDebug() << "Using compression for Client:" << qPrintable(socket->peerAddress().toString()); + } +#endif + } else { // for the rest, we need an initialized connection if(!clientInfo.contains(socket)) {