static ssize_t Curl_gtls_pull(void *s, void *buf, size_t len) { ssize_t ret = sread(GNUTLS_POINTER_TO_INT_CAST(s), buf, len); #if defined(USE_WINSOCK) && !defined(GNUTLS_MAPS_WINSOCK_ERRORS) if(ret < 0) gnutls_transport_set_global_errno(gtls_mapped_sockerrno()); #endif return ret; }
static ssize_t Curl_gtls_push(void *s, const void *buf, size_t len) { ssize_t ret = swrite(GNUTLS_POINTER_TO_INT_CAST(s), buf, len); #ifdef USE_WINSOCK if(ret < 0) gnutls_transport_set_global_errno(gtls_mapped_sockerrno()); #endif return ret; }
static ssize_t Curl_gtls_pull(void *s, void *buf, size_t len) { return sread(GNUTLS_POINTER_TO_INT_CAST(s), buf, len); }
/* * 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() * (although here using the sread/swrite macros as defined by setup_once.h). * We use custom functions rather than the GNU TLS defaults because it allows * us to get specific about the fourth "flags" argument, and to use arbitrary * private data with gnutls_transport_set_ptr if we wish. */ static ssize_t Curl_gtls_push(void *s, const void *buf, size_t len) { return swrite(GNUTLS_POINTER_TO_INT_CAST(s), buf, len); }