Skip to content

Commit

Permalink
Redo readonly command if an error is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
pwdng committed Mar 30, 2018
1 parent 15979e0 commit 3088665
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,15 @@ int server_read(struct connection *server)
cmd->asking = 0;
continue;
case CORVUS_READONLY:
LOG(DEBUG, "recv readonly");
if (cmd->reply_type == REP_ERROR) {
LOG(ERROR, "recv invalid readonly reponse");
info->readonly = true;
} else {
LOG(DEBUG, "recv readonly");
}

mbuf_range_clear(cmd->ctx, cmd->rep_buf);
server->info->readonly_sent = false;
info->readonly_sent = false;
continue;
case CORVUS_OK:
STAILQ_REMOVE_HEAD(&info->waiting_queue, waiting_next);
Expand Down

0 comments on commit 3088665

Please sign in to comment.