Compare commits

...

101 Commits

Author SHA1 Message Date
Qt Submodule Update Bot fc48adb437 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Iff9cf0e6781e33507641f3112518f3df13abfd65
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-17 03:39:08 +00:00
Qt Submodule Update Bot ed64498884 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ie3e41f2cdd603a45857114db620d340751d02635
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-12 04:14:09 +00:00
Qt Submodule Update Bot feaab0d09e Update dependencies on 'dev' in qt/qtcoap
Change-Id: I559b155a73c774389acb2a214ebcabe3f7a6ed8c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-09 09:32:04 +00:00
Volker Hilsheimer d1edf59e2e QCoapClient: remove documentation about custom transport
Neither QCoapConnection nor QCoapQUdpConnection are public classes, and
there is no QCoapClient constructor (or other API) that would accept a
connection-instance.

Task-number: QTBUG-139697
Pick-to: 6.10 6.9 6.8
Change-Id: I3024d886299175401557a0b30987e98ab80b956f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-09-05 17:18:53 +02:00
Qt Submodule Update Bot 66e3a99700 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ie70b254a66dfa5623742482ca278816f7214dcce
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-05 05:11:07 +00:00
Qt Submodule Update Bot 980443ff65 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I38b40d13eb15376d0558544a6724be1ae730ad7e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-01 12:05:36 +00:00
Qt Submodule Update Bot ff41dfbbf4 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I1ce92a306515c500a12ae70376ae39076cfa0b5d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-25 04:30:02 +00:00
Qt Submodule Update Bot 398b0ca080 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I690c48a47b6cbc50ae2602c684102b433be929e0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-21 05:01:17 +00:00
Qt Submodule Update Bot 4e08b0e7c0 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I34d497178bacf4b60e11878f3d232065a40415b9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-18 08:48:36 +00:00
Qt Submodule Update Bot f6509ba532 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I8c4b5c7cb4cff22f208753299061e1759a3fd305
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-14 08:54:01 +00:00
Qt Submodule Update Bot cd1fc74704 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ic7d41867484c671c7e96210b03704b8834382710
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-13 04:50:52 +00:00
Qt Submodule Update Bot f39277bf14 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ia50edc5612ad23f38b781526aa5ce863eab1f026
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-08 17:35:45 +00:00
Topi Reinio 241da3cf7c Doc: Fix incorrect usage of \generatelist
The \generatelist command takes an optional argument
that affect how the members are listed, for example,
`classesbymodule` which creates an annotated list of
the classes in a named C++ module.

`groupsbymodule` is not recognized or documented. QDoc
falls back to generating a list of all members of a
group in this case. While the end result is correct,
this relies on an undocumented feature that is likely
to change and break.

Replace these instances with an explicit \annotatedlist
command that produces the same output.

Pick-to: 6.10
Task-number: QTBUG-138901
Change-Id: I0c23dac38445e41940907cf32a6da6fe3b769f7f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2025-08-06 09:14:57 +00:00
Qt Submodule Update Bot d7928a43b0 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ibd0f980b81bbce15b38cfdaea84f649afb59615e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-05 04:18:47 +00:00
Ivan Solovev de51e04450 Mark the rest of the files in QtCoAP as security-significant
The previous commits identified and marked all security-critical files.
This commit marks the rest of the module with the default security
level (i.e. significant).

Fixes: QTBUG-135752
Pick-to: 6.10 6.9 6.8
Change-Id: I5ca76189504a2dfa1143def36abaafcca14bbcf5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-08-01 15:18:07 +02:00
Ivan Solovev 27beb42a33 Mark qcoapresourcediscoveryreply.cpp as security-critical
The QCoapResourceDiscoveryReplyPrivate::resourcesFromCoreLinkList()
method parses the resource discovery reply according to the CoRE Link
Format.

Task-number: QTBUG-135752
Pick-to: 6.10 6.9 6.8
Change-Id: I274c6ea467ccafe8d8bef1230a87d0c12d79dbc8
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-08-01 15:18:07 +02:00
Ivan Solovev d28ae1fef4 QCoapClient::post(): align the implementation with the docs
The docs clearly mention that a null device is treated as empty content.
However, the code was simply returning a nullptr in such case instead
of posting an actual request with an empty data.

As a drive-by, update the docs to actually mention that if the original
request has a payload, it will be used in such case. That is how the
QBA overload behaves.

[ChangeLog][Important Behavior Changes][QCoapClient] The post() overload
that takes a QIODevice* now behaves according to the documentation.
Specifically, if the provided QIODevice* is null, it will act as if an
empty QByteArray was provided instead of simply returning nullptr.

Change-Id: If8848515c71bd48f15e7672be6e184f903ce576d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-08-01 15:18:07 +02:00
Qt Submodule Update Bot 2dcc46856e Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ic54574353ee6d682e1df4111c98e1cc5ee44522b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-01 11:07:31 +00:00
Ivan Solovev 95a161861b Explicitly mark qcoaprequest.cpp as significant
Various methods in this file parse and adjust the user-provided URL.
However, they do it by using the public QUrl APIs only. Since QUrl
itself is security-critical, this file can be marked with the default
security score.

Task-number: QTBUG-135752
Pick-to: 6.10 6.9 6.8
Change-Id: I556a5b171aa0b1944688d5d87ab2279c13277ec3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-08-01 10:46:13 +02:00
Ivan Solovev 19498bed65 Mark files that implement the CoAP protocol as security-critical
The QCoapInternalMessage::setFromDescriptiveBlockOption() method
implements a part of the CoAP protocol, so mark qcoapinternalmessage.cpp
as security-critical.

The QCoapInternalReply class has createFromFrame() and nextBlockToSend()
methods that implement parts of the CoAP protocol, so mark
qcoapinternalreply.cpp as security-critical.

The QCoapInternalRequest class contains multiple methods that
implement the CoAP protocol (e.g. toQByteArray() or blockOption()), so
mark qcoapinternalrequest.cpp as security-critical.

The QCoapProtocol class implements the high-level details of the CoAP
protocol. It does not directly parse the data or generate the frames,
but contains the logic to call the proper low-level implementation.
Therefor, mark it as security-critical as well.

Task-number: QTBUG-135752
Pick-to: 6.10 6.9 6.8
Change-Id: I84855b6c352356f6163f7310b2d7075fd86bc9d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-08-01 10:46:07 +02:00
Ivan Solovev 163b5e619b Docs: clarify QCoapClient::put() QIODevice overload
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ib3c4f5b82803a83bafe10ba56a3d01b61287a0c5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-08-01 08:45:58 +00:00
Ivan Solovev b80c11bf00 QCoapResourceDiscoveryReply: do not copy QByteArrays when iterating
Take them by const ref instead.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Iaf24edcc63d7ff7f682ced01665753a6a94f95dd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-07-30 09:33:00 +02:00
Ivan Solovev d85ded9e40 QCoapResourceDiscoveryReply: store QString's size in qsizetype
... instead of an int. The int variable had a risk of overflow, which
is technically an UB. However, in practice it would have silently
resulted in a negative value.
The only usage of the variable is a call to QString::mid(), which
handles the negative second parameter as "provide data until the end
of the string".

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ic95de0ceba09e02b726ab90407d637c449da2ccd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-07-30 09:32:57 +02:00
Ivan Solovev f310b4a5a2 QCoapReply: add test for a chunked read
QCoapReply is a QIODevice, but it was not obvious if readData() is
implemented properly, or if it also needed to update pos().

This patch adds a unit test that checks a chunked read from the reply.
The test passes, so nothing needs to be fixed in the implementation.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I0642718f21a31cf978a733bc3bc742ad1eb47b3a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-07-30 09:32:54 +02:00
Ivan Solovev a292490ba6 QCoapOption: use qt_ptr_swap() instead of qSwap()
It's faster when we know that we operate on pointers.

Change-Id: I1366c96159ff65186f2aa67d397772b5a4d4c5bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-07-30 09:32:50 +02:00
Ivan Solovev 11df2d4c33 Optimize QCoapClient::observe()
There's no need to call get() once the request was created. It will
simply result in unnecessary copy of the request.
We can call sendRequest() directly instead.

Change-Id: I313a186478b4f2e9701c46e83d80c091f5a64a5f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-07-30 09:32:47 +02:00
Qt Submodule Update Bot db77da4802 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I056102f02bf884b3d43b73e61968162e67963572
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-30 04:33:59 +00:00
Qt Submodule Update Bot 8df5be74a0 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I2a924e1934fe4943ba4b4ca623edbadea6ad2c9e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-18 03:23:22 +00:00
Lucie Gérard 72953e45c4 Remove year from Qt Copyright in REUSE.toml
Change-Id: If05e5a7c1a0c68b022360e680b8b43e086a4e724
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-07-14 09:46:45 +02:00
Qt Submodule Update Bot 10ae4b6665 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I7d007931a33d1ff69fb4391f4afa24d51917f0cd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-10 14:05:22 +00:00
Qt Submodule Update Bot fc4eda33f1 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I705c9c4264d79717cc328bb68eb8665ecbd9de40
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-09 06:46:15 +00:00
Qt Submodule Update Bot 533c0d18f9 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I95b6adb52d709d3daa60c204bf7230946bc2e757
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-06 21:54:55 +00:00
Qt Submodule Update Bot c7da497512 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ia7fe8c6bd1dd1ddc371626c4d19f51d7db765adf
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-03 05:06:44 +00:00
Qt Submodule Update Bot ad485a7171 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I16ae1607fb4197b55316ad93913cfa8a7d1b686b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-01 13:37:29 +00:00
Qt Submodule Update Bot 9b58df71a8 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I3b2dcc80edc3ffb589c1952495f8ffe7c004375c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-30 06:00:59 +00:00
Qt Submodule Update Bot 8540256517 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ic8018404b44611813eb31ebd8f10f8804041ded9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-27 07:32:32 +00:00
Qt Submodule Update Bot f38eff095e Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ieadf27ef705ca882b88c99d208a37fa6ed33a781
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-25 10:51:06 +00:00
Qt Submodule Update Bot e26601dac4 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ied131ddbd2854d9bf5128e00e0d5f4f62b1a6329
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-22 18:16:46 +00:00
Cristian Le 6f5de771d9 Move `qt_internal_project_setup` as early as possible
The earliest we can move this is right after `BuildInternals`. This
allows us to add function calls before navigating the `find_package`
tree of the dependents.

Task-number: QTBUG-135233
Change-Id: I6330c79688c3b5fe566165ffb90658092a8c96b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-20 15:26:54 +02:00
Qt Submodule Update Bot cc2d8bb958 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I5fed922989fe6ba190f0705f4998e1a4a2bdcf0e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-20 11:41:10 +00:00
Qt Submodule Update Bot 4aa77ed0db Update dependencies on 'dev' in qt/qtcoap
Change-Id: I956d4e3465875f0a67ab09f83788af254f63a0b5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-17 17:00:39 +00:00
Qt Submodule Update Bot b37714a28e Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ic3632e320a8c2cdca215ab15a39bec6eea0e1c40
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-16 13:03:22 +00:00
Qt Submodule Update Bot b73c764d25 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ied96e0d54ce7a99161fb57b60ea7ecfc4590105d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-14 14:55:25 +00:00
Qt Submodule Update Bot 39c77b56d3 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I4b7b076093949a722cf421c7cd4c2e18d946995e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-11 09:09:08 +00:00
Qt Submodule Update Bot 0c050f2182 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ib71b7babab386260ae5cac14b3129cdef72f8f14
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-07 18:33:05 +00:00
Jani Heikkinen 2f67264d54 Bump version to 6.11.0
Change-Id: I128777056c484d0398b712f39751ee04a140eef8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-05 16:29:28 +01:00
Qt Submodule Update Bot e1a1fa96bc Update dependencies on 'dev' in qt/qtcoap
Change-Id: I427a7b13c456060dbb57c452834cf23e33e214fd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-05 15:29:27 +00:00
Qt Submodule Update Bot 14ff760873 Update dependencies on 'dev' in qt/qtcoap
Change-Id: If7e6aaedae8a6007c90379e1458c5a826f3e79e4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-04 18:51:14 +00:00
Marc Mutz 0ea08d303c Normalize signal/slot signatures 2025
This is the result of running util/normalize on the code base. The
following manual edits were needed:

(none)

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ia18b3968bc164a8dce5e7cca7653c759646cc4da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-06-04 15:00:33 +02:00
Qt Submodule Update Bot 5bd6c49990 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I842f695002a01a63634bcd7af72cd231996303dd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-03 13:15:27 +00:00
Qt Submodule Update Bot a691cd6f6d Update dependencies on 'dev' in qt/qtcoap
Change-Id: Iabac1e274d3db7a8e007464709e252aaa795ea2f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-01 10:08:15 +00:00
Qt Submodule Update Bot 4f1cd59ec7 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Icfca0fd95ef9b07c2d610977fc1642b8d6ba71ed
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-31 12:31:47 +00:00
Qt Submodule Update Bot 14ee3d26be Update dependencies on 'dev' in qt/qtcoap
Change-Id: I2c2e041304b0730f7f6fa682addce082d658c568
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-28 20:22:34 +00:00
Qt Submodule Update Bot faaebe5ced Update dependencies on 'dev' in qt/qtcoap
Change-Id: I33059e9106be1d8836b28c95b8c04dbf046ed996
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-28 05:02:54 +00:00
Qt Submodule Update Bot 4294227f1c Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ifd116ff0ac3f05a89d21792ab233ef457b5d1fc8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-27 04:59:49 +00:00
Qt Submodule Update Bot 4622c24d0e Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ia545082db1bcd9ab34884ed7900ac015e1c6ecad
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-26 04:10:10 +00:00
Qt Submodule Update Bot 772aff6e43 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I678d65705f2d5cc3efabd0c956458df3cc81d4f3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-23 04:51:55 +00:00
Qt Submodule Update Bot c38d7b0ee3 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I37caac17a724bd5e65fc9d7781e436a97f091e1c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-21 05:27:49 +00:00
Qt Submodule Update Bot c1a52251b4 Update dependencies on 'dev' in qt/qtcoap
Change-Id: If9e1a61ae1820af8d892e6c07ee27f442d2f6bed
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-18 06:46:16 +00:00
Juha Vuolle 579f9dcd39 Add check for UDP socket availability
With lite configurations UDP socket may be disabled while rest of the
networking is enabled. UDP socket is important for Coap => skip module
build if UDP socket support is not present.

Fixes: QTBUG-136669
Change-Id: I18543fc3358cd6d7f1fd406ba0ab335c4d5e2d6a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-05-12 08:05:25 +03:00
Qt Submodule Update Bot 664c4df0a0 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I30f2612765694d790bd4d1f5f84b29d9f141a1c3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-12 04:55:15 +00:00
Qt Submodule Update Bot bbb76a9556 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ica6e44964deae083cc93e3c0664baab2eaff875b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-08 07:25:32 +00:00
Qt Submodule Update Bot ce19f0a28e Update dependencies on 'dev' in qt/qtcoap
Change-Id: Iab98a3e6f6d9a29af4e90353d44fe70bd4b619e6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-02 13:24:31 +00:00
Qt Submodule Update Bot 5350035042 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ia574fe1e4b8be459acc2a5e20169f3b9070b71bc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-01 03:23:22 +00:00
Qt Submodule Update Bot 21af8b7754 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I10a3aa276bba5a69d323d3380fb0536d2e5b9aef
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-28 04:33:29 +00:00
Qt Submodule Update Bot d34f543212 Update dependencies on 'dev' in qt/qtcoap
Change-Id: If9daa0eb8704ccfe9ddcdbce1eea23c4b64df120
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-24 03:23:35 +00:00
Qt Submodule Update Bot 40f95c2b22 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I15836cacc72f56af73e4606bc8ba7389f069bf69
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-22 04:48:13 +00:00
Qt Submodule Update Bot 22d73265dc Update dependencies on 'dev' in qt/qtcoap
Change-Id: I279f2bb6bc13279fc7db6d28030e3cb1fc6b8a4f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-14 06:30:52 +00:00
Qt Submodule Update Bot 8fdda96703 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I83c631134c4dbf9a156dcd661d302d08bbd6f154
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-08 14:02:23 +00:00
Qt Submodule Update Bot 8e87a4d03d Update dependencies on 'dev' in qt/qtcoap
Change-Id: I5b089cfc644b4b781c4cb13ade223427fb392183
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-03 06:28:33 +00:00
Qt Submodule Update Bot 5322676ddc Update dependencies on 'dev' in qt/qtcoap
Change-Id: I8df43d85868ca372f7b9c439553af884fc591aff
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-01 04:35:49 +00:00
Qt Submodule Update Bot 9381fbd24b Update dependencies on 'dev' in qt/qtcoap
Change-Id: I46c526789bc0aa52b699017c44a52bef177baf4d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-03-28 06:22:38 +00:00
Paul Wicking 4e2bf91523 Add .gitreview file
`git-review` is a command line tool for interacting with Gerrit.
Some IDEs offer support for this tool, either natively or through
plugins. The tool relies on a configuration file, .gitreview. Adding
this configuration file to our repositories simplifies initial setup
for contributors that use the tool directly or through their IDE of
choice.

The configuration file adds a remote called 'gerrit'. This is the
default for the tool, and also the name set for
codereview.qt-project.org by Qt's `init-repository` script. Thus,
the configuration should work seamlessly alongside other repository
helpers.

Task-number: QTBUG-132604
Pick-to: 6.9 6.8
Change-Id: If68d4fdf77ac9b9d2e3de853d538d2acad8baadc
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2025-03-24 16:08:18 +01:00
Qt Submodule Update Bot a98c8b0e0a Update dependencies on 'dev' in qt/qtcoap
Change-Id: I100e0897e4356bd77379f1e4b63677f495fdc295
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-03-18 05:32:48 +00:00
Lucie Gérard fa6fac26ec Update licensing of files with infrastructure type
A QUIP 18[1] update sets git files, REUSE.toml and licenseRule.json
as infrastructure type files. They are licensed with:
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.9 6.8
Change-Id: Ieb6657192f6ba3dcab0b04c5b1eb02e94b9bba73
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-03-12 17:10:17 +01:00
Qt Submodule Update Bot 84f827608d Update dependencies on 'dev' in qt/qtcoap
Change-Id: I69f44693d91f4604c010ba5002ffd91bfccc5298
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-03-12 14:29:09 +00:00
Lucie Gérard 295d5cdd08 Make module ready for source SBOM checking
This includes:
- turning VERIFY_SOURCE_SBOM ON
- adding rules to the licenseRule.json files
- correcting the licensing given via REUSE.toml files

A lot of files are skipped during the license test,
but all are present in the source SBOM.
This is why corrections are needed before turning the
source SBOM check on.

Task-number: QTBUG-131434
Pick-to: 6.9
Change-Id: I66a2d28d93c6d6a40afca201bc53f2fc519ded32
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-02-26 10:43:44 +01:00
Qt Submodule Update Bot 1120e29ca8 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I3e9c9f59b20c519870fee980e5ac5bf0e908f7d9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-25 13:04:25 +00:00
Qt Submodule Update Bot 4ebd3c0cd5 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ic9b13a82fbc6600f7fe411f4da3ec31acfcf39b4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-19 18:57:04 +00:00
Qt Submodule Update Bot ffa8096216 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ieb930cf958af25124e6e5d8a67edc383097cc5a5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-19 10:14:22 +00:00
Qt Submodule Update Bot b04786dc8a Update dependencies on 'dev' in qt/qtcoap
Change-Id: I1cac0fbcf1ae3f64604cf4af1b93d150c97547aa
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-18 19:59:52 +00:00
Qt Submodule Update Bot e59a478700 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ife0306b2f48d495aeb30556b525d30b7a059238f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-13 19:00:34 +00:00
Qt Submodule Update Bot d9d7040c30 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ic8389b41e66a4b5aad0d555230bdcd5ace07cc0b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-12 05:47:40 +00:00
Qt Submodule Update Bot 900bf15846 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Iaeb30ddf12547282e49fe32cab11e9ca913cf450
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-06 10:06:42 +00:00
Qt Submodule Update Bot f4b9b13c81 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ie38428af207c03b75349f48bc399ae8c132eabaa
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-03 12:50:20 +00:00
Qt Submodule Update Bot 6af3aa9499 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I49c70f601c3f477cfa5b352c67a437df0e22e0ab
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-29 05:38:27 +00:00
Qt Submodule Update Bot 681cf2dd4c Update dependencies on 'dev' in qt/qtcoap
Change-Id: I77f9bfa2a30c5aac4600c99345d2b8ba78e078e5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-23 07:59:02 +00:00
Qt Submodule Update Bot 5c982a9be3 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I7d55a7a3b43337b3066987d134ea17554cadb667
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-20 07:31:18 +00:00
Qt Submodule Update Bot 7a99878a77 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I19993e9ed91d23d0904e7d1a18fc16af54773b01
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-14 06:01:05 +00:00
Qt Submodule Update Bot 274323c264 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I0380965837348283452f577aa30f0ed66861b859
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-13 05:04:23 +00:00
Qt Submodule Update Bot b810301162 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I9e29dba05c6ac482aa6e807527f1a75e463a9133
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-10 17:16:40 +00:00
Qt Submodule Update Bot 809be51696 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I3db935ce61a0738a4e9c5741ee1e8436050749c9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-09 05:49:13 +00:00
Qt Submodule Update Bot 34a944bec4 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I2928a048b7c26532a4b9fd5d4e853b29433ec9cc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-03 05:48:02 +00:00
Qt Submodule Update Bot 2769f9a008 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Idec4967be05d84a642e52485a2f5cc0f1517fdd1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-02 05:35:11 +00:00
Qt Submodule Update Bot 28014e3a8e Update dependencies on 'dev' in qt/qtcoap
Change-Id: I65b724cd85167afac2c053d56eeb7be81a189ff7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-20 19:31:11 +00:00
Qt Submodule Update Bot 64c51f849e Update dependencies on 'dev' in qt/qtcoap
Change-Id: Ia45bd7f2e1c430b25b33c847fd0ca5a69f880ad0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-19 18:13:48 +00:00
Volker Hilsheimer 060d2edbec Move logging categories into private header
The are not part of the public API.

Addresses header review comment, and amends
41b71d6187

Task-number: QTBUG-132090
Pick-to: 6.9
Change-Id: Iff94177bbd10b4f74e957e362e5a0c3ba72cf11f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-12-17 13:48:39 +01:00
Qt Submodule Update Bot a781ac2312 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I62e3840e83ddb19f096a08f44d376045f6277d9d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-14 16:31:06 +00:00
Jani Heikkinen 046338ab5a Bump version to 6.10.0
Change-Id: I7d99e2fa7f154d28b4969dfe69029c4126a310e6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-14 16:31:05 +00:00
Qt Submodule Update Bot 77b66428f7 Update dependencies on 'dev' in qt/qtcoap
Change-Id: Icacba57c0348b8a66b346c7695f0f9bd6dd46600
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-13 07:29:23 +00:00
Qt Submodule Update Bot 5616fe25f1 Update dependencies on 'dev' in qt/qtcoap
Change-Id: I20c7df01c3ceb425db6761caf8d4c2c312a49628
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-09 19:59:28 +00:00
50 changed files with 198 additions and 86 deletions

View File

@ -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_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=codereview.qt-project.org
project=qt/qtcoap
defaultbranch=dev

View File

@ -11,8 +11,18 @@ project(QtCoap
LANGUAGES CXX
)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Network)
find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui Widgets Quick Qml)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals)
# This should be called as early as possible, just after find_package(BuildInternals) where it is
# defined.
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()

View File

@ -1,40 +1,40 @@
version = 1
[[annotations]]
path = [".tag", "**/.gitattributes", "**.gitignore"]
path = ["**/.gitattributes", "**.gitignore", "**.gitreview"]
precedence = "closest"
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
SPDX-License-Identifier = "BSD-3-Clause"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
[[annotations]]
path = [".cmake.conf", "**.yaml", "**.json", "**.yml"]
path = [".tag", ".cmake.conf", "**.yaml", "**.yml", "**ci_config_linux.json"]
precedence = "closest"
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"
[[annotations]]
path = ["examples/**"]
comment = "this must be after the build system table because example and snippets take precedence over build system"
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"
[[annotations]]
path = ["**/README*", "**.qdocconf", "src/coap/doc/style/style.css"]
comment = "documentation"
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"
[[annotations]]
path = ["**.toml", "licenseRule.json"]
precedence = "override"
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
[[annotations]]
path = ["**LICENSE*", "**.pem"]
path = ["**.pem"]
precedence = "override"
comment = "License file. Or such. To be confirmed for .pem files"
SPDX-FileCopyrightText = "None"

View File

@ -6,6 +6,9 @@ accept_configuration:
instructions:
Build:
- type: EnvironmentVariable
variableName: VERIFY_SOURCE_SBOM
variableValue: "ON"
- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
Test:

View File

@ -1,4 +1,4 @@
dependencies:
../qtbase:
ref: d89cef439f5c1a58aeff879a12d9a33292764b7f
ref: 6db355c6cd1c668ee79bcdccfdc4d5cbc379833f
required: true

2
dist/REUSE.toml vendored
View File

@ -4,5 +4,5 @@ version = 1
path = ["*"]
precedence = "override"
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"

View File

@ -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",
"the file path (relative to the git submodule root).",
"spdx: list of SPDX-License-Expression's allowed in the matching files.",
@ -9,75 +9,100 @@
"unless they are examples",
"Files with other endings can also be build system files"
],
"file_pattern_ending" : ["CMakeLists.txt", ".cmake", ".pro", ".pri", ".prf",
"configure", "configure.bat", "cmake.in", "plist.in", "CMakeLists.txt.in"],
"location" : {
"" : {
"comment" : "Default",
"file type" : "build system",
"spdx" : ["BSD-3-Clause"]
"file_pattern_ending": ["CMakeLists.txt", ".cmake", ".pro", ".pri", ".prf",
"configure", "configure.bat", "cmake.in", "plist.in", "CMakeLists.txt.in",
".cmake.conf",".tag", "ci_config_linux.json",
".yaml", ".yml"],
"location": {
"": {
"comment": "Default",
"file type": "build system",
"spdx": ["BSD-3-Clause"]
},
"(.*)(examples/|snippets/)" : {
"comment" : "Example takes precedent",
"file type" : "examples and snippets",
"spdx" : ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
"(.*)(examples/|snippets/)": {
"comment": "Example takes precedent",
"file type": "examples and snippets",
"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.",
"Files with other endings can also be tool files."],
"file_pattern_ending" : [".sh", ".py", ".pl", ".bat", ".ps1"],
"location" :{
"" : {
"comment" : "Default",
"file type" : "tools and utils",
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
"file_pattern_ending": [".sh", ".py", ".pl", ".bat", ".ps1"],
"location":{
"": {
"comment": "Default",
"file type": "tools and utils",
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
},
"(.*)(examples/|snippets/)" : {
"comment" : "Example takes precedent",
"file type" : "examples and snippets",
"spdx" : ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
"(.*)(examples/|snippets/)": {
"comment": "Example takes precedent",
"file type": "examples and snippets",
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
}
}
},
{
"comment" : "Files with the following endings are Documentation licensed.",
"file_pattern_ending" : [".qdoc", ".qdocinc" , ".qdocconf", ".txt", "README", "qt_attribution.json"],
"location" :{
"" : {
"comment" : "",
"file type" : "documentation",
"spdx" : ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
"comment": "Files with the following endings are Documentation licensed.",
"file_pattern_ending": [".qdoc", ".qdocinc" , ".qdocconf", "README", "qt_attribution.json",
"README.md", ".css"],
"location":{
"": {
"comment": "",
"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.",
"NO <file_pattern_ending> key for this case!",
"This needs to be the last entry of the file."],
"location" : {
"" : {
"comment" : "Default",
"file type" : "module and plugin",
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
"location": {
"": {
"comment": "Default",
"file type": "module and plugin",
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
},
"src/" : {
"comment" : "Default",
"file type" : "module and plugin",
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
"dist/": {
"comment": "Default",
"file type": "documentation",
"spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
},
"tests/" : {
"comment" : "Default",
"file type" : "test",
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
"src/": {
"comment": "Default",
"file type": "module and plugin",
"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/": {
"comment": "Default",
"file type": "test",
"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"]
}
}
}

View File

@ -67,5 +67,5 @@
In addition, it is available under the
\l{GNU General Public License, version 3}.
\generatelist{groupsbymodule attributions-qtcoap}
\annotatedlist attributions-qtcoap
*/

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapclient_p.h"
#include "qcoapprotocol_p.h"
@ -130,10 +131,6 @@ QCoapClientPrivate::~QCoapClientPrivate()
The default for \a securityMode is QtCoap::NoSecurity, which
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) :
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
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.
@ -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
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.
@ -313,10 +312,7 @@ QCoapReply *QCoapClient::post(const QCoapRequest &request, const QByteArray &dat
*/
QCoapReply *QCoapClient::post(const QCoapRequest &request, QIODevice *device)
{
if (!device)
return nullptr;
return post(request, device->readAll());
return post(request, device ? device->readAll() : QByteArray());
}
/*!
@ -444,7 +440,7 @@ QCoapReply *QCoapClient::observe(const QCoapRequest &request)
d->connection->isSecure());
copyRequest.enableObserve();
return get(copyRequest);
return d->sendRequest(copyRequest);
}
/*!

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPCLIENT_H
#define QCOAPCLIENT_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPCLIENT_P_H
#define QCOAPCLIENT_P_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapconnection_p.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPCONNECTION_P_H
#define QCOAPCONNECTION_P_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPGLOBAL_H
#define QCOAPGLOBAL_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:network-protocol
#include "qcoapinternalmessage_p.h"
#include "qcoaprequest_p.h"

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPINTERNALMESSAGE_P_H
#define QCOAPINTERNALMESSAGE_P_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:network-protocol
#include "qcoapinternalreply_p.h"
#include <QtCore/qmath.h>

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPINTERNALREPLY_H
#define QCOAPINTERNALREPLY_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:network-protocol
#include "qcoaprequest.h"
#include "qcoapinternalrequest_p.h"

View File

@ -1,14 +1,15 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPINTERNALREQUEST_H
#define QCOAPINTERNALREQUEST_H
#include <private/qcoapinternalmessage_p.h>
#include <private/qcoapnamespace_p.h>
#include <QtCoap/qcoapglobal.h>
#include <QtCoap/qcoapnamespace.h>
#include <private/qcoapconnection_p.h>
#include <QtCore/qglobal.h>

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapmessage_p.h"

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPMESSAGE_H
#define QCOAPMESSAGE_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPMESSAGE_P_H
#define QCOAPMESSAGE_P_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapnamespace_p.h"

View File

@ -1,20 +1,17 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include <QtCoap/qcoapglobal.h>
#include <QtCore/qobject.h>
#include <QtCore/qrandom.h>
#include <QtCore/qloggingcategory.h>
#ifndef QCOAPNAMESPACE_H
#define QCOAPNAMESPACE_H
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcCoapExchange)
Q_DECLARE_LOGGING_CATEGORY(lcCoapConnection)
#define FOR_EACH_COAP_ERROR(X) \
X(BadRequest, 0x80) X(Unauthorized, 0x81) X(BadOption, 0x82) X(Forbidden, 0x83) \
X(NotFound, 0x84) X(MethodNotAllowed, 0x85) X(NotAcceptable, 0x86) \

View File

@ -1,11 +1,14 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPNAMESPACE_P_H
#define QCOAPNAMESPACE_P_H
#include "qcoapnamespace.h"
#include "private/qglobal_p.h"
#include <QtCore/qloggingcategory.h>
//
// W A R N I N G
@ -20,6 +23,9 @@
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcCoapExchange)
Q_DECLARE_LOGGING_CATEGORY(lcCoapConnection)
namespace QtCoap
{
bool Q_AUTOTEST_EXPORT isError(QtCoap::ResponseCode code);

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapoption_p.h"
@ -157,7 +158,7 @@ QCoapOption &QCoapOption::operator=(QCoapOption &&other) noexcept
*/
void QCoapOption::swap(QCoapOption &other) noexcept
{
qSwap(d_ptr, other.d_ptr);
qt_ptr_swap(d_ptr, other.d_ptr);
}
/*!

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPOPTION_H
#define QCOAPOPTION_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPOPTION_P_H
#define QCOAPOPTION_P_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:network-protocol
#include "qcoapprotocol_p.h"
#include "qcoapinternalrequest_p.h"

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPPROTOCOL_P_H
#define QCOAPPROTOCOL_P_H

View File

@ -1,8 +1,10 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapqudpconnection_p.h"
#include <private/qcoapnamespace_p.h>
#include <QtCore/qloggingcategory.h>
#include <QtNetwork/qnetworkdatagram.h>

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPQUDPCONNECTION_P_H
#define QCOAPQUDPCONNECTION_P_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapreply_p.h"
#include "qcoapinternalreply_p.h"

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPREPLY_H
#define QCOAPREPLY_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPREPLY_P_H
#define QCOAPREPLY_P_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoaprequest_p.h"

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPREQUEST_H
#define QCOAPREQUEST_H

View File

@ -1,11 +1,12 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPREQUEST_P_H
#define QCOAPREQUEST_P_H
#include <QtCoap/qcoapnamespace.h>
#include <private/qcoapnamespace_p.h>
#include <QtCoap/qcoaprequest.h>
#include <private/qcoapmessage_p.h>

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapresource_p.h"

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPRESOURCE_H
#define QCOAPRESOURCE_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPRESOURCE_P_H
#define QCOAPRESOURCE_P_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "qcoapresourcediscoveryreply_p.h"
#include "qcoapinternalreply_p.h"
@ -108,14 +109,14 @@ QCoapResourceDiscoveryReplyPrivate::resourcesFromCoreLinkList(const QHostAddress
QLatin1String quote = QLatin1String("\"");
const QList<QByteArray> links = data.split(',');
for (QByteArray link : links) {
for (const QByteArray &link : links) {
QCoapResource resource;
resource.setHost(sender);
const QList<QByteArray> parameterList = link.split(';');
for (QByteArray parameter : parameterList) {
for (const QByteArray &parameter : parameterList) {
QString parameterString = QString::fromUtf8(parameter);
int length = parameterString.size();
const qsizetype length = parameterString.size();
if (parameter.startsWith('<'))
resource.setPath(parameterString.mid(1, length - 2));
else if (parameter.startsWith("title="))

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPRESOURCEDISCOVERYREPLY_H
#define QCOAPRESOURCEDISCOVERYREPLY_H

View File

@ -1,6 +1,7 @@
// Copyright (C) 2017 Witekio.
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPRESOURCEDISCOVERYREPLY_P_H
#define QCOAPRESOURCEDISCOVERYREPLY_P_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qcoapsecurityconfiguration.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QCOAPSECURITYCONFIGURATION_H
#define QCOAPSECURITYCONFIGURATION_H

View File

@ -151,7 +151,7 @@ bool waitForHost(const QUrl &url, QtCoap::SecurityMode security = QtCoap::Securi
if (security != QtCoap::SecurityMode::NoSecurity)
client.setSecurityConfiguration(createConfiguration(security));
QSignalSpy spyClientFinished(&client, SIGNAL(finished(QCoapReply *)));
QSignalSpy spyClientFinished(&client, SIGNAL(finished(QCoapReply*)));
client.get(url);
spyClientFinished.wait(1000);

View File

@ -18,6 +18,7 @@ private Q_SLOTS:
void updateReply();
void requestData();
void abortRequest();
void readReplyChunked();
};
void tst_QCoapReply::updateReply_data()
@ -117,6 +118,39 @@ void tst_QCoapReply::abortRequest()
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)
#include "tst_qcoapreply.moc"