diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2014-02-12 15:17:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-15 14:40:02 +0100 |
commit | 45eadd663ff22df46fadf03c45db7e058e71e476 (patch) | |
tree | 896959f43e107cd446b3e948a295e0a7661d4f47 /src/websockets/qwebsocket_p.h | |
parent | abb6912c11dc322718724eb11e70617d8428b6f5 (diff) | |
download | qtwebsockets-45eadd663ff22df46fadf03c45db7e058e71e476.tar.gz |
Add user configurable mask generation
Created a QMaskGenerator abstract base class to serve as a basis for
user specific mask generators. Added the possibility to override the
default mask generation in QWebSocket.
Change-Id: Iaa02b44193f854d103b5f352617789175fe61f89
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src/websockets/qwebsocket_p.h')
-rw-r--r-- | src/websockets/qwebsocket_p.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h index 3bd9918..c1128c5 100644 --- a/src/websockets/qwebsocket_p.h +++ b/src/websockets/qwebsocket_p.h @@ -68,6 +68,7 @@ #include "qwebsocketprotocol.h" #include "qwebsocketdataprocessor_p.h" +#include "qdefaultmaskgenerator_p.h" QT_BEGIN_NAMESPACE @@ -75,6 +76,7 @@ class QWebSocketHandshakeRequest; class QWebSocketHandshakeResponse; class QTcpSocket; class QWebSocket; +class QMaskGenerator; struct QWebSocketConfiguration { @@ -122,6 +124,8 @@ public: QNetworkProxy proxy() const; void setProxy(const QNetworkProxy &networkProxy); #endif + void setMaskGenerator(const QMaskGenerator *maskGenerator); + const QMaskGenerator *maskGenerator() const; qint64 readBufferSize() const; void resume(); void setPauseMode(QAbstractSocket::PauseModes pauseMode); @@ -195,7 +199,6 @@ private: quint32 generateMaskingKey() const; QByteArray generateKey() const; - quint32 generateRandomNumber() const; qint64 writeFrames(const QList<QByteArray> &frames) Q_REQUIRED_RESULT; qint64 writeFrame(const QByteArray &frame) Q_REQUIRED_RESULT; @@ -226,6 +229,9 @@ private: QWebSocketDataProcessor m_dataProcessor; QWebSocketConfiguration m_configuration; + QMaskGenerator *m_pMaskGenerator; + QDefaultMaskGenerator m_defaultMaskGenerator; + friend class QWebSocketServerPrivate; }; |