summaryrefslogtreecommitdiff
path: root/src/webchannel/qmetaobjectpublisher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webchannel/qmetaobjectpublisher.cpp')
-rw-r--r--src/webchannel/qmetaobjectpublisher.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/webchannel/qmetaobjectpublisher.cpp b/src/webchannel/qmetaobjectpublisher.cpp
index d9aa548..7c6c6eb 100644
--- a/src/webchannel/qmetaobjectpublisher.cpp
+++ b/src/webchannel/qmetaobjectpublisher.cpp
@@ -474,7 +474,7 @@ void QMetaObjectPublisher::deleteWrappedObject(QObject *object) const
void QMetaObjectPublisher::broadcastMessage(const QJsonObject &message) const
{
if (webChannel->d_func()->transports.isEmpty()) {
- qWarning("QWebChannel is not connected to any transports, cannot send messages.");
+ qWarning("QWebChannel is not connected to any transports, cannot send message: %s", QJsonDocument(message).toJson().constData());
return;
}
@@ -485,6 +485,11 @@ void QMetaObjectPublisher::broadcastMessage(const QJsonObject &message) const
void QMetaObjectPublisher::handleMessage(const QJsonObject &message, QWebChannelAbstractTransport *transport)
{
+ if (!webChannel->d_func()->transports.contains(transport)) {
+ qWarning() << "Refusing to handle message of unknown transport:" << transport;
+ return;
+ }
+
if (!message.contains(KEY_TYPE)) {
qWarning("JSON message object is missing the type property: %s", QJsonDocument(message).toJson().constData());
return;