diff options
Diffstat (limited to 'lib/vtls')
-rw-r--r-- | lib/vtls/gtls.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 3f30b6c8c..688e83807 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -152,7 +152,8 @@ static int gtls_mapped_sockerrno(void) static ssize_t Curl_gtls_push(void *s, const void *buf, size_t len) { - ssize_t ret = swrite(CURLX_POINTER_TO_INTEGER_CAST(s), buf, len); + curl_socket_t sock = *(curl_socket_t *)s; + ssize_t ret = swrite(sock, buf, len); #if defined(USE_WINSOCK) && !defined(GNUTLS_MAPS_WINSOCK_ERRORS) if(ret < 0) gnutls_transport_set_global_errno(gtls_mapped_sockerrno()); @@ -162,7 +163,8 @@ static ssize_t Curl_gtls_push(void *s, const void *buf, size_t len) static ssize_t Curl_gtls_pull(void *s, void *buf, size_t len) { - ssize_t ret = sread(CURLX_POINTER_TO_INTEGER_CAST(s), buf, len); + curl_socket_t sock = *(curl_socket_t *)s; + ssize_t ret = sread(sock, buf, len); #if defined(USE_WINSOCK) && !defined(GNUTLS_MAPS_WINSOCK_ERRORS) if(ret < 0) gnutls_transport_set_global_errno(gtls_mapped_sockerrno()); @@ -848,7 +850,7 @@ gtls_connect_step1(struct connectdata *conn, } else { /* file descriptor for the socket */ - transport_ptr = CURLX_INTEGER_TO_POINTER_CAST(conn->sock[sockindex]); + transport_ptr = &conn->sock[sockindex]; gnutls_transport_push = Curl_gtls_push; gnutls_transport_pull = Curl_gtls_pull; } |