From 17a4cab86c0161ebd54d07bf5dff8c32d587d6e0 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 17 Aug 2014 22:46:51 +1000 Subject: [PATCH] Off by one error on new connections --- src/connector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connector.c b/src/connector.c index 7657e6d6..668917d5 100644 --- a/src/connector.c +++ b/src/connector.c @@ -64,7 +64,7 @@ static client_instance_t *fdclients; /* Linked list of dead clients no longer in use but may still have references */ static client_instance_t *dead_clients; -static int64_t client_id; +static int64_t client_id = 1; struct sender_send { struct sender_send *next; @@ -135,7 +135,7 @@ retry: client->fd = fd; ck_wlock(&ci->lock); - client->id = ++client_id; + client->id = client_id++; HASH_ADD_INT(clients, id, client); HASH_REPLACE(fdhh, fdclients, fd, SOI, client, old_client); ci->nfds++;