Zbigniew Jędrzejewski-Szmek 62fe94
From 665c6a9eab46b0b253af6566ca9fc70c866b3fcd Mon Sep 17 00:00:00 2001
Michal Schmidt d962ba
From: Kay Sievers <kay@vrfy.org>
Michal Schmidt d962ba
Date: Tue, 2 Sep 2014 14:27:00 +0200
Zbigniew Jędrzejewski-Szmek 62fe94
Subject: [PATCH] timesyncd: remove retry_timer logic which is covered by the
Zbigniew Jędrzejewski-Szmek 62fe94
 server timeout
Michal Schmidt d962ba
Michal Schmidt d962ba
---
Michal Schmidt d962ba
 src/timesync/timesyncd-manager.c | 14 --------------
Michal Schmidt d962ba
 src/timesync/timesyncd-manager.h |  1 -
Michal Schmidt d962ba
 2 files changed, 15 deletions(-)
Michal Schmidt d962ba
Michal Schmidt d962ba
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
Zbigniew Jędrzejewski-Szmek 62fe94
index b7b39ef822..19a28f37e2 100644
Michal Schmidt d962ba
--- a/src/timesync/timesyncd-manager.c
Michal Schmidt d962ba
+++ b/src/timesync/timesyncd-manager.c
Michal Schmidt d962ba
@@ -206,19 +206,6 @@ static int manager_send_request(Manager *m) {
Michal Schmidt d962ba
                 return manager_connect(m);
Michal Schmidt d962ba
         }
Michal Schmidt d962ba
 
Michal Schmidt d962ba
-        /* re-arm timer with increasing timeout, in case the packets never arrive back */
Michal Schmidt d962ba
-        if (m->retry_interval > 0) {
Michal Schmidt d962ba
-                if (m->retry_interval < NTP_POLL_INTERVAL_MAX_SEC * USEC_PER_SEC)
Michal Schmidt d962ba
-                        m->retry_interval *= 2;
Michal Schmidt d962ba
-        } else
Michal Schmidt d962ba
-                m->retry_interval = NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC;
Michal Schmidt d962ba
-
Michal Schmidt d962ba
-        r = manager_arm_timer(m, m->retry_interval);
Michal Schmidt d962ba
-        if (r < 0) {
Michal Schmidt d962ba
-                log_error("Failed to rearm timer: %s", strerror(-r));
Michal Schmidt d962ba
-                return r;
Michal Schmidt d962ba
-        }
Michal Schmidt d962ba
-
Michal Schmidt d962ba
         r = sd_event_add_time(
Michal Schmidt d962ba
                         m->event,
Michal Schmidt d962ba
                         &m->event_timeout,
Michal Schmidt d962ba
@@ -601,7 +588,6 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
Michal Schmidt d962ba
 
Michal Schmidt d962ba
         /* valid packet */
Michal Schmidt d962ba
         m->pending = false;
Michal Schmidt d962ba
-        m->retry_interval = 0;
Michal Schmidt d962ba
 
Michal Schmidt d962ba
         /* announce leap seconds */
Michal Schmidt d962ba
         if (NTP_FIELD_LEAP(ntpmsg.field) & NTP_LEAP_PLUSSEC)
Michal Schmidt d962ba
diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h
Zbigniew Jędrzejewski-Szmek 62fe94
index bb3e50915e..0ac0e179c1 100644
Michal Schmidt d962ba
--- a/src/timesync/timesyncd-manager.h
Michal Schmidt d962ba
+++ b/src/timesync/timesyncd-manager.h
Michal Schmidt d962ba
@@ -59,7 +59,6 @@ struct Manager {
Michal Schmidt d962ba
         /* last sent packet */
Michal Schmidt d962ba
         struct timespec trans_time_mon;
Michal Schmidt d962ba
         struct timespec trans_time;
Michal Schmidt d962ba
-        usec_t retry_interval;
Michal Schmidt d962ba
         bool pending;
Michal Schmidt d962ba
 
Michal Schmidt d962ba
         /* poll timer */