MCPcopy Create free account
hub / github.com/apache/brpc / RedisCommandByComponents

Function RedisCommandByComponents

src/brpc/redis_command.cpp:353–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353butil::Status RedisCommandByComponents(butil::IOBuf* output,
354 const butil::StringPiece* components,
355 size_t ncomponents) {
356 if (output == NULL) {
357 return butil::Status(EINVAL, "Param[output] is NULL");
358 }
359 AppendHeader(*output, '*', ncomponents);
360 for (size_t i = 0; i < ncomponents; ++i) {
361 AppendHeader(*output, '$', components[i].size());
362 output->append(components[i].data(), components[i].size());
363 output->append("\r\n", 2);
364 }
365 return butil::Status::OK();
366}
367
368RedisCommandParser::RedisCommandParser()
369 : _parsing_array(false)

Callers 1

Calls 5

AppendHeaderFunction · 0.85
StatusEnum · 0.70
sizeMethod · 0.45
appendMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected