Title: Message
I think that Robert was replying to my original question about cancelling threads. For some reason it took a couple of days for my message to get on the list, and I managed to get my code working properly.
 
In case anyone is interested, it does seem to work good (at least on Solaris). I just registered a pthreads cleanup handler that calls SSL_free on the SSL *structure, and closes the socket.
 
If my thread either gets cancelled or terminates normally, the resulting cleanup code gets executed. This is great as I can implement timeouts this way by still using Blocking IO. Non blocking IO was giving me a headache :) My code is much simpler to understand.
 
I may still have an issue though - It seems that my memory usage is growing over time. I am not sure if this is a leak or if this is expected behaviour. The leak is not big (a couple of pages per 10 or so SSL connections opened and closed so far) but as this is a daemon process it will eventually cause a problem (if this is in fact a leak).
 
I have not run it for long enough to see if the memory usage will 'level out'.
 
What I am trying to determine is the proper procedure for cleaning up after an established/used SSL connection. All I am doing in my code is an SSL_free followed by a close of the socket. Is this enough?
 
Thanks,
Tim
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Andrew Finnell
Sent: Monday, December 17, 2001 7:52 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Cancelling threads currently blocked or doing IO

        Neff,
               
                Now by canceling the thread do you mean doing a terminate on it? If so that could be your problem. You might want to run your application through purify it will tell you exactly where the problem is.

- Andrew

-------------------------------------
Andrew T. Finnell
Software Engineer
eSecurity Inc
(321) 394-2485


> -----Original Message-----
> From: Neff Robert A [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 17, 2001 9:44 AM
> To: 'Tim Pushor'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: Cancelling threads currently blocked or doing IO
>
>
> Tim,
> From your main/monitor pthread simply close the socket of the
> thread you want terminated.  That kicks you out of the thread
> and should allow you to clean up properly. Rob
>
> -----Original Message-----
> From: Tim Pushor [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 13, 2001 6:27 PM
> To: [EMAIL PROTECTED]
> Subject: Cancelling threads currently blocked or doing IO
>
>
> List,
>
> Has anyone sucessfully cancelled a thread that is currently
> doing IO or blocked in an SSL handshake/read/write operation?
>
> I am trying to do this to simplify timeouts.
>
> The problem is when I cancel the thread and call SSL_free on
> the SSL structure, I still seem to have stuff stuck around in
> memory (leak).
>
> Has anyone done this and have any words of wisdom, or perhaps
> have a better way of implementing a timeout? I am currently
> using Solaris 2.6, OpenSSL 0.9.6b, and the app uses pthreads.
>
> Thanks!
> Tim
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
> *****************************************************************
> DISCLAIMER:   The information contained in this e-mail may be
> confidential
> and is intended solely for the use of the named addressee. 
> Access, copying or re-use of the e-mail or any information
> contained therein by any other person is not authorized.  If
> you are not the intended recipient please
> notify us immediately by returning the e-mail to the originator.   
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
>

Reply via email to