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
abf52c7c
Commit
abf52c7c
authored
Aug 27, 2018
by
antirez
Browse files
Better variable meaning in processCommand().
parent
66b5afda
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
abf52c7c
...
@@ -2594,14 +2594,14 @@ int processCommand(client *c) {
...
@@ -2594,14 +2594,14 @@ int processCommand(client *c) {
* keys in the dataset). If there are not the only thing we can do
* keys in the dataset). If there are not the only thing we can do
* is returning an error. */
* is returning an error. */
if (server.maxmemory) {
if (server.maxmemory) {
int
retval
= freeMemoryIfNeeded();
int
out_of_memory
= freeMemoryIfNeeded()
== C_ERR
;
/* freeMemoryIfNeeded may flush slave output buffers. This may result
/* freeMemoryIfNeeded may flush slave output buffers. This may result
* into a slave, that may be the active client, to be freed. */
* into a slave, that may be the active client, to be freed. */
if (server.current_client == NULL) return C_ERR;
if (server.current_client == NULL) return C_ERR;
/* It was impossible to free enough memory, and the command the client
/* It was impossible to free enough memory, and the command the client
* is trying to execute is denied during OOM conditions? Error. */
* is trying to execute is denied during OOM conditions? Error. */
if ((c->cmd->flags & CMD_DENYOOM) &&
retval == C_ERR
) {
if ((c->cmd->flags & CMD_DENYOOM) &&
out_of_memory
) {
flagTransaction(c);
flagTransaction(c);
addReply(c, shared.oomerr);
addReply(c, shared.oomerr);
return C_OK;
return C_OK;
...
...
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