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
a3a323e0
Commit
a3a323e0
authored
Oct 28, 2010
by
Pieter Noordhuis
Browse files
When REDIS_CLOSE_AFTER_REPLY is set, there may never be new replies
parent
5e78edb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
a3a323e0
...
@@ -55,7 +55,12 @@ redisClient *createClient(int fd) {
...
@@ -55,7 +55,12 @@ redisClient *createClient(int fd) {
return
c
;
return
c
;
}
}
/* Set the event loop to listen for write events on the client's socket.
* Typically gets called every time a reply is built. */
int
_installWriteEvent
(
redisClient
*
c
)
{
int
_installWriteEvent
(
redisClient
*
c
)
{
/* When CLOSE_AFTER_REPLY is set, no more replies may be added! */
redisAssert
(
!
(
c
->
flags
&
REDIS_CLOSE_AFTER_REPLY
));
if
(
c
->
fd
<=
0
)
return
REDIS_ERR
;
if
(
c
->
fd
<=
0
)
return
REDIS_ERR
;
if
(
c
->
bufpos
==
0
&&
listLength
(
c
->
reply
)
==
0
&&
if
(
c
->
bufpos
==
0
&&
listLength
(
c
->
reply
)
==
0
&&
(
c
->
replstate
==
REDIS_REPL_NONE
||
(
c
->
replstate
==
REDIS_REPL_NONE
||
...
...
src/redis.c
View file @
a3a323e0
...
@@ -893,7 +893,6 @@ int processCommand(redisClient *c) {
...
@@ -893,7 +893,6 @@ int processCommand(redisClient *c) {
* go through checking for replication and QUIT will cause trouble
* go through checking for replication and QUIT will cause trouble
* when FORCE_REPLICATION is enabled and would be implemented in
* when FORCE_REPLICATION is enabled and would be implemented in
* a regular command proc. */
* a regular command proc. */
redisAssert
(
!
(
c
->
flags
&
REDIS_CLOSE_AFTER_REPLY
));
if
(
!
strcasecmp
(
c
->
argv
[
0
]
->
ptr
,
"quit"
))
{
if
(
!
strcasecmp
(
c
->
argv
[
0
]
->
ptr
,
"quit"
))
{
addReply
(
c
,
shared
.
ok
);
addReply
(
c
,
shared
.
ok
);
c
->
flags
|=
REDIS_CLOSE_AFTER_REPLY
;
c
->
flags
|=
REDIS_CLOSE_AFTER_REPLY
;
...
...
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