1. 18 Jan, 2022 1 commit
    • Bjorn Svensson's avatar
      Allow sending commands after sending an unsubscribe (#1036) · f2ce5980
      Bjorn Svensson authored
      * 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.
      f2ce5980
  2. 11 Jan, 2022 1 commit
    • Bjorn Svensson's avatar
      Correction for command timeout during pubsub (#1038) · ff860e55
      Bjorn Svensson authored
      * 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.
      ff860e55
  3. 09 Jan, 2022 1 commit
    • Fabrice Fontaine's avatar
      CMakeLists.txt: allow building without a C++ compiler (#872) · 24d53449
      Fabrice Fontaine authored
      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: default avatarFabrice Fontaine <fontaine.fabrice@gmail.com>
      24d53449
  4. 05 Jan, 2022 1 commit
  5. 24 Dec, 2021 1 commit
  6. 23 Dec, 2021 1 commit
    • zhenwei pi's avatar
      Makefile: move SSL options into a block and refine rules · f74b0818
      zhenwei pi authored
      
      
      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: default avatarzhenwei pi <pizhenwei@bytedance.com>
      f74b0818
  7. 22 Dec, 2021 3 commits
    • Eric Deng's avatar
      Update CMakeLists.txt for more portability (#1005) · f347743b
      Eric Deng authored
      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.
      f347743b
    • sundb's avatar
      f2be7480
    • Bjorn Svensson's avatar
      Handle array response in parallell with pubsub using RESP3 (#1014) · 58aacdac
      Bjorn Svensson authored
      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.
      58aacdac
  8. 16 Dec, 2021 2 commits
    • Bjorn Svensson's avatar
      Support PING while subscribing (RESP2) (#1027) · d3384260
      Bjorn Svensson authored
      * 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
      d3384260
    • Michael Grunder's avatar
      FreeBSD build fixes + CI (#1026) · e3a479e4
      Michael Grunder authored
      
      
      * 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: default avatarDavid Carlier <devnexen@gmail.com>
      e3a479e4
  9. 01 Dec, 2021 1 commit
    • Bjorn Svensson's avatar
      Add asynchronous test for pubsub using RESP3 (#1012) · da5a4ff3
      Bjorn Svensson authored
      * 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.
      da5a4ff3
  10. 25 Nov, 2021 1 commit
    • Bjorn Svensson's avatar
      Valgrind returns error exit code when errors found (#1011) · b5716ee8
      Bjorn Svensson authored
      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.
      b5716ee8
  11. 18 Nov, 2021 3 commits
  12. 17 Nov, 2021 1 commit
  13. 27 Oct, 2021 1 commit
  14. 26 Oct, 2021 1 commit
    • Björn Svensson's avatar
      Add build options for enabling async tests · 648763c3
      Björn Svensson authored
      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.
      648763c3
  15. 21 Oct, 2021 1 commit
    • Bjorn Svensson's avatar
      Correcting the build target `coverage` for enabled SSL (#1009) · c98c6994
      Bjorn Svensson authored
      * 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.
      c98c6994
  16. 20 Oct, 2021 1 commit
  17. 14 Oct, 2021 1 commit
  18. 12 Oct, 2021 3 commits
  19. 10 Oct, 2021 4 commits
  20. 09 Oct, 2021 1 commit
  21. 07 Oct, 2021 3 commits
  22. 04 Oct, 2021 3 commits
  23. 03 Oct, 2021 1 commit
  24. 19 Aug, 2021 1 commit
  25. 11 Jul, 2021 1 commit
  26. 17 Jun, 2021 1 commit