MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaSetResp

Function luaSetResp

app/redis-6.2.6/src/scripting.c:1023–1039  ·  view source on GitHub ↗

redis.setresp() */

Source from the content-addressed store, hash-verified

1021
1022/* redis.setresp() */
1023int luaSetResp(lua_State *lua) {
1024 int argc = lua_gettop(lua);
1025
1026 if (argc != 1) {
1027 lua_pushstring(lua, "redis.setresp() requires one argument.");
1028 return lua_error(lua);
1029 }
1030
1031 int resp = lua_tonumber(lua,-argc);
1032 if (resp != 2 && resp != 3) {
1033 lua_pushstring(lua, "RESP version must be 2 or 3.");
1034 return lua_error(lua);
1035 }
1036
1037 server.lua_client->resp = resp;
1038 return 0;
1039}
1040
1041/* ---------------------------------------------------------------------------
1042 * Lua engine initialization and reset.

Callers

nothing calls this directly

Calls 4

lua_tonumberFunction · 0.85
lua_gettopFunction · 0.50
lua_pushstringFunction · 0.50
lua_errorFunction · 0.50

Tested by

no test coverage detected