From f54891fae839945dc1f4cc1b5b5c93a815ac4c24 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 13 Dec 2015 23:06:12 +1100 Subject: [PATCH] Try both userid and userip to detect disconnected clients --- src/stratifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index 4b13d9bf..dcc0b412 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3579,7 +3579,7 @@ static json_t *parse_subscribe(stratum_instance_t *client, const int64_t client_ * which matches a recently disconnected session. */ if (session_id) userid = userid_from_sessionid(ckp_sdata, session_id); - else + if (userid == -1) userid = userid_from_sessionip(ckp_sdata, client->address); if (userid != -1) { sdata_t *user_sdata = select_sdata(ckp, ckp_sdata, userid);