diff options
author | Geoff Thorpe <geoff@openssl.org> | 2000-12-01 21:31:52 +0100 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2000-12-01 21:31:52 +0100 |
commit | 385d81380cb8aa062b9d7e2c678419623c7db484 (patch) | |
tree | f866963b5b03410694d03a37d20695327a72a460 /ssl | |
parent | Write a first HOWTO on how to create certificates. This is currently (diff) | |
download | openssl-385d81380cb8aa062b9d7e2c678419623c7db484.tar.xz openssl-385d81380cb8aa062b9d7e2c678419623c7db484.zip |
First step in tidying up the LHASH code. The callback prototypes (and
casts) used in the lhash code are about as horrible and evil as they can
be. For starters, the callback prototypes contain empty parameter lists.
Yuck.
This first change defines clearer prototypes - including "typedef"'d
function pointer types to use as "hash" and "compare" callbacks, as well as
the callbacks passed to the lh_doall and lh_doall_arg iteration functions.
Now at least more explicit (and clear) casting is required in all of the
dependant code - and that should be included in this commit.
The next step will be to hunt down and obliterate some of the function
pointer casting being used when it's not necessary - a particularly evil
variant exists in the implementation of lh_doall.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_lib.c | 3 | ||||
-rw-r--r-- | ssl/ssl_sess.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 866cd182d4..28a1c67cd7 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1164,7 +1164,8 @@ SSL_CTX *SSL_CTX_new(SSL_METHOD *meth) ret->default_passwd_callback_userdata=NULL; ret->client_cert_cb=NULL; - ret->sessions=lh_new(SSL_SESSION_hash,SSL_SESSION_cmp); + ret->sessions=lh_new((LHASH_HASH_FN_TYPE)SSL_SESSION_hash, + (LHASH_COMP_FN_TYPE)SSL_SESSION_cmp); if (ret->sessions == NULL) goto err; ret->cert_store=X509_STORE_new(); if (ret->cert_store == NULL) goto err; diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 7064262def..830f1d9b0f 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -606,7 +606,7 @@ void SSL_CTX_flush_sessions(SSL_CTX *s, long t) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); i=tp.cache->down_load; tp.cache->down_load=0; - lh_doall_arg(tp.cache,(void (*)())timeout,&tp); + lh_doall_arg(tp.cache, (LHASH_DOALL_ARG_FN_TYPE)timeout, &tp); tp.cache->down_load=i; CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); } |