File: system-cpp-httplib.patch

package info (click to toggle)
zeal 1%3A0.7.2-1.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,632 kB
  • sloc: cpp: 15,425; xml: 69; makefile: 9
file content (37 lines) | stat: -rw-r--r-- 1,299 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Author: Konstantin Demin <rockdrilla@gmail.com>
Description: build using system cpp-httplib.
Forwarded: no

 src/libs/core/CMakeLists.txt | 9 +--------
 src/libs/core/httpserver.cpp | 2 +-
 2 files changed, 2 insertions(+), 9 deletions(-)

--- a/src/libs/core/CMakeLists.txt
+++ b/src/libs/core/CMakeLists.txt
@@ -45,14 +45,7 @@
 # Configure cpp-httplib.
 add_definitions(-DCPPHTTPLIB_USE_POLL)
 
-find_package(httplib CONFIG QUIET)
-if(httplib_FOUND)
-    target_link_libraries(Core httplib::httplib)
-else()
-    # Use bundled version of cpp-httplib if not found.
-    # TODO: Replace with QHttpServer once Qt 5 is dropped.
-    include_directories("${CMAKE_SOURCE_DIR}/src/contrib/cpp-httplib")
-endif()
+target_link_libraries(Core cpp-httplib)
 
 # Required by cpp-httplib.
 if(NOT WIN32)
--- a/src/libs/core/httpserver.cpp
+++ b/src/libs/core/httpserver.cpp
@@ -52,7 +52,7 @@
         const QString html = QStringLiteral("<b>ERROR %1</b><br><pre>Request path: %2</pre>")
                 .arg(res.status)
                 .arg(QString::fromStdString(req.path));
-        res.set_content(html.toUtf8().data(), "text/html");
+        res.set_content(html.toStdString(), "text/html");
     });
 
     m_future = std::async(std::launch::async, &httplib::Server::listen_after_bind, m_server.get());