They're already stored in unique_ptr internally, so use the more
expressive pass-unique_ptr-by-value idiom to express ownership
transfer, so the docs don't need to mention it anymore.
Also fixes a theoretical memleak on failed vector::emplace_back().
Pick-to: 6.4
Task-number: QTBUG-100868
Change-Id: I32e386378fe177e4890deea44f0e937c8054c1c6
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
- in route() implementations, the viewHandler was passed by universal
reference, however, it was then captured either by value (copying,
which some viewHandlers may not support) or - yuck - by reference,
creating a dangling pointer in case a temporary was passed. This
error was also present in the example implementations in the docs
and the test. To fix, std::forward the viewHandler into the mutable
lambda and std::move() it inside the lambda into
route.bindCaptured().
- One more case of RouterHandler being passed by rvalue ref and then
std::forward()ed, fixed by taking by value and std::move()ing
instead.
Pick-to: 6.4
Task-number: QTBUG-100868
Change-Id: I729f7e0c8fd0838679bcefc141fd5cea333d276b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
This function allows to register a function to be run after each request.
Task-number: QTBUG-77090
Change-Id: I40dd4c1e9a447fbe034149ffc1923c7c814cf0e9
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
Coin by default uses dev branch of qtbase.
Add 5.12 qtbase into the dependencies file
Change-Id: I849ea65e36c74f153dbd5531c01e3a3b00ab4fef
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
Currently QHttpServerRouterViewTraits contains all helpers and tools
inside itself. It is hard to read and extend.
This patch:
- Moves all helper and tools to QtPrivate namespace
- Tries to "simplify" template magic
- Adds support for unit test
Change-Id: I6aa443b286c4c896b8dbfee85fffb638328868ad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It is required to have continuous integration enabled in the
repository.
Change-Id: I71728a6e89841640e77c50a05cf59f34d697f897
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Provide simple API for routing, parsing, capture and call callback
Change-Id: Ibd7c37282d00bd56f96d841db92b473a65a2bf5c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>