Stop connection attempts if interrupted
If the interruptor is interrupted, every network call will fail, but the retry-on-error mechanism must also be stopped.
This commit is contained in:
@@ -234,6 +234,12 @@ connect_to_server(struct sc_server *server, uint32_t attempts, sc_tick delay) {
|
|||||||
|
|
||||||
net_close(socket);
|
net_close(socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sc_intr_is_interrupted(&server->intr)) {
|
||||||
|
// Stop immediately
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (attempts) {
|
if (attempts) {
|
||||||
sc_mutex_lock(&server->mutex);
|
sc_mutex_lock(&server->mutex);
|
||||||
sc_tick deadline = sc_tick_now() + delay;
|
sc_tick deadline = sc_tick_now() + delay;
|
||||||
|
|||||||
Reference in New Issue
Block a user