Assign an unique non-repeating ID to each new client.

This will be used by CLIENT KILL and is also a good way to ensure a
given client is still the same across CLIENT LIST calls.

The output of CLIENT LIST was modified to include the new ID, but this
change is considered to be backward compatible as the API does not imply
you can do positional parsing, since each filed as a different name.
This commit is contained in:
antirez
2014-06-16 14:22:55 +02:00
parent b6a26b52bf
commit cad13223f0
3 changed files with 7 additions and 2 deletions

View File

@ -1366,6 +1366,7 @@ void initServerConfig() {
server.lua_time_limit = REDIS_LUA_TIME_LIMIT;
server.lua_client = NULL;
server.lua_timedout = 0;
server.next_client_id = 1; /* Client IDs, start from 1 .*/
server.loading_process_events_interval_bytes = (1024*1024*2);
updateLRUClock();