]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
openconnect_make_cstp_connection should always set ssl_times.last_tx on successful...
authorDaniel Lenski <dlenski@gmail.com>
Fri, 26 Apr 2019 01:32:43 +0000 (20:32 -0500)
committerDaniel Lenski <dlenski@gmail.com>
Wed, 20 May 2020 01:38:32 +0000 (18:38 -0700)
As suggested by David Woodhouse (https://gitlab.com/openconnect/openconnect/merge_requests/35#note_163190180)

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
library.c

index bde20a1ce1794f7e51c4f130083c6af29c030df2..be8adcb6f3d07b9dacfd4919a97189da0e8e7ba8 100644 (file)
--- a/library.c
+++ b/library.c
@@ -281,7 +281,12 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
 
 int openconnect_make_cstp_connection(struct openconnect_info *vpninfo)
 {
-       return vpninfo->proto->tcp_connect(vpninfo);
+       int result = vpninfo->proto->tcp_connect(vpninfo);
+
+       /* ssl_times.last_tx should be set to show that a connection has been setup */
+       if (result == 0 && vpninfo->ssl_times.last_tx == 0)
+               vpninfo->ssl_times.last_tx = time(NULL);
+       return result;
 }
 
 int openconnect_set_reported_os(struct openconnect_info *vpninfo,