Well, not like I'm doing it now anyway :

Initthread -> array of connections <-> push thread <-> array of
connections <- cleanup thread

I guess I must be missing something :)

On 9/3/07, kris vandercapellen <[EMAIL PROTECTED]> wrote:
> Nope, still didn't solve the memory issue.
> For now it looks like openssl isn't able to share connections in
> between threads.
>
> On 8/31/07, Marek Marcola <[EMAIL PROTECTED]> wrote:
> > Hello,
> > > StartupThreads are getting a incomming connection, create a
> > > SSL_new(ctx), create a BIO_new(BIO_s_socket()), BIO_set_fd, and
> > > SSL_set_bio. Then they SSL_accept(ssl), and SSL_read what is comming
> > > in.
> > >
> > > So far so good.
> > >
> > > When the input is something this httpsd should react to, i put a
> > > "user" class in an array, with bio, ssl and socket as class variables.
> > >  To pass them on to a "worker" thread, which loops over this array and
> > > SSL_writes to the ssl. (once every second)
> > >
> > > When SSL_write < 1, the socket gets closed and gets set to -1 and the
> > > destructor for that user gets called by cleanup thread.
> > > This is what is in there :
> > >     if(bio) BIO_ssl_shutdown(bio);
> > >     if(ssl){
> > >         ERR_clear_error(); //added and removed  these, no difference
> > >         ERR_remove_state(0); //idem
> > >         SSL_shutdown(ssl);
> > >         SSL_free(ssl);
> > >     }
> > >
> > > So what is the problem here : It works fine, it just leaves a lot of
> > > used memory behind (memory leak ?)
> > I'm not sure, but maybe you should call ERR_remove_state(0) last
> > (after SSL_free()) because error stack is allocated automatically
> > and after this SSL_* calls you may allocate this stack again.
> >
> > Best regards,
> > --
> > Marek Marcola <[EMAIL PROTECTED]>
> >
> > ______________________________________________________________________
> > OpenSSL Project                                 http://www.openssl.org
> > User Support Mailing List                    openssl-users@openssl.org
> > Automated List Manager                           [EMAIL PROTECTED]
> >
>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to