redis.setresp() */
| 1021 | |
| 1022 | /* redis.setresp() */ |
| 1023 | int 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. |
nothing calls this directly
no test coverage detected