summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-10CI updates (#1139)Bjorn Svensson
* Build CMake generated makefiles * Simplify and update checkout * Update CI workflow 'C/C++ CI' * Some corrections of spelling and naming. * Remove running on branch dev since not officially available.
2022-11-09fix flag referencedachui
2022-11-09Make freeing a NULL redisAsyncContext a no op.michael-grunder
This makes our behavior consistent with redisFree and freeReplyObject.
2022-11-09Update version in dev branch.michael-grunder
2022-11-06Prepare for v1.1.0-rc1michael-grunder
- Update changelog. - Bump version/soname defines.
2022-11-02CI fixes in preparation of releasemichael-grunder
- Upgrade to actions/checkout@v3 as node 12 is being phased out. - Perform a manual dnf refresh on RockyLinux during setup. - Switch to official cygwin/cygwin-install-action
2022-11-02Add author information to release-drafter template.michael-grunder
2022-10-26Update for mingw cross compilebit0fun
- Used lowercase for Mstcpip.h as mingw will not find the file otherwise
2022-10-24fixed cpp build error with adapters/libhv.hcqm
2022-10-14Fixup of PR734: Coverage of hiredis.c (#1124)Bjorn Svensson
Improve coverage (#734) * Remove duplicate tests - double covered by: "Can parse RESP3 doubles" - bool covered via: "Can parse RESP3 bool" * Make (connect) timeout in test config general * Set error string in Unix connect with invalid timeout Restructure testcase since redisConnectWithTimeout() and redisConnectUnixWithTimeout() now behaves similar. * Use quiet flag in lcov/genhtml instead of piping to /dev/null * Fixup of redisCommandArgv test case * Update test case to match what it covers Use new test case info text since the previous one seemed copy&pasted. The sought coverage was the handling of the parent-chaining for a double object, which the test case now focuses on. Co-authored-by: Ariel <ashtul@gmail.com>
2022-09-29CMake corrections for building on Windows (#1122)Bjorn Svensson
* Replace use of newer CMake builtins than in v3.0.0 Visual Studio generator will replace -D with /D. * Only use /Z7 flag on a Visual Studio compilator Flag is not available on a GNU compilator running on windows, like in a mingw64 setup.
2022-09-27Fix PUSH handler tests for Redis >= 7.0.5michael-grunder
Redis updated how invalidation push messages are sent to the client after a FLUSHDB or FLUSHALL command. See: redis/redis#8935
2022-09-27Install on windows fixes (#1117)Bjorn Svensson
* Remove attempt to install .pdb file for windows static lib From ff57c18b (#1054) the debug information was embedded in the windows static lib rather than creating a .pdb file. Removing the installation step of this file in CMake when building with buildtype Debug or RelWithDebInfo. * Embed debug information in windows hiredis_ssl_static lib See ff57c18b (#1054) for same change in library hiredis_static.
2022-09-21Add timeout support to libhv adapter. (#1109)Michael Grunder
Add timeout support to libhv adapter. See: #904
2022-09-19Additional include directory given by pkg-config (#1118)Bjorn Svensson
* Update include example in README * Update pkg-config installed via CMake Gives the include directory to enable the use of: #include <hiredis/hiredis.h> but keeps the existing include dir. for backwards compatibility. Example: > pkg-config hiredis --cflags -D_FILE_OFFSET_BITS=64 -I/usr/local/include/hiredis -I/usr/local/include * Update pkg-config installed via Make Gives the include directory to enable the use of: #include <hiredis/hiredis.h> but keeps the existing include path for backwards compatibility. Example: > pkg-config hiredis --cflags -D_FILE_OFFSET_BITS=64 -I/usr/local/include/hiredis -I/usr/local/include
2022-09-14Use __attribute__ when building with clang on windowsBjörn Svensson
Since clang supports __attribute__ we can avoid disabling it and use packed sdshdr structs. This also make sure we dont affect subsequent header files that require __attribute__. Note: Clang attempts to be compatible with MSVC and defines _MSC_VER
2022-09-08set default SSL certificate directoryVlad Turchenko
2022-09-08Minor refactormichael-grunder
Protect against a NULL pointer dereference, and remove unused write to a variable.
2022-09-07Add libhv example to our standard Makefilemichael-grunder
See #904
2022-09-07Add adapters/libhvhewei.it
2022-09-06Fix pkgconfig for hiredis_sslBjörn Svensson
Respect an overridden libdir when installing using CMake. CMake now generates the hiredis_ssl.pc file with the correct result in `libdir` and `Libs`. See #767 and CMakes `CMAKE_INSTALL_LIBDIR`
2022-09-05Fix protocol error (#1106)Michael Grunder
Fix ProtocolError This commit attempts to fix hiredis such that a recoverable write error will be retried rather than throwing a hard error. Since our read/write functions are now behind function pointers, we specify semantically that a return value of < 0 is a hard error, 0 a recoverable error, and > 0 a success. Our default `redisNetRead` function was already doing something similar so this also improves code consistency. Resolves #961 Co-authored-by: Maksim Tuleika <maksim.tuleika@appcast.io>
2022-09-03Use a windows specific keepalive function. (#1104)Michael Grunder
Use a windows specific keepalive function. While it is possible to toggle `TCP_KEEPALIVE` in windows via setsockopt, you have to use `WSAIoctl` to set the interval. Since `WSAIoctl` can actually do all of this in one call (toggle the option, and set the corresponding interval), just use that in Windows and avoid the call to `setsockopt` alltogether. Fixes: #1100
2022-09-02Introduce .close method for redisContextFuncszhenwei pi
Currently, hiredis supports TCP/SSL/Unix, all of the connection types use a single FD(int), close() is enough to close a connection. For the further step, introduce .close method for redisContextFuncs, this allows to close a complex connection context, for example RDMA. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-09-02Add REDIS_OPT_PREFER_UNSPEC (#1101)Michael Grunder
Add REDIS_OPT_PREFER_UNSPEC See: #1099, #1096 Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2022-09-01Update documentation to explain redisConnectWithOptions.michael-grunder
Additionally document the new `REDIS_OPT_PREFER_IPV4`, `REDIS_OPT_PREFER_IPV6` as well as the rest of our existing options. See #1096
2022-09-01fix heap-buffer-overflow (#957)zhangtaoXT5
Prevent incrementing passed a `\0` in our format string. Co-authored-by: Michael Grunder <michael.grunder@gmail.com> Co-authored-by: Kristján Valur Jónsson <sweskman@gmail.com>
2022-09-01uvadapter: reduce number of uv_poll_start callsAnton Tiurin
Internally uv_poll_start iterates over all attached event handlers to update event mask. It's quite expensive operation if there many event handlers attached to a loop. As redisLibuvEvents.events is a copy of what libuv should see, we can rely on it to avoid event mask updates. Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2022-09-01Fix cmake config path on Linux.Tongliang Liao
CMake config files were installed to `/usr/local/share/hiredis`, which is not recognizable by `find_package()`. I'm not sure why it was set that way. Given the commit introducing it is for Windows, I keep that behavior consistent there, but fix the rest.
2022-09-01Add possibility to prefer IPv6, IPv4 or unspecifiedViktor Söderqvist
2022-09-01fuzzer: No alloc in redisFormatCommand() when failBjörn Svensson
2022-09-01Fix heap-buffer-overflow issue in redisvFormatCommadBjörn Svensson
A command with a faulty formatting string that lacks the conversion specifier results in a ASAN heap-buffer-overflow. This was due to that strchr() matches on null-termination, which triggers a continuation of the string parsing.
2022-09-01Polling adapter requires sockcompat.hmichael-grunder
We need to install our socket compatibility header as the new polling adapter needs it.
2022-08-31Regression test for off-by-one parsing errorbugwz
See: #916
2022-08-30Add do while(0) protection for macrosPei-Hsuan Hung
Wrapping multi-line macros in do...while(0) statement prevents potential dangling else problem.
2022-08-29Rework asSleep to be a generic millisleep function.michael-grunder
2022-08-29Do store command timeout in the context for redisSetTimeout (#593)Arseniy Simonov
2022-08-29CMake: remove dict.c form hiredis_sourcesLipraxde
Commit c6b8bd77c0fe00dbc455b39208f15761178160a3 to make all functions in dict.c static. If a CMake project set warning unused functions, and include hiredis using add_subdirectory , this cause warnings / errors.
2022-08-29Add Github Actions CI workflow for hiredis: Arm, Arm64, 386, windows. (#943)Kristján Valur Jónsson
* Add docker support to test.sh specifying a REDIS_DOCKER env var will run this as a server. * Add initial test workflow * Add workflow test to test 32 bit build * Add ARM x compilation tests * Add tests for windows platform * Test with valgrind
2022-08-29Merge pull request #964 from afcidk/fix-createDoubleObjectMichael Grunder
Fix potential fault at createDoubleObject
2022-08-29Merge pull request #901 from devnexen/illumos_test_fixMichael Grunder
Illumos test fixes, error message difference fot bad hostname test.
2022-08-29Merge pull request #905 from sundb/masterMichael Grunder
Remove semicolon after do-while in _EL_CLEANUP
2022-08-29Merge pull request #1091 from redis/ssl-error-ub-fixMichael Grunder
Fix some undefined behavior
2022-08-29Fix some undefined behaviourjengab
- redisSSLContextError must always be initialized at defintion, otherwise when SSL connect succeeds it may not be assigned to a valid error. Thus the memory trash remains in the variable, which may sign a misleading error.
2022-08-29Merge pull request #1090 from Nordix/subscribe-oom-errorMichael Grunder
Copy OOM errors to redisAsyncContext when finding subscribe callback
2022-08-29Copy error to redisAsyncContext when finding subscribe cbBjörn Svensson
2022-08-26Merge pull request #1087 from redis/const-and-non-const-callbackMichael Grunder
Maintain backward compatibiliy withour onConnect callback.
2022-08-26Maintain backward compatibiliy withour onConnect callback.michael-grunder
In f69fac7690fb22a7fc19dba61ef70e5f79ccb2e9, our async onConnect callback was improved to take a non-const redisAsyncContext allowing it to be reentrant. Unfortunately, this is a breaking change we can't make until hiredis v2.0.0. This commit creates a separate callback member and corresponding function that allows us to use the new functionality, while maintaining our existing API for legacy code. Fixes #1086
2022-08-26Merge pull request #1079 from SukkaW/drop-macos-10.15-runnerMichael Grunder
CI: bump macos runner version
2022-08-19Merge pull request #931 from kristjanvalur/pr2Michael Grunder
Stability: Support calling redisAsyncCommand and redisAsyncDisconnect from the onConnected callback