Merge pull request #6486 from CaptV0rt3x/httplib
externals: httplib: replace custom httplib header with upstream as submodule
This commit is contained in:
commit
83ac715e76
6 changed files with 7 additions and 6731 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -43,3 +43,6 @@
|
||||||
[submodule "SDL"]
|
[submodule "SDL"]
|
||||||
path = externals/SDL
|
path = externals/SDL
|
||||||
url = https://github.com/libsdl-org/SDL.git
|
url = https://github.com/libsdl-org/SDL.git
|
||||||
|
[submodule "externals/cpp-httplib"]
|
||||||
|
path = externals/cpp-httplib
|
||||||
|
url = https://github.com/yhirose/cpp-httplib.git
|
||||||
|
|
2
externals/CMakeLists.txt
vendored
2
externals/CMakeLists.txt
vendored
|
@ -115,7 +115,7 @@ if (ENABLE_WEB_SERVICE)
|
||||||
|
|
||||||
# httplib
|
# httplib
|
||||||
add_library(httplib INTERFACE)
|
add_library(httplib INTERFACE)
|
||||||
target_include_directories(httplib INTERFACE ./httplib)
|
target_include_directories(httplib INTERFACE ./cpp-httplib)
|
||||||
target_compile_definitions(httplib INTERFACE -DCPPHTTPLIB_OPENSSL_SUPPORT)
|
target_compile_definitions(httplib INTERFACE -DCPPHTTPLIB_OPENSSL_SUPPORT)
|
||||||
target_link_libraries(httplib INTERFACE ${OPENSSL_LIBRARIES})
|
target_link_libraries(httplib INTERFACE ${OPENSSL_LIBRARIES})
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
1
externals/cpp-httplib
vendored
Submodule
1
externals/cpp-httplib
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 9648f950f5a8a41d18833cf4a85f5821b1bcac54
|
15
externals/httplib/README.md
vendored
15
externals/httplib/README.md
vendored
|
@ -1,15 +0,0 @@
|
||||||
From https://github.com/yhirose/cpp-httplib/tree/ff5677ad197947177c158fe857caff4f0e242045 with https://github.com/yhirose/cpp-httplib/pull/701
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
===
|
|
||||||
|
|
||||||
cpp-httplib
|
|
||||||
|
|
||||||
A C++11 header-only HTTP library.
|
|
||||||
|
|
||||||
It's extremely easy to setup. Just include httplib.h file in your code!
|
|
||||||
|
|
||||||
Inspired by Sinatra and express.
|
|
||||||
|
|
||||||
© 2017 Yuji Hirose
|
|
6714
externals/httplib/httplib.h
vendored
6714
externals/httplib/httplib.h
vendored
File diff suppressed because it is too large
Load diff
|
@ -100,8 +100,9 @@ struct Client::Impl {
|
||||||
request.body = data;
|
request.body = data;
|
||||||
|
|
||||||
httplib::Response response;
|
httplib::Response response;
|
||||||
|
httplib::Error error;
|
||||||
|
|
||||||
if (!cli->send(request, response)) {
|
if (!cli->send(request, response, error)) {
|
||||||
LOG_ERROR(WebService, "{} to {} returned null", method, host + path);
|
LOG_ERROR(WebService, "{} to {} returned null", method, host + path);
|
||||||
return WebResult{WebResult::Code::LibError, "Null response", ""};
|
return WebResult{WebResult::Code::LibError, "Null response", ""};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue