summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 03:04:34 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 03:04:40 +0200
commit31cfb286aefcd4625d8b41961ac87c592581d839 (patch)
tree78fd2291314ae1407aa310567c88ab67248e750a
parentd234e25d530f19979fbfc4b4fea73277358a0a39 (diff)
parentff8ac61c5ddab365fbed5b1534be05d79d9e978a (diff)
downloadqtwebsockets-31cfb286aefcd4625d8b41961ac87c592581d839.tar.gz
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
-rw-r--r--dist/changes-5.12.520
-rw-r--r--dist/changes-5.13.120
-rw-r--r--src/websockets/qwebsocket_wasm_p.cpp16
3 files changed, 52 insertions, 4 deletions
diff --git a/dist/changes-5.12.5 b/dist/changes-5.12.5
new file mode 100644
index 0000000..e8be931
--- /dev/null
+++ b/dist/changes-5.12.5
@@ -0,0 +1,20 @@
+Qt 5.12.5 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.4.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+ - This release contains only minor code improvements.
diff --git a/dist/changes-5.13.1 b/dist/changes-5.13.1
new file mode 100644
index 0000000..57ebdbe
--- /dev/null
+++ b/dist/changes-5.13.1
@@ -0,0 +1,20 @@
+Qt 5.13.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.13.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.13 series is binary compatible with the 5.12.x series.
+Applications compiled for 5.12 will continue to run with 5.13.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+ - This release contains only minor code improvements.
diff --git a/src/websockets/qwebsocket_wasm_p.cpp b/src/websockets/qwebsocket_wasm_p.cpp
index 199fe44..85fcab2 100644
--- a/src/websockets/qwebsocket_wasm_p.cpp
+++ b/src/websockets/qwebsocket_wasm_p.cpp
@@ -137,11 +137,19 @@ qint64 QWebSocketPrivate::sendTextMessage(const QString &message)
qint64 QWebSocketPrivate::sendBinaryMessage(const QByteArray &data)
{
- socketContext.call<void>("send",
- val(typed_memory_view(data.size(),
- reinterpret_cast<const unsigned char *>
- (data.constData()))));
+ // Make a copy of the payload data; we don't know how long WebSocket.send() will
+ // retain the memory view, while the QByteArray passed to this function may be
+ // destroyed as soon as this function returns. In addition, the WebSocket.send()
+ // API does not accept data from a view backet by a SharedArrayBuffer, which will
+ // be the case for the view produced by typed_memory_view() when threads are enabled.
+ val Uint8Array = val::global("Uint8Array");
+ val dataCopy = Uint8Array.new_(data.size());
+ val dataView = val(typed_memory_view(data.size(),
+ reinterpret_cast<const unsigned char *>
+ (data.constData())));
+ dataCopy.call<void>("set", dataView);
+ socketContext.call<void>("send", dataCopy);
return data.length();
}