diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2014-01-19 13:58:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-20 22:40:19 +0100 |
commit | 281647a7efcc122c87d65518d9d8fbf259a3803a (patch) | |
tree | d3b556a2faecea0309a3352a90e310522da306ef | |
parent | f8b27c6b833ee796193ae115cb87574cb0e4df4c (diff) | |
download | qtwebsockets-281647a7efcc122c87d65518d9d8fbf259a3803a.tar.gz |
Rename SecureMode to SslMode
Renamed SecureMode to SslMode to be more inline with
QSslSocket.
Change-Id: Id2f0c5ebc1e06fcd7b0ce5059e88520e5f0e6fe5
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
-rw-r--r-- | examples/echoserver/echoserver.cpp | 2 | ||||
-rw-r--r-- | examples/simplechat/chatserver.cpp | 2 | ||||
-rw-r--r-- | examples/sslechoserver/sslechoserver.cpp | 2 | ||||
-rw-r--r-- | src/websockets/qwebsocketserver.cpp | 42 | ||||
-rw-r--r-- | src/websockets/qwebsocketserver.h | 12 | ||||
-rw-r--r-- | src/websockets/qwebsocketserver_p.cpp | 10 | ||||
-rw-r--r-- | src/websockets/qwebsocketserver_p.h | 12 |
7 files changed, 41 insertions, 41 deletions
diff --git a/examples/echoserver/echoserver.cpp b/examples/echoserver/echoserver.cpp index a3465c0..6b14754 100644 --- a/examples/echoserver/echoserver.cpp +++ b/examples/echoserver/echoserver.cpp @@ -49,7 +49,7 @@ QT_USE_NAMESPACE EchoServer::EchoServer(quint16 port, QObject *parent) : QObject(parent), m_pWebSocketServer(new QWebSocketServer(QStringLiteral("Echo Server"), - QWebSocketServer::SecureModeNonSecure, this)), + QWebSocketServer::NonSecureMode, this)), m_clients() { if (m_pWebSocketServer->listen(QHostAddress::Any, port)) { diff --git a/examples/simplechat/chatserver.cpp b/examples/simplechat/chatserver.cpp index ffb4fad..0e1a0e5 100644 --- a/examples/simplechat/chatserver.cpp +++ b/examples/simplechat/chatserver.cpp @@ -52,7 +52,7 @@ ChatServer::ChatServer(quint16 port, QObject *parent) : m_clients() { m_pWebSocketServer = new QWebSocketServer(QStringLiteral("Chat Server"), - QWebSocketServer::SecureModeNonSecure, + QWebSocketServer::NonSecureMode, this); if (m_pWebSocketServer->listen(QHostAddress::Any, port)) { diff --git a/examples/sslechoserver/sslechoserver.cpp b/examples/sslechoserver/sslechoserver.cpp index db44af6..b360a08 100644 --- a/examples/sslechoserver/sslechoserver.cpp +++ b/examples/sslechoserver/sslechoserver.cpp @@ -55,7 +55,7 @@ SslEchoServer::SslEchoServer(quint16 port, QObject *parent) : m_clients() { m_pWebSocketServer = new QWebSocketServer(QStringLiteral("SSL Echo Server"), - QWebSocketServer::SecureModeSecure, + QWebSocketServer::SecureMode, this); QSslConfiguration sslConfiguration; QFile certFile(QStringLiteral("./localhost.cert")); diff --git a/src/websockets/qwebsocketserver.cpp b/src/websockets/qwebsocketserver.cpp index dcc4309..9b27ffb 100644 --- a/src/websockets/qwebsocketserver.cpp +++ b/src/websockets/qwebsocketserver.cpp @@ -181,11 +181,11 @@ */ /*! - \enum QWebSocketServer::SecureMode - Indicates whether the server operates over wss (SecureModeSecure) or ws (SecureModeNonSecure) + \enum QWebSocketServer::SslMode + Indicates whether the server operates over wss (SecureMode) or ws (NonSecureMode) - \value SecureModeSecure The server operates in secure mode (over wss) - \value SecureModeNonSecure The server operates in non-secure mode (over ws) + \value SecureMode The server operates in secure mode (over wss) + \value NonSecureMode The server operates in non-secure mode (over ws) */ #include "qwebsocketprotocol.h" @@ -206,21 +206,21 @@ QT_BEGIN_NAMESPACE /*! Constructs a new WebSocketServer with the given \a serverName. The \a serverName will be used in the http handshake phase to identify the server. - The \a secureMode parameter indicates whether the server operates over wss (\l{SECURE_MODE}) - or over ws (\l{NON_SECURE_MODE}). + The \a secureMode parameter indicates whether the server operates over wss (\l{SecureMode}) + or over ws (\l{NonSecureMode}). \a parent is passed to the QObject constructor. */ -QWebSocketServer::QWebSocketServer(const QString &serverName, SecureMode secureMode, +QWebSocketServer::QWebSocketServer(const QString &serverName, SslMode secureMode, QObject *parent) : QObject(parent), d_ptr(new QWebSocketServerPrivate(serverName, #ifndef QT_NO_SSL - (secureMode == SecureModeSecure) ? - QWebSocketServerPrivate::SecureModeSecure : - QWebSocketServerPrivate::SecureModeNonSecure, + (secureMode == SecureMode) ? + QWebSocketServerPrivate::SecureMode : + QWebSocketServerPrivate::NonSecureMode, #else - QWebSocketServerPrivate::SecureModeNonSecure, + QWebSocketServerPrivate::NonSecureMode, #endif this, this)) @@ -373,9 +373,9 @@ void QWebSocketServer::setProxy(const QNetworkProxy &networkProxy) /*! Sets the SSL configuration for the websocket server to \a sslConfiguration. This method has no effect if QWebSocketServer runs in non-secure mode - (QWebSocketServer::SecureModeNonSecure). + (QWebSocketServer::NonSecureMode). - \sa sslConfiguration(), SecureMode + \sa sslConfiguration(), SslMode */ void QWebSocketServer::setSslConfiguration(const QSslConfiguration &sslConfiguration) { @@ -385,10 +385,10 @@ void QWebSocketServer::setSslConfiguration(const QSslConfiguration &sslConfigura /*! Returns the SSL configuration used by the websocket server. - If the server is not running in secure mode (QWebSocketServer::SECURE_MODE), + If the server is not running in secure mode (QWebSocketServer::SecureMode), this method returns QSslConfiguration::defaultConfiguration(). - \sa setSslConfiguration(), SecureMode, QSslConfiguration::defaultConfiguration() + \sa setSslConfiguration(), SslMode, QSslConfiguration::defaultConfiguration() */ QSslConfiguration QWebSocketServer::sslConfiguration() const { @@ -441,18 +441,18 @@ QHostAddress QWebSocketServer::serverAddress() const } /*! - Returns the mode the server is running in. + Returns the secure mode the server is running in. - \sa QWebSocketServer(), SecureMode + \sa QWebSocketServer(), SslMode */ -QWebSocketServer::SecureMode QWebSocketServer::secureMode() const +QWebSocketServer::SslMode QWebSocketServer::secureMode() const { #ifndef QT_NO_SSL Q_D(const QWebSocketServer); - return (d->secureMode() == QWebSocketServerPrivate::SecureModeSecure) ? - QWebSocketServer::SecureModeSecure : QWebSocketServer::SecureModeNonSecure; + return (d->secureMode() == QWebSocketServerPrivate::SecureMode) ? + QWebSocketServer::SecureMode : QWebSocketServer::NonSecureMode; #else - return QWebSocketServer::SecureModeNonSecure; + return QWebSocketServer::NonSecureMode; #endif } diff --git a/src/websockets/qwebsocketserver.h b/src/websockets/qwebsocketserver.h index 2267a66..59472fe 100644 --- a/src/websockets/qwebsocketserver.h +++ b/src/websockets/qwebsocketserver.h @@ -66,17 +66,17 @@ class Q_WEBSOCKETS_EXPORT QWebSocketServer : public QObject Q_DISABLE_COPY(QWebSocketServer) Q_DECLARE_PRIVATE(QWebSocketServer) - Q_ENUMS(SecureMode) + Q_ENUMS(SslMode) public: - enum SecureMode { + enum SslMode { #ifndef QT_NO_SSL - SecureModeSecure, + SecureMode, #endif - SecureModeNonSecure + NonSecureMode }; - explicit QWebSocketServer(const QString &serverName, SecureMode secureMode, + explicit QWebSocketServer(const QString &serverName, SslMode secureMode, QObject *parent = Q_NULLPTR); virtual ~QWebSocketServer(); @@ -91,7 +91,7 @@ public: quint16 serverPort() const; QHostAddress serverAddress() const; - SecureMode secureMode() const; + SslMode secureMode() const; bool setSocketDescriptor(int socketDescriptor); int socketDescriptor() const; diff --git a/src/websockets/qwebsocketserver_p.cpp b/src/websockets/qwebsocketserver_p.cpp index 4490826..4bf5724 100644 --- a/src/websockets/qwebsocketserver_p.cpp +++ b/src/websockets/qwebsocketserver_p.cpp @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE \internal */ QWebSocketServerPrivate::QWebSocketServerPrivate(const QString &serverName, - QWebSocketServerPrivate::SecureMode secureMode, + QWebSocketServerPrivate::SslMode secureMode, QWebSocketServer * const pWebSocketServer, QObject *parent) : QObject(parent), @@ -74,7 +74,7 @@ QWebSocketServerPrivate::QWebSocketServerPrivate(const QString &serverName, m_errorString() { Q_ASSERT(pWebSocketServer); - if (m_secureMode == SecureModeSecure) { + if (m_secureMode == SecureMode) { m_pTcpServer = new QTcpServer(this); if (Q_LIKELY(m_pTcpServer)) connect(m_pTcpServer, &QTcpServer::newConnection, @@ -318,7 +318,7 @@ QString QWebSocketServerPrivate::serverName() const /*! \internal */ -QWebSocketServerPrivate::SecureMode QWebSocketServerPrivate::secureMode() const +QWebSocketServerPrivate::SslMode QWebSocketServerPrivate::secureMode() const { return m_secureMode; } @@ -326,7 +326,7 @@ QWebSocketServerPrivate::SecureMode QWebSocketServerPrivate::secureMode() const #ifndef QT_NO_SSL void QWebSocketServerPrivate::setSslConfiguration(const QSslConfiguration &sslConfiguration) { - if (m_secureMode == SecureModeSecure) + if (m_secureMode == SecureMode) qobject_cast<QSslServer *>(m_pTcpServer)->setSslConfiguration(sslConfiguration); else qWarning() << tr("Cannot set SSL configuration for non-secure server."); @@ -334,7 +334,7 @@ void QWebSocketServerPrivate::setSslConfiguration(const QSslConfiguration &sslCo QSslConfiguration QWebSocketServerPrivate::sslConfiguration() const { - if (m_secureMode == SecureModeSecure) + if (m_secureMode == SecureMode) return qobject_cast<QSslServer *>(m_pTcpServer)->sslConfiguration(); else return QSslConfiguration::defaultConfiguration(); diff --git a/src/websockets/qwebsocketserver_p.h b/src/websockets/qwebsocketserver_p.h index 9a2977e..861b1e7 100644 --- a/src/websockets/qwebsocketserver_p.h +++ b/src/websockets/qwebsocketserver_p.h @@ -75,13 +75,13 @@ class QWebSocketServerPrivate : public QObject Q_DECLARE_PUBLIC(QWebSocketServer) public: - enum SecureMode + enum SslMode { - SecureModeSecure = true, - SecureModeNonSecure + SecureMode = true, + NonSecureMode }; - explicit QWebSocketServerPrivate(const QString &serverName, SecureMode secureMode, + explicit QWebSocketServerPrivate(const QString &serverName, SslMode secureMode, QWebSocketServer * const pWebSocketServer, QObject *parent = Q_NULLPTR); virtual ~QWebSocketServerPrivate(); @@ -113,7 +113,7 @@ public: void setServerName(const QString &serverName); QString serverName() const; - SecureMode secureMode() const; + SslMode secureMode() const; #ifndef QT_NO_SSL void setSslConfiguration(const QSslConfiguration &sslConfiguration); @@ -132,7 +132,7 @@ private: QTcpServer *m_pTcpServer; QString m_serverName; - SecureMode m_secureMode; + SslMode m_secureMode; QQueue<QWebSocket *> m_pendingConnections; QWebSocketProtocol::CloseCode m_error; QString m_errorString; |