diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-06-11 17:01:58 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-06-11 17:01:58 +0000 |
commit | 04d5c8fb779afdb4f7e85a701f8b4b987a4016ee (patch) | |
tree | 622d3243f17ed29f4df5b3405de5a78599b86e32 /lib/sslgen.h | |
parent | 5980b3cbb09c4c06340433041b825cc9bed00eca (diff) | |
download | curl-04d5c8fb779afdb4f7e85a701f8b4b987a4016ee.tar.gz |
- I did a cleanup of the internal generic SSL layer and how the various SSL
libraries are supported. Starting now, each underlying SSL library support
code does a set of defines for the 16 functions the generic layer (sslgen.c)
uses (all these new function defines use the prefix "curlssl_"). This
greatly simplified the generic layer in readability by involving much less
#ifdefs and other preprocessor stuff and should make it easier for people to
make libcurl work with new SSL libraries.
Hopefully I can later on document these 16 functions somewhat as well.
I also made most of the internal SSL-dependent functions (using Curl_ssl_
prefix) #defined to nothing when no SSL support is requested - previously
they would unnecessarily call mostly empty functions.
Diffstat (limited to 'lib/sslgen.h')
-rw-r--r-- | lib/sslgen.h | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/lib/sslgen.h b/lib/sslgen.h index d93225dd8..b421fc362 100644 --- a/lib/sslgen.h +++ b/lib/sslgen.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2008, 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 @@ -29,19 +29,22 @@ bool Curl_clone_ssl_config(struct ssl_config_data* source, struct ssl_config_data* dest); void Curl_free_ssl_config(struct ssl_config_data* sslc); +#ifdef USE_SSL int Curl_ssl_init(void); void Curl_ssl_cleanup(void); CURLcode Curl_ssl_connect(struct connectdata *conn, int sockindex); CURLcode Curl_ssl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done); -void Curl_ssl_close(struct connectdata *conn, int sockindex); /* tell the SSL stuff to close down all open information regarding connections (and thus session ID caching etc) */ void Curl_ssl_close_all(struct SessionHandle *data); +void Curl_ssl_close(struct connectdata *conn, int sockindex); +CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex); CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine); /* Sets engine as default for all SSL operations */ CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data); +struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data); ssize_t Curl_ssl_send(struct connectdata *conn, int sockindex, const void *mem, @@ -50,9 +53,34 @@ 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 */ - /* init the SSL session ID cache */ CURLcode Curl_ssl_initsessions(struct SessionHandle *, long); +size_t Curl_ssl_version(char *buffer, size_t size); +bool Curl_ssl_data_pending(const struct connectdata *conn, + int connindex); +int Curl_ssl_check_cxn(struct connectdata *conn); + +#else +/* When SSL support is not present, just define away these function calls */ +#define Curl_ssl_init() 1 +#define Curl_ssl_cleanup() +#define Curl_ssl_connect(x,y) CURLE_FAILED_INIT +#define Curl_ssl_connect_nonblocking(x,y,z) (z=z, CURLE_FAILED_INIT) +#define Curl_ssl_close_all(x) +#define Curl_ssl_close(x,y) +#define Curl_ssl_shutdown(x,y) CURLE_FAILED_INIT +#define Curl_ssl_set_engine(x,y) CURLE_FAILED_INIT +#define Curl_ssl_set_engine_default(x) CURLE_FAILED_INIT +#define Curl_ssl_engines_list(x) NULL +#define Curl_ssl_send(a,b,c,d) -1 +#define Curl_ssl_recv(a,b,c,d) -1 +#define Curl_ssl_initsessions(x,y) CURLE_OK +#define Curl_ssl_version(x,y) 0 +#define Curl_ssl_data_pending(x,y) 0 +#define Curl_ssl_check_cxn(x) 0 + +#endif + /* extract a session ID */ int Curl_ssl_getsessionid(struct connectdata *conn, void **ssl_sessionid, @@ -62,18 +90,6 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn, void *ssl_sessionid, size_t idsize); - -struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data); - -size_t Curl_ssl_version(char *buffer, size_t size); - -int Curl_ssl_check_cxn(struct connectdata *conn); - -CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex); - -bool Curl_ssl_data_pending(const struct connectdata *conn, - int connindex); - #if !defined(USE_SSL) && !defined(SSLGEN_C) /* set up blank macros for none-SSL builds */ #define Curl_ssl_close_all(x) |