Handle zlib on Ubuntu.
This commit is contained in:
@@ -117,6 +117,11 @@ if(WIN32)
|
||||
|
||||
# For including CMake generated zconf.h.
|
||||
include_directories(${PROJECT_BINARY_DIR}/third_party/src/zlib)
|
||||
else()
|
||||
find_package(ZLIB REQUIRED)
|
||||
if(ZLIB_FOUND)
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# SOAP support needs pugixml to parse and create XML.
|
||||
|
||||
@@ -5,6 +5,8 @@ set(EXAMPLE_COMMON_LIBS webcc ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES}
|
||||
"${CMAKE_THREAD_LIBS_INIT}")
|
||||
if(WIN32)
|
||||
set(EXAMPLE_COMMON_LIBS ${EXAMPLE_COMMON_LIBS} zlibstatic crypt32)
|
||||
else()
|
||||
set(EXAMPLE_COMMON_LIBS ${EXAMPLE_COMMON_LIBS} ${ZLIB_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
|
||||
@@ -117,7 +117,8 @@ int main() {
|
||||
// Note that the exception handling is mandatory.
|
||||
try {
|
||||
|
||||
ExampleBasic();
|
||||
// ExampleBasic();
|
||||
ExampleCompression();
|
||||
|
||||
} catch (const Exception& e) {
|
||||
std::cout << "Exception: " << e.what() << std::endl;
|
||||
|
||||
@@ -300,7 +300,7 @@ bool HttpParser::Finish() {
|
||||
// Also see: https://stackoverflow.com/questions/5280633/gzip-compression-of-chunked-encoding-response
|
||||
std::string decompressed;
|
||||
if (!Decompress(content_, decompressed)) {
|
||||
LOG_ERRO("Cannot decompress the HTTP content!", );
|
||||
LOG_ERRO("Cannot decompress the HTTP content!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user