From c27ca22fe83cb7b8ddbf16c46fbcf2b0be659075 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 12 Jun 2011 19:11:45 +0100 Subject: [PATCH] site setup: move st->key_renegotiate_time default calculation nearer use st->key_renegotiate_time is first calculated as a default and then that value ought to be used as a default for the config lookup. So move the default calculation near where the config lookup takes place to keep the related code together. Pure code motion; no functional change. Also, the value computed is not currently used due to a bug which will be fixed in the next patch. Signed-off-by: Ian Jackson --- site.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/site.c b/site.c index 835ccc8..b780815 100644 --- a/site.c +++ b/site.c @@ -1238,16 +1238,17 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context, st->key_lifetime=dict_read_number( dict,"key-lifetime",False,"site",loc,DEFAULT_KEY_LIFETIME); - if (st->key_lifetime < DEFAULT_KEY_RENEGOTIATE_GAP*2) - st->key_renegotiate_time=st->key_lifetime/2; - else - st->key_renegotiate_time=st->key_lifetime-DEFAULT_KEY_RENEGOTIATE_GAP; st->setup_retries=dict_read_number( dict,"setup-retries",False,"site",loc,DEFAULT_SETUP_RETRIES); st->setup_timeout=dict_read_number( dict,"setup-timeout",False,"site",loc,DEFAULT_SETUP_TIMEOUT); st->wait_timeout=dict_read_number( dict,"wait-time",False,"site",loc,DEFAULT_WAIT_TIME); + + if (st->key_lifetime < DEFAULT_KEY_RENEGOTIATE_GAP*2) + st->key_renegotiate_time=st->key_lifetime/2; + else + st->key_renegotiate_time=st->key_lifetime-DEFAULT_KEY_RENEGOTIATE_GAP; st->key_renegotiate_time=dict_read_number( dict,"renegotiate-time",False,"site",loc,st->key_lifetime); if (st->key_renegotiate_time > st->key_lifetime) { -- 2.30.2