aboutsummaryrefslogtreecommitdiff
path: root/lib/gtls.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-10-29 14:58:50 +0200
committerYang Tse <yangsita@gmail.com>2011-10-29 14:58:50 +0200
commitf5bb37018647f6088398ca127235ce776eec9bbe (patch)
tree78c4a17b499228b64a6ca3cbc069c45d9fda7777 /lib/gtls.c
parentbae4e3f03512617c793ce5ca1073d5257c82195e (diff)
gtls.c: gnutls_transport_set_global_errno() deprecated in version 2.12.3
Diffstat (limited to 'lib/gtls.c')
-rw-r--r--lib/gtls.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/gtls.c b/lib/gtls.c
index 7ca46c812..c1e9cae51 100644
--- a/lib/gtls.c
+++ b/lib/gtls.c
@@ -78,6 +78,17 @@ static void tls_log_func(int level, const char *str)
#endif
static bool gtls_inited = FALSE;
+#if defined(GNUTLS_VERSION_NUMBER)
+# if (GNUTLS_VERSION_NUMBER >= 0x020c00)
+# undef gnutls_transport_set_lowat
+# define gnutls_transport_set_lowat(A,B) Curl_nop_stmt
+# endif
+# if (GNUTLS_VERSION_NUMBER >= 0x020c03)
+# undef gnutls_transport_set_global_errno
+# define gnutls_transport_set_global_errno(A) SET_ERRNO((A))
+# endif
+#endif
+
/*
* Custom push and pull callback functions used by GNU TLS to read and write
* to the socket. These functions are simple wrappers to send() and recv()
@@ -476,10 +487,8 @@ gtls_connect_step1(struct connectdata *conn,
gnutls_transport_set_push_function(session, Curl_gtls_push);
gnutls_transport_set_pull_function(session, Curl_gtls_pull);
-#if GNUTLS_VERSION_NUMBER < 0x020c00
/* lowat must be set to zero when using custom push and pull functions. */
gnutls_transport_set_lowat(session, 0);
-#endif
/* This might be a reconnect, so we check for a session ID in the cache
to speed up things */