Browse Source

Fix typo dropping userproxies and simplify reconnects to just on notify

master
Con Kolivas 9 years ago
parent
commit
4281828167
  1. 13
      src/generator.c
  2. 24
      src/stratifier.c

13
src/generator.c

@ -1323,8 +1323,7 @@ out:
break;
parse_method(ckp, proxi, buf);
};
}
if (!proxi->global) {
} else if (!proxi->global) {
LOGNOTICE("Disabling userproxy %d:%d %s that failed authorisation as %s",
proxi->id, proxi->subid, proxi->url, proxi->auth);
proxi->disabled = true;
@ -1405,14 +1404,6 @@ static void stratifier_reconnect_client(ckpool_t *ckp, const int64_t id)
send_proc(ckp->stratifier, buf);
}
static void stratifier_reconnect_user(ckpool_t *ckp, const int userid)
{
char buf[256];
sprintf(buf, "reconnuser=%d", userid);
send_proc(ckp->stratifier, buf);
}
/* Add a share to the gdata share hashlist. Returns the share id */
static int add_share(gdata_t *gdata, const int64_t client_id, const double diff)
{
@ -1822,8 +1813,6 @@ out:
Close(cs->fd);
}
proxi->alive = ret;
if (ckp->userproxy && ret && !proxi->global)
stratifier_reconnect_user(ckp, proxi->userid);
return ret;
}

24
src/stratifier.c

@ -2611,22 +2611,6 @@ static void reconnect_client_id(sdata_t *sdata, const int64_t client_id)
dec_instance_ref(sdata, client);
}
/* Reconnect all clients with a particular userid */
static void reconnect_user_id(sdata_t *sdata, int userid)
{
stratum_instance_t *client, *tmp;
LOGWARNING("Dropping user id %d", userid);
ck_rlock(&sdata->instance_lock);
HASH_ITER(hh, sdata->stratum_instances, client, tmp) {
if (client->user_id != userid)
continue;
reconnect_client(sdata, client);
}
ck_runlock(&sdata->instance_lock);
}
/* API commands */
static user_instance_t *get_user(sdata_t *sdata, const char *username);
@ -3280,14 +3264,6 @@ retry:
LOGWARNING("Stratifier failed to parse reconnclient command: %s", buf);
else
reconnect_client_id(sdata, client_id);
} else if (cmdmatch(buf, "reconnuser")) {
int userid;
ret = sscanf(buf, "reconnuser=%d", &userid);
if (ret < 0)
LOGWARNING("Stratifier failed to parse reconnuser command: %s", buf);
else
reconnect_user_id(sdata, userid);
} else if (cmdmatch(buf, "dropall")) {
drop_allclients(ckp);
} else if (cmdmatch(buf, "block")) {

Loading…
Cancel
Save