Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
2ad6e875
Commit
2ad6e875
authored
Nov 30, 2018
by
antirez
Browse files
RESP3: add shared.nullarray for better RESP2 compat.
parent
1a17cdfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
2ad6e875
...
@@ -1471,9 +1471,14 @@ void createSharedObjects(void) {
...
@@ -1471,9 +1471,14 @@ void createSharedObjects(void) {
/* The shared NULL depends on the protocol version. */
/* The shared NULL depends on the protocol version. */
shared.null[0] = NULL;
shared.null[0] = NULL;
shared.null[1] = NULL;
shared.null[1] = NULL;
shared
.
null
[
2
]
=
createObject
(
OBJ_STRING
,
sdsnew
(
"
*
-1
\r\n
"
));
shared.null[2] = createObject(OBJ_STRING,sdsnew("
$
-1\r\n"));
shared.null[3] = createObject(OBJ_STRING,sdsnew("_\r\n"));
shared.null[3] = createObject(OBJ_STRING,sdsnew("_\r\n"));
shared.nullarray[0] = NULL;
shared.nullarray[1] = NULL;
shared.nullarray[2] = createObject(OBJ_STRING,sdsnew("*-1\r\n"));
shared.nullarray[3] = createObject(OBJ_STRING,sdsnew("_\r\n"));
for (j = 0; j < PROTO_SHARED_SELECT_CMDS; j++) {
for (j = 0; j < PROTO_SHARED_SELECT_CMDS; j++) {
char dictid_str[64];
char dictid_str[64];
int dictid_len;
int dictid_len;
...
...
src/server.h
View file @
2ad6e875
...
@@ -782,7 +782,7 @@ struct moduleLoadQueueEntry {
...
@@ -782,7 +782,7 @@ struct moduleLoadQueueEntry {
struct
sharedObjectsStruct
{
struct
sharedObjectsStruct
{
robj
*
crlf
,
*
ok
,
*
err
,
*
emptybulk
,
*
czero
,
*
cone
,
*
pong
,
*
space
,
robj
*
crlf
,
*
ok
,
*
err
,
*
emptybulk
,
*
czero
,
*
cone
,
*
pong
,
*
space
,
*
colon
,
*
queued
,
*
null
[
4
],
*
colon
,
*
queued
,
*
null
[
4
],
nullarray
[
4
],
*
emptyarray
,
*
wrongtypeerr
,
*
nokeyerr
,
*
syntaxerr
,
*
sameobjecterr
,
*
emptyarray
,
*
wrongtypeerr
,
*
nokeyerr
,
*
syntaxerr
,
*
sameobjecterr
,
*
outofrangeerr
,
*
noscripterr
,
*
loadingerr
,
*
slowscripterr
,
*
bgsaveerr
,
*
outofrangeerr
,
*
noscripterr
,
*
loadingerr
,
*
slowscripterr
,
*
bgsaveerr
,
*
masterdownerr
,
*
roslaveerr
,
*
execaborterr
,
*
noautherr
,
*
noreplicaserr
,
*
masterdownerr
,
*
roslaveerr
,
*
execaborterr
,
*
noautherr
,
*
noreplicaserr
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment