diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2005-08-05 23:56:11 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2005-08-05 23:56:11 +0000 |
commit | f3b656b246f45a0159aea9c38634a9f72f98d31d (patch) | |
tree | ccff70185528b91ee93c7e4be53ed411e4edad5b /ssl/t1_srvr.c | |
parent | 53b38d37a90ad53962b9e0f14eb942fa6ab8f341 (diff) |
Initialize SSL_METHOD structures at compile time. This removes the need
for locking code. The CRYPTO_LOCK_SSL_METHOD lock is now no longer used.
Diffstat (limited to 'ssl/t1_srvr.c')
-rw-r--r-- | ssl/t1_srvr.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/ssl/t1_srvr.c b/ssl/t1_srvr.c index 1c1149e49f..b75636abba 100644 --- a/ssl/t1_srvr.c +++ b/ssl/t1_srvr.c @@ -73,26 +73,8 @@ static SSL_METHOD *tls1_get_server_method(int ver) return(NULL); } -SSL_METHOD *TLSv1_server_method(void) - { - static int init=1; - static SSL_METHOD TLSv1_server_data; - - if (init) - { - CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD); - - if (init) - { - memcpy((char *)&TLSv1_server_data,(char *)tlsv1_base_method(), - sizeof(SSL_METHOD)); - TLSv1_server_data.ssl_accept=ssl3_accept; - TLSv1_server_data.get_ssl_method=tls1_get_server_method; - init=0; - } - - CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD); - } - return(&TLSv1_server_data); - } +IMPLEMENT_tls1_meth_func(TLSv1_server_method, + ssl3_accept, + ssl_undefined_function, + tls1_get_server_method) |