MCPcopy Create free account
hub / github.com/apache/kvrocks / RedisProtocolToLuaTypeBulk

Function RedisProtocolToLuaTypeBulk

src/storage/scripting.cc:1124–1135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1122}
1123
1124const char *RedisProtocolToLuaTypeBulk(lua_State *lua, const char *reply) {
1125 const char *p = strchr(reply + 1, '\r');
1126 auto bulklen = ParseInt<int64_t>(std::string(reply + 1, p - reply - 1), 10).ValueOr(0);
1127
1128 if (bulklen == -1) {
1129 lua_pushboolean(lua, 0);
1130 return p + 2;
1131 } else {
1132 lua_pushlstring(lua, p + 2, bulklen);
1133 return p + 2 + bulklen + 2;
1134 }
1135}
1136
1137const char *RedisProtocolToLuaTypeStatus(lua_State *lua, const char *reply) {
1138 const char *p = strchr(reply + 1, '\r');

Callers 1

RedisProtocolToLuaTypeFunction · 0.85

Calls 1

ValueOrMethod · 0.80

Tested by

no test coverage detected