From 52732b38da995490fa33f8062a25d37cd7e7abcc Mon Sep 17 00:00:00 2001 From: Bodo Möller Date: Wed, 26 Jan 2000 22:36:55 +0000 Subject: Some comments added, and slight code clean-ups. --- ssl/ssl_sess.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'ssl/ssl_sess.c') diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 849908141d..cab50d107f 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -67,19 +67,14 @@ static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck); static int ssl_session_num=0; static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_session_meth=NULL; -#if 1 /* traditional SSLeay behaviour */ SSL_SESSION *SSL_get_session(SSL *ssl) +/* aka SSL_get0_session; gets 0 objects, just returns a copy of the pointer */ { return(ssl->session); } -#else /* suggested change: increase reference counter so that a session - * can later be set in a new SSL object. - * Objections: - * -- the modified function should have a new name (or old - * applications, including s_client, leak memory); - * -- the locking seems unnecessary given that SSL structures - * usually cannot be safely shared between threads anyway. */ -SSL_SESSION *SSL_get_session(SSL *ssl) + +SSL_SESSION *SSL_get1_session(SSL *ssl) +/* variant of SSL_get_session: caller really gets something */ { SSL_SESSION *sess; /* Need to lock this all up rather than just use CRYPTO_add so that @@ -92,7 +87,6 @@ SSL_SESSION *SSL_get_session(SSL *ssl) CRYPTO_r_unlock(CRYPTO_LOCK_SSL_SESSION); return(sess); } -#endif int SSL_SESSION_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) -- cgit v1.2.3