mirror of
https://github.com/fluencelabs/redis
synced 2025-06-15 02:01:21 +00:00
Refactoring: new function to test if client has pending output.
This commit is contained in:
@ -570,7 +570,7 @@ void syncCommand(client *c) {
|
||||
* the client about already issued commands. We need a fresh reply
|
||||
* buffer registering the differences between the BGSAVE and the current
|
||||
* dataset, so that we can copy to other slaves if needed. */
|
||||
if (listLength(c->reply) != 0 || c->bufpos != 0) {
|
||||
if (clientHasPendingReplies(c)) {
|
||||
addReplyError(c,"SYNC and PSYNC are invalid with pending output");
|
||||
return;
|
||||
}
|
||||
@ -1924,7 +1924,7 @@ void replicationResurrectCachedMaster(int newfd) {
|
||||
|
||||
/* We may also need to install the write handler as well if there is
|
||||
* pending data in the write buffers. */
|
||||
if (server.master->bufpos || listLength(server.master->reply)) {
|
||||
if (clientHasPendingReplies(server.master)) {
|
||||
if (aeCreateFileEvent(server.el, newfd, AE_WRITABLE,
|
||||
sendReplyToClient, server.master)) {
|
||||
serverLog(LL_WARNING,"Error resurrecting the cached master, impossible to add the writable handler: %s", strerror(errno));
|
||||
|
Reference in New Issue
Block a user