summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_sess.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-01-26 22:36:55 +0000
committerBodo Möller <bodo@openssl.org>2000-01-26 22:36:55 +0000
commit52732b38da995490fa33f8062a25d37cd7e7abcc (patch)
treec3d0df61bde15db39ddec86dfc9774644fc47fea /ssl/ssl_sess.c
parentada3cc4a8fb407c3ea6c399de03fd7e1084ae6c3 (diff)
Some comments added, and slight code clean-ups.
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r--ssl/ssl_sess.c14
1 files changed, 4 insertions, 10 deletions
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)