diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-03-06 17:59:05 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-03-11 16:53:50 +0000 |
commit | dcc2cb63e9d3e58e95c8cd6455b3e8280d66a746 (patch) | |
tree | 4b35d2a03dbe621ced0edfb0040abc03d18a9a4d /src/coap/qcoapprotocol.cpp | |
parent | 872ab757fd2ab19f2b004b38a176ac7700de9926 (diff) |
Add the sender address to responses for a multicast request
For the responses to multicast requests the address of the
sender of the reply does not match with the host address in
the request URI. There should be a way to find out who
has sent the response.
Change-Id: Icbc6c6ae926198870dbc7dbbb92dc319c46d7de7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/coap/qcoapprotocol.cpp')
-rw-r--r-- | src/coap/qcoapprotocol.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/coap/qcoapprotocol.cpp b/src/coap/qcoapprotocol.cpp index 5c71655..8e0b5f2 100644 --- a/src/coap/qcoapprotocol.cpp +++ b/src/coap/qcoapprotocol.cpp @@ -69,11 +69,13 @@ QT_BEGIN_NAMESPACE /*! \fn void QCoapProtocol::responseToMulticastReceived(QCoapReply *reply, - const QCoapMessage& message) + const QCoapMessage& message, + const QHostAddress &sender) This signal is emitted when a unicast response to a multicast request arrives. The \a reply parameter contains a pointer to the reply that has just - been received, and \a message contains the payload and the message details. + been received, \a message contains the payload and the message details, + and \a sender contains the sender address. \sa error(), QCoapReply::finished(), QCoapReply::error() */ @@ -547,7 +549,7 @@ void QCoapProtocolPrivate::onLastMessageReceived(QCoapInternalRequest *request, forgetExchangeReplies(request->token()); } else if (request->isMulticast()) { Q_Q(QCoapProtocol); - emit q->responseToMulticastReceived(userReply, *lastReply->message()); + emit q->responseToMulticastReceived(userReply, *lastReply->message(), sender); } else { QMetaObject::invokeMethod(userReply, "_q_setFinished", Qt::QueuedConnection, Q_ARG(QtCoap::Error, QtCoap::NoError)); |