--=_79bbc0327b31a9526961dea57a1bad6d
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Oh
I forgot to mention that I instantiated those variables (it was like obviou=
s for me). Here is the
initialization code:

int Server::TLS_init()
{
=C2=A0=C2=A0=C2=A0 int i;

=C2=A0=C2=A0=C2=A0 mutex_buf =3D (pthread_mutex_t*) malloc(CRYPTO_num_locks=
() * sizeof(pthread_mutex_t));
=C2=A0=C2=A0=C2=A0 if (mutex_buf =3D=3D NULL) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -1;
=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < CRYPTO_num_locks(); i ) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pthread_mutex_init(&mutex_buf[i]=
, NULL);
=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=20
=C2=A0=C2=A0=C2=A0 CRYPTO_set_locking_callback(locking_function);
=C2=A0=C2=A0=C2=A0 CRYPTO_set_id_callback(id_function);
=C2=A0=C2=A0=20
=C2=A0=C2=A0=C2=A0 SSL_library_init();
=C2=A0=C2=A0=C2=A0 SSL_load_error_strings();
=C2=A0=C2=A0=C2=A0=20
=C2=A0=C2=A0=C2=A0 return 0;
}

int Server::TLS_cleanup()
{
=C2=A0=C2=A0=C2=A0 int i;

=C2=A0=C2=A0=C2=A0 if (mutex_buf =3D=3D NULL) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0;
=C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 CRYPTO_set_locking_callback(NULL);
=C2=A0=C2=A0=C2=A0 CRYPTO_set_id_callback(NULL);

=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < CRYPTO_num_locks(); i ) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pthread_mutex_destroy(&mutex_buf=
[i]);
=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 free(mutex_buf);
=C2=A0=C2=A0=C2=A0 mutex_buf =3D NULL;

=C2=A0=C2=A0=C2=A0 return 0;
}

I'm calling TLS_init in server's constructor and TLS_cleanup in server's de=
structor.



-----------------------------------
Nirvana


__________________________________
Whozin - Are you in?=20
We pay you to read your own e-mail!=20
Primul webmail adev=C4=83rat =C3=AEn limba rom=C3=A2n=C4=83 ! =20

--=_79bbc0327b31a9526961dea57a1bad6d
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

Oh r />I forgot to mention that I =
instantiated those variables (it was like obvious for me). Here is the init=
ialization code:

8000">int Server::TLS_init()
r; color: #008000">{
: #008000">    int i;

family: courier; color: #008000"> ; color: #008000">    mutex_buf =3D (pthread_mutex_t*) mallo=
c(CRYPTO_num_locks() * sizeof(pthread_mutex_t));

"font-family: courier; color: #008000">    if (mutex_buf =3D=
=3D NULL) {

">        return -1;
tyle=3D"font-family: courier; color: #008000">    } r />   =
for (i =3D 0; i < CRYPTO_num_locks(); i ) {

"font-family: courier; color: #008000">      =
  pthread_mutex_init(&mutex_buf[i], NULL);

=3D"font-family: courier; color: #008000">    }
=
    pan>
style=3D"font-family: courier; color: #008000">    CRYPTO_s=
et_locking_callback(locking_function);

ly: courier; color: #008000">    CRYPTO_set_id_callback(id_f=
unction);

=
  

00"> &nbsp=
;  SSL_library_init();

; color: #008000">    SSL_load_error_strings();
=
    pan>
  =
  return 0;

08000">}

000">int Server::TLS_cleanup()
ier; color: #008000">{
or: #008000">    int i;

t-family: courier; color: #008000">    if (mutex_buf =3D=3D =
NULL) {

&n=
bsp;       return 0;

=3D"font-family: courier; color: #008000">    }
=

  &nbs=
p; CRYPTO_set_locking_callback(NULL);

y: courier; color: #008000">    CRYPTO_set_id_callback(NULL)=
;


&n=
bsp;   for (i =3D 0; i < CRYPTO_num_locks(); i ) {

/>   &n=
bsp;    pthread_mutex_destroy(&mutex_buf[i]);

/>    }=

 &nb=
sp;  free(mutex_buf);

color: #008000">    mutex_buf =3D NULL;

<=
span style=3D"font-family: courier; color: #008000">    retu=
rn 0;

} pan>

I'm calling TLS_init in serv=
er's constructor and TLS_cleanup in server's destructor.

>

-----------------------------------
Nirvana<=
/p>


__________________________________


Whozin=
- Are you in?

We pay you to read your own e-mail!

Primul webmail adev=C4=83rat =C3=AEn limba rom=C3=A2n=C4=83!

--=_79bbc0327b31a9526961dea57a1bad6d--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org