mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-23 20:00:42 +00:00
stratum: prevent segfault on repeated sock timeout
This commit is contained in:
parent
5907efbc51
commit
bf05f7b532
1 changed files with 4 additions and 4 deletions
|
@ -117,14 +117,14 @@ void job_broadcast(YAAMP_JOB *job)
|
|||
client->broadcast_timeouts++;
|
||||
clientlog(client, "unable to send job, sock err %d (%d times)", err, client->broadcast_timeouts);
|
||||
// too much timeouts, disconnect him
|
||||
if (client->broadcast_timeouts > 5) {
|
||||
if (client->broadcast_timeouts >= 3) {
|
||||
shutdown(client->sock->sock, SHUT_RDWR);
|
||||
if(client->workerid && !client->reconnecting) {
|
||||
CommonLock(&g_db_mutex);
|
||||
// CommonLock(&g_db_mutex);
|
||||
db_clear_worker(g_db, client);
|
||||
CommonUnlock(&g_db_mutex);
|
||||
// CommonUnlock(&g_db_mutex);
|
||||
}
|
||||
client_delete(client);
|
||||
object_delete(client);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
|
|
Loading…
Add table
Reference in a new issue