aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-12 03:07:03 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-12 03:07:03 +0200
commitd7549a362676a18bebe661338c3b09b1469eb730 (patch)
treecc32de2081743a8970c892d6778eb46acda07880
parente0d35eb9877ae7cb2efd653e0d426e276a72612c (diff)
parenta7bfc7ebb30dd45e4692ec38d8b9ede6372939f0 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
-rw-r--r--examples/coap/coap.pro6
-rw-r--r--src/coap/qcoapprotocol.cpp4
-rw-r--r--src/coap/qcoapqudpconnection.cpp12
-rw-r--r--tests/auto/qcoapclient/tst_qcoapclient.cpp5
4 files changed, 14 insertions, 13 deletions
diff --git a/examples/coap/coap.pro b/examples/coap/coap.pro
index 006c281..befe3b7 100644
--- a/examples/coap/coap.pro
+++ b/examples/coap/coap.pro
@@ -1,8 +1,8 @@
TEMPLATE = subdirs
-SUBDIRS += \
- simplecoapclient \
- consolecoapclient
+SUBDIRS += consolecoapclient
+
+qtHaveModule(gui) SUBDIRS += simplecoapclient
qtHaveModule(quick) {
SUBDIRS += \
diff --git a/src/coap/qcoapprotocol.cpp b/src/coap/qcoapprotocol.cpp
index 42ef4ba..9d365c6 100644
--- a/src/coap/qcoapprotocol.cpp
+++ b/src/coap/qcoapprotocol.cpp
@@ -139,14 +139,14 @@ void QCoapProtocol::sendRequest(QPointer<QCoapReply> reply, QCoapConnection *con
|| !QCoapRequestPrivate::isUrlValid(reply->request().url()))
return;
- connect(reply, &QCoapReply::aborted, this, [this](const QCoapToken &token) {
+ connect(reply.data(), &QCoapReply::aborted, this, [this](const QCoapToken &token) {
Q_D(QCoapProtocol);
d->onRequestAborted(token);
});
auto internalRequest = QSharedPointer<QCoapInternalRequest>::create(reply->request(), this);
internalRequest->setMaxTransmissionWait(maximumTransmitWait());
- connect(reply, &QCoapReply::finished, this, &QCoapProtocol::finished);
+ connect(reply.data(), &QCoapReply::finished, this, &QCoapProtocol::finished);
if (internalRequest->isMulticast()) {
connect(internalRequest.data(), &QCoapInternalRequest::multicastRequestExpired, this,
diff --git a/src/coap/qcoapqudpconnection.cpp b/src/coap/qcoapqudpconnection.cpp
index ebb3fa9..41224a2 100644
--- a/src/coap/qcoapqudpconnection.cpp
+++ b/src/coap/qcoapqudpconnection.cpp
@@ -113,15 +113,17 @@ QCoapQUdpConnection::QCoapQUdpConnection(QCoapQUdpConnectionPrivate &dd, QObject
configuration.setPeerVerifyMode(QSslSocket::VerifyNone);
d->dtls->setDtlsConfiguration(configuration);
- connect(d->dtls, &QDtls::pskRequired, this, &QCoapQUdpConnection::pskRequired);
- connect(d->dtls, &QDtls::handshakeTimeout, this, &QCoapQUdpConnection::handshakeTimeout);
+ connect(d->dtls.data(), &QDtls::pskRequired, this, &QCoapQUdpConnection::pskRequired);
+ connect(d->dtls.data(), &QDtls::handshakeTimeout,
+ this, &QCoapQUdpConnection::handshakeTimeout);
break;
case QtCoap::SecurityMode::Certificate:
d->dtls = new QDtls(QSslSocket::SslClientMode, this);
configuration.setPeerVerifyMode(QSslSocket::VerifyPeer);
d->dtls->setDtlsConfiguration(configuration);
- connect(d->dtls, &QDtls::handshakeTimeout, this, &QCoapQUdpConnection::handshakeTimeout);
+ connect(d->dtls.data(), &QDtls::handshakeTimeout,
+ this, &QCoapQUdpConnection::handshakeTimeout);
break;
default:
break;
@@ -145,11 +147,11 @@ void QCoapQUdpConnection::createSocket()
d->udpSocket = new QUdpSocket(this);
- connect(d->udpSocket, &QUdpSocket::readyRead, [this]() {
+ connect(d->udpSocket.data(), &QUdpSocket::readyRead, [this]() {
Q_D(QCoapQUdpConnection);
d->socketReadyRead();
});
- connect(d->udpSocket, QOverload<QAbstractSocket::SocketError>::of(&QUdpSocket::error),
+ connect(d->udpSocket.data(), QOverload<QAbstractSocket::SocketError>::of(&QUdpSocket::error),
[this](QAbstractSocket::SocketError socketError) {
qCWarning(lcCoapConnection) << "CoAP UDP socket error" << socketError
<< socket()->errorString();
diff --git a/tests/auto/qcoapclient/tst_qcoapclient.cpp b/tests/auto/qcoapclient/tst_qcoapclient.cpp
index b7844b7..e28a48b 100644
--- a/tests/auto/qcoapclient/tst_qcoapclient.cpp
+++ b/tests/auto/qcoapclient/tst_qcoapclient.cpp
@@ -433,10 +433,9 @@ void tst_QCoapClient::removeReply()
QCoapClient client;
QCoapReply *reply = client.get(QUrl(testServerResource()));
QVERIFY2(reply != nullptr, "Request failed unexpectedly");
+ connect(reply, &QCoapReply::finished, this, [reply]() { reply->deleteLater(); });
try {
- reply->deleteLater();
-
QEventLoop eventLoop;
QTimer::singleShot(2000, &eventLoop, &QEventLoop::quit);
eventLoop.exec();
@@ -1109,7 +1108,7 @@ void tst_QCoapClient::setMinimumTokenSize()
QScopedPointer<QCoapReply> reply;
reply.reset(client.get(QCoapRequest("127.0.0.1")));
- QTRY_COMPARE_WITH_TIMEOUT(spyClientError.count(), 1, 100);
+ QTRY_COMPARE_WITH_TIMEOUT(spyClientError.count(), 1, 300);
QVERIFY(reply->request().tokenLength() >= expectedMinSize);
QVERIFY(reply->request().tokenLength() <= maxSize);
}