diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-07-21 13:45:43 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-07-25 12:08:55 +0000 |
commit | 530b1f145d0deb076416fbce6cd02de86e827479 (patch) | |
tree | 3deb3a3b8054a4107db23ef963694ed7fdeca0c8 /src/qmldebug | |
parent | 42f6af4781fc4be3f565881277fab041bcabecec (diff) |
QmlDebug: Fixes for QQmlDebugConnection
Properly close the connection on invalid hello messages and implement
flush() also for local sockets.
Change-Id: Ie78441b9933c6de053962a11b5d7e2636792a31c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qmldebug')
-rw-r--r-- | src/qmldebug/qqmldebugconnection.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qmldebug/qqmldebugconnection.cpp b/src/qmldebug/qqmldebugconnection.cpp index 35a540bff8..61f178fd28 100644 --- a/src/qmldebug/qqmldebugconnection.cpp +++ b/src/qmldebug/qqmldebugconnection.cpp @@ -159,7 +159,7 @@ void QQmlDebugConnection::protocolReadyRead() if (!validHello) { qWarning("QQmlDebugConnection: Invalid hello message"); - QObject::disconnect(d->protocol, SIGNAL(protocolReadyRead()), this, SLOT(protocolReadyRead())); + close(); return; } d->gotHello = true; @@ -374,8 +374,9 @@ bool QQmlDebugConnection::sendMessage(const QString &name, const QByteArray &mes void QQmlDebugConnectionPrivate::flush() { - QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(device); - if (socket) + if (QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(device)) + socket->flush(); + else if (QLocalSocket *socket = qobject_cast<QLocalSocket *>(device)) socket->flush(); } |