diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-10-19 08:42:42 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-10-19 08:50:28 (GMT) |
commit | 2e575432f1e1fd90e1f973791f2ee8df33b6e45e (patch) | |
tree | a2d626031741276f33ed925f67c10f2165db4fd7 /src/network/ssl | |
parent | 8472e256280f683f69fd5d9db5c2ed645dab6c92 (diff) | |
download | Qt-2e575432f1e1fd90e1f973791f2ee8df33b6e45e.zip Qt-2e575432f1e1fd90e1f973791f2ee8df33b6e45e.tar.gz Qt-2e575432f1e1fd90e1f973791f2ee8df33b6e45e.tar.bz2 |
QSslSocket: Also handle setSocketOption
Handle setSocketOption and forward it to the plainSocket that
QSslSocket is using internally.
Reviewed-by: Thiago
Diffstat (limited to 'src/network/ssl')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 16 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.h | 4 |
2 files changed, 20 insertions, 0 deletions
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; |