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
211e985e
Commit
211e985e
authored
Apr 17, 2020
by
antirez
Browse files
alsoPropagate(): just propagate() when out of context.
parent
7cb97aa6
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
211e985e
...
@@ -3110,7 +3110,10 @@ void propagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
...
@@ -3110,7 +3110,10 @@ void propagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
* The function does not take a reference to the passed 'argv' vector,
* The function does not take a reference to the passed 'argv' vector,
* so it is up to the caller to release the passed argv (but it is usually
* so it is up to the caller to release the passed argv (but it is usually
* stack allocated). The function autoamtically increments ref count of
* stack allocated). The function autoamtically increments ref count of
* passed objects, so the caller does not need to. */
* passed objects, so the caller does not need to.
*
* Note that if we are outside the execution of a command, that is we
* are not inside call(), this function will just act like propagate(). */
void
alsoPropagate
(
struct
redisCommand
*
cmd
,
int
dbid
,
robj
**
argv
,
int
argc
,
void
alsoPropagate
(
struct
redisCommand
*
cmd
,
int
dbid
,
robj
**
argv
,
int
argc
,
int
target
)
int
target
)
{
{
...
@@ -3119,6 +3122,13 @@ void alsoPropagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
...
@@ -3119,6 +3122,13 @@ void alsoPropagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
if
(
server
.
loading
)
return
;
/* No propagation during loading. */
if
(
server
.
loading
)
return
;
/* No propagation during loading. */
/* Just call propagate() if we are out of the scope of a command.
* For asynchronous operations usually we want to propagate immediately. */
if
(
server
.
current_client
==
NULL
)
{
propagate
(
cmd
,
dbid
,
argv
,
argc
,
target
);
return
;
}
argvcopy
=
zmalloc
(
sizeof
(
robj
*
)
*
argc
);
argvcopy
=
zmalloc
(
sizeof
(
robj
*
)
*
argc
);
for
(
j
=
0
;
j
<
argc
;
j
++
)
{
for
(
j
=
0
;
j
<
argc
;
j
++
)
{
argvcopy
[
j
]
=
argv
[
j
];
argvcopy
[
j
]
=
argv
[
j
];
...
...
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