summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2022-06-26Fix typosKristján Valur Jónsson
2022-06-26Add some documentation on connect/disconnect callbacks and command callbacksKristján Valur Jónsson
2022-06-26Merge pull request #1073 from michael-grunder/kristjanvalur-pr1Michael Grunder
Fix async connect on Windows
2022-06-26Whitespace, stylemichael-grunder
2022-06-26Use correct type for getsockopt()Kristján Valur Jónsson
2022-06-26Support failed async connects on windows.Kristján Valur Jónsson
2022-06-26Merge pull request #1072 from michael-grunder/fix-redis7-unit-testsMichael Grunder
Fix tests so they work for Redis 7.0
2022-06-26Fix tests so they work for Redis 7.0michael-grunder
* Redis >= 7.0.0 disables the `DEBUG` command by default, which we need for our unit tests. * Downgrade to Redis 6.2.x in macOS temporarily There is a macOS specific TLS error on large payloads when running against 7.x.x so temporarily run our tests against 6.2, while we investigate the root cause.
2022-05-04Merge pull request #1058 from orgads/win64Michael Grunder
Fix warnings on Win64
2022-04-24Fix warnings on Win64Orgad Shaneh
read.c:399:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 399 | obj = (void*)(long)cur->type; | ^
2022-04-23Merge pull request #1062 from yossigo/fix-push-notification-orderMichael Grunder
Handle push notifications before or after reply.
2022-04-23Merge pull request #1061 from yossigo/update-redis-aptMichael Grunder
Use official repository for redis package.
2022-04-23Merge pull request #1063 from redis/fix-windows-testsMichael Grunder
Whitelist hiredis repo path in cygwin
2022-04-23Whitelist hiredis repo path in cygwinmichael-grunder
2022-04-22Handle push notifications before or after reply.Yossi Gottlieb
2022-04-22Use official repository for redis package.Yossi Gottlieb
2022-04-05Merge pull request #1047 from Nordix/unsubscribe-handlingMichael Grunder
Unsubscribe handling in async
2022-04-05Merge pull request #1045 from Nordix/sds-updatesMichael Grunder
Update hiredis sds with improvements found in redis
2022-03-29Use the same name for static and shared librariesOrgad Shaneh
On all system except MSVC, the targets are different. Unix: libhiredis.so, libhiredis.a MinGW: libhiredis.dll+libhiredis.dll.a, libhiredis.a MSVC: hiredis.dll+hiredis.lib, hiredis_static.lib
2022-03-24Embed debug information in windows static lib, rather than create a .pdb fileKristján Valur Jónsson
Using .pdb files with .lib files on windows is very inconvenient, particularly if the .lib file is then linked as part of a different .dll. Chances are that the original .pdb will not be picked up or distributed along with the tooling.
2022-02-03Handle any pipelined unsubscribe in asyncBjörn Svensson
Redis responds to an unsubscribe with one or many replies, depending on the current subscribe state. When channels/patterns names are provided in a command each given name will trigger a reply even if duplicated or not subscribed to. To know when we can return from the subscribed state we need to do bookkeeping on pending additional unsubscribe replies, and make sure we receive them all before switching state.
2022-02-02Ignore pubsub replies without a channel/patternBjörn Svensson
2022-02-02Handle overflows as errors instead of assertingBjörn Svensson
2022-02-01Catch size_t overflows in sds.cBjörn Svensson
Equivalent changes introduced to redis sds.c via: https://github.com/redis/redis/pull/8522 https://github.com/redis/redis/pull/9584
2022-02-01Use size_t/long to avoid truncationBjörn Svensson
Equivalent changes introduced to redis sds.c via: https://github.com/redis/redis/pull/4568
2022-02-01Merge pull request #1046 from redis/rockylinux-ciMichael Grunder
CentOS 8 is EOL, switch to RockyLinux
2022-02-01CentOS 8 is EOL, switch to RockyLinuxmichael-grunder
2022-01-27Avoid incorrect call to the previous reply's callback (#1040)Bjorn Svensson
* No reuse of the previous reply callback When multiple replies are parsed from a socket in one read a previously found callback might get reused when the current reply has no known callback. This can be triggered by the added testcase which unsubscribe to subscribed (A,B) and a non-subscribed channel (X). Without this correction a callback for wrong channel is called. - In 'unsubscribe B X A', B's callback is called when handling X. - Now this is not done, i.e. there is no callback called for X. * Re-push monitor callback for each reply MONITORING used the same callback for all replies while parsing multiple responses. This handling was changed to avoid calling the wrong callback in some scenarios. Now also change monitorings repush to work with this change. Includes an added async monitoring testcase.
2022-01-24fix building on AIX and SunOS (#1031)Dietmar Scheidl
2022-01-18Add timeout support for libuv adapter (#1016)MichaelSuen
Add timeout to libuv adapter Co-authored-by: sunmingqi <sunmingqi@corp.netease.com> Co-authored-by: sunmingqi <smq222@126.com> Co-authored-by: Michael Grunder <michael.grunder@gmail.com> Co-authored-by: Viktor Söderqvist <viktor@zuiderkwast.se>
2022-01-18Allow sending commands after sending an unsubscribe (#1036)Bjorn Svensson
* Add test of async commands after unsubscribe Verify that commands are handled after unsubscribing from a channel. A command is sent before the `unsubscribe` response is received, which currently triggers an assert in async.c:567: `redisProcessCallbacks: Assertion `(c->flags & REDIS_SUBSCRIBED || c->flags & REDIS_MONITORING)' failed.` * Handle async commands after an unsubscribe When unsubscribing from the last channel we move from the `subscribe` state to a normal state. These states uses different holders for the command callback information. By moving the callback info during the state change the callback order can be maintained.
2022-01-11Correction for command timeout during pubsub (#1038)Bjorn Svensson
* Add test of command timeout during pubsub A timeout of a non-subscribe command will be ignored during pubsub. It will be handled as an idle timeout and a response is awaited for. * Correction for command timeout during pubsub Disconnect when a sent non-subscribe command triggers a timeout.
2022-01-08CMakeLists.txt: allow building without a C++ compiler (#872)Fabrice Fontaine
Define hiredis as a C project (and use a single PROJECT statement) to avoid the following build failure if a C++ compiler is not found: CMake Error at CMakeLists.txt:3 (PROJECT): The CMAKE_CXX_COMPILER: /srv/storage/autobuild/run/instance-1/output-1/host/bin/arm-linux-g++ is not a full path to an existing compiler tool. Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. The only cpp source file is examples/example-qt.cpp which is never compiled with cmake buildsystem. This file is compiled only with the Makefile buildsystem so perhaps it should be removed. If it is added to the cmake buildsystem, a call to enable_language(CXX) will have to be added. Fixes: - http://autobuild.buildroot.org/results/830ec3398cd29b9fc5cde06a225ef531d7a9d850 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-01-05Fix adapters/libevent.h compilation for 64-bit Windows (#937)Peter Tummillo
Where SOCKET is a 64-bit unsigned integer.
2021-12-24Don't link with crypto libs if USE_SSL isn't set.michael-grunder
2021-12-23Makefile: move SSL options into a block and refine ruleszhenwei pi
Move SSL options into two blocks to make it easy to read: 1, first part: SSL variables part 1, second part: SSL building rules part and change global rules to make it easy to maintain. For the further step, it gets extensible to add another type. New version of the library building rule: static: $(STLIBNAME) $(SSL_STLIB) dynamic: $(DYLIBNAME) $(SSL_DYLIB) Compare with the orignal version: dynamic: $(DYLIBNAME) static: $(STLIBNAME) ifeq ($(USE_SSL),1) dynamic: $(SSL_DYLIBNAME) static: $(SSL_STLIBNAME) endif If we want to add a new type(Ex, RDMA), for the new version, we can do like this: ########### RDMA variables start ############### ..... ########### RDMA variables end ############### static: $(STLIBNAME) $(SSL_STLIB) $(RDMA_STLIB) dynamic: $(DYLIBNAME) $(SSL_DYLIB) $(RDMA_DYLIB) ########### RDMA building rules start ############### ..... ########### RDMA building rules end ############### Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
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