summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-22Update CMakeLists.txt for more portability (#1005)Eric Deng
add alias hiredis::hiredis and hiredis::hiredis_static so when this project is FetchContent, it behave the same as find_package-ed. e.g. ``` find_package(hiredis 1.0.2 QUIET) if (NOT hiredis_FOUND) FetchContent_Declare( hiredis GIT_REPOSITORY https://github.com/redis/hiredis.git GIT_TAG v1.0.2 ) FetchContent_MakeAvailable(hiredis) endif () # later target_link_libraries(target **hiredis::hiredis**) #can always use hiredis::hiredis to ref to this project. no matter find_package or FetchContent ``` this is actually sort of best practice when making a CMake lib.
2021-12-22Fix integer overflow when format command larger than 4GB (#1030)sundb
2021-12-22Handle array response in parallell with pubsub using RESP3 (#1014)Bjorn Svensson
RESP3 allows sending commands in parallell with pubsub handling and these commands might get responded with a REDIS_REPLY_ARRAY. This conflicts with the pubsub response handling for RESP2 and results in a faulty state when using RESP3. Add functionality to keep track of PUSH/RESP3 support on the connection and only expect the message type REDIS_REPLY_PUSH as subscribe messages when once seen.
2021-12-16Support PING while subscribing (RESP2) (#1027)Bjorn Svensson
* Handle PING during pubsub in RESP2 * Rename invalid callback list Some commands are valid to send during a subscribe in RESP2, and most in RESP3. Renaming the callback list from `invalid` to `replies` to detail this fact. * Fix review comment
2021-12-16FreeBSD build fixes + CI (#1026)Michael Grunder
* BSD linkage fix proposal * Touch up the Makefile to fix BSD builds Fixes #984 * Add a build in FreeBSD to GitHub Actions Lots of people use hiredis in FreeBSD so this should reduce some pain moving forward. Co-authored-by: David Carlier <devnexen@gmail.com>
2021-12-01Add asynchronous test for pubsub using RESP3 (#1012)Bjorn Svensson
* Include `unsubscribe` as a subscribe reply in RESP3 By providing the (p)unsubscribe message via the subscribe callback, instead of via the push callback, we get the same behavior in RESP3 as in RESP2. * Add asynchronous test for pubsub using RESP3 The testcase will subscribe to a channel, and via a second client a message is published to the channel. After receiving the message the testcase will unsubscribe and disconnect. This RESP3 testcase reuses the subscribe callback from the RESP2 testcase to make sure we have a common behavior.
2021-11-24Valgrind returns error exit code when errors found (#1011)Bjorn Svensson
By default Valgrind will return the exit code from the tested process. Since our test can return 0 (ALL TESTS PASS) even when a leak was found we need to tell Valgrind to return an error code. This will fail the CI job when issues are found.
2021-11-18Move to using make directly in Cygwin (#1020)Michael Grunder
CMake started hanging when trying to detect the C compiler ABI in cygin, so for now just build with make directly.
2021-11-18Correct CMake warning for libevent adapter exampleBjörn Svensson
2021-11-18Remove unused parameter warning in libev adapterBjörn Svensson
A warning in `redisLibevTimeout(..)` is triggered when building the libev adapter with Clang using -Wextra/-Wunused-parameter. Works fine with gcc..
2021-11-17Small tweaks of the async testsmichael-grunder
2021-10-27Add asynchronous test for pubsub using RESP2Björn Svensson
The testcase will subscribe to a channel, and via a second client a message is published to the channel. After receiving the message the testcase will unsubscribe and disconnect.
2021-10-26Add build options for enabling async testsBjörn Svensson
Asynchronous testcases that requires the event library `libevent` can be built and enabled by using the added build flags: - ENABLE_ASYNC_TESTS when using CMake - TEST_ASYNC when using Make The async tests are disabled by default to avoid adding new requirements, but the testcases are built and run in CI.
2021-10-21Correcting the build target `coverage` for enabled SSL (#1009)Bjorn Svensson
* Exclude includes from /usr in coverage reporting * Correct build target `coverage` for enabled ssl `USE_SSL=1 make coverage` will now build the test binary with the forwarded define HIREDIS_TEST_SSL. This avoids inconsistency between built test binary and the testrunner `test.sh`. This enables test coverage measurements for SSL too.
2021-10-20Run SSL tests in CIBjörn Svensson
2021-10-14Add valgrind and CMake to testsmichael-grunder
2021-10-12Add Centos8michael-grunder
I'm sure this can be done with a container matrix but figuring that out is left for another day.
2021-10-12We should run actions on PRsmichael-grunder
2021-10-12Add Cygwin build testmichael-grunder
2021-10-10Add Windows tests in GitHub actionsmichael-grunder
See: #992 TODO: MinGW/cygwin tests
2021-10-10Switch to GitHub actionsmichael-grunder
Since TravisCI.org was deprecated we've been without any tests. This commit adds back basic tests in Ubuntu, CentOS, and MacOS. More sophisticated tests/platforms to come in the future (e.g. 32bit tests). See: #992
2021-10-10Fix unused variable warning.michael-grunder
2021-10-10Minor refactor of CVE-2021-32765 fix.michael-grunder
Since `hi_calloc` always passes through one of our wrapper functions, we can perform this overflow in the wrapper, and get protection everywhere. Previous commit: 76a7b10005c70babee357a7d0f2becf28ec7ed1e Related vuln ID: CVE-2021-32765 [Full Details](https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2)
2021-10-09Remove extra comma from cmake var.Tongliang Liao
Or it'll be treated as part of the var name.
2021-10-07Merge branch 'release/v1.0.2'michael-grunder
2021-10-07Prepare for v1.0.2 GAmichael-grunder
2021-10-07Revert erroneous SONAME bumpmichael-grunder
2021-10-04Merge branch 'release/v1.0.1'michael-grunder
Merge the v1.0.1 release branch and bump the dev version to 1.0.2-dev
2021-10-04 Prepare for v1.0.1 GAmichael-grunder
2021-10-04Fix for integer/buffer overflow CVE-2021-32765Yossi Gottlieb
This fix prevents hiredis from trying to allocate more than `SIZE_MAX` bytes, which would result in a buffer overrun. [Full Details](https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2)
2021-10-03Allow to override OPENSSL_PREFIX in LinuxYunier Perez
2021-08-18Don't leak memory if an invalid type is set (#906)rouzier
Co-authored-by: James Rouzier <jrouzier@inverse.ca>
2021-07-11Added REDIS_NO_AUTO_FREE_REPLIES flag (#962)Meir Shpilraien (Spielrein)
When set hiredis will not automatically free replies in an async context, and the replies must be freed instead by the user. Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
2021-06-17Ensure we curry any connect error to an async context.michael-grunder
2021-05-23Fix README.mdmichael-grunder
Closes #929
2021-05-02Merge pull request #935 from kristjanvalur/pr5Michael Grunder
Bugfix: Ignore timeout callback from a successful connect (fixes #945)
2021-05-02Merge pull request #939 from zmartzone/improve_pr_896_ssl_leakMichael Grunder
improve SSL leak fix redis/hiredis#896
2021-05-02Merge pull request #949 from plan-do-break-fix/Typo-correctionsMichael Grunder
fix(docs): corrects typos in project README
2021-04-24fix(docs): corrects typos in project READMEplan-do-break-fix
2021-04-11improve SSL leak fix redis/hiredis#896Hans Zandbelt
Free SSL object when redisSSLConnect fails but avoid doing that for callers of redisInitiateSSL who are supposed to manager their own SSL object. Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
2021-04-08Ignore timeout callback from a successful connectKristján Valur Jónsson
2021-04-02Change order independant push logic to not change behavior.michael-grunder
Since redisGetReplyFromReader is exposed in a header file, we probably shouldn't modify how it behaves in any way. For this reason, handle the changed logic in an internal static helper method.
2021-04-02Handle the case where an invalidation is sent second.michael-grunder
RESP3 invalidation messages always seemed to be sent before the response to a given command, but it appears this is not always the case: In Redis 6.2.0RC1 Redis sends the invalidation after the HSET in the following sequence: ``` hget hash field $5 value hset hash field value :0 >2 $10 invalidate *1 $4 hash ``` To account for this possibility just wrap redisGetReplyFromReader in a loop as it is called twice in redisGetReply.
2021-02-25Merge branch 'reader-updates'michael-grunder
Updates and improvements to the RESP3 protocol reader. * Fix the unset len field when creating RESP3 double objects * Fix RESP3 double infinity parsing * Add additional validations when parsing various reply types * Fix the parent type assertions in certain default reply object creation callbacks (mostly to include PUSH as a parent). * Additional reader test cases * Implement RESP3 BIGNUM support * Refactor seekNewline() to use memchr()
2021-02-25Fix off-by-one error in seekNewlinemichael-grunder
2021-02-25read: Validate line items prior to checking for object creation callbacksAlex Smith
2021-02-25read: Remove obsolete comment on nested multi bulk depth limitationAlex Smith
2021-02-25read: Add support for the RESP3 bignum typeAlex Smith
2021-02-25read: Ensure no invalid '\r' or '\n' in simple status/error stringsAlex Smith
2021-02-25read: Additional validation and test case for RESP3 doubleAlex Smith
This ensures that malformed RESP3 double messages that include an invalid null byte are not parsed as valid.