From ac1f2aaadd927e8187edabaea9a788425bb42b9f Mon Sep 17 00:00:00 2001 From: Test_User Date: Tue, 8 Aug 2023 22:46:35 -0400 Subject: Hopefully disconnect on its own when things break now --- tls.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tls.h') diff --git a/tls.h b/tls.h index 116512d..577251b 100644 --- a/tls.h +++ b/tls.h @@ -34,11 +34,13 @@ extern gnutls_session_t session; extern int connect_tls(void); -inline size_t RECV(char *buf, size_t buflen) { +inline size_t RECV(char *buf, size_t buflen, char *timeout) { int len; do { len = gnutls_record_recv(session, buf, buflen); } while (len == GNUTLS_E_AGAIN || len == GNUTLS_E_INTERRUPTED); + + *timeout = (len == GNUTLS_E_TIMEDOUT); if (len < 0) return 0; else -- cgit v1.2.3