mirror of https://github.com/qt/qtcoap.git
Compare commits
101 Commits
v6.9.0-bet
...
dev
Author | SHA1 | Date |
---|---|---|
|
fc48adb437 | |
|
ed64498884 | |
|
feaab0d09e | |
|
d1edf59e2e | |
|
66e3a99700 | |
|
980443ff65 | |
|
ff41dfbbf4 | |
|
398b0ca080 | |
|
4e08b0e7c0 | |
|
f6509ba532 | |
|
cd1fc74704 | |
|
f39277bf14 | |
|
241da3cf7c | |
|
d7928a43b0 | |
|
de51e04450 | |
|
27beb42a33 | |
|
d28ae1fef4 | |
|
2dcc46856e | |
|
95a161861b | |
|
19498bed65 | |
|
163b5e619b | |
|
b80c11bf00 | |
|
d85ded9e40 | |
|
f310b4a5a2 | |
|
a292490ba6 | |
|
11df2d4c33 | |
|
db77da4802 | |
|
8df5be74a0 | |
|
72953e45c4 | |
|
10ae4b6665 | |
|
fc4eda33f1 | |
|
533c0d18f9 | |
|
c7da497512 | |
|
ad485a7171 | |
|
9b58df71a8 | |
|
8540256517 | |
|
f38eff095e | |
|
e26601dac4 | |
|
6f5de771d9 | |
|
cc2d8bb958 | |
|
4aa77ed0db | |
|
b37714a28e | |
|
b73c764d25 | |
|
39c77b56d3 | |
|
0c050f2182 | |
|
2f67264d54 | |
|
e1a1fa96bc | |
|
14ff760873 | |
|
0ea08d303c | |
|
5bd6c49990 | |
|
a691cd6f6d | |
|
4f1cd59ec7 | |
|
14ee3d26be | |
|
faaebe5ced | |
|
4294227f1c | |
|
4622c24d0e | |
|
772aff6e43 | |
|
c38d7b0ee3 | |
|
c1a52251b4 | |
|
579f9dcd39 | |
|
664c4df0a0 | |
|
bbb76a9556 | |
|
ce19f0a28e | |
|
5350035042 | |
|
21af8b7754 | |
|
d34f543212 | |
|
40f95c2b22 | |
|
22d73265dc | |
|
8fdda96703 | |
|
8e87a4d03d | |
|
5322676ddc | |
|
9381fbd24b | |
|
4e2bf91523 | |
|
a98c8b0e0a | |
|
fa6fac26ec | |
|
84f827608d | |
|
295d5cdd08 | |
|
1120e29ca8 | |
|
4ebd3c0cd5 | |
|
ffa8096216 | |
|
b04786dc8a | |
|
e59a478700 | |
|
d9d7040c30 | |
|
900bf15846 | |
|
f4b9b13c81 | |
|
6af3aa9499 | |
|
681cf2dd4c | |
|
5c982a9be3 | |
|
7a99878a77 | |
|
274323c264 | |
|
b810301162 | |
|
809be51696 | |
|
34a944bec4 | |
|
2769f9a008 | |
|
28014e3a8e | |
|
64c51f849e | |
|
060d2edbec | |
|
a781ac2312 | |
|
046338ab5a | |
|
77b66428f7 | |
|
5616fe25f1 |
|
@ -1,4 +1,4 @@
|
||||||
set(QT_REPO_MODULE_VERSION "6.9.0")
|
set(QT_REPO_MODULE_VERSION "6.11.0")
|
||||||
set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
|
set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
|
||||||
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
|
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
|
||||||
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")
|
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[gerrit]
|
||||||
|
host=codereview.qt-project.org
|
||||||
|
project=qt/qtcoap
|
||||||
|
defaultbranch=dev
|
|
@ -11,8 +11,18 @@ project(QtCoap
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Network)
|
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals)
|
||||||
find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui Widgets Quick Qml)
|
|
||||||
|
# This should be called as early as possible, just after find_package(BuildInternals) where it is
|
||||||
|
# defined.
|
||||||
qt_internal_project_setup()
|
qt_internal_project_setup()
|
||||||
|
|
||||||
|
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core Network)
|
||||||
|
find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui Widgets Quick Qml)
|
||||||
|
|
||||||
|
if(NOT QT_FEATURE_udpsocket)
|
||||||
|
message(NOTICE "UDP socket support is required for QtCoap, skipping module")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
qt_build_repo()
|
qt_build_repo()
|
||||||
|
|
20
REUSE.toml
20
REUSE.toml
|
@ -1,40 +1,40 @@
|
||||||
version = 1
|
version = 1
|
||||||
|
|
||||||
[[annotations]]
|
[[annotations]]
|
||||||
path = [".tag", "**/.gitattributes", "**.gitignore"]
|
path = ["**/.gitattributes", "**.gitignore", "**.gitreview"]
|
||||||
precedence = "closest"
|
precedence = "closest"
|
||||||
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
|
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
|
||||||
SPDX-License-Identifier = "BSD-3-Clause"
|
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
|
||||||
|
|
||||||
[[annotations]]
|
[[annotations]]
|
||||||
path = [".cmake.conf", "**.yaml", "**.json", "**.yml"]
|
path = [".tag", ".cmake.conf", "**.yaml", "**.yml", "**ci_config_linux.json"]
|
||||||
precedence = "closest"
|
precedence = "closest"
|
||||||
comment = "build system"
|
comment = "build system"
|
||||||
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
|
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
|
||||||
SPDX-License-Identifier = "BSD-3-Clause"
|
SPDX-License-Identifier = "BSD-3-Clause"
|
||||||
|
|
||||||
[[annotations]]
|
[[annotations]]
|
||||||
path = ["examples/**"]
|
path = ["examples/**"]
|
||||||
comment = "this must be after the build system table because example and snippets take precedence over build system"
|
comment = "this must be after the build system table because example and snippets take precedence over build system"
|
||||||
precedence = "closest"
|
precedence = "closest"
|
||||||
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
|
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
|
||||||
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
|
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
|
||||||
|
|
||||||
[[annotations]]
|
[[annotations]]
|
||||||
path = ["**/README*", "**.qdocconf", "src/coap/doc/style/style.css"]
|
path = ["**/README*", "**.qdocconf", "src/coap/doc/style/style.css"]
|
||||||
comment = "documentation"
|
comment = "documentation"
|
||||||
precedence = "closest"
|
precedence = "closest"
|
||||||
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
|
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
|
||||||
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
|
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
|
||||||
|
|
||||||
[[annotations]]
|
[[annotations]]
|
||||||
path = ["**.toml", "licenseRule.json"]
|
path = ["**.toml", "licenseRule.json"]
|
||||||
precedence = "override"
|
precedence = "override"
|
||||||
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
|
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
|
||||||
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
|
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
|
||||||
|
|
||||||
[[annotations]]
|
[[annotations]]
|
||||||
path = ["**LICENSE*", "**.pem"]
|
path = ["**.pem"]
|
||||||
precedence = "override"
|
precedence = "override"
|
||||||
comment = "License file. Or such. To be confirmed for .pem files"
|
comment = "License file. Or such. To be confirmed for .pem files"
|
||||||
SPDX-FileCopyrightText = "None"
|
SPDX-FileCopyrightText = "None"
|
||||||
|
|
|
@ -6,6 +6,9 @@ accept_configuration:
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
Build:
|
Build:
|
||||||
|
- type: EnvironmentVariable
|
||||||
|
variableName: VERIFY_SOURCE_SBOM
|
||||||
|
variableValue: "ON"
|
||||||
- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
|
- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
../qtbase:
|
../qtbase:
|
||||||
ref: d89cef439f5c1a58aeff879a12d9a33292764b7f
|
ref: 6db355c6cd1c668ee79bcdccfdc4d5cbc379833f
|
||||||
required: true
|
required: true
|
||||||
|
|
|
@ -4,5 +4,5 @@ version = 1
|
||||||
path = ["*"]
|
path = ["*"]
|
||||||
precedence = "override"
|
precedence = "override"
|
||||||
comment = "Licensed as documentation."
|
comment = "Licensed as documentation."
|
||||||
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
|
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
|
||||||
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
|
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
|
||||||
|
|
121
licenseRule.json
121
licenseRule.json
|
@ -1,6 +1,6 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"comment" : ["file_pattern_ending: strings matched against the end of a file name.",
|
"comment": ["file_pattern_ending: strings matched against the end of a file name.",
|
||||||
"location keys: regular expression matched against the beginning of",
|
"location keys: regular expression matched against the beginning of",
|
||||||
"the file path (relative to the git submodule root).",
|
"the file path (relative to the git submodule root).",
|
||||||
"spdx: list of SPDX-License-Expression's allowed in the matching files.",
|
"spdx: list of SPDX-License-Expression's allowed in the matching files.",
|
||||||
|
@ -9,75 +9,100 @@
|
||||||
"unless they are examples",
|
"unless they are examples",
|
||||||
"Files with other endings can also be build system files"
|
"Files with other endings can also be build system files"
|
||||||
],
|
],
|
||||||
"file_pattern_ending" : ["CMakeLists.txt", ".cmake", ".pro", ".pri", ".prf",
|
"file_pattern_ending": ["CMakeLists.txt", ".cmake", ".pro", ".pri", ".prf",
|
||||||
"configure", "configure.bat", "cmake.in", "plist.in", "CMakeLists.txt.in"],
|
"configure", "configure.bat", "cmake.in", "plist.in", "CMakeLists.txt.in",
|
||||||
"location" : {
|
".cmake.conf",".tag", "ci_config_linux.json",
|
||||||
"" : {
|
".yaml", ".yml"],
|
||||||
"comment" : "Default",
|
"location": {
|
||||||
"file type" : "build system",
|
"": {
|
||||||
"spdx" : ["BSD-3-Clause"]
|
"comment": "Default",
|
||||||
|
"file type": "build system",
|
||||||
|
"spdx": ["BSD-3-Clause"]
|
||||||
},
|
},
|
||||||
"(.*)(examples/|snippets/)" : {
|
"(.*)(examples/|snippets/)": {
|
||||||
"comment" : "Example takes precedent",
|
"comment": "Example takes precedent",
|
||||||
"file type" : "examples and snippets",
|
"file type": "examples and snippets",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
|
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"comments" : ["Files with the following endings are Tool licensed,",
|
"comments": ["Files with the following endings are infrastructure licensed"],
|
||||||
|
"file_pattern_ending": [".gitattributes", ".gitignore", ".gitmodules", ".gitreview",
|
||||||
|
"_clang-format", "licenseRule.json", "REUSE.toml"],
|
||||||
|
"location":{
|
||||||
|
"": {
|
||||||
|
"comment": "Default",
|
||||||
|
"file type": "infrastructure",
|
||||||
|
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"comments": ["Files with the following endings are Tool licensed,",
|
||||||
"unless they are examples.",
|
"unless they are examples.",
|
||||||
"Files with other endings can also be tool files."],
|
"Files with other endings can also be tool files."],
|
||||||
"file_pattern_ending" : [".sh", ".py", ".pl", ".bat", ".ps1"],
|
"file_pattern_ending": [".sh", ".py", ".pl", ".bat", ".ps1"],
|
||||||
"location" :{
|
"location":{
|
||||||
"" : {
|
"": {
|
||||||
"comment" : "Default",
|
"comment": "Default",
|
||||||
"file type" : "tools and utils",
|
"file type": "tools and utils",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
|
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
|
||||||
},
|
},
|
||||||
"(.*)(examples/|snippets/)" : {
|
"(.*)(examples/|snippets/)": {
|
||||||
"comment" : "Example takes precedent",
|
"comment": "Example takes precedent",
|
||||||
"file type" : "examples and snippets",
|
"file type": "examples and snippets",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
|
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"comment" : "Files with the following endings are Documentation licensed.",
|
"comment": "Files with the following endings are Documentation licensed.",
|
||||||
"file_pattern_ending" : [".qdoc", ".qdocinc" , ".qdocconf", ".txt", "README", "qt_attribution.json"],
|
"file_pattern_ending": [".qdoc", ".qdocinc" , ".qdocconf", "README", "qt_attribution.json",
|
||||||
"location" :{
|
"README.md", ".css"],
|
||||||
"" : {
|
"location":{
|
||||||
"comment" : "",
|
"": {
|
||||||
"file type" : "documentation",
|
"comment": "",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
|
"file type": "documentation",
|
||||||
|
"spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"comment" : ["All other files",
|
"comment": ["All other files",
|
||||||
"The licensing is defined only by the file location in the Qt module repository.",
|
"The licensing is defined only by the file location in the Qt module repository.",
|
||||||
"NO <file_pattern_ending> key for this case!",
|
"NO <file_pattern_ending> key for this case!",
|
||||||
"This needs to be the last entry of the file."],
|
"This needs to be the last entry of the file."],
|
||||||
"location" : {
|
"location": {
|
||||||
"" : {
|
"": {
|
||||||
"comment" : "Default",
|
"comment": "Default",
|
||||||
"file type" : "module and plugin",
|
"file type": "module and plugin",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
|
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
|
||||||
},
|
},
|
||||||
"src/" : {
|
"dist/": {
|
||||||
"comment" : "Default",
|
"comment": "Default",
|
||||||
"file type" : "module and plugin",
|
"file type": "documentation",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
|
"spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
|
||||||
},
|
},
|
||||||
"tests/" : {
|
"src/": {
|
||||||
"comment" : "Default",
|
"comment": "Default",
|
||||||
"file type" : "test",
|
"file type": "module and plugin",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
|
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
|
||||||
},
|
},
|
||||||
"(.*)(examples/|snippets/)" : {
|
"tests/": {
|
||||||
"comment" : "Default",
|
"comment": "Default",
|
||||||
"file type" : "examples and snippets",
|
"file type": "test",
|
||||||
"spdx" : ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
|
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
|
||||||
|
},
|
||||||
|
"(.*)(examples/|snippets/)": {
|
||||||
|
"comment": "Default",
|
||||||
|
"file type": "examples and snippets",
|
||||||
|
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
|
||||||
|
},
|
||||||
|
"tests/auto/qcoapclient/testdata/.*pem": {
|
||||||
|
"comment": "",
|
||||||
|
"file type": "keys",
|
||||||
|
"spdx": ["CC0-1.0"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,5 +67,5 @@
|
||||||
In addition, it is available under the
|
In addition, it is available under the
|
||||||
\l{GNU General Public License, version 3}.
|
\l{GNU General Public License, version 3}.
|
||||||
|
|
||||||
\generatelist{groupsbymodule attributions-qtcoap}
|
\annotatedlist attributions-qtcoap
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapclient_p.h"
|
#include "qcoapclient_p.h"
|
||||||
#include "qcoapprotocol_p.h"
|
#include "qcoapprotocol_p.h"
|
||||||
|
@ -130,10 +131,6 @@ QCoapClientPrivate::~QCoapClientPrivate()
|
||||||
|
|
||||||
The default for \a securityMode is QtCoap::NoSecurity, which
|
The default for \a securityMode is QtCoap::NoSecurity, which
|
||||||
disables security.
|
disables security.
|
||||||
|
|
||||||
This connects using a QCoapQUdpConnection; to use a custom transport,
|
|
||||||
sub-class QCoapConnection and pass an instance to one of the other
|
|
||||||
constructors.
|
|
||||||
*/
|
*/
|
||||||
QCoapClient::QCoapClient(QtCoap::SecurityMode securityMode, QObject *parent) :
|
QCoapClient::QCoapClient(QtCoap::SecurityMode securityMode, QObject *parent) :
|
||||||
QObject(*new QCoapClientPrivate(new QCoapProtocol, new QCoapQUdpConnection(securityMode)),
|
QObject(*new QCoapClientPrivate(new QCoapProtocol, new QCoapQUdpConnection(securityMode)),
|
||||||
|
@ -258,7 +255,8 @@ QCoapReply *QCoapClient::put(const QCoapRequest &request, const QByteArray &data
|
||||||
|
|
||||||
Sends the \a request using the PUT method and returns a new QCoapReply
|
Sends the \a request using the PUT method and returns a new QCoapReply
|
||||||
object. Uses \a device content as the payload for this request.
|
object. Uses \a device content as the payload for this request.
|
||||||
A null device is treated as empty content.
|
A null device is treated as empty content, in which case the payload of the
|
||||||
|
\a request will be used.
|
||||||
|
|
||||||
\note The device has to be open and readable before calling this function.
|
\note The device has to be open and readable before calling this function.
|
||||||
|
|
||||||
|
@ -305,7 +303,8 @@ QCoapReply *QCoapClient::post(const QCoapRequest &request, const QByteArray &dat
|
||||||
|
|
||||||
Sends the \a request using the POST method and returns a new QCoapReply
|
Sends the \a request using the POST method and returns a new QCoapReply
|
||||||
object. Uses \a device content as the payload for this request.
|
object. Uses \a device content as the payload for this request.
|
||||||
A null device is treated as empty content.
|
A null device is treated as empty content, in which case the payload of the
|
||||||
|
\a request will be used.
|
||||||
|
|
||||||
\note The device has to be open and readable before calling this function.
|
\note The device has to be open and readable before calling this function.
|
||||||
|
|
||||||
|
@ -313,10 +312,7 @@ QCoapReply *QCoapClient::post(const QCoapRequest &request, const QByteArray &dat
|
||||||
*/
|
*/
|
||||||
QCoapReply *QCoapClient::post(const QCoapRequest &request, QIODevice *device)
|
QCoapReply *QCoapClient::post(const QCoapRequest &request, QIODevice *device)
|
||||||
{
|
{
|
||||||
if (!device)
|
return post(request, device ? device->readAll() : QByteArray());
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
return post(request, device->readAll());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -444,7 +440,7 @@ QCoapReply *QCoapClient::observe(const QCoapRequest &request)
|
||||||
d->connection->isSecure());
|
d->connection->isSecure());
|
||||||
copyRequest.enableObserve();
|
copyRequest.enableObserve();
|
||||||
|
|
||||||
return get(copyRequest);
|
return d->sendRequest(copyRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPCLIENT_H
|
#ifndef QCOAPCLIENT_H
|
||||||
#define QCOAPCLIENT_H
|
#define QCOAPCLIENT_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPCLIENT_P_H
|
#ifndef QCOAPCLIENT_P_H
|
||||||
#define QCOAPCLIENT_P_H
|
#define QCOAPCLIENT_P_H
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
// Copyright (C) 2019 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapconnection_p.h"
|
#include "qcoapconnection_p.h"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
// Copyright (C) 2019 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPCONNECTION_P_H
|
#ifndef QCOAPCONNECTION_P_H
|
||||||
#define QCOAPCONNECTION_P_H
|
#define QCOAPCONNECTION_P_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPGLOBAL_H
|
#ifndef QCOAPGLOBAL_H
|
||||||
#define QCOAPGLOBAL_H
|
#define QCOAPGLOBAL_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:network-protocol
|
||||||
|
|
||||||
#include "qcoapinternalmessage_p.h"
|
#include "qcoapinternalmessage_p.h"
|
||||||
#include "qcoaprequest_p.h"
|
#include "qcoaprequest_p.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPINTERNALMESSAGE_P_H
|
#ifndef QCOAPINTERNALMESSAGE_P_H
|
||||||
#define QCOAPINTERNALMESSAGE_P_H
|
#define QCOAPINTERNALMESSAGE_P_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:network-protocol
|
||||||
|
|
||||||
#include "qcoapinternalreply_p.h"
|
#include "qcoapinternalreply_p.h"
|
||||||
#include <QtCore/qmath.h>
|
#include <QtCore/qmath.h>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPINTERNALREPLY_H
|
#ifndef QCOAPINTERNALREPLY_H
|
||||||
#define QCOAPINTERNALREPLY_H
|
#define QCOAPINTERNALREPLY_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:network-protocol
|
||||||
|
|
||||||
#include "qcoaprequest.h"
|
#include "qcoaprequest.h"
|
||||||
#include "qcoapinternalrequest_p.h"
|
#include "qcoapinternalrequest_p.h"
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPINTERNALREQUEST_H
|
#ifndef QCOAPINTERNALREQUEST_H
|
||||||
#define QCOAPINTERNALREQUEST_H
|
#define QCOAPINTERNALREQUEST_H
|
||||||
|
|
||||||
#include <private/qcoapinternalmessage_p.h>
|
#include <private/qcoapinternalmessage_p.h>
|
||||||
|
#include <private/qcoapnamespace_p.h>
|
||||||
|
|
||||||
#include <QtCoap/qcoapglobal.h>
|
#include <QtCoap/qcoapglobal.h>
|
||||||
#include <QtCoap/qcoapnamespace.h>
|
|
||||||
#include <private/qcoapconnection_p.h>
|
#include <private/qcoapconnection_p.h>
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapmessage_p.h"
|
#include "qcoapmessage_p.h"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPMESSAGE_H
|
#ifndef QCOAPMESSAGE_H
|
||||||
#define QCOAPMESSAGE_H
|
#define QCOAPMESSAGE_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPMESSAGE_P_H
|
#ifndef QCOAPMESSAGE_P_H
|
||||||
#define QCOAPMESSAGE_P_H
|
#define QCOAPMESSAGE_P_H
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
// Copyright (C) 2019 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapnamespace_p.h"
|
#include "qcoapnamespace_p.h"
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include <QtCoap/qcoapglobal.h>
|
#include <QtCoap/qcoapglobal.h>
|
||||||
#include <QtCore/qobject.h>
|
#include <QtCore/qobject.h>
|
||||||
#include <QtCore/qrandom.h>
|
#include <QtCore/qrandom.h>
|
||||||
#include <QtCore/qloggingcategory.h>
|
|
||||||
|
|
||||||
#ifndef QCOAPNAMESPACE_H
|
#ifndef QCOAPNAMESPACE_H
|
||||||
#define QCOAPNAMESPACE_H
|
#define QCOAPNAMESPACE_H
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
Q_DECLARE_LOGGING_CATEGORY(lcCoapExchange)
|
|
||||||
Q_DECLARE_LOGGING_CATEGORY(lcCoapConnection)
|
|
||||||
|
|
||||||
#define FOR_EACH_COAP_ERROR(X) \
|
#define FOR_EACH_COAP_ERROR(X) \
|
||||||
X(BadRequest, 0x80) X(Unauthorized, 0x81) X(BadOption, 0x82) X(Forbidden, 0x83) \
|
X(BadRequest, 0x80) X(Unauthorized, 0x81) X(BadOption, 0x82) X(Forbidden, 0x83) \
|
||||||
X(NotFound, 0x84) X(MethodNotAllowed, 0x85) X(NotAcceptable, 0x86) \
|
X(NotFound, 0x84) X(MethodNotAllowed, 0x85) X(NotAcceptable, 0x86) \
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
// Copyright (C) 2019 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPNAMESPACE_P_H
|
#ifndef QCOAPNAMESPACE_P_H
|
||||||
#define QCOAPNAMESPACE_P_H
|
#define QCOAPNAMESPACE_P_H
|
||||||
|
|
||||||
#include "qcoapnamespace.h"
|
#include "qcoapnamespace.h"
|
||||||
#include "private/qglobal_p.h"
|
#include "private/qglobal_p.h"
|
||||||
|
#include <QtCore/qloggingcategory.h>
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// W A R N I N G
|
// W A R N I N G
|
||||||
|
@ -20,6 +23,9 @@
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(lcCoapExchange)
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(lcCoapConnection)
|
||||||
|
|
||||||
namespace QtCoap
|
namespace QtCoap
|
||||||
{
|
{
|
||||||
bool Q_AUTOTEST_EXPORT isError(QtCoap::ResponseCode code);
|
bool Q_AUTOTEST_EXPORT isError(QtCoap::ResponseCode code);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapoption_p.h"
|
#include "qcoapoption_p.h"
|
||||||
|
|
||||||
|
@ -157,7 +158,7 @@ QCoapOption &QCoapOption::operator=(QCoapOption &&other) noexcept
|
||||||
*/
|
*/
|
||||||
void QCoapOption::swap(QCoapOption &other) noexcept
|
void QCoapOption::swap(QCoapOption &other) noexcept
|
||||||
{
|
{
|
||||||
qSwap(d_ptr, other.d_ptr);
|
qt_ptr_swap(d_ptr, other.d_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPOPTION_H
|
#ifndef QCOAPOPTION_H
|
||||||
#define QCOAPOPTION_H
|
#define QCOAPOPTION_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPOPTION_P_H
|
#ifndef QCOAPOPTION_P_H
|
||||||
#define QCOAPOPTION_P_H
|
#define QCOAPOPTION_P_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:network-protocol
|
||||||
|
|
||||||
#include "qcoapprotocol_p.h"
|
#include "qcoapprotocol_p.h"
|
||||||
#include "qcoapinternalrequest_p.h"
|
#include "qcoapinternalrequest_p.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPPROTOCOL_P_H
|
#ifndef QCOAPPROTOCOL_P_H
|
||||||
#define QCOAPPROTOCOL_P_H
|
#define QCOAPPROTOCOL_P_H
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapqudpconnection_p.h"
|
#include "qcoapqudpconnection_p.h"
|
||||||
|
#include <private/qcoapnamespace_p.h>
|
||||||
|
|
||||||
#include <QtCore/qloggingcategory.h>
|
#include <QtCore/qloggingcategory.h>
|
||||||
#include <QtNetwork/qnetworkdatagram.h>
|
#include <QtNetwork/qnetworkdatagram.h>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPQUDPCONNECTION_P_H
|
#ifndef QCOAPQUDPCONNECTION_P_H
|
||||||
#define QCOAPQUDPCONNECTION_P_H
|
#define QCOAPQUDPCONNECTION_P_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapreply_p.h"
|
#include "qcoapreply_p.h"
|
||||||
#include "qcoapinternalreply_p.h"
|
#include "qcoapinternalreply_p.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPREPLY_H
|
#ifndef QCOAPREPLY_H
|
||||||
#define QCOAPREPLY_H
|
#define QCOAPREPLY_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPREPLY_P_H
|
#ifndef QCOAPREPLY_P_H
|
||||||
#define QCOAPREPLY_P_H
|
#define QCOAPREPLY_P_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoaprequest_p.h"
|
#include "qcoaprequest_p.h"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPREQUEST_H
|
#ifndef QCOAPREQUEST_H
|
||||||
#define QCOAPREQUEST_H
|
#define QCOAPREQUEST_H
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPREQUEST_P_H
|
#ifndef QCOAPREQUEST_P_H
|
||||||
#define QCOAPREQUEST_P_H
|
#define QCOAPREQUEST_P_H
|
||||||
|
|
||||||
#include <QtCoap/qcoapnamespace.h>
|
#include <private/qcoapnamespace_p.h>
|
||||||
#include <QtCoap/qcoaprequest.h>
|
#include <QtCoap/qcoaprequest.h>
|
||||||
#include <private/qcoapmessage_p.h>
|
#include <private/qcoapmessage_p.h>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapresource_p.h"
|
#include "qcoapresource_p.h"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPRESOURCE_H
|
#ifndef QCOAPRESOURCE_H
|
||||||
#define QCOAPRESOURCE_H
|
#define QCOAPRESOURCE_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPRESOURCE_P_H
|
#ifndef QCOAPRESOURCE_P_H
|
||||||
#define QCOAPRESOURCE_P_H
|
#define QCOAPRESOURCE_P_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:data-parser
|
||||||
|
|
||||||
#include "qcoapresourcediscoveryreply_p.h"
|
#include "qcoapresourcediscoveryreply_p.h"
|
||||||
#include "qcoapinternalreply_p.h"
|
#include "qcoapinternalreply_p.h"
|
||||||
|
@ -108,14 +109,14 @@ QCoapResourceDiscoveryReplyPrivate::resourcesFromCoreLinkList(const QHostAddress
|
||||||
|
|
||||||
QLatin1String quote = QLatin1String("\"");
|
QLatin1String quote = QLatin1String("\"");
|
||||||
const QList<QByteArray> links = data.split(',');
|
const QList<QByteArray> links = data.split(',');
|
||||||
for (QByteArray link : links) {
|
for (const QByteArray &link : links) {
|
||||||
QCoapResource resource;
|
QCoapResource resource;
|
||||||
resource.setHost(sender);
|
resource.setHost(sender);
|
||||||
|
|
||||||
const QList<QByteArray> parameterList = link.split(';');
|
const QList<QByteArray> parameterList = link.split(';');
|
||||||
for (QByteArray parameter : parameterList) {
|
for (const QByteArray ¶meter : parameterList) {
|
||||||
QString parameterString = QString::fromUtf8(parameter);
|
QString parameterString = QString::fromUtf8(parameter);
|
||||||
int length = parameterString.size();
|
const qsizetype length = parameterString.size();
|
||||||
if (parameter.startsWith('<'))
|
if (parameter.startsWith('<'))
|
||||||
resource.setPath(parameterString.mid(1, length - 2));
|
resource.setPath(parameterString.mid(1, length - 2));
|
||||||
else if (parameter.startsWith("title="))
|
else if (parameter.startsWith("title="))
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPRESOURCEDISCOVERYREPLY_H
|
#ifndef QCOAPRESOURCEDISCOVERYREPLY_H
|
||||||
#define QCOAPRESOURCEDISCOVERYREPLY_H
|
#define QCOAPRESOURCEDISCOVERYREPLY_H
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (C) 2017 Witekio.
|
// Copyright (C) 2017 Witekio.
|
||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
// Copyright (C) 2018 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPRESOURCEDISCOVERYREPLY_P_H
|
#ifndef QCOAPRESOURCEDISCOVERYREPLY_P_H
|
||||||
#define QCOAPRESOURCEDISCOVERYREPLY_P_H
|
#define QCOAPRESOURCEDISCOVERYREPLY_P_H
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
// Copyright (C) 2019 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#include "qcoapsecurityconfiguration.h"
|
#include "qcoapsecurityconfiguration.h"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
// Copyright (C) 2019 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:default
|
||||||
|
|
||||||
#ifndef QCOAPSECURITYCONFIGURATION_H
|
#ifndef QCOAPSECURITYCONFIGURATION_H
|
||||||
#define QCOAPSECURITYCONFIGURATION_H
|
#define QCOAPSECURITYCONFIGURATION_H
|
||||||
|
|
|
@ -151,7 +151,7 @@ bool waitForHost(const QUrl &url, QtCoap::SecurityMode security = QtCoap::Securi
|
||||||
if (security != QtCoap::SecurityMode::NoSecurity)
|
if (security != QtCoap::SecurityMode::NoSecurity)
|
||||||
client.setSecurityConfiguration(createConfiguration(security));
|
client.setSecurityConfiguration(createConfiguration(security));
|
||||||
|
|
||||||
QSignalSpy spyClientFinished(&client, SIGNAL(finished(QCoapReply *)));
|
QSignalSpy spyClientFinished(&client, SIGNAL(finished(QCoapReply*)));
|
||||||
client.get(url);
|
client.get(url);
|
||||||
|
|
||||||
spyClientFinished.wait(1000);
|
spyClientFinished.wait(1000);
|
||||||
|
|
|
@ -18,6 +18,7 @@ private Q_SLOTS:
|
||||||
void updateReply();
|
void updateReply();
|
||||||
void requestData();
|
void requestData();
|
||||||
void abortRequest();
|
void abortRequest();
|
||||||
|
void readReplyChunked();
|
||||||
};
|
};
|
||||||
|
|
||||||
void tst_QCoapReply::updateReply_data()
|
void tst_QCoapReply::updateReply_data()
|
||||||
|
@ -117,6 +118,39 @@ void tst_QCoapReply::abortRequest()
|
||||||
QVERIFY(arguments.at(0).toByteArray() == "token");
|
QVERIFY(arguments.at(0).toByteArray() == "token");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QCoapReply::readReplyChunked()
|
||||||
|
{
|
||||||
|
const QByteArray token = "\xAF\x01\xC2";
|
||||||
|
const quint16 id = 645;
|
||||||
|
const QByteArray payload = "this is some payload";
|
||||||
|
|
||||||
|
QScopedPointer<QCoapReply> reply(QCoapReplyPrivate::createCoapReply(QCoapRequest()));
|
||||||
|
QCoapMessage message;
|
||||||
|
message.setToken(token);
|
||||||
|
message.setMessageId(id);
|
||||||
|
message.setPayload(payload);
|
||||||
|
|
||||||
|
QMetaObject::invokeMethod(reply.data(), "_q_setContent",
|
||||||
|
Q_ARG(QHostAddress, QHostAddress()),
|
||||||
|
Q_ARG(QCoapMessage, message),
|
||||||
|
Q_ARG(QtCoap::ResponseCode, QtCoap::ResponseCode::Content));
|
||||||
|
QMetaObject::invokeMethod(reply.data(), "_q_setFinished",
|
||||||
|
Q_ARG(QtCoap::Error, QtCoap::Error::Ok));
|
||||||
|
|
||||||
|
QCOMPARE_EQ(reply->pos(), 0);
|
||||||
|
const qsizetype startBytes = 7;
|
||||||
|
const QByteArray start = reply->read(startBytes);
|
||||||
|
QCOMPARE_EQ(start, payload.first(startBytes));
|
||||||
|
QCOMPARE_EQ(reply->pos(), startBytes);
|
||||||
|
|
||||||
|
QByteArray last(100, Qt::Uninitialized);
|
||||||
|
const qint64 read = reply->read(last.data(), last.size());
|
||||||
|
QCOMPARE_EQ(read, payload.size() - startBytes);
|
||||||
|
QCOMPARE_EQ(reply->pos(), payload.size());
|
||||||
|
last.resize(read);
|
||||||
|
QCOMPARE_EQ(start + last, payload);
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_MAIN(tst_QCoapReply)
|
QTEST_MAIN(tst_QCoapReply)
|
||||||
|
|
||||||
#include "tst_qcoapreply.moc"
|
#include "tst_qcoapreply.moc"
|
||||||
|
|
Loading…
Reference in New Issue