8 Commits

Author SHA1 Message Date
Jesus Fernandez
fe96330ca0 Fix license headers
Change-Id: Ie15244adb917e2938fe7897c30d4616218d26ac0
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-01-31 11:31:21 +00:00
Tasuku Suzuki
7df45b8ea6 Refactor QAbstractHttpServer::servers()
Change-Id: I11e7100dd5f25d6c02bef28f4c53ce3acc257390
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-10-22 01:26:44 +00:00
Jesus Fernandez
f53818c8ef Introduce QHttpServerResponder
It encapsulates the socket and gives an API to answer the received
requests.

Change-Id: Ic95db2c50224a650a02b206faca9a0ff8d1cc62b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-26 12:38:56 +00:00
Ryan Chu
9856170359 Fix build error about missing QTcpSocket header file
The compiler will complain the invalid use of incomplete type 'class
QTcpSocket' when calling the functions by the socket pointer. Such as
connect(), isTransactionStarted(), startTransaction(), and disconnect().

When connecting the signals of QTcpSocket (QTcpSocket::readyRead,
QTcpSocket::disconnected), the compiler will complain the incomplete
type 'QTcpSocket' used in nested name specifier.

Change-Id: I0e631218b0446e72b994718850f6886bec979a2d
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-22 10:16:20 +00:00
Mikhail Svetkin
1bc95822cf Fix Qt code style
Change-Id: Ie2a5eb3cbfce8742ebdd5973078a665463306466
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-07-20 08:28:13 +00:00
Jesus Fernandez
419e7a17f6 Return the server port in listen()
It allows knowing the server port in case the user chooses to use a
random port. In the previous implementation listen() was returning a
boolean value making it impossible to know the port number.

Change-Id: I73384188b3b2eb57816eb6c6c9a7ac1a511b7456
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-19 15:28:32 +00:00
Mikhail Svetkin
1ba50028d2 Allow inherits from QAbstractHttpServer with custom private class
Change-Id: I35ba1c7cf460d51beecad3427976f1e8a710aef0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-16 15:19:48 +00:00
Jesus Fernandez
b24745265d Introduce Qt HttpServer framework
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>
2018-07-16 14:36:08 +00:00