Browse Source

Drop the connections to clients that are unauthorised, which also makes stratifier restarts work

master
Con Kolivas 11 years ago
parent
commit
0e8fa71c11
  1. 8
      src/stratifier.c

8
src/stratifier.c

@ -1273,7 +1273,15 @@ static json_t *gen_json_result(int client_id, json_t *json_msg, json_t *method_v
/* We should only accept authorised requests from here on */ /* We should only accept authorised requests from here on */
if (!client->authorised) { if (!client->authorised) {
char buf[128];
/* Dropping unauthorised clients here also allows the
* stratifier process to restart since it will have lost all
* the stratum instance data. Clients will just reconnect. */
ret = json_string("Unauthorised"); ret = json_string("Unauthorised");
LOGINFO("Dropping unauthorised client %d", client->id);
sprintf(buf, "dropclient=%d", client->id);
send_proc(&client->ckp->connector, buf);
goto out; goto out;
} }

Loading…
Cancel
Save