summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2022-08-17Merge pull request #1083 from chayim/ck-drafterMichael Grunder
Support for generating release notes
2022-08-15Merge pull request #1085 from stanhu/ssl-improve-options-settingMichael Grunder
Make it possible to set SSL verify mode
2022-08-15Make it possible to set SSL verify modeStan Hu
If no SSL certificates are provided, many Redis clients default to disabling SSL peer verification. Previously it was a bit cumbersome to configure this because the client would either have to reimplement `redisCreateSSLContext()` or reach into the internals to set the OpenSSL verify mode. We can improve the SSL API by introducing a `redisCreateSSLContextWithOptions()` call that takes into structured parameters for SSL initialization. This structure contains a verify mode that is used to set the OpenSSL verify mode. Relates to https://github.com/redis/hiredis/issues/646
2022-08-10Merge pull request #1084 from stanhu/sh-improve-ssl-docsMichael Grunder
Improve example for SSL initialization in README.md
2022-08-10Improve example for SSL initialization in README.mdStan Hu
The previous example left `ssl_error` uninitialized. `redisCreateSSLContex` is not guaranteed to set this when no error occurs. Use the `REDIS_SSL_CTX_NONE` constant instead of 0 to be precise.
2022-08-10Release drafterChayim I. Kirshen
2022-08-05CI: use recommended `vmactions/freebsd-vm@v0`Sukka
Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
2022-08-04Merge pull request #1080 from Nordix/readme-correctionsMichael Grunder
Fix README typos
2022-08-04Fix README typosBjörn Svensson
2022-07-31Merge pull request #1050 from smmir-cent/fix-cmake-versionMichael Grunder
fix cmake version
2022-07-25CI: bump macos runner versionSukkaW
2022-07-08Drop `const` on redisAsyncContext in redisConnectCallbackKristján Valur Jónsson
Since the callback is now re-entrant, it can call apis such as redisAsyncDisconnect()
2022-07-08Support calling redisAsyncDisconnect from the onConnected callback, by ↵Kristján Valur Jónsson
deferring context deletion
2022-07-08Add async regression test for issue #931Kristján Valur Jónsson
2022-07-07Merge pull request #932 from kristjanvalur/pr3Michael Grunder
Polling adapter and example
2022-07-05Add regression test for issue #945Kristján Valur Jónsson
2022-07-05Initial async testsKristján Valur Jónsson
2022-07-05Polling adapter and exampleKristján Valur Jónsson
2022-06-26Merge pull request #1057 from orgads/static-nameMichael Grunder
Use the same name for static and shared libraries
2022-06-26Merge pull request #1054 from kristjanvalur/pr08Michael Grunder
Embed debug information in windows static .lib file
2022-06-26Merge pull request #1074 from michael-grunder/kristjanvalur-pr4Michael Grunder
Improved async documentation
2022-06-26Whitespacemichael-grunder