Commit Graph

837 Commits

Author SHA1 Message Date
michael-grunder
b9b9f446fe Fix handling of NIL invalidation messages.
When CLIENT TRACKING is enabled, Redis will send an invalidation message
with a NIL payload to all tracking clients after a FLUSHDB is executed.

We didn't account for REDIS_REPLY_PUSH being a valid parent object to a
NIL payload, and were failing an assertion.

Additionally this commit adds a regression test for the logic.
2020-10-17 19:08:05 -07:00
Michael Grunder
acc917548d
Merge pull request #885 from gkorland/patch-1
clean a warning, remvoe empty else block
2020-10-12 15:47:14 -07:00
Guy Korland
b086f763e7
clean a warning, remvoe empty else block 2020-10-12 17:15:29 +03:00
Michael Grunder
b47fae4e70
Merge pull request #881 from timgates42/bugfix_typo_terminated
docs: Fix simple typo, termined -> terminated
2020-09-27 21:04:58 -07:00
Tim Gates
f989670e59
docs: Fix simple typo, termined -> terminated
There is a small typo in sds.c.

Should read `terminated` rather than `termined`.
2020-09-26 20:58:09 +10:00
shiyuge
773d6ea8a7
Copy error to redisAsyncContext on timeout 2020-09-23 15:46:20 +08:00
michael-grunder
2a5a57b90a Remove whitespace 2020-09-07 17:47:50 -07:00
Alessio M
1b40ec5096 fixed issue with unit test linking on windows with SSL 2020-09-07 23:27:45 +01:00
Alessio M
d7b1d21e80 Merge branch 'master' of github.com:redis/hiredis 2020-09-04 09:31:47 +01:00
Michael Grunder
fb0e6c0dd9
Merge pull request #870 from michael-grunder/cmake-c99
Explicitly set c99 in CMake
2020-08-31 10:29:37 -07:00
michael-grunder
13a35bdb64 Explicitly set c99 in CMake
See #869
2020-08-28 12:35:20 -07:00
Michael Grunder
bea137ca94
Merge pull request #868 from michael-grunder/fix-sockaddr-typo
Fix sockaddr typo
2020-08-20 18:38:16 -07:00
michael-grunder
bd6f86eb6b Fix sockaddr typo
Fixes #867
2020-08-20 17:58:23 -07:00
Michael Grunder
48696e7e5e
Don't use non-installed win32.h helper in examples (#863)
See: #862
2020-08-07 10:26:38 -07:00
michael-grunder
faa1c4863a Merge tag 'v1.0.0'
Release of v1.0.0

Hiredis v1.0.0 marks the first stable release of Hiredis and introduces
RESP3 support, SSL connections, allocator injection, better Windows support,
and more.

IMPORTANT:  There are breaking changes in this release meaning your code
will need to be recompiled and may need small changes.  The exact
details of the breaking changes can be found in README.md.

CHANGELOG.md has a detailed list of changes between v0.14.1 and v1.0.0.

~~~

Thank you to everyone who contriubuted to the project by submitting PRs,
reporting bugs, or helping answer people's questions.

And a special thank you to the following people who contributed at least
five lines of code to this release (sorted by lines contributed) \o/

Michael Grunder, Yossi Gottlieb, Mark Nunberg, Marcus Geelnard, Justin Brewer,
Minun Dragonation, Omri Steiner, Sangmoon Yi, Jinjiazh, Odin Hultgren Van Der Horst,
Nick Rivera, Qi Yang, kevin1018
2020-08-03 12:00:32 -07:00
michael-grunder
d5b4c69b71 Prepare for v1.0.0 GA 2020-08-03 11:18:07 -07:00
Michael Grunder
5003906d63
Define a no op assert if we detect NDEBUG (#861)
Addresses #642
2020-07-31 13:23:28 -07:00
michael-grunder
ea063b7cc8 Use development specific versions in master
Avoids issues like #860
2020-07-31 12:32:40 -07:00
Michael Grunder
04a27f4800
We can run SSL tests everywhere except mingw/Windows (#859) 2020-07-31 09:16:32 -07:00
Michael Grunder
8966a1fc2b
Remove extra whitespace (#858) 2020-07-30 16:55:48 -07:00
lijiageng
34b7f7a0ff
Keep libev's code style (#857) 2020-07-30 10:59:19 -07:00
michael-grunder
a853467542 Update notes preparing for v1.0.0-rc1 2020-07-29 13:39:28 -07:00
Michael Grunder
d8ff72387d
Move SSL management to a distinct private pointer. (#855)
We need to allow our users to use redisContext->privdata as context
for any RESP3 PUSH messages, which means we can't use it for managing
SSL connections.

Bulletpoints:

* Create a secondary redisContext member for internal use only called
  privctx and rename the redisContextFuncs->free_privdata accordingly.

* Adds a `free_privdata` function pointer so the user can tie allocated
  memory to the lifetime of a redisContext (like they can already do
  with redisAsyncContext)

* Enables SSL tests in .travis.yml
2020-07-29 11:53:03 -07:00
Michael Grunder
be32bcdc8e
Minor refactor for scheduling an async timer. (#854)
Small change to the logic introduced in #839
2020-07-26 13:03:42 -07:00
valentinogeron
38b5ae543f
add a command_timeout to redisContextOptions (#839)
Add an additional timeout so the user has a convenient way of controlling distinct connect and command timeouts
2020-07-26 12:32:27 -07:00
masariello
07c3618ffe Add static library target and cpack support 2020-07-22 20:30:41 +01:00
michael-grunder
3bb985314d Fix a static analysis false positive
Static analyzer's can't tell that hi_calloc is calloc-like, and report a
potential null pointer dereference.  This isn't possible but it's
probably smarter to make the test anyway in the event code changes.
2020-07-21 15:39:40 -07:00
Michael Grunder
18fc12c392
Move include to sockcompat.h to maintain style (#850)
See #848
2020-07-20 16:27:28 -07:00
Malizia R
43aeabbbee
fix windows compiling with mingw (#848) 2020-07-20 15:34:52 -07:00
Michael Grunder
5a3c324138
Remove erroneous tag and add license to push example (#849) 2020-07-19 21:47:28 -07:00
Michael Grunder
2e7d7cbabd
Resp3 oob push support (#841)
Proper support for RESP3 PUSH messages.

By default, PUSH messages are now intercepted and the reply memory freed.  
This means existing code should work unchanged when connecting to Redis
>= 6.0.0 even if `CLIENT TRACKING` were then enabled.

Additionally, we define two callbacks users can configure if they wish to handle
these messages in a custom way:

void redisPushFn(void *privdata, void *reply);
void redisAsyncPushFn(redisAsyncContext *ac, void *reply);

See #825
2020-07-19 18:54:42 -07:00
Michael Grunder
1864e76ea7
Some Windows quality of life improvments. (#846)
* Don't try to ignore SIGPIPE in Windows (it doesn't exist).
* Add an include to our win32.h compatibility header.
* Enable building examples on Travis in Windows.

See #831
2020-07-10 12:53:52 -07:00
Michael Grunder
ada3665279
Use _WIN32 define instead of WIN32 (#845)
It appears that _WIN32 is always defined by MSVC whereas WIN32 may not
be, depending on configuration.
2020-07-08 17:44:30 -07:00
Michael Grunder
08593db1f2
Non Linux CI fixes (#844)
* Switch to memurai for Windows tests

* Switch to macports from brew.
2020-07-08 17:06:30 -07:00
OmriSteiner
392de5d7f9
fix #785: defer TCP_NODELAY in async tcp connections (#836)
Co-authored-by: Omri Steiner <omri@insoundz.com>
2020-06-22 13:20:30 -07:00
valentinogeron
a28de70a01
timeout option in redisConnectWithOptions should be on connect only (#829)
When connecting with a timeout, we shouldn't also call `redisSetTimeout` which will implement a timeout for commands.

See related issue #722
2020-06-18 21:45:25 -07:00
Michael Grunder
6448f735d5
sdsrange overflow fix (#830)
Fix overflow bug in `sdsrange`
2020-06-07 14:38:16 -07:00
Aureus
c726723545
Use explicit pointer casting for c++ compatibility (#826) 2020-06-01 15:21:27 -07:00
michael-grunder
4152bfce7c Merge branch 'new-ssl-api' 2020-05-30 11:50:59 -07:00
michael-grunder
904bf7fe00 Tiny OOM fix 2020-05-30 11:03:45 -07:00
michael-grunder
ffd6eaebd6 Merge branch 'master' into new-ssl-api 2020-05-30 09:30:01 -07:00
Michael Grunder
e553e0f382
Document allocator injection and completeness fix in test.c (#824) 2020-05-26 10:06:28 -07:00
Michael Grunder
f5d2585043
Use unique names for allocator struct members (#823)
Using `strdup` as a struct member causes issues in older gcc
2020-05-25 12:17:43 -07:00
Yossi Gottlieb
190bca88d0 New SSL API to replace redisSecureConnection(). 2020-05-24 23:37:47 +03:00
Michael Grunder
8e0264cfd6
Allow users to replace allocator and handle OOM everywhere. (#800)
* Adds an indirection to every allocation/deallocation to allow users to 
  plug in ones of their choosing (use custom functions, jemalloc, etc).

* Gracefully handle OOM everywhere in hiredis.  This should make it possible
  for users of the library to have more flexibility in how they handle such situations.

* Changes `redisReaderTask->elements` from an `int` to a `long long` to prevent
  a possible overflow when transferring the task elements into a `redisReply`.

* Adds a configurable `max elements` member to `redisReader` that defaults to
  2^32 - 1.  This can be set to "unlimited" by setting the value to zero.
2020-05-22 09:27:49 -07:00
Michael Grunder
83bba659b9
Add logic to handle RESP3 push messages (#819)
Fixes #815
2020-05-21 11:12:18 -07:00
Muhammad Zahalqa
c8999c6602
Use standrad isxdigit instead of custom helper function. (#814)
Standard function available and on most platforms uses a lookup table and not
a check with 3 ranges.
2020-05-20 09:35:15 -07:00
Michael Grunder
5c9f49e212
Resp3 verbatim string support (#805)
Pull RESP3 verbatim string handling from Redis

Fixes #802
2020-05-19 12:56:02 -07:00
Yossi Gottlieb
243099ccd2
Fix missing SSL build/install options. (#812)
* Fix missing SSL build/install options.

* Use different build commands for non-Linux linkers.
* Add missing install targets.

Fixes #809
2020-05-19 10:13:32 -07:00
Michael Grunder
a6a824cb65
Add link to ABI tracker (#808)
Addresses #506
2020-05-16 12:15:26 -07:00