diff options
authorEdward Welbourne <>2017-05-03 13:19:12 (GMT)
committerEdward Welbourne <>2017-05-04 12:55:26 (GMT)
commit9970187acb7221f62ec001128026d202391699c0 (patch)
parentcec66b8969215d7355aa61655e68893f7dad5595 (diff)
QQmlWebSocket::setUrl(): let open() decided what to actually do
After emitting urlChanged(), setUrl() did a manual open(url) if it had a web-socket to do it on, omitting various checks that open() imposes on actually calling open(url); as a result, it left the web socket in an inconsistent state if it wasn't yet active. This meant that setting active could trigger a second open() while the web-socket was already open(), which upset it. Replaced the hand-rolled call to open(url) with a call to open() so as to be consistent and avoid such problems. Task-number: QTBUG-58278 Change-Id: Iee84f2b0d973e7fd288a14018039a665658c0040 Reviewed-by: Jesus Fernandez <> Reviewed-by: Timur Pocheptsov <>
1 files changed, 1 insertions, 3 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