diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-10-19 22:33:29 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-10-19 22:33:29 (GMT) |
commit | ae1cb61204530099f438656226a4b24449658203 (patch) | |
tree | 485a961f295ab0db5b60cdd62f6072ac2368dfe6 /src/network | |
parent | 55bddd50925da27f7a106041db44c15057aac6c1 (diff) | |
parent | 02c15e6a8cdb0f8a0bb6ee36880877fe90334d69 (diff) | |
download | Qt-ae1cb61204530099f438656226a4b24449658203.zip Qt-ae1cb61204530099f438656226a4b24449658203.tar.gz Qt-ae1cb61204530099f438656226a4b24449658203.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts:
tools/qdoc3/cppcodemarker.cpp
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/socket/qabstractsocket.cpp | 13 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 16 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.h | 4 |
3 files changed, 33 insertions, 0 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 86ccef2..9fb0b47 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1578,6 +1578,13 @@ bool QAbstractSocket::setSocketDescriptor(int socketDescriptor, SocketState sock */ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) { +#ifndef QT_NO_OPENSSL + if (QSslSocket *sslSocket = qobject_cast<QSslSocket*>(this)) { + sslSocket->setSocketOption(option, value); + return; + } +#endif + if (!d_func()->socketEngine) return; @@ -1600,6 +1607,12 @@ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, cons */ QVariant QAbstractSocket::socketOption(QAbstractSocket::SocketOption option) { +#ifndef QT_NO_OPENSSL + if (QSslSocket *sslSocket = qobject_cast<QSslSocket*>(this)) { + return sslSocket->socketOption(option); + } +#endif + if (!d_func()->socketEngine) return QVariant(); diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index a5732fb..ad766c1 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -467,6 +467,22 @@ bool QSslSocket::setSocketDescriptor(int socketDescriptor, SocketState state, Op return retVal; } +void QSslSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) +{ + Q_D(QSslSocket); + if (d->plainSocket) + d->plainSocket->setSocketOption(option, value); +} + +QVariant QSslSocket::socketOption(QAbstractSocket::SocketOption option) +{ + Q_D(QSslSocket); + if (d->plainSocket) + return d->plainSocket->socketOption(option); + else + return QVariant(); +} + /*! Returns the current mode for the socket; either UnencryptedMode, where QSslSocket behaves identially to QTcpSocket, or one of SslClientMode or diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index a41e600..adb206c 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -90,6 +90,10 @@ public: bool setSocketDescriptor(int socketDescriptor, SocketState state = ConnectedState, OpenMode openMode = ReadWrite); + // ### Qt 5: Make virtual + void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value); + QVariant socketOption(QAbstractSocket::SocketOption option); + SslMode mode() const; bool isEncrypted() const; |