880 Commits

Author SHA1 Message Date
plan-do-break-fix
0743f57bba fix(docs): corrects typos in project README 2021-04-24 02:23:36 -05:00
michael-grunder
dfa33e60b0 Change order independant push logic to not change behavior.
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-02 09:34:09 -07:00
michael-grunder
6204182aae Handle the case where an invalidation is sent second.
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-04-02 09:34:09 -07:00
michael-grunder
d6a0b192b4 Merge branch 'reader-updates'
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-25 21:53:34 -08:00
michael-grunder
410c24d2a9 Fix off-by-one error in seekNewline 2021-02-25 21:25:17 -08:00
Alex Smith
bd7488d27d read: Validate line items prior to checking for object creation callbacks 2021-02-25 21:25:17 -08:00
Alex Smith
5f9242a1f8 read: Remove obsolete comment on nested multi bulk depth limitation 2021-02-25 21:25:17 -08:00
Alex Smith
83c1450425 read: Add support for the RESP3 bignum type 2021-02-25 21:25:17 -08:00
Alex Smith
c6646cb192 read: Ensure no invalid '\r' or '\n' in simple status/error strings 2021-02-25 21:25:17 -08:00
Alex Smith
e43061156c read: Additional validation and test case for RESP3 double
This ensures that malformed RESP3 double messages that include an
invalid null byte are not parsed as valid.
2021-02-25 21:25:17 -08:00
Alex Smith
c8adea4024 redisReply: Fix parent type assertions during double, nil, bool creation
Per RESP3, push messages are able to contain exactly what array
messages can contain (that is, any other type).
2021-02-25 21:25:17 -08:00
Alex Smith
ff73f1f9e7 redisReply: Explicitly list nil and bool cases in freeReplyObject() switch. 2021-02-25 21:25:17 -08:00
Alex Smith
0f92518847 test: Add test case for RESP3 set 2021-02-25 21:25:17 -08:00
Alex Smith
33c06dd503 test: Add test case for RESP3 map 2021-02-25 21:25:17 -08:00
Alex Smith
397fe26301 read: Use memchr() in seekNewline() instead of looping over entire string 2021-02-25 21:25:17 -08:00
Alex Smith
81c48a9821 test: Add test cases for RESP3 bool 2021-02-25 21:25:17 -08:00
Alex Smith
51e693f4fd read: Add additional RESP3 bool validation
RESP3 bools should be only one of "#t\r\n" or "#f\r\n". We also allow
capital 'T' and 'F' to be lenient.
2021-02-25 21:25:17 -08:00
Alex Smith
790b4d3b4d test: Add test cases for RESP3 nil 2021-02-25 21:25:17 -08:00
Alex Smith
d8899fbc19 read: Add additional RESP3 nil validation
RESP3 nil should consist of "_\r\n" and nothing else.
2021-02-25 21:25:17 -08:00
Alex Smith
96e8ea6110 test: Add test cases for infinite and NaN doubles 2021-02-25 21:25:17 -08:00
Alex Smith
f913e9b997 read: Fix double validation and infinity parsing
The ',' protocol byte gets removed in processItem(), so it should not
be compared against in processLineItem().

strtod() allows multiple representations of infinity and NaN that are
not RESP3 compliant. Since we explicitly check for the two compliant
infinity cases, strtod() should only return finite values.
2021-02-25 21:25:17 -08:00
Alex Smith
8039c7d26c test: Add test case for doubles 2021-02-25 21:25:17 -08:00
Alex Smith
49539fd1a7 redisReply: Fix - set len in double objects 2021-02-25 21:25:17 -08:00
Michael Grunder
53a8144c81
Merge pull request #924 from cheese1/master
http -> https
2021-02-17 10:08:35 -08:00
cheese1
9390de006d
http -> https 2021-02-17 16:15:45 +01:00
Michael Grunder
7d99b56356
Merge pull request #917 from Nordix/stack-alloc-dict-iter
Stack allocate dict iterators
2021-01-26 11:20:25 -08:00
Bjorn Svensson
4bba72103c Handle OOM during async command callback registration
Unless the callback is pushed to the list it will trigger an assert
in redisProcessCallbacks() when the response arrives.
This change let the user get an early error instead,
available in the async context directly.
2021-01-26 09:57:19 +01:00
Bjorn Svensson
920128a260 Stack allocate dict iterators
Replacing the get & release functions with an initiation
function. Simplifies the code and will make sure we
run subscription callbacks in OOM scenarios.
2021-01-25 16:19:42 +01:00
michael-grunder
297ecbecb7 Tiny formatting changes + suppress implicit memcpy warning 2020-12-12 11:56:35 -08:00
AdamKorcz
f746a28e71 Removed 2 typecasts 2020-12-12 19:26:04 +00:00
AdamKorcz
940a04f4dd Added fuzzer 2020-12-11 14:03:42 +00:00
Michael Grunder
e4a200040a
Merge pull request #896 from ayeganov/bugfix/ssl_leak
Free SSL object when redisSSLConnect fails
2020-11-15 09:56:10 -08:00
Aleksandr Yeganov
aefef8987f Free SSL object when redisSSLConnect fails 2020-11-10 11:59:41 -05:00
Michael Grunder
e3f88ebcf8
Merge pull request #894 from jcohen02/fix/issue893
Updating SSL connection example in README
2020-10-27 14:20:53 -07:00
Jeremy Cohen
308ffcab8d Updating SSL connection example 2020-10-27 19:40:13 +00:00
Michael Grunder
297f6551da
Merge pull request #889 from redis/wincert
Add support for Wincert CA store in Windows
2020-10-18 14:55:42 -07:00
michael-grunder
e7dda97859 Formatting 2020-10-18 14:24:22 -07:00
Michael Grunder
f44945a0af
Merge pull request #874 from masariello/position-independent-code
Enable position-independent code, and add PDB files to packages for MSVC builds
2020-10-18 14:04:02 -07:00
Michael Grunder
74e78498cf
Merge pull request #888 from michael-grunder/nil-push-invalidation
Fix handling of NIL invalidation messages.
2020-10-18 13:25:45 -07:00
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
Alessio M
e35300a668 add pdb files to packages for MSVC builds 2020-09-09 18:11:05 +01:00
Alessio M
dde6916b42 Add d suffix to debug libraries so that can packaged together with optimized builds (Release, RelWithDebInfo, etc) 2020-09-09 17:27:28 +01:00
Alessio M
3b68b5018e Enable position-independent code 2020-09-09 11:55:42 +01:00
Alessio M
6693863f4c Add support for system CA certificate store on Windows 2020-09-08 20:09:39 +01:00
michael-grunder
2a5a57b90a Remove whitespace 2020-09-07 17:47:50 -07:00