From: Arne Schwabe Date: Fri, 22 Apr 2022 14:29:40 +0000 (+0200) Subject: Remove pointless indentation from tls_process. X-Git-Tag: v2.6_beta1~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48ed1a3dd6e1dc2849a0dd909f1c848cc2c05f91;p=thirdparty%2Fopenvpn.git Remove pointless indentation from tls_process. This is probably a result from earlier code that still needed to be C89 compatible add probably added this to allow variable decleration Acked-by: Frank Lichtenheld Message-Id: <20220422142953.3805364-6-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24166.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 3bfb1c4ae..2c1cad670 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -2775,45 +2775,43 @@ tls_process(struct tls_multi *multi, } /* When should we wake up again? */ + if (ks->state >= S_INITIAL) { - if (ks->state >= S_INITIAL) - { - compute_earliest_wakeup(wakeup, - reliable_send_timeout(ks->send_reliable)); - - if (ks->must_negotiate) - { - compute_earliest_wakeup(wakeup, ks->must_negotiate - now); - } - } + compute_earliest_wakeup(wakeup, + reliable_send_timeout(ks->send_reliable)); - if (ks->established && session->opt->renegotiate_seconds) + if (ks->must_negotiate) { - compute_earliest_wakeup(wakeup, - ks->established + session->opt->renegotiate_seconds - now); + compute_earliest_wakeup(wakeup, ks->must_negotiate - now); } + } - dmsg(D_TLS_DEBUG, "TLS: tls_process: timeout set to %d", *wakeup); + if (ks->established && session->opt->renegotiate_seconds) + { + compute_earliest_wakeup(wakeup, + ks->established + session->opt->renegotiate_seconds - now); + } - /* prevent event-loop spinning by setting minimum wakeup of 1 second */ - if (*wakeup <= 0) - { - *wakeup = 1; + dmsg(D_TLS_DEBUG, "TLS: tls_process: timeout set to %d", *wakeup); - /* if we had something to send to remote, but to_link was busy, - * let caller know we need to be called again soon */ - return true; - } + /* prevent event-loop spinning by setting minimum wakeup of 1 second */ + if (*wakeup <= 0) + { + *wakeup = 1; - /* If any of the state changes resulted in the to_link buffer being - * set, we are also active */ - if (to_link->len) - { - return true; - } + /* if we had something to send to remote, but to_link was busy, + * let caller know we need to be called again soon */ + return true; + } - return false; + /* If any of the state changes resulted in the to_link buffer being + * set, we are also active */ + if (to_link->len) + { + return true; } + + return false; } /*