* Fix successful decompress reported as Error::Read
Streams less than 4096 bytes are sometimes reported as failed reads because stream_.avail_in is not reduced to 0. The next iteration of the loop finds `prev_avail_in == strm_.avail_in` and return false. `ret = inflate(...)` returns Z_STREAM_END on the first iteration of the loop indicating that inflate is finished. This fix prevents the second iteration of the loop from failing.
* Fix successful decompress reported as Error::Read
- Add unit tests for raw deflate that illustrates the decompression failure when there are extra trailing bytes
GoogleTest, starting with vesion 1.13.0, requires C++14 to build. This
patch enables C++14 if GoogleTest 1.13.0 or newer is detected when
compiling the tests with Meson, making it possible to use new GTest
versions.
You can find GoogleTest's release notes at
<https://github.com/google/googletest/releases/tag/v1.13.0>.
* Reuse gtest on the system
Try to use gtest on the system if found. Avoid using recent CMake
features.
* Set CMP0135 only when using FetchContent
* Add /bigobj option for MSVC
* Support also cmake between 3.14 and 3.20
Older versions provided only GTest::Main target, not currently used
gtest_main. Provide backward compatibility also to old cmake versions.
* Remove redundant variable checking
---------
Co-authored-by: Jiwoo Park <jiwoo_90@naver.com>
* Support loading system certs from Keychein on MacOS
* review improvements: add deps to meson.build and improve conditional expressions in cmake
* fix tabs
* fix tabs
* review improvements
* fix after review
* additionally load root certs from the system root keychain
* cmake fix
* fix
* small refactoring
* small refactoring
---------
Co-authored-by: Sergey Kazmin <sergey.kazmin@kaspersky.com>
* Add test/CMakeLists.txt to enable testing with CTest
Add HTTPLIB_TEST option
Downlaod GoogleTest source using FetchContent module
Generate cert files to test httplib with OpenSSL
* Generate cert2.pem with a new certificate request
* Use the latest GoogleTest library
* add support for requests with both MultipartFormDataItems and ContentProviders
* rework implementation
* use const auto & and fix offset calculation
* fix zero items
* snake case variables
* clang-format
* commonize get_multipart_content_provider, add Put() with MultipartFormDataProviderItems
* fix linker multiple definition error
* add test MultipartFormDataTest.DataProviderItems
* Add EINTR and EAGAIN judge for accept
* Add EINTR signal tests
* Cancel win32 and win64 compile on signal unittest
Co-authored-by: yukun.yu <yukun.yu@alibaba-inc.com>
* Move next job in task queue rather than copy
* Notify waiting thread after unlocking mutex
* Add unit test for TaskQueue
* Don't use C++14 feature in test code
* handle socket options for UNIX socket same as others
* set FD_CLOEXEC by default
* invoke `socket_options` callback if set
* Offer Client info even on UNIX socket based Server
HTTP Request header "REMOTE_PORT" contains client process id if possible
when Server works on UNIX socket.
* retrigger checks
* retrigger checks
* add support macOS
Co-authored-by: Changbin Park <changbin.park@ahnlab.com>