ssb: Audit timer use that might cause unnecessary delays during shutdown.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 29m34s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 29m34s
This commit is contained in:
parent
bfec46673d
commit
0a6f0ed3f7
32
src/ssb.c
32
src/ssb.c
@ -746,13 +746,16 @@ static bool _tf_ssb_connection_get_request_callback(
|
|||||||
*out_name = request->name;
|
*out_name = request->name;
|
||||||
}
|
}
|
||||||
request->last_active = uv_now(connection->ssb->loop);
|
request->last_active = uv_now(connection->ssb->loop);
|
||||||
if (connection->flags & k_tf_ssb_connect_flag_one_shot)
|
if (tf_ssb_connection_is_connected(connection) && !tf_ssb_connection_is_closing(connection) && !tf_ssb_is_shutting_down(tf_ssb_connection_get_ssb(connection)))
|
||||||
{
|
{
|
||||||
uv_timer_start(&connection->activity_timer, _tf_ssb_connection_activity_timer, k_activity_timeout_ms, 0);
|
if ((connection->flags & k_tf_ssb_connect_flag_one_shot))
|
||||||
}
|
{
|
||||||
if (uv_timer_get_due_in(&connection->ssb->request_activity_timer) == 0)
|
uv_timer_start(&connection->activity_timer, _tf_ssb_connection_activity_timer, k_activity_timeout_ms, 0);
|
||||||
{
|
}
|
||||||
uv_timer_start(&connection->ssb->request_activity_timer, _tf_ssb_request_activity_timer, k_rpc_active_ms, 0);
|
if (uv_timer_get_due_in(&connection->ssb->request_activity_timer) == 0)
|
||||||
|
{
|
||||||
|
uv_timer_start(&connection->ssb->request_activity_timer, _tf_ssb_request_activity_timer, k_rpc_active_ms, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -799,13 +802,16 @@ void tf_ssb_connection_add_request(tf_ssb_connection_t* connection, int32_t requ
|
|||||||
connection->requests_count++;
|
connection->requests_count++;
|
||||||
connection->ssb->request_count++;
|
connection->ssb->request_count++;
|
||||||
}
|
}
|
||||||
if (connection->flags & k_tf_ssb_connect_flag_one_shot)
|
if (tf_ssb_connection_is_connected(connection) && !tf_ssb_connection_is_closing(connection) && !tf_ssb_is_shutting_down(tf_ssb_connection_get_ssb(connection)))
|
||||||
{
|
{
|
||||||
uv_timer_start(&connection->activity_timer, _tf_ssb_connection_activity_timer, k_activity_timeout_ms, 0);
|
if (connection->flags & k_tf_ssb_connect_flag_one_shot)
|
||||||
}
|
{
|
||||||
if (uv_timer_get_due_in(&connection->ssb->request_activity_timer) == 0)
|
uv_timer_start(&connection->activity_timer, _tf_ssb_connection_activity_timer, k_activity_timeout_ms, 0);
|
||||||
{
|
}
|
||||||
uv_timer_start(&connection->ssb->request_activity_timer, _tf_ssb_request_activity_timer, k_rpc_active_ms, 0);
|
if (uv_timer_get_due_in(&connection->ssb->request_activity_timer) == 0)
|
||||||
|
{
|
||||||
|
uv_timer_start(&connection->ssb->request_activity_timer, _tf_ssb_request_activity_timer, k_rpc_active_ms, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_tf_ssb_notify_connections_changed(connection->ssb, k_tf_ssb_change_update, connection);
|
_tf_ssb_notify_connections_changed(connection->ssb, k_tf_ssb_change_update, connection);
|
||||||
connection->last_notified_active = now_ms;
|
connection->last_notified_active = now_ms;
|
||||||
@ -1997,7 +2003,7 @@ static void _tf_ssb_connection_destroy(tf_ssb_connection_t* connection, const ch
|
|||||||
if (!connection->is_closing)
|
if (!connection->is_closing)
|
||||||
{
|
{
|
||||||
connection->is_closing = true;
|
connection->is_closing = true;
|
||||||
uv_timer_start(&connection->linger_timer, _tf_ssb_connection_linger_timer, 5000, 0);
|
uv_timer_start(&connection->linger_timer, _tf_ssb_connection_linger_timer, ssb->shutting_down ? 0 : 5000, 0);
|
||||||
_tf_ssb_notify_connections_changed(ssb, k_tf_ssb_change_update, connection);
|
_tf_ssb_notify_connections_changed(ssb, k_tf_ssb_change_update, connection);
|
||||||
}
|
}
|
||||||
if (connection->connect_callback)
|
if (connection->connect_callback)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user