mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
stratum: prevent double auth & ignore invalid sockets
seems to works well, but not a normal case/behavior
This commit is contained in:
parent
1d523798be
commit
383682190b
2 changed files with 8 additions and 0 deletions
|
@ -197,6 +197,13 @@ bool client_validate_user_address(YAAMP_CLIENT *client)
|
|||
|
||||
bool client_authorize(YAAMP_CLIENT *client, json_value *json_params)
|
||||
{
|
||||
|
||||
if(g_list_client.Find(client)) {
|
||||
clientlog(client, "Already logged");
|
||||
client_send_error(client, 21, "Already logged");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(json_params->u.array.length>1)
|
||||
strncpy(client->password, json_params->u.array.values[1]->u.string.ptr, 1023);
|
||||
|
||||
|
|
|
@ -107,6 +107,7 @@ void job_broadcast(YAAMP_JOB *job)
|
|||
{
|
||||
YAAMP_CLIENT *client = (YAAMP_CLIENT *)li->data;
|
||||
if(client->deleted) continue;
|
||||
if(!client->sock) continue;
|
||||
// if(client->reconnecting && client->locked) continue;
|
||||
|
||||
if(client->jobid_next != job->id) continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue