diff options
author | Kamil Dudka <kdudka@redhat.com> | 2010-04-04 23:37:18 +0200 |
---|---|---|
committer | Kamil Dudka <kdudka@redhat.com> | 2010-04-04 23:37:18 +0200 |
commit | ff8711135e9311d5a54c7210a5a87a86077271cb (patch) | |
tree | a6a1c8ee0167e6899a44f9fa34c97287d20a6c23 /lib/sslgen.c | |
parent | 7425db3fab04007ac2f4ac62d77c1838adb6177d (diff) | |
download | curl-ff8711135e9311d5a54c7210a5a87a86077271cb.tar.gz |
refactorize interface of Curl_ssl_recv/Curl_ssl_send
Diffstat (limited to 'lib/sslgen.c')
-rw-r--r-- | lib/sslgen.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/lib/sslgen.c b/lib/sslgen.c index a050f1094..df2a4075a 100644 --- a/lib/sslgen.c +++ b/lib/sslgen.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2010, 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 @@ -408,38 +408,22 @@ struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data) return curlssl_engines_list(data); } -/* return number of sent (non-SSL) bytes; -1 on error */ ssize_t Curl_ssl_send(struct connectdata *conn, int sockindex, const void *mem, - size_t len) + size_t len, + int *curlcode) { - return curlssl_send(conn, sockindex, mem, len); + return curlssl_send(conn, sockindex, mem, len, curlcode); } -/* return number of received (decrypted) bytes */ - -/* - * If the read would block (EWOULDBLOCK) we return -1. If an error occurs during - * the read, we return -2. Otherwise we return the count of bytes transfered. - */ -ssize_t Curl_ssl_recv(struct connectdata *conn, /* connection data */ - int sockindex, /* socketindex */ - char *mem, /* store read data here */ - size_t len) /* max amount to read */ +ssize_t Curl_ssl_recv(struct connectdata *conn, + int sockindex, + char *mem, + size_t len, + int *curlcode) { - ssize_t nread; - bool block = FALSE; - - nread = curlssl_recv(conn, sockindex, mem, len, &block); - if(nread == -1) { - if(!block) - return -2; /* this is a true error, not EWOULDBLOCK */ - else - return -1; /* EWOULDBLOCK */ - } - - return nread; + return curlssl_recv(conn, sockindex, mem, len, curlcode); } |