summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2020-10-20 12:11:20 +0200
committerAndré Klitzing <aklitzing@gmail.com>2020-10-21 08:32:24 +0200
commita0a81f9217a1a197b7b9a4b22edaeae221836b5b (patch)
treecbe04326d0b9a38b282427c095f9a360203df85e
parent2aad8a7928f2227bfce979b524c6c45d074cab18 (diff)
downloadqtwebsockets-dev.tar.gz
Use QByteArray operator of QStringDecoderHEADdev
qwebsocketdataprocessor.cpp:203:72: error: no match for call to '(QStringDecoder) (const char*, qsizetype)' frame.payload().size()); qwebsocketdataprocessor.cpp:293:86: error: no match for call to '(QStringDecoder) (const char*, qsizetype)' closeReason = toUtf16(payload.constData() + 2, payload.size() - 2); Change-Id: Ia56b7b0b6e184ed95abf105d22149b4e07f18551 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
-rw-r--r--dependencies.yaml4
-rw-r--r--src/websockets/qwebsocketdataprocessor.cpp5
2 files changed, 4 insertions, 5 deletions
diff --git a/dependencies.yaml b/dependencies.yaml
index 6acb751..54d4949 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,7 +1,7 @@
dependencies:
../qtbase:
- ref: 46c1e609893b09a61d70dda3589e6b8d25261468
+ ref: 86d2f7f365c35f9833f3cf5c5731a8c258ad8ec4
required: true
../qtdeclarative:
- ref: 6412bcd2219d2a5c1f8193d8f394ddb1279dee2b
+ ref: 22e0701ee8baaf20a996abc3773e391687cbad70
required: false
diff --git a/src/websockets/qwebsocketdataprocessor.cpp b/src/websockets/qwebsocketdataprocessor.cpp
index 3ffc084..48a940d 100644
--- a/src/websockets/qwebsocketdataprocessor.cpp
+++ b/src/websockets/qwebsocketdataprocessor.cpp
@@ -199,8 +199,7 @@ bool QWebSocketDataProcessor::process(QIODevice *pIoDevice)
}
if (m_opCode == QWebSocketProtocol::OpCodeText) {
- QString frameTxt = m_decoder(frame.payload().constData(),
- frame.payload().size());
+ QString frameTxt = m_decoder(frame.payload());
if (Q_UNLIKELY(m_decoder.hasError())) {
clear();
Q_EMIT errorEncountered(QWebSocketProtocol::CloseCodeWrongDatatype,
@@ -290,7 +289,7 @@ bool QWebSocketDataProcessor::processControlFrame(const QWebSocketFrame &frame)
if (payload.size() > 2) {
auto toUtf16 = QStringDecoder(QStringDecoder::Utf8,
QStringDecoder::Flag::Stateless | QStringDecoder::Flag::ConvertInvalidToNull);
- closeReason = toUtf16(payload.constData() + 2, payload.size() - 2);
+ closeReason = toUtf16(QByteArrayView(payload).sliced(2));
if (Q_UNLIKELY(toUtf16.hasError())) {
closeCode = QWebSocketProtocol::CloseCodeWrongDatatype;
closeReason = tr("Invalid UTF-8 code encountered.");