This makes the ownership transfer visible from the API.
Task-number: QTBUG-100868
Pick-to: 6.4
Change-Id: Ie07dd3fd442837c87b6612da8a094bd880b6574f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This allows to deny a websocket upgrade with e.g.
a HTTP error ServiceUnavailable instead of hard
disconnection if the application has some special
logic.
Also fire missingHandler for WebSockets for
better application integration.
Pick-to: 6.4
Change-Id: I31f4b66f9a9a7873a46d0eaba6b6121b1a9ac953
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I657c36f679b9448ec68d411a492171bc39df1411
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
- replace with QLatin1StringView
- take by value, not by cref
- in one case, replace with a char16_t, because size() == 1
Pick-to: 6.4
Task-number: QTBUG-100868
Change-Id: Ib1d9c3058d3dc9aad560b27bda89b7dc1f897dbb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
According HTTP/1.1 specifications (RFC 7231) CONNECT is intended only
for use in requests to a proxy. That it is why http-parser sets the upgrade flag.
This patch will allow users to decide how to handle this.
Change-Id: Ic2d10ca4ab113b4cac85e14f15af7890d5773e98
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QTcpSocket was created on heap without a parent and it never called
delete.
Change-Id: I492633f9797427e546065f9afadf19a672dc552c
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Which then makes it compatible with other listen() functions in Qt
in the sense that doing if (server.listen()) will behave
consistently.
Ports being listened to can then be gotten from the new serverPorts()
function, mirroring serverPort() from QTcpServer etc., except it's a
QVector.
This is a source incompatible change, but is allowed because this
module is still in tech preview.
Fixes: QTBUG-79411
Change-Id: I09764afbf8fd866af4f43ab90fcf9c2e9a373237
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
When the parser received "CONNECT / HTTP/1.1\n\n", its upgrade variable
is set to 1 even though there is no "upgrade" header available.
In this case, QMap::find() returns its end.
Task-number: QTBUG-82053
Change-Id: I41cc23511459c6735a474bb7b903638dd4b1208f
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>
To avoid using the deprecated QString implicit constructor
Change-Id: If6f29952b0dbec96437e0b940c3cb52a801c0d32
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
We have undefined behavior when we check server.method.
Because HttpServer::method was uninitialized.
Also start checking a return value from QTcpServer::listen.
Change-Id: Ib7c31f33be956582a6ef264743ca9e44d4de24b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: I536226270db1534b0bda1a2205898c291285721a
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Small, Qt integrated framework for creating specialized http server.
Goals of the project:
- Create a framework allowing creation of a specialized web server
running in non public networks (home and company networks, stealth
or hidden services)
- Create an easy tool for developers to embed http servers in their
apps.
- Playground to narrow down problems in Qt, related to network
stack, but also to explore general usability.
- Potentially reduce code duplication in Qt.
Not goals:
- Standalone server, in particular not Apache or nginx replacement
Change-Id: I0d8b83e50992b9a95c88f4735539329279cf5425
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>