redis.setresp() */
| 1035 | |
| 1036 | /* redis.setresp() */ |
| 1037 | int luaSetResp(lua_State *lua) { |
| 1038 | int argc = lua_gettop(lua); |
| 1039 | |
| 1040 | if (argc != 1) { |
| 1041 | lua_pushstring(lua, "redis.setresp() requires one argument."); |
| 1042 | return lua_error(lua); |
| 1043 | } |
| 1044 | |
| 1045 | int resp = lua_tonumber(lua,-argc); |
| 1046 | if (resp != 2 && resp != 3) { |
| 1047 | lua_pushstring(lua, "RESP version must be 2 or 3."); |
| 1048 | return lua_error(lua); |
| 1049 | } |
| 1050 | |
| 1051 | serverTL->lua_client->resp = resp; |
| 1052 | return 0; |
| 1053 | } |
| 1054 | |
| 1055 | /* --------------------------------------------------------------------------- |
| 1056 | * Lua engine initialization and reset. |
nothing calls this directly
no test coverage detected