diff --git a/src/core/ddsi/src/ddsi_acknack.c b/src/core/ddsi/src/ddsi_acknack.c index 8de59e038c..1b0a4c8dce 100644 --- a/src/core/ddsi/src/ddsi_acknack.c +++ b/src/core/ddsi/src/ddsi_acknack.c @@ -505,20 +505,15 @@ static struct ddsi_xmsg *make_and_resched_acknack (struct ddsi_xevent *ev, struc static dds_duration_t preemptive_acknack_interval (const struct ddsi_pwr_rd_match *rwn) { - if (rwn->t_last_ack.v < rwn->tcreate.v) - return 0; + const dds_duration_t age = rwn->t_last_ack.v - rwn->tcreate.v; + if (age <= DDS_SECS (10)) + return DDS_SECS (1); + else if (age <= DDS_SECS (60)) + return DDS_SECS (2); + else if (age <= DDS_SECS (120)) + return DDS_SECS (5); else - { - const dds_duration_t age = rwn->t_last_ack.v - rwn->tcreate.v; - if (age <= DDS_SECS (10)) - return DDS_SECS (1); - else if (age <= DDS_SECS (60)) - return DDS_SECS (2); - else if (age <= DDS_SECS (120)) - return DDS_SECS (5); - else - return DDS_SECS (10); - } + return DDS_SECS (10); } static struct ddsi_xmsg *make_preemptive_acknack (struct ddsi_xevent *ev, struct ddsi_proxy_writer *pwr, struct ddsi_pwr_rd_match *rwn, ddsrt_mtime_t tnow) diff --git a/src/core/ddsi/src/ddsi_endpoint_match.c b/src/core/ddsi/src/ddsi_endpoint_match.c index bbcf695c6d..f40a8ba84a 100644 --- a/src/core/ddsi/src/ddsi_endpoint_match.c +++ b/src/core/ddsi/src/ddsi_endpoint_match.c @@ -1026,7 +1026,7 @@ void ddsi_proxy_writer_add_connection (struct ddsi_proxy_writer *pwr, struct dds ELOGDISC (pwr, " ddsi_proxy_writer_add_connection(pwr "PGUIDFMT" rd "PGUIDFMT")", PGUID (pwr->e.guid), PGUID (rd->e.guid)); m->rd_guid = rd->e.guid; - m->tcreate = ddsrt_time_monotonic (); + m->tcreate = tnow; /* We track the last heartbeat count value per reader--proxy-writer pair, so that we can correctly handle directed heartbeats. The