On macOS, the version suffix of a shared library comes before the
`.dylib` suffix, which is different from the convention on other
systems. Currently, the Makefile only overrides `DYLIB_MINOR_NAME` for
macOS, but does not handle the other similar variables, namely
`DYLIB_MAJOR_NAME`, `SSL_DYLIB_MINOR_NAME`, and `SSL_DYLIB_MAJOR_NAME`.
This commit fixes the issue by overriding all these variables for macOS.
Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
Reading the manpage it seems like we only need to test for `EAGAIN` but
testing for both seems more prudent since this may be subtly different
on more esoteric kernels (SunOS, AIX, BSD, etc).
Fixes#1260
Currently, Redis DEBUG PROTOCOL 'attrib' command will return an
attribute type, but hiredis doesn't support it yet. So it got the
protocol type error:
```
127.0.0.1:6379> DEBUG PROTOCOL attrib
Error: Protocol error, got "|" as reply type byte
```
After apply this PR, it should reply:
```
127.0.0.1:6379> DEBUG PROTOCOL attrib
1# "key-popularity"
1# 1) "key:123"
2) (integer) 90
```
The NuGet hiredis.target packaging description file is of no use on
systems that are not using NuGet, like Linux systems, and the spurious
presence of that file is not "clean".
Add a cmake option to allow users to disable installation of that file.
As some people may have relied on that file to be installed, continue to
install it by default.
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
We merged a fix for a "maybe uninitialized" warning in #1209, but after
merging there could actually have then been a double free.
The reason is that when compiling with NDEBUG our assert macro becomes a
no-op, meaning that execution would no longer stop after `assert(NULL)`.
This commit just adds a simple panic macro which will execute regardless
of whether NDEBUG is defined or not.
This commit adds logic to retry our poll call when waiting for the
connection to complete, in the event that we are interrupted by a
signal.
Additionally we do some simple bookkeeping to keep track of the overall
timeout specified by the user.
Fixes#1206
This change addresses the issue discussed in #1202 and should make it
possible in the future to update minor versions without requiring
re-linking binaries.
* Implement redisSetTcpUserTimeout to set socket option TCP_USER_TIMEOUT
* Documentation for redisSetTcpUserTimeout and some more undocumented functions
Documentation for redisReconnect() and the setters of socket options:
* redisKeepAlive()
* redisEnableKeepAliveWithInterval()
* redisSetTcpUserTimeout()
Adds a test that we don't attempt to set any socket timeout if the
connection itself failed. This issue only seemed to occur on macOS but
it's nice to have a test for it.
The installation path for openssl may vary depending on the way
used for its installation and the macOS version.
This commit attempts to find the correct path for openssl to use.
* cmake: build either static or shared libs
* cmake: allow to build non-PIC static libs
* fix typo
* cmake: add ALIAS targets
* cmake: link to OpenSSL imported targets
CMake imported targets are more robust
* turn ENABLE_EXAMPLES to a CMake option
* fix typo
* install pdb files if shared
* fix hiredis_ssl-config file
* Fix more targets
* CMake knows when to enable CMAKE_POSITION_INDEPENDENT_CODE
* Restore setting of /Z7
* [ci] fix building of shared and static libs
* Apply suggestions from code review
Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
* Make it possible to change name of exported target
---------
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
* Write a version file for the CMake package
> If no VERSION is given, the PROJECT_VERSION variable is used.
Since we set the project version to `${VERSION}`, we can safely skip
passing it to `write_basic_package_version_file` as well.