Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package hiredis for openSUSE:Factory checked in at 2025-05-23 14:28:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hiredis (Old) and /work/SRC/openSUSE:Factory/.hiredis.new.2732 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hiredis" Fri May 23 14:28:35 2025 rev:15 rq:1278333 version:1.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/hiredis/hiredis.changes 2024-02-23 16:41:32.175087028 +0100 +++ /work/SRC/openSUSE:Factory/.hiredis.new.2732/hiredis.changes 2025-05-23 14:29:12.197161439 +0200 @@ -1,0 +2,9 @@ +Sun May 18 06:42:35 UTC 2025 - Andreas Stieger <[email protected]> + +- hiredis 1.3.0: + * Add support of RESP3 attribute type + * Make redisEnableKeepAlive a no-op on AF_UNIX connections + * Retry poll(2) if we are intterupted + * code correctness fixes and developer visible changes + +------------------------------------------------------------------- Old: ---- v1.2.0.tar.gz New: ---- v1.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hiredis.spec ++++++ --- /var/tmp/diff_new_pack.kWKMLE/_old 2025-05-23 14:29:12.633179831 +0200 +++ /var/tmp/diff_new_pack.kWKMLE/_new 2025-05-23 14:29:12.633179831 +0200 @@ -2,6 +2,7 @@ # spec file for package hiredis # # Copyright (c) 2023 SUSE LLC +# Copyright (c) 2025 Andreas Stieger <[email protected]> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +17,9 @@ # -%global libname lib%{name}1_1_0 +%global libname lib%{name}1_3_0 Name: hiredis -Version: 1.2.0 +Version: 1.3.0 Release: 0 Summary: Minimalistic C client for Redis License: BSD-3-Clause @@ -72,8 +73,7 @@ find %{buildroot} -type f -name '*.a' -delete -%post -n %{libname} -p /sbin/ldconfig -%postun -n %{libname} -p /sbin/ldconfig +%ldconfig_scriptlets -n %{libname} %files %license COPYING ++++++ v1.2.0.tar.gz -> v1.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/.github/spellcheck-settings.yml new/hiredis-1.3.0/.github/spellcheck-settings.yml --- old/hiredis-1.2.0/.github/spellcheck-settings.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/hiredis-1.3.0/.github/spellcheck-settings.yml 2025-04-23 13:10:29.000000000 +0200 @@ -0,0 +1,29 @@ +matrix: +- name: Markdown + expect_match: false + apsell: + lang: en + d: en_US + ignore-case: true + dictionary: + wordlists: + - .github/wordlist.txt + output: wordlist.dic + pipeline: + - pyspelling.filters.markdown: + markdown_extensions: + - markdown.extensions.extra: + - pyspelling.filters.html: + comments: false + attributes: + - alt + ignores: + - ':matches(code, pre)' + - code + - pre + - blockquote + - img + sources: + - 'README.md' + - 'FAQ.md' + - 'docs/**' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/.github/wordlist.txt new/hiredis-1.3.0/.github/wordlist.txt --- old/hiredis-1.2.0/.github/wordlist.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/hiredis-1.3.0/.github/wordlist.txt 2025-04-23 13:10:29.000000000 +0200 @@ -0,0 +1,99 @@ +ABI +ACLs +alloc +Allocator +allocators +antirez +api +APIs +ASYNC +asyncRedisContext +asyncronous +AUTOFREE +autoload +autoloader +autoloading +Autoloading +backend +backends +behaviour +boolean +CAS +Changelog +customizable +Customizable +CVE +dataset +de +deallocation +ElastiCache +extensibility +FPM +getaddrinfo +gmail +grunder +Grunder +hiredis +Hiredis +HIREDIS +hostname +IANA +IPv +IPV +keepalive +keyspace +keyspaces +KiB +libc +libev +libevent +localhost +Lua +michael +minimalistic +namespace +NOAUTOFREE +NOAUTOFREEREPLIES +NONBLOCK +Noordhuis +OpenSSL +Packagist +pcnoordhuis +PhpRedis +Pieter +pipelined +pipelining +pluggable +Predis +PRERELEASE +printf +PSR +PSUBSCRIBE +rb +Readme +README +rebalanced +rebalancing +redis +Redis +redisAsyncContext +redisContext +redisOptions +redisReader +reusability +REUSEADDR +runtime +Sanfilippo +SHA +sharding +SONAME +SSL +struct +stunnel +subelements +TCP +TLS +unparsed +UNSPEC +URI +variadic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/.github/workflows/build.yml new/hiredis-1.3.0/.github/workflows/build.yml --- old/hiredis-1.2.0/.github/workflows/build.yml 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/.github/workflows/build.yml 2025-04-23 13:10:29.000000000 +0200 @@ -37,42 +37,6 @@ # TEST_PREFIX: valgrind --error-exitcode=99 --track-origins=yes --leak-check=full # run: $GITHUB_WORKSPACE/test.sh - centos7: - name: CentOS 7 - runs-on: ubuntu-latest - container: centos:7 - steps: - - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm - yum -y --enablerepo=remi install redis - yum -y install gcc gcc-c++ make openssl openssl-devel cmake3 valgrind libevent-devel - - - name: Build using cmake - env: - EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON -DENABLE_ASYNC_TESTS:BOOL=ON - CFLAGS: -Werror - CXXFLAGS: -Werror - run: mkdir build && cd build && cmake3 .. && make - - - name: Build using Makefile - run: USE_SSL=1 TEST_ASYNC=1 make - - - name: Run tests - env: - SKIPS_AS_FAILS: 1 - TEST_SSL: 1 - run: $GITHUB_WORKSPACE/test.sh - - - name: Run tests under valgrind - env: - SKIPS_AS_FAILS: 1 - TEST_SSL: 1 - TEST_PREFIX: valgrind --error-exitcode=99 --track-origins=yes --leak-check=full - run: $GITHUB_WORKSPACE/test.sh - centos8: name: RockyLinux 8 runs-on: ubuntu-latest @@ -112,13 +76,13 @@ run: $GITHUB_WORKSPACE/test.sh freebsd: - runs-on: macos-12 + runs-on: ubuntu-latest name: FreeBSD steps: - uses: actions/checkout@v3 - name: Build in FreeBSD - uses: vmactions/freebsd-vm@v0 + uses: vmactions/[email protected] with: prepare: pkg install -y gmake cmake run: | @@ -133,8 +97,8 @@ - name: Install dependencies run: | - brew install openssl [email protected] - brew link [email protected] --force + brew install openssl [email protected] + brew link [email protected] --force - name: Build hiredis run: USE_SSL=1 make @@ -175,3 +139,29 @@ HIREDIS_PATH: ${{ github.workspace }} run: | make clean && make + + test-cmake-version: + name: Test build with CMake ${{ matrix.cmake-version }} + runs-on: ubuntu-latest + strategy: + matrix: + cmake-version: [ + '3.7.0', # Minimum version + '3.22.0', # Ubuntu 22.04 LTS + '3.28.0', # Ubuntu 24.04 LTS + '4.0.0' # Latest version + ] + steps: + - uses: actions/checkout@v4 + - name: Setup CMake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: ${{ matrix.cmake-version }} + - name: Install hiredis dependencies + run: | + sudo apt-get install -y libssl-dev libevent-dev + - name: Build + run: | + mkdir build && cd build + cmake -DENABLE_SSL=ON -DENABLE_SSL_TESTS=ON -DENABLE_ASYNC_TESTS=ON -DENABLE_EXAMPLES=ON .. + make \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/.github/workflows/spellcheck.yml new/hiredis-1.3.0/.github/workflows/spellcheck.yml --- old/hiredis-1.2.0/.github/workflows/spellcheck.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/hiredis-1.3.0/.github/workflows/spellcheck.yml 2025-04-23 13:10:29.000000000 +0200 @@ -0,0 +1,14 @@ +name: spellcheck +on: + pull_request: +jobs: + check-spelling: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check Spelling + uses: rojopolis/[email protected] + with: + config_path: .github/spellcheck-settings.yml + task_name: Markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/.gitignore new/hiredis-1.3.0/.gitignore --- old/hiredis-1.2.0/.gitignore 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/.gitignore 2025-04-23 13:10:29.000000000 +0200 @@ -7,3 +7,4 @@ /*.pc *.dSYM tags +compile_commands.json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/CHANGELOG.md new/hiredis-1.3.0/CHANGELOG.md --- old/hiredis-1.2.0/CHANGELOG.md 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/CHANGELOG.md 2025-04-23 13:10:29.000000000 +0200 @@ -1,218 +1,9 @@ -## [1.2.0](https://github.com/redis/hiredis/tree/v1.2.0) - (2023-06-04) +# Hiredis Changelog -Announcing Hiredis v1.2.0 with with new adapters, and a great many bug fixes. +Since [v1.1.0-rc1](https://github.com/redis/hiredis/releases/tag/v1.1.0-rc1) we track changelog using [GitHub releases](https://github.com/redis/hiredis/releases). +Below you can find the changelog for all versions prior to that. -## 🚀 New Features - -- Add sdevent adapter @Oipo (#1144) -- Allow specifying the keepalive interval @michael-grunder (#1168) -- Add RedisModule adapter @tezc (#1182) -- Helper for setting TCP_USER_TIMEOUT socket option @zuiderkwast (#1188) - -## 🐛 Bug Fixes - -- Fix a typo in b6a052f. @yossigo (#1190) -- Fix wincrypt symbols conflict @hudayou (#1151) -- Don't attempt to set a timeout if we are in an error state. @michael-grunder (#1180) -- Accept -nan per the RESP3 spec recommendation. @michael-grunder (#1178) -- Fix colliding option values @zuiderkwast (#1172) -- Ensure functionality without `_MSC_VER` definition @windyakin (#1194) - -## 🧰 Maintenance - -- Add a test for the TCP_USER_TIMEOUT option. @michael-grunder (#1192) -- Add -Werror as a default. @yossigo (#1193) -- CI: Update homebrew Redis version. @yossigo (#1191) -- Fix typo in makefile. @michael-grunder (#1179) -- Write a version file for the CMake package @Neverlord (#1165) -- CMakeLists.txt: respect BUILD_SHARED_LIBS @ffontaine (#1147) -- Cmake static or shared @autoantwort (#1160) -- fix typo @tillkruss (#1153) -- Add a test ensuring we don't clobber connection error. @michael-grunder (#1181) -- Search for openssl on macOS @michael-grunder (#1169) - - -## Contributors -We'd like to thank all the contributors who worked on this release! - -<a href="https://github.com/neverlord"><img src="https://github.com/neverlord.png" width="32" height="32"></a> -<a href="https://github.com/Oipo"><img src="https://github.com/Oipo.png" width="32" height="32"></a> -<a href="https://github.com/autoantwort"><img src="https://github.com/autoantwort.png" width="32" height="32"></a> -<a href="https://github.com/ffontaine"><img src="https://github.com/ffontaine.png" width="32" height="32"></a> -<a href="https://github.com/hudayou"><img src="https://github.com/hudayou.png" width="32" height="32"></a> -<a href="https://github.com/michael-grunder"><img src="https://github.com/michael-grunder.png" width="32" height="32"></a> -<a href="https://github.com/postgraph"><img src="https://github.com/postgraph.png" width="32" height="32"></a> -<a href="https://github.com/tezc"><img src="https://github.com/tezc.png" width="32" height="32"></a> -<a href="https://github.com/tillkruss"><img src="https://github.com/tillkruss.png" width="32" height="32"></a> -<a href="https://github.com/vityafx"><img src="https://github.com/vityafx.png" width="32" height="32"></a> -<a href="https://github.com/windyakin"><img src="https://github.com/windyakin.png" width="32" height="32"></a> -<a href="https://github.com/yossigo"><img src="https://github.com/yossigo.png" width="32" height="32"></a> -<a href="https://github.com/zuiderkwast"><img src="https://github.com/zuiderkwast.png" width="32" height="32"></a> - -## [1.1.0](https://github.com/redis/hiredis/tree/v1.1.0) - (2022-11-15) - -Announcing Hiredis v1.1.0 GA with better SSL convenience, new async adapters and a great many bug fixes. - -**NOTE**: Hiredis can now return `nan` in addition to `-inf` and `inf` when returning a `REDIS_REPLY_DOUBLE`. - -## 🐛 Bug Fixes - -- Add support for nan in RESP3 double [@filipecosta90](https://github.com/filipecosta90) - ([\#1133](https://github.com/redis/hiredis/pull/1133)) - -## 🧰 Maintenance - -- Add an example that calls redisCommandArgv [@michael-grunder](https://github.com/michael-grunder) - ([\#1140](https://github.com/redis/hiredis/pull/1140)) -- fix flag reference [@pata00](https://github.com/pata00) ([\#1136](https://github.com/redis/hiredis/pull/1136)) -- Make freeing a NULL redisAsyncContext a no op. [@michael-grunder](https://github.com/michael-grunder) - ([\#1135](https://github.com/redis/hiredis/pull/1135)) -- CI updates ([@bjosv](https://github.com/redis/bjosv) ([\#1139](https://github.com/redis/hiredis/pull/1139)) - - -## Contributors -We'd like to thank all the contributors who worked on this release! - -<a href="https://github.com/bjsov"><img src="https://github.com/bjosv.png" width="32" height="32"></a> -<a href="https://github.com/filipecosta90"><img src="https://github.com/filipecosta90.png" width="32" height="32"></a> -<a href="https://github.com/michael-grunder"><img src="https://github.com/michael-grunder.png" width="32" height="32"></a> -<a href="https://github.com/pata00"><img src="https://github.com/pata00.png" width="32" height="32"></a> - -## [1.1.0-rc1](https://github.com/redis/hiredis/tree/v1.1.0-rc1) - (2022-11-06) - -Announcing Hiredis v1.1.0-rc1, with better SSL convenience, new async adapters, and a great many bug fixes. - -## 🚀 New Features - -- Add possibility to prefer IPv6, IPv4 or unspecified [@zuiderkwast](https://github.com/zuiderkwast) - ([\#1096](https://github.com/redis/hiredis/pull/1096)) -- Add adapters/libhv [@ithewei](https://github.com/ithewei) ([\#904](https://github.com/redis/hiredis/pull/904)) -- Add timeout support to libhv adapter. [@michael-grunder](https://github.com/michael-grunder) ([\#1109](https://github.com/redis/hiredis/pull/1109)) -- set default SSL verification path [@adobeturchenko](https://github.com/adobeturchenko) ([\#928](https://github.com/redis/hiredis/pull/928)) -- Introduce .close method for redisContextFuncs [@pizhenwei](https://github.com/pizhenwei) ([\#1094](https://github.com/redis/hiredis/pull/1094)) -- Make it possible to set SSL verify mode [@stanhu](https://github.com/stanhu) ([\#1085](https://github.com/redis/hiredis/pull/1085)) -- Polling adapter and example [@kristjanvalur](https://github.com/kristjanvalur) ([\#932](https://github.com/redis/hiredis/pull/932)) -- Unsubscribe handling in async [@bjosv](https://github.com/bjosv) ([\#1047](https://github.com/redis/hiredis/pull/1047)) -- Add timeout support for libuv adapter [@MichaelSuen-thePointer](https://github.com/@MichaelSuenthePointer) ([\#1016](https://github.com/redis/hiredis/pull/1016)) - -## 🐛 Bug Fixes - -- Update for MinGW cross compile [@bit0fun](https://github.com/bit0fun) ([\#1127](https://github.com/redis/hiredis/pull/1127)) -- fixed CPP build error with adapters/libhv.h [@mtdxc](https://github.com/mtdxc) ([\#1125](https://github.com/redis/hiredis/pull/1125)) -- Fix protocol error - [@michael-grunder](https://github.com/michael-grunder), - [@mtuleika-appcast](https://github.com/mtuleika-appcast) ([\#1106](https://github.com/redis/hiredis/pull/1106)) -- Use a windows specific keepalive function. [@michael-grunder](https://github.com/michael-grunder) ([\#1104](https://github.com/redis/hiredis/pull/1104)) -- Fix CMake config path on Linux. [@xkszltl](https://github.com/xkszltl) ([\#989](https://github.com/redis/hiredis/pull/989)) -- Fix potential fault at createDoubleObject [@afcidk](https://github.com/afcidk) ([\#964](https://github.com/redis/hiredis/pull/964)) -- Fix some undefined behavior [@jengab](https://github.com/jengab) ([\#1091](https://github.com/redis/hiredis/pull/1091)) -- Copy OOM errors to redisAsyncContext when finding subscribe callback [@bjosv](https://github.com/bjosv) ([\#1090](https://github.com/redis/hiredis/pull/1090)) -- Maintain backward compatibility with our onConnect callback. [@michael-grunder](https://github.com/michael-grunder) ([\#1087](https://github.com/redis/hiredis/pull/1087)) -- Fix PUSH handler tests for Redis >= 7.0.5 [@michael-grunder](https://github.com/michael-grunder) ([\#1121](https://github.com/redis/hiredis/pull/1121)) -- fix heap-buffer-overflow [@zhangtaoXT5](https://github.com/zhangtaoXT5) ([\#957](https://github.com/redis/hiredis/pull/957)) -- Fix heap-buffer-overflow issue in redisvFormatCommad [@bjosv](https://github.com/bjosv) ([\#1097](https://github.com/redis/hiredis/pull/1097)) -- Polling adapter requires sockcompat.h [@michael-grunder](https://github.com/michael-grunder) ([\#1095](https://github.com/redis/hiredis/pull/1095)) -- Illumos test fixes, error message difference for bad hostname test. [@devnexen](https://github.com/devnexen) ([\#901](https://github.com/redis/hiredis/pull/901)) -- Remove semicolon after do-while in \_EL\_CLEANUP [@sundb](https://github.com/sundb) ([\#905](https://github.com/redis/hiredis/pull/905)) -- Stability: Support calling redisAsyncCommand and redisAsyncDisconnect from the onConnected callback [@kristjanvalur](https://github.com/kristjanvalur) - ([\#931](https://github.com/redis/hiredis/pull/931)) -- Fix async connect on Windows [@kristjanvalur](https://github.com/kristjanvalur) ([\#1073](https://github.com/redis/hiredis/pull/1073)) -- Fix tests so they work for Redis 7.0 [@michael-grunder](https://github.com/michael-grunder) ([\#1072](https://github.com/redis/hiredis/pull/1072)) -- Fix warnings on Win64 [@orgads](https://github.com/orgads) ([\#1058](https://github.com/redis/hiredis/pull/1058)) -- Handle push notifications before or after reply. [@yossigo](https://github.com/yossigo) ([\#1062](https://github.com/redis/hiredis/pull/1062)) -- Update hiredis sds with improvements found in redis [@bjosv](https://github.com/bjosv) ([\#1045](https://github.com/redis/hiredis/pull/1045)) -- Avoid incorrect call to the previous reply's callback [@bjosv](https://github.com/bjosv) ([\#1040](https://github.com/redis/hiredis/pull/1040)) -- fix building on AIX and SunOS [\#1031](https://github.com/redis/hiredis/pull/1031) ([@scddev](https://github.com/scddev)) -- Allow sending commands after sending an unsubscribe [@bjosv](https://github.com/bjosv) ([\#1036](https://github.com/redis/hiredis/pull/1036)) -- Correction for command timeout during pubsub [@bjosv](https://github.com/bjosv) ([\#1038](https://github.com/redis/hiredis/pull/1038)) -- Fix adapters/libevent.h compilation for 64-bit Windows [@pbtummillo](https://github.com/pbtummillo) ([\#937](https://github.com/redis/hiredis/pull/937)) -- Fix integer overflow when format command larger than 4GB [@sundb](https://github.com/sundb) ([\#1030](https://github.com/redis/hiredis/pull/1030)) -- Handle array response during subscribe in RESP3 [@bjosv](https://github.com/bjosv) ([\#1014](https://github.com/redis/hiredis/pull/1014)) -- Support PING while subscribing (RESP2) [@bjosv](https://github.com/bjosv) ([\#1027](https://github.com/redis/hiredis/pull/1027)) - -## 🧰 Maintenance - -- CI fixes in preparation of release [@michael-grunder](https://github.com/michael-grunder) ([\#1130](https://github.com/redis/hiredis/pull/1130)) -- Add do while(0) (protection for macros [@afcidk](https://github.com/afcidk) [\#959](https://github.com/redis/hiredis/pull/959)) -- Fixup of PR734: Coverage of hiredis.c [@bjosv](https://github.com/bjosv) ([\#1124](https://github.com/redis/hiredis/pull/1124)) -- CMake corrections for building on Windows [@bjosv](https://github.com/bjosv) ([\#1122](https://github.com/redis/hiredis/pull/1122)) -- Install on windows fixes [@bjosv](https://github.com/bjosv) ([\#1117](https://github.com/redis/hiredis/pull/1117)) -- Add libhv example to our standard Makefile [@michael-grunder](https://github.com/michael-grunder) ([\#1108](https://github.com/redis/hiredis/pull/1108)) -- Additional include directory given by pkg-config [@bjosv](https://github.com/bjosv) ([\#1118](https://github.com/redis/hiredis/pull/1118)) -- Use __attribute__ when building with Clang on Windows [@bjosv](https://github.com/bjosv) ([\#1115](https://github.com/redis/hiredis/pull/1115)) -- Minor refactor [@michael-grunder](https://github.com/michael-grunder) ([\#1110](https://github.com/redis/hiredis/pull/1110)) -- Fix pkgconfig result for hiredis_ssl [@bjosv](https://github.com/bjosv) ([\#1107](https://github.com/redis/hiredis/pull/1107)) -- Update documentation to explain redisConnectWithOptions. [@michael-grunder](https://github.com/michael-grunder) ([\#1099](https://github.com/redis/hiredis/pull/1099)) -- uvadapter: reduce number of uv_poll_start calls [@noxiouz](https://github.com/noxiouz) ([\#1098](https://github.com/redis/hiredis/pull/1098)) -- Regression test for off-by-one parsing error [@bugwz](https://github.com/bugwz) ([\#1092](https://github.com/redis/hiredis/pull/1092)) -- CMake: remove dict.c form hiredis_sources [@Lipraxde](https://github.com/Lipraxde) ([\#1055](https://github.com/redis/hiredis/pull/1055)) -- Do store command timeout in the context for redisSetTimeout [@catterer](https://github.com/catterer) ([\#593](https://github.com/redis/hiredis/pull/593), [\#1093](https://github.com/redis/hiredis/pull/1093)) -- Add GitHub Actions CI workflow for hiredis: Arm, Arm64, 386, windows. [@kristjanvalur](https://github.com/kristjanvalur) ([\#943](https://github.com/redis/hiredis/pull/943)) -- CI: bump macOS runner version [@SukkaW](https://github.com/SukkaW) ([\#1079](https://github.com/redis/hiredis/pull/1079)) -- Support for generating release notes [@chayim](https://github.com/chayim) ([\#1083](https://github.com/redis/hiredis/pull/1083)) -- Improve example for SSL initialization in README.md [@stanhu](https://github.com/stanhu) ([\#1084](https://github.com/redis/hiredis/pull/1084)) -- Fix README typos [@bjosv](https://github.com/bjosv) ([\#1080](https://github.com/redis/hiredis/pull/1080)) -- fix cmake version [@smmir-cent](https://github.com/@smmircent) ([\#1050](https://github.com/redis/hiredis/pull/1050)) -- Use the same name for static and shared libraries [@orgads](https://github.com/orgads) ([\#1057](https://github.com/redis/hiredis/pull/1057)) -- Embed debug information in windows static .lib file [@kristjanvalur](https://github.com/kristjanvalur) ([\#1054](https://github.com/redis/hiredis/pull/1054)) -- Improved async documentation [@kristjanvalur](https://github.com/kristjanvalur) ([\#1074](https://github.com/redis/hiredis/pull/1074)) -- Use official repository for redis package. [@yossigo](https://github.com/yossigo) ([\#1061](https://github.com/redis/hiredis/pull/1061)) -- Whitelist hiredis repo path in cygwin [@michael-grunder](https://github.com/michael-grunder) ([\#1063](https://github.com/redis/hiredis/pull/1063)) -- CentOS 8 is EOL, switch to RockyLinux [@michael-grunder](https://github.com/michael-grunder) ([\#1046](https://github.com/redis/hiredis/pull/1046)) -- CMakeLists.txt: allow building without a C++ compiler [@ffontaine](https://github.com/ffontaine) ([\#872](https://github.com/redis/hiredis/pull/872)) -- Makefile: move SSL options into a block and refine rules [@pizhenwei](https://github.com/pizhenwei) ([\#997](https://github.com/redis/hiredis/pull/997)) -- Update CMakeLists.txt for more portability [@EricDeng1001](https://github.com/EricDeng1001) ([\#1005](https://github.com/redis/hiredis/pull/1005)) -- FreeBSD build fixes + CI [@michael-grunder](https://github.com/michael-grunder) ([\#1026](https://github.com/redis/hiredis/pull/1026)) -- Add asynchronous test for pubsub using RESP3 [@bjosv](https://github.com/bjosv) ([\#1012](https://github.com/redis/hiredis/pull/1012)) -- Trigger CI failure when Valgrind issues are found [@bjosv](https://github.com/bjosv) ([\#1011](https://github.com/redis/hiredis/pull/1011)) -- Move to using make directly in Cygwin [@michael-grunder](https://github.com/michael-grunder) ([\#1020](https://github.com/redis/hiredis/pull/1020)) -- Add asynchronous API tests [@bjosv](https://github.com/bjosv) ([\#1010](https://github.com/redis/hiredis/pull/1010)) -- Correcting the build target `coverage` for enabled SSL [@bjosv](https://github.com/bjosv) ([\#1009](https://github.com/redis/hiredis/pull/1009)) -- GH Actions: Run SSL tests during CI [@bjosv](https://github.com/bjosv) ([\#1008](https://github.com/redis/hiredis/pull/1008)) -- GH: Actions - Add valgrind and CMake [@michael-grunder](https://github.com/michael-grunder) ([\#1004](https://github.com/redis/hiredis/pull/1004)) -- Add Centos8 tests in GH Actions [@michael-grunder](https://github.com/michael-grunder) ([\#1001](https://github.com/redis/hiredis/pull/1001)) -- We should run actions on PRs [@michael-grunder](https://github.com/michael-grunder) (([\#1000](https://github.com/redis/hiredis/pull/1000)) -- Add Cygwin test in GitHub actions [@michael-grunder](https://github.com/michael-grunder) ([\#999](https://github.com/redis/hiredis/pull/999)) -- Add Windows tests in GitHub actions [@michael-grunder](https://github.com/michael-grunder) ([\#996](https://github.com/redis/hiredis/pull/996)) -- Switch to GitHub actions [@michael-grunder](https://github.com/michael-grunder) ([\#995](https://github.com/redis/hiredis/pull/995)) -- Minor refactor of CVE-2021-32765 fix. [@michael-grunder](https://github.com/michael-grunder) ([\#993](https://github.com/redis/hiredis/pull/993)) -- Remove extra comma from CMake var. [@xkszltl](https://github.com/xkszltl) ([\#988](https://github.com/redis/hiredis/pull/988)) -- Add REDIS\_OPT\_PREFER\_UNSPEC [@michael-grunder](https://github.com/michael-grunder) ([\#1101](https://github.com/redis/hiredis/pull/1101)) - -## Contributors -We'd like to thank all the contributors who worked on this release! - -<a href="https://github.com/EricDeng1001"><img src="https://github.com/EricDeng1001.png" width="32" height="32"></a> -<a href="https://github.com/Lipraxde"><img src="https://github.com/Lipraxde.png" width="32" height="32"></a> -<a href="https://github.com/MichaelSuen-thePointer"><img src="https://github.com/MichaelSuen-thePointer.png" width="32" height="32"></a> -<a href="https://github.com/SukkaW"><img src="https://github.com/SukkaW.png" width="32" height="32"></a> -<a href="https://github.com/adobeturchenko"><img src="https://github.com/adobeturchenko.png" width="32" height="32"></a> -<a href="https://github.com/afcidk"><img src="https://github.com/afcidk.png" width="32" height="32"></a> -<a href="https://github.com/bit0fun"><img src="https://github.com/bit0fun.png" width="32" height="32"></a> -<a href="https://github.com/bjosv"><img src="https://github.com/bjosv.png" width="32" height="32"></a> -<a href="https://github.com/bugwz"><img src="https://github.com/bugwz.png" width="32" height="32"></a> -<a href="https://github.com/catterer"><img src="https://github.com/catterer.png" width="32" height="32"></a> -<a href="https://github.com/chayim"><img src="https://github.com/chayim.png" width="32" height="32"></a> -<a href="https://github.com/devnexen"><img src="https://github.com/devnexen.png" width="32" height="32"></a> -<a href="https://github.com/ffontaine"><img src="https://github.com/ffontaine.png" width="32" height="32"></a> -<a href="https://github.com/ithewei"><img src="https://github.com/ithewei.png" width="32" height="32"></a> -<a href="https://github.com/jengab"><img src="https://github.com/jengab.png" width="32" height="32"></a> -<a href="https://github.com/kristjanvalur"><img src="https://github.com/kristjanvalur.png" width="32" height="32"></a> -<a href="https://github.com/michael-grunder"><img src="https://github.com/michael-grunder.png" width="32" height="32"></a> -<a href="https://github.com/noxiouz"><img src="https://github.com/noxiouz.png" width="32" height="32"></a> -<a href="https://github.com/mtdxc"><img src="https://github.com/mtdxc.png" width="32" height="32"></a> -<a href="https://github.com/orgads"><img src="https://github.com/orgads.png" width="32" height="32"></a> -<a href="https://github.com/pbtummillo"><img src="https://github.com/pbtummillo.png" width="32" height="32"></a> -<a href="https://github.com/pizhenwei"><img src="https://github.com/pizhenwei.png" width="32" height="32"></a> -<a href="https://github.com/scddev"><img src="https://github.com/scddev.png" width="32" height="32"></a> -<a href="https://github.com/smmir-cent"><img src="https://github.com/smmir-cent.png" width="32" height="32"></a> -<a href="https://github.com/stanhu"><img src="https://github.com/stanhu.png" width="32" height="32"></a> -<a href="https://github.com/sundb"><img src="https://github.com/sundb.png" width="32" height="32"></a> -<a href="https://github.com/vturchenko"><img src="https://github.com/vturchenko.png" width="32" height="32"></a> -<a href="https://github.com/xkszltl"><img src="https://github.com/xkszltl.png" width="32" height="32"></a> -<a href="https://github.com/yossigo"><img src="https://github.com/yossigo.png" width="32" height="32"></a> -<a href="https://github.com/zhangtaoXT5"><img src="https://github.com/zhangtaoXT5.png" width="32" height="32"></a> -<a href="https://github.com/zuiderkwast"><img src="https://github.com/zuiderkwast.png" width="32" height="32"></a> +----------------- ## [1.0.2](https://github.com/redis/hiredis/tree/v1.0.2) - (2021-10-07) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/CMakeLists.txt new/hiredis-1.3.0/CMakeLists.txt --- old/hiredis-1.2.0/CMakeLists.txt 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/CMakeLists.txt 2025-04-23 13:10:29.000000000 +0200 @@ -1,11 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) - -OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON) -OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) -OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF) -OPTION(ENABLE_SSL_TESTS "Should we test SSL connections" OFF) -OPTION(ENABLE_EXAMPLES "Enable building hiredis examples" OFF) -OPTION(ENABLE_ASYNC_TESTS "Should we run all asynchronous API tests" OFF) +CMAKE_MINIMUM_REQUIRED(VERSION 3.7.0) MACRO(getVersionBit name) SET(VERSION_REGEX "^#define ${name} (.+)$") @@ -24,6 +17,16 @@ PROJECT(hiredis LANGUAGES "C" VERSION "${VERSION}") INCLUDE(GNUInstallDirs) +OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON) +OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) +OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF) +OPTION(ENABLE_SSL_TESTS "Should we test SSL connections" OFF) +OPTION(ENABLE_EXAMPLES "Enable building hiredis examples" OFF) +OPTION(ENABLE_ASYNC_TESTS "Should we run all asynchronous API tests" OFF) +# Historically, the NuGet file was always install; default +# to ON for those who rely on that historical behaviour. +OPTION(ENABLE_NUGET "Install NuGET packaging details" ON) + # Hiredis requires C99 SET(CMAKE_C_STANDARD 99) SET(CMAKE_DEBUG_POSTFIX d) @@ -50,7 +53,8 @@ SET_TARGET_PROPERTIES(hiredis PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE - VERSION "${HIREDIS_SONAME}") + VERSION "${VERSION}" + SOVERSION "${HIREDIS_MAJOR}") IF(MSVC) SET_TARGET_PROPERTIES(hiredis PROPERTIES COMPILE_FLAGS /Z7) @@ -105,9 +109,11 @@ CONFIGURATIONS Debug RelWithDebInfo) endif() -# For NuGet packages -INSTALL(FILES hiredis.targets - DESTINATION build/native) +if (ENABLE_NUGET) + # For NuGet packages + INSTALL(FILES hiredis.targets + DESTINATION build/native) +endif() INSTALL(FILES hiredis.h read.h sds.h async.h alloc.h sockcompat.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis) @@ -164,7 +170,8 @@ SET_TARGET_PROPERTIES(hiredis_ssl PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE - VERSION "${HIREDIS_SONAME}") + VERSION "${VERSION}" + SOVERSION "${HIREDIS_MAJOR}") IF(MSVC) SET_TARGET_PROPERTIES(hiredis_ssl PROPERTIES COMPILE_FLAGS /Z7) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/Makefile new/hiredis-1.3.0/Makefile --- old/hiredis-1.2.0/Makefile 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/Makefile 2025-04-23 13:10:29.000000000 +0200 @@ -39,7 +39,11 @@ CC:=$(shell sh -c 'type $${CC%% *} >/dev/null 2>/dev/null && echo $(CC) || echo gcc') CXX:=$(shell sh -c 'type $${CXX%% *} >/dev/null 2>/dev/null && echo $(CXX) || echo g++') OPTIMIZATION?=-O3 -WARNINGS=-Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers +WARNINGS=-Wall -Wextra -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers +USE_WERROR?=1 +ifeq ($(USE_WERROR),1) + WARNINGS+=-Werror +endif DEBUG_FLAGS?= -g -ggdb REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CPPFLAGS) $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) $(PLATFORM_FLAGS) REAL_LDFLAGS=$(LDFLAGS) @@ -137,7 +141,10 @@ ifeq ($(uname_S),Darwin) DYLIBSUFFIX=dylib DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_SONAME).$(DYLIBSUFFIX) + DYLIB_MAJOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX) DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) + SSL_DYLIB_MINOR_NAME=$(SSL_LIBNAME).$(HIREDIS_SONAME).$(DYLIBSUFFIX) + SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX) SSL_DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME) -o $(SSL_DYLIBNAME) $(LDFLAGS) $(SSL_LDFLAGS) DYLIB_PLUGIN=-Wl,-undefined -Wl,dynamic_lookup endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/README.md new/hiredis-1.3.0/README.md --- old/hiredis-1.2.0/README.md 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/README.md 2025-04-23 13:10:29.000000000 +0200 @@ -23,6 +23,17 @@ The library comes with multiple APIs. There is the *synchronous API*, the *asynchronous API* and the *reply parsing API*. +## Upgrading to > 1.2.0 (**PRERELEASE**) + +* After v1.2.0 we modified how we invoke `poll(2)` to wait for connections to complete, such that we will now retry + the call if it is interrupted by a signal until: + + a) The connection succeeds or fails. + b) The overall connection timeout is reached. + + In previous versions, an interrupted `poll(2)` call would cause the connection to fail + with `c->err` set to `REDIS_ERR_IO` and `c->errstr` set to `poll(2): Interrupted system call`. + ## Upgrading to `1.1.0` Almost all users will simply need to recompile their applications against the newer version of hiredis. @@ -147,7 +158,7 @@ These functions return `REDIS_OK` on success. On failure, `REDIS_ERR` is returned and the underlying connection is closed. -To configure these for an asyncronous context (see *Asynchronous API* below), use `ac->c` to get the redisContext out of an asyncRedisContext. +To configure these for an asynchronous context (see *Asynchronous API* below), use `ac->c` to get the redisContext out of an asyncRedisContext. ```C int redisEnableKeepAlive(redisContext *c); @@ -291,7 +302,7 @@ This function immediately closes the socket and then frees the allocations done in creating the context. -### Sending commands (cont'd) +### Sending commands (continued) Together with `redisCommand`, the function `redisCommandArgv` can be used to issue commands. It has the following prototype: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/adapters/libuv.h new/hiredis-1.3.0/adapters/libuv.h --- old/hiredis-1.2.0/adapters/libuv.h 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/adapters/libuv.h 2025-04-23 13:10:29.000000000 +0200 @@ -159,6 +159,7 @@ memset(p, 0, sizeof(*p)); if (uv_poll_init_socket(loop, &p->handle, c->fd) != 0) { + hi_free(p); return REDIS_ERR; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/adapters/macosx.h new/hiredis-1.3.0/adapters/macosx.h --- old/hiredis-1.2.0/adapters/macosx.h 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/adapters/macosx.h 2025-04-23 13:10:29.000000000 +0200 @@ -1,7 +1,35 @@ -// -// Created by Дмитрий Бахвалов on 13.07.15. -// Copyright (c) 2015 Dmitry Bakhvalov. All rights reserved. -// +/* + * Copyright (c) 2015 Дмитрий Бахвалов (Dmitry Bakhvalov) + * + * Permission for license update: + * https://github.com/redis/hiredis/issues/1271#issuecomment-2258225227 + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Redis nor the names of its contributors may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef __HIREDIS_MACOSX_H__ #define __HIREDIS_MACOSX_H__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/async.c new/hiredis-1.3.0/async.c --- old/hiredis-1.2.0/async.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/async.c 2025-04-23 13:10:29.000000000 +0200 @@ -478,7 +478,7 @@ /* Match reply with the expected format of a pushed message. * The type and number of elements (3 to 4) are specified at: - * https://redis.io/topics/pubsub#format-of-pushed-messages */ + * https://redis.io/docs/latest/develop/interact/pubsub/#format-of-pushed-messages */ if ((reply->type == REDIS_REPLY_ARRAY && !(c->flags & REDIS_SUPPORTS_PUSH) && reply->elements >= 3) || reply->type == REDIS_REPLY_PUSH) { assert(reply->element[0]->type == REDIS_REPLY_STRING); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/examples/example-macosx.c new/hiredis-1.3.0/examples/example-macosx.c --- old/hiredis-1.2.0/examples/example-macosx.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/examples/example-macosx.c 2025-04-23 13:10:29.000000000 +0200 @@ -1,7 +1,35 @@ -// -// Created by Дмитрий Бахвалов on 13.07.15. -// Copyright (c) 2015 Dmitry Bakhvalov. All rights reserved. -// +/* + * Copyright (c) 2015 Дмитрий Бахвалов (Dmitry Bakhvalov) + * + * Permission for license update: + * https://github.com/redis/hiredis/issues/1271#issuecomment-2258225227 + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Redis nor the names of its contributors may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #include <stdio.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/fuzzing/format_command_fuzzer.c new/hiredis-1.3.0/fuzzing/format_command_fuzzer.c --- old/hiredis-1.2.0/fuzzing/format_command_fuzzer.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/fuzzing/format_command_fuzzer.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2020, Salvatore Sanfilippo <antirez at gmail dot com> - * Copyright (c) 2020, Pieter Noordhuis <pcnoordhuis at gmail dot com> - * Copyright (c) 2020, Matt Stancliff <matt at genges dot com>, - * Jan-Erik Rediger <janerik at fnordig dot com> - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Redis nor the names of its contributors may be used - * to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdlib.h> -#include <string.h> -#include "hiredis.h" - -int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - char *new_str, *cmd; - - if (size < 3) - return 0; - - new_str = malloc(size+1); - if (new_str == NULL) - return 0; - - memcpy(new_str, data, size); - new_str[size] = '\0'; - - if (redisFormatCommand(&cmd, new_str) != -1) - hi_free(cmd); - - free(new_str); - return 0; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/hiredis.c new/hiredis-1.3.0/hiredis.c --- old/hiredis-1.2.0/hiredis.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/hiredis.c 2025-04-23 13:10:29.000000000 +0200 @@ -102,6 +102,7 @@ break; /* Nothing to free */ case REDIS_REPLY_ARRAY: case REDIS_REPLY_MAP: + case REDIS_REPLY_ATTR: case REDIS_REPLY_SET: case REDIS_REPLY_PUSH: if (r->element != NULL) { @@ -160,6 +161,7 @@ parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || + parent->type == REDIS_REPLY_ATTR || parent->type == REDIS_REPLY_SET || parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; @@ -192,6 +194,7 @@ parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || + parent->type == REDIS_REPLY_ATTR || parent->type == REDIS_REPLY_SET || parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; @@ -212,6 +215,7 @@ parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || + parent->type == REDIS_REPLY_ATTR || parent->type == REDIS_REPLY_SET || parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; @@ -249,6 +253,7 @@ parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || + parent->type == REDIS_REPLY_ATTR || parent->type == REDIS_REPLY_SET || parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; @@ -267,6 +272,7 @@ parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || + parent->type == REDIS_REPLY_ATTR || parent->type == REDIS_REPLY_SET || parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; @@ -287,6 +293,7 @@ parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || + parent->type == REDIS_REPLY_ATTR || parent->type == REDIS_REPLY_SET || parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/hiredis.h new/hiredis-1.3.0/hiredis.h --- old/hiredis-1.2.0/hiredis.h 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/hiredis.h 2025-04-23 13:10:29.000000000 +0200 @@ -46,9 +46,9 @@ #include "alloc.h" /* for allocation wrappers */ #define HIREDIS_MAJOR 1 -#define HIREDIS_MINOR 2 +#define HIREDIS_MINOR 3 #define HIREDIS_PATCH 0 -#define HIREDIS_SONAME 1.1.0 +#define HIREDIS_SONAME 1.3.0 /* Connection type can be blocking or non-blocking and is set in the * least significant bit of the flags field in redisContext. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/net.c new/hiredis-1.3.0/net.c --- old/hiredis-1.2.0/net.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/net.c 2025-04-23 13:10:29.000000000 +0200 @@ -41,6 +41,7 @@ #include <stdio.h> #include <limits.h> #include <stdlib.h> +#include <time.h> #include "net.h" #include "sds.h" @@ -172,6 +173,10 @@ int val = 1; redisFD fd = c->fd; + /* TCP_KEEPALIVE makes no sense with AF_UNIX connections */ + if (c->connection_type == REDIS_CONN_UNIX) + return REDIS_ERR; + #ifndef _WIN32 if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val)) == -1){ __redisSetError(c,REDIS_ERR_OTHER,strerror(errno)); @@ -271,37 +276,54 @@ return REDIS_OK; } +static long redisPollMillis(void) { +#ifndef _MSC_VER + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + return (now.tv_sec * 1000) + now.tv_nsec / 1000000; +#else + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + return (((long long)ft.dwHighDateTime << 32) | ft.dwLowDateTime) / 10; +#endif +} + static int redisContextWaitReady(redisContext *c, long msec) { - struct pollfd wfd[1]; + struct pollfd wfd; + long end; + int res; - wfd[0].fd = c->fd; - wfd[0].events = POLLOUT; + if (errno != EINPROGRESS) { + __redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL); + redisNetClose(c); + return REDIS_ERR; + } - if (errno == EINPROGRESS) { - int res; + wfd.fd = c->fd; + wfd.events = POLLOUT; + end = msec >= 0 ? redisPollMillis() + msec : 0; - if ((res = poll(wfd, 1, msec)) == -1) { + while ((res = poll(&wfd, 1, msec)) <= 0) { + if (res < 0 && errno != EINTR) { __redisSetErrorFromErrno(c, REDIS_ERR_IO, "poll(2)"); redisNetClose(c); return REDIS_ERR; - } else if (res == 0) { + } else if (res == 0 || (msec >= 0 && redisPollMillis() >= end)) { errno = ETIMEDOUT; - __redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL); + __redisSetErrorFromErrno(c, REDIS_ERR_IO, NULL); redisNetClose(c); return REDIS_ERR; + } else { + /* res < 0 && errno == EINTR, try again */ } + } - if (redisCheckConnectDone(c, &res) != REDIS_OK || res == 0) { - redisCheckSocketError(c); - return REDIS_ERR; - } - - return REDIS_OK; + if (redisCheckConnectDone(c, &res) != REDIS_OK || res == 0) { + redisCheckSocketError(c); + return REDIS_ERR; } - __redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL); - redisNetClose(c); - return REDIS_ERR; + return REDIS_OK; } int redisCheckConnectDone(redisContext *c, int *completed) { @@ -646,7 +668,7 @@ sa->sun_family = AF_UNIX; strncpy(sa->sun_path, path, sizeof(sa->sun_path) - 1); if (connect(c->fd, (struct sockaddr*)sa, sizeof(*sa)) == -1) { - if (errno == EINPROGRESS && !blocking) { + if ((errno == EAGAIN || errno == EINPROGRESS) && !blocking) { /* This is ok. */ } else { if (redisContextWaitReady(c,timeout_msec) != REDIS_OK) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/read.c new/hiredis-1.3.0/read.c --- old/hiredis-1.2.0/read.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/read.c 2025-04-23 13:10:29.000000000 +0200 @@ -250,6 +250,7 @@ prv = r->task[r->ridx-1]; assert(prv->type == REDIS_REPLY_ARRAY || prv->type == REDIS_REPLY_MAP || + prv->type == REDIS_REPLY_ATTR || prv->type == REDIS_REPLY_SET || prv->type == REDIS_REPLY_PUSH); if (cur->idx == prv->elements-1) { @@ -534,7 +535,7 @@ moveToNextTask(r); } else { - if (cur->type == REDIS_REPLY_MAP) elements *= 2; + if (cur->type == REDIS_REPLY_MAP || cur->type == REDIS_REPLY_ATTR) elements *= 2; if (r->fn && r->fn->createArray) obj = r->fn->createArray(cur,elements); @@ -602,6 +603,9 @@ case '%': cur->type = REDIS_REPLY_MAP; break; + case '|': + cur->type = REDIS_REPLY_ATTR; + break; case '~': cur->type = REDIS_REPLY_SET; break; @@ -642,6 +646,7 @@ return processBulkItem(r); case REDIS_REPLY_ARRAY: case REDIS_REPLY_MAP: + case REDIS_REPLY_ATTR: case REDIS_REPLY_SET: case REDIS_REPLY_PUSH: return processAggregateItem(r); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/sds.c new/hiredis-1.3.0/sds.c --- old/hiredis-1.2.0/sds.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/sds.c 2025-04-23 13:10:29.000000000 +0200 @@ -692,10 +692,10 @@ * Output will be just "Hello World". */ sds sdstrim(sds s, const char *cset) { - char *start, *end, *sp, *ep; + char *end, *sp, *ep; size_t len; - sp = start = s; + sp = s; ep = end = s+sdslen(s)-1; while(sp <= end && strchr(cset, *sp)) sp++; while(ep > sp && strchr(cset, *ep)) ep--; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/ssl.c new/hiredis-1.3.0/ssl.c --- old/hiredis-1.2.0/ssl.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/ssl.c 2025-04-23 13:10:29.000000000 +0200 @@ -34,6 +34,9 @@ #include "async.h" #include "net.h" +#include <openssl/ssl.h> +#include <openssl/err.h> + #include <assert.h> #include <errno.h> #include <string.h> @@ -52,9 +55,6 @@ #include <pthread.h> #endif -#include <openssl/ssl.h> -#include <openssl/err.h> - #include "win32.h" #include "async_private.h" #include "hiredis_ssl.h" @@ -167,8 +167,8 @@ int redisInitOpenSSL(void) { - SSL_library_init(); #ifdef HIREDIS_USE_CRYPTO_LOCKS + SSL_library_init(); initOpensslLocks(); #endif @@ -364,7 +364,6 @@ return REDIS_ERR; } - c->funcs = &redisContextSSLFuncs; rssl->ssl = ssl; SSL_set_mode(rssl->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); @@ -372,15 +371,19 @@ SSL_set_connect_state(rssl->ssl); ERR_clear_error(); + int rv = SSL_connect(rssl->ssl); if (rv == 1) { + c->funcs = &redisContextSSLFuncs; c->privctx = rssl; return REDIS_OK; } rv = SSL_get_error(rssl->ssl, rv); if (((c->flags & REDIS_BLOCK) == 0) && - (rv == SSL_ERROR_WANT_READ || rv == SSL_ERROR_WANT_WRITE)) { + (rv == SSL_ERROR_WANT_READ || rv == SSL_ERROR_WANT_WRITE)) + { + c->funcs = &redisContextSSLFuncs; c->privctx = rssl; return REDIS_OK; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/test.c new/hiredis-1.3.0/test.c --- old/hiredis-1.2.0/test.c 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/test.c 2025-04-23 13:10:29.000000000 +0200 @@ -104,6 +104,13 @@ #define assert(e) (void)(e) #endif +#define redisTestPanic(msg) \ + do { \ + fprintf(stderr, "PANIC: %s (In function \"%s\", file \"%s\", line %d)\n", \ + msg, __func__, __FILE__, __LINE__); \ + exit(1); \ + } while (1) + /* Helper to extract Redis version information. Aborts on any failure. */ #define REDIS_VERSION_FIELD "redis_version:" void get_redis_version(redisContext *c, int *majorptr, int *minorptr) { @@ -149,7 +156,7 @@ assert(reply != NULL); freeReplyObject(reply); - /* Make sure the DB is emtpy */ + /* Make sure the DB is empty */ reply = redisCommand(c,"DBSIZE"); assert(reply != NULL); if (reply->type == REDIS_REPLY_INTEGER && reply->integer == 0) { @@ -232,7 +239,7 @@ c = redisConnectFd(fd); } } else { - assert(NULL); + redisTestPanic("Unknown connection type!"); } if (c == NULL) { @@ -424,6 +431,24 @@ redisFree(c); } +static void test_unix_keepalive(struct config cfg) { + redisContext *c; + redisReply *r; + + c = do_connect(cfg); + + test("Setting TCP_KEEPALIVE on a unix socket returns an error: "); + test_cond(redisEnableKeepAlive(c) == REDIS_ERR && c->err == 0); + + test("Setting TCP_KEEPALIVE on a unix socket doesn't break the connection: "); + r = redisCommand(c, "PING"); + test_cond(r != NULL && r->type == REDIS_REPLY_STATUS && r->len == 4 && + !memcmp(r->str, "PONG", 4)); + freeReplyObject(r); + + redisFree(c); +} + static void test_reply_reader(void) { redisReader *reader; void *reply, *root; @@ -770,6 +795,26 @@ freeReplyObject(reply); redisReaderFree(reader); + test("Can parse RESP3 attribute: "); + reader = redisReaderCreate(); + redisReaderFeed(reader, "|2\r\n+foo\r\n:123\r\n+bar\r\n#t\r\n",26); + ret = redisReaderGetReply(reader,&reply); + test_cond(ret == REDIS_OK && + ((redisReply*)reply)->type == REDIS_REPLY_ATTR && + ((redisReply*)reply)->elements == 4 && + ((redisReply*)reply)->element[0]->type == REDIS_REPLY_STATUS && + ((redisReply*)reply)->element[0]->len == 3 && + !strcmp(((redisReply*)reply)->element[0]->str,"foo") && + ((redisReply*)reply)->element[1]->type == REDIS_REPLY_INTEGER && + ((redisReply*)reply)->element[1]->integer == 123 && + ((redisReply*)reply)->element[2]->type == REDIS_REPLY_STATUS && + ((redisReply*)reply)->element[2]->len == 3 && + !strcmp(((redisReply*)reply)->element[2]->str,"bar") && + ((redisReply*)reply)->element[3]->type == REDIS_REPLY_BOOL && + ((redisReply*)reply)->element[3]->integer); + freeReplyObject(reply); + redisReaderFree(reader); + test("Can parse RESP3 set: "); reader = redisReaderCreate(); redisReaderFeed(reader, "~5\r\n+orange\r\n$5\r\napple\r\n#f\r\n:100\r\n:999\r\n",40); @@ -1231,15 +1276,13 @@ redisContext *c; redisReply *reply; ssize_t s; - const char *sleep_cmd = "DEBUG SLEEP 3\r\n"; - struct timeval tv; + const char *sleep_cmd = "DEBUG SLEEP 1\r\n"; + struct timeval tv = {.tv_sec = 0, .tv_usec = 10000}; c = do_connect(config); test("Successfully completes a command when the timeout is not exceeded: "); reply = redisCommand(c,"SET foo fast"); freeReplyObject(reply); - tv.tv_sec = 0; - tv.tv_usec = 10000; redisSetTimeout(c, tv); reply = redisCommand(c, "GET foo"); test_cond(reply != NULL && reply->type == REDIS_REPLY_STRING && memcmp(reply->str, "fast", 4) == 0); @@ -1257,8 +1300,6 @@ sdsfree(c->obuf); c->obuf = sdsempty(); - tv.tv_sec = 0; - tv.tv_usec = 10000; redisSetTimeout(c, tv); reply = redisCommand(c, "GET foo"); #ifndef _WIN32 @@ -1271,7 +1312,7 @@ freeReplyObject(reply); // wait for the DEBUG SLEEP to complete so that Redis server is unblocked for the following tests - millisleep(3000); + millisleep(1100); } else { test_skipped(); } @@ -1340,7 +1381,7 @@ } static void test_invalid_timeout_errors(struct config config) { - redisContext *c; + redisContext *c = NULL; test("Set error when an invalid timeout usec value is used during connect: "); @@ -1352,10 +1393,10 @@ } else if(config.type == CONN_UNIX) { c = redisConnectUnixWithTimeout(config.unix_sock.path, config.connect_timeout); } else { - assert(NULL); + redisTestPanic("Unknown connection type!"); } - test_cond(c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0); + test_cond(c != NULL && c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0); redisFree(c); test("Set error when an invalid timeout sec value is used during connect: "); @@ -1368,10 +1409,10 @@ } else if(config.type == CONN_UNIX) { c = redisConnectUnixWithTimeout(config.unix_sock.path, config.connect_timeout); } else { - assert(NULL); + redisTestPanic("Unknown connection type!"); } - test_cond(c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0); + test_cond(c != NULL && c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0); redisFree(c); } @@ -2253,7 +2294,7 @@ */ test("Ping/Pong from onConnected callback (Issue #931): "); c = do_aconnect(config, ASTEST_ISSUE_931_PING); - /* connect callback issues ping, reponse callback destroys context */ + /* connect callback issues ping, response callback destroys context */ while(astest.ac) redisPollTick(c, 0.1); assert(astest.connected == 0); @@ -2356,6 +2397,7 @@ test_blocking_connection_timeouts(cfg); test_blocking_io_errors(cfg); test_invalid_timeout_errors(cfg); + test_unix_keepalive(cfg); if (throughput) test_throughput(cfg); } else { test_skipped(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hiredis-1.2.0/test.sh new/hiredis-1.3.0/test.sh --- old/hiredis-1.2.0/test.sh 2023-07-12 09:31:17.000000000 +0200 +++ new/hiredis-1.3.0/test.sh 2025-04-23 13:10:29.000000000 +0200 @@ -11,7 +11,7 @@ REDIS_DOCKER=${REDIS_DOCKER:-} # We need to enable the DEBUG command for redis-server >= 7.0.0 -REDIS_MAJOR_VERSION="$(redis-server --version|awk -F'[^0-9]+' '{ print $2 }')" +REDIS_MAJOR_VERSION="$(${REDIS_SERVER} --version|awk -F'[^0-9]+' '{ print $2 }')" if [ "$REDIS_MAJOR_VERSION" -gt "6" ]; then ENABLE_DEBUG_CMD="enable-debug-command local" fi @@ -98,7 +98,7 @@ -p ${REDIS_SSL_PORT}:${REDIS_SSL_PORT} \ -v ${tmpdir}:${tmpdir} \ ${REDIS_DOCKER} \ - redis-server ${tmpdir}/redis.conf + ${REDIS_SERVER} ${tmpdir}/redis.conf else ${REDIS_SERVER} ${tmpdir}/redis.conf fi
