diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/qmlwebsockets/qqmlwebsocket.cpp | 4 | ||||
-rw-r--r-- | src/src.pro | 6 | ||||
-rw-r--r-- | src/websockets/qwebsocket_p.cpp | 6 | ||||
-rw-r--r-- | src/websockets/qwebsocket_p.h | 15 |
4 files changed, 16 insertions, 15 deletions
diff --git a/src/imports/qmlwebsockets/qqmlwebsocket.cpp b/src/imports/qmlwebsockets/qqmlwebsocket.cpp index 35f6259..37a2fad 100644 --- a/src/imports/qmlwebsockets/qqmlwebsocket.cpp +++ b/src/imports/qmlwebsockets/qqmlwebsocket.cpp @@ -181,9 +181,7 @@ void QQmlWebSocket::setUrl(const QUrl &url) } m_url = url; Q_EMIT urlChanged(); - if (m_webSocket) { - m_webSocket->open(m_url); - } + open(); } QQmlWebSocket::Status QQmlWebSocket::status() const diff --git a/src/src.pro b/src/src.pro index ad1b0c7..b5d9d1b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,5 +1,7 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS += websockets -qtHaveModule(quick): SUBDIRS += imports +qtConfig(textcodec) { + SUBDIRS += websockets + qtHaveModule(quick): SUBDIRS += imports +} diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index 1a47e76..f36056c 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -953,7 +953,7 @@ void QWebSocketPrivate::processHandshake(QTcpSocket *pSocket) case NothingDoneState: m_headers.clear(); m_handshakeState = ReadingStatusState; - // no break + Q_FALLTHROUGH(); case ReadingStatusState: if (!pSocket->canReadLine()) return; @@ -963,7 +963,7 @@ void QWebSocketPrivate::processHandshake(QTcpSocket *pSocket) break; } m_handshakeState = ReadingHeaderState; - // no break + Q_FALLTHROUGH(); case ReadingHeaderState: while (pSocket->canReadLine()) { QString headerLine = readLine(pSocket); @@ -985,7 +985,7 @@ void QWebSocketPrivate::processHandshake(QTcpSocket *pSocket) } return; } - // no break + Q_FALLTHROUGH(); case ParsingHeaderState: { const QString acceptKey = m_headers.value(QStringLiteral("sec-websocket-accept"), QString()); const QString upgrade = m_headers.value(QStringLiteral("upgrade"), QString()); diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h index 4863de7..4d33788 100644 --- a/src/websockets/qwebsocket_p.h +++ b/src/websockets/qwebsocket_p.h @@ -179,7 +179,7 @@ private: void processHandshake(QTcpSocket *pSocket); void processStateChanged(QAbstractSocket::SocketState socketState); - qint64 doWriteFrames(const QByteArray &data, bool isBinary) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT qint64 doWriteFrames(const QByteArray &data, bool isBinary); void makeConnections(const QTcpSocket *pTcpSocket); void releaseConnections(const QTcpSocket *pTcpSocket); @@ -195,15 +195,16 @@ private: QByteArray key, const QList<QPair<QString, QString> > &headers); - static QWebSocket *upgradeFrom(QTcpSocket *tcpSocket, - const QWebSocketHandshakeRequest &request, - const QWebSocketHandshakeResponse &response, - QObject *parent = Q_NULLPTR) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static QWebSocket * + upgradeFrom(QTcpSocket *tcpSocket, + const QWebSocketHandshakeRequest &request, + const QWebSocketHandshakeResponse &response, + QObject *parent = Q_NULLPTR); quint32 generateMaskingKey() const; QByteArray generateKey() const; - qint64 writeFrames(const QList<QByteArray> &frames) Q_REQUIRED_RESULT; - qint64 writeFrame(const QByteArray &frame) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT qint64 writeFrames(const QList<QByteArray> &frames); + Q_REQUIRED_RESULT qint64 writeFrame(const QByteArray &frame); QTcpSocket *m_pSocket; QString m_errorString; |