Commit e4e751fe authored by Mikhail Zabaluev's avatar Mikhail Zabaluev

nua/outbound.c: calculate the keepalive timer interval with regard to the maximum defer interval

The point is not to miss the keepalive deadlines.

Re-recorded 20090123142528-5b6ca-43c4952962c9ce02469f01ee7bd51b0528ea7a22

darcs-hash:20090128183201-5b6ca-0012003d9a33046c6f070094b0dc1a9470f38aef.gz
parent 88897615
......@@ -685,8 +685,16 @@ void outbound_start_keepalive(outbound_t *ob,
su_timer_destroy(ob->ob_keepalive.timer), ob->ob_keepalive.timer = NULL;
if (interval) {
su_duration_t max_defer;
max_defer = su_root_get_max_defer(ob->ob_root);
if ((su_duration_t)interval >= max_defer) {
interval -= max_defer - 100;
}
ob->ob_keepalive.timer =
su_timer_create(su_root_task(ob->ob_root), interval);
su_timer_deferrable(ob->ob_keepalive.timer, 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment