* 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>.
We already detect OpenSSL in our tree for another project, but don't want to
link httplib against OpenSSL or with SSL support.
Allow us to `set(HTTPLIB_IS_USING_OPENSSL FALSE)`.
Removed multiple old-style (C) casts and replaced them with the
appropriate _cast's. This makes httplib a better citizen inside projects
that are compiled with all warnings enabled.
Unfortunately one warning remains as a result of invoking an
OpenSSL macro (at least on Linux), that would have to be fixed
upstream.
Also fixed a few casts for invocations of setsockopt.
setsockopt takes a const void* for the value pointer, not a char*.
Well, except on Windows ...
Co-authored-by: Andre Eisenbach <git@4ae.us>
This allows disabling the use of C++ exceptions at CMake configure time.
The value is encoded in the generated httplibTargets.cmake file and will
be used by CMake projects that import it.
* Explicitly #include <utility> for use of std::move
* Move not copy Logger arg from Client to ClientImpl
* Move not copy, set_error_handler Handler to lambda
* Remove null statement in non-empty if/else block
I guess it was a relic from a time before the other statement was added.
---------
Co-authored-by: Daniel Boles <daniel.boles@voltalis.com>