summaryrefslogtreecommitdiff
path: root/tls.h
diff options
context:
space:
mode:
Diffstat (limited to 'tls.h')
-rw-r--r--tls.h4
1 files changed, 3 insertions, 1 deletions
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