Commit 8c1f531f authored by zhujiashun's avatar zhujiashun

redis_server_protocol: refine code

parent d7826178
......@@ -81,7 +81,7 @@ void ConsumeTask(QueueMeta* meta, const RedisMessage& m, butil::Arena* arena, bu
char buf[64];
do {
std::vector<const char*> args;
args.reserve(7);
args.reserve(8);
bool args_parsed = true;
for (size_t i = 0; i < m.size(); ++i) {
if (!m[i].is_string()) {
......@@ -125,11 +125,14 @@ void ConsumeTask(QueueMeta* meta, const RedisMessage& m, butil::Arena* arena, bu
sendbuf->append(nocountbuf);
return;
} else if (result == REDIS_COMMAND_ERROR) {
meta->handler_continue = NULL;
meta->queue_command_name.clear();
if (!output.is_error()) {
output.set_error("internal server error", arena);
}
} else {
meta->handler_continue = NULL;
meta->queue_command_name.clear();
LOG(ERROR) << "unknown redis command result=" << result;
output.set_error("internal server error", arena);
}
......
......@@ -102,7 +102,7 @@ public:
// Returns PARSE_ERROR_ABSOLUTELY_WRONG if the parsing failed.
ParseError ConsumePartialIOBuf(butil::IOBuf& buf, butil::Arena* arena);
//
// Serialize to buf using redis protocol
bool SerializeToIOBuf(butil::IOBuf* buf);
// Swap internal fields with another reply.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment