Commit Graph

1084 Commits

Author SHA1 Message Date
David W. Dougherty
8d8703ee61 Update old link for modules-api-ref.md 2024-11-04 09:20:07 -08:00
Orion Poplawski
e0f48202aa Make test.sh use REDIS_SERVER everywhere 2024-08-27 18:45:18 -07:00
michael-grunder
329346bb64 Test for both EAGAIN and EINPROGRESS for AF_UNIX sockets.
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
2024-08-21 08:56:21 -07:00
michael-grunder
0c63e3f396 Fix timing based macOS CI failure.
Signed-off-by: michael-grunder <michael.grunder@gmail.com>
2024-08-13 08:03:06 -07:00
michael-grunder
45b7820dc3 CentOS 7 is EOL
CentOS 7 reached EOL of even maintinance updates on 2024-06-30.
2024-08-06 14:14:19 -07:00
michael-grunder
643dddafab Clarify macos adapter and example license.
Fixes #1271
2024-08-06 14:11:56 -07:00
michael-grunder
19cfd60d92 Only override context read/write funcs on SSL_connect success.
Fixes #1233
2024-04-03 07:57:33 -07:00
michael-grunder
2a7b8fac96 Remove dead assignment in sdstrim.
The assignment is harmless but causes noise in static analysers
2024-04-02 14:19:35 -07:00
guoguangwu
7ab6b824c7 fix: typos
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-03-15 20:56:25 -07:00
Uilian Ries
398e16e7cc
[cmake] Fix cmake options position to support cmake toolchain (#1250)
Move CMake `OPTION` values below where we declare the `PROJECT` so they are scoped within it.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
2024-02-14 10:24:17 -08:00
git-hulk
ab30060a6e Fix review comments 2024-01-31 12:08:52 -08:00
git-hulk
5b253d89c7 Add support of RESP3 attribute type
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
```
2024-01-31 12:08:52 -08:00
Mark Agranat
2706c3e16d Fix memory leak.
When redisLibuvAttach receives error from call to
uv_poll_init_socket there is a memory leaked ptr
of type redisLibuvEvents.
2024-01-30 10:42:32 -08:00
Yann E. MORIN
ff7a064490 CMakeList: add option to not install NuGet packaging
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>
2024-01-21 13:31:26 -08:00
michael-grunder
94d931d96a Fix macOS and FreeBSD CI runners.
* Update macOS to brew install redis@7.2
* Switch freeBSD runner to v1 and switch from running it on a macos
  runner to ubuntu.
2024-01-21 12:28:15 -08:00
Michael Grunder
869f3d0ef1
Make redisEnableKeepAlive a no-op on AF_UNIX connections. (#1215)
Fixes #1185
2023-08-18 21:07:25 -07:00
Chayim
039385bd8b
Integrating spellcheck into CI (#1218)
* Adding spellcheck testing

* words

* updating version of spellcheck action
2023-08-18 21:06:47 -07:00
michael-grunder
e07ae7d3b6 Add a panic helper for non-assert aborts.
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.
2023-07-25 11:16:07 -07:00
michael-grunder
bfe45d9f80 Document poll(2) logic changes.
See #1206, #1213
2023-07-25 11:15:04 -07:00
michael-grunder
af95517612 Retry poll(2) if we are intterupted.
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
2023-07-25 10:24:06 -07:00
V G
dedc6208b1 Fix a false positive warning of gcc 12+ -Werror=maybe-uninitialized 2023-07-14 08:37:31 -07:00
Romain Geissler
bff171c9fc Allow disabling the -Werror flag. 2023-07-13 11:27:05 -07:00
michael-grunder
d7a84df9ea Bump development SONAME. 2023-07-13 09:17:53 -07:00
Chayim
60e5075d4a
Version 1.2.0 (#1202)
Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
2023-07-12 10:31:17 +03:00
Valentino Geron
adef139a75
Remove support in deprecated TLS versions 1.0 and 1.1 (#1205) 2023-07-12 09:20:56 +03:00
Yossi Gottlieb
d543baba67 Install major version symlink of shared objects.
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.
2023-07-10 08:44:57 -07:00
windyakin
052f99ab2d Ensure functionality without _MSC_VER definition 2023-06-08 12:18:12 -07:00
Michael Grunder
ded32c7d1a
Add a test for the TCP_USER_TIMEOUT option. (#1192)
* Add a test for the TCP_USER_TIMEOUT option.
* Explicitly set errno to ENOTSUP on unsupported OS's
2023-06-01 09:09:11 -07:00
Yossi Gottlieb
5cbd1f2960
Add -Werror as a default. (#1193) 2023-06-01 19:03:24 +03:00
Yossi Gottlieb
af14456383
CI: Update homebrew Redis version. (#1191)
Fixes cross-compilation QEMU CI tests

* CI: Update homebrew Redis version.
* CI: Try apt-get update as a workaround.
2023-05-30 14:09:03 -07:00
Yossi Gottlieb
6de326e872 Fix a typo in b6a052f. 2023-05-30 14:05:28 -07:00
Viktor Söderqvist
b6a052fe09
Helper for setting TCP_USER_TIMEOUT socket option (#1188)
* 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()
2023-05-29 13:25:34 -07:00
Ozan Tezcan
3fa9b69443
Add RedisModule adapter (#1182)
* Add RedisModule adapter
* add timer callback, add compatibility helper
2023-04-24 15:00:47 -07:00
Jacky Hu
d13c091e9f Fix wincrypt symbols conflict 2023-04-18 20:03:41 -07:00
michael-grunder
5d84c8cfdb Add a test ensuring we don't clobber connection error.
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.
2023-04-15 17:20:11 -07:00
michael-grunder
3f95fcdae4 Don't attempt to set a timeout if we are in an error state. 2023-04-14 23:02:01 -07:00
michael-grunder
aacb84b8d4 Fix typo in makefile. 2023-04-14 12:42:14 -07:00
Michael Grunder
563b062e37 Accept -nan per the RESP3 spec recommendation.
For reference:
https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md
2023-04-14 12:41:58 -07:00
Viktor Söderqvist
04c1b5b029 Fix colliding option values 2023-03-13 12:08:58 -07:00
michael-grunder
4ca8e73f66 Rework searching for openssl 2023-03-09 15:53:55 -08:00
Victor Polevoy
cd208812f9 Attempt to find the correct path for openssl.
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.
2023-03-09 15:53:55 -08:00
michael-grunder
011f7093c0 Allow specifying the keepalive interval
Fixes #1155
2023-03-07 17:06:35 -08:00
autoantwort
e9243d4f70
Cmake static or shared (#1160)
* 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>
2023-03-07 17:05:25 -08:00
Dominik Charousset
1cbd5bc762
Write a version file for the CMake package (#1165)
* 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.
2023-02-24 11:42:18 -08:00
Till Krüss
6f5bae8c69 fix typo 2023-01-06 12:29:45 -08:00
Fabrice Fontaine
acd09461d3 CMakeLists.txt: respect BUILD_SHARED_LIBS
To allow building hiredis on toolchain without dynamic library support,
respect standard cmake BUILD_SHARED_LIBS:
https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-12-27 11:24:55 -08:00
Michael de Lang
97fcf0fd1a Add sdevent adapter 2022-12-21 15:55:54 -08:00
michael-grunder
ccff093bcd Bump dev version for the next release cycle. 2022-11-15 21:18:54 -08:00
michael-grunder
c14775b4e4 Prepare for v1.1.0 GA 2022-11-14 20:34:30 -08:00
filipe oliveira
f0bdf8405b
Add support for nan in RESP3 double (#1133) 2022-11-14 08:55:52 -08:00