This is a problem with OldSSLClientIn as well,here's a patch with both. thanks, Jacob
On Feb 6, 2008 5:29 PM, Jacob Burkhart <[EMAIL PROTECTED]> wrote: > There appears to me a minor memory leak in StartTLS, I observe a slow but > steady climb in memory usage over the course of hundreds of client SSL > connect/disconnects. Which, I no longer observe when this patch is applied. > from what I can gather from: > > http://search.cpan.org/~sampo/Net_SSLeay.pm-1.25/SSLeay.pm > > > The $ctx created on line 22 of: > > > http://code.sixapart.com/trac/djabberd/browser/trunk/DJabberd/lib/DJabberd/Stanza/StartTLS.pm > > > needs to be freed with: > > Net::SSLeay::CTX_free ($ctx); > > > The other thing going on in StartTLS, is that a new $ctx is being created > for every SSL connection, which is not really needed. It would be more > efficient to create a single $ctx (never collect it) and reuse it. Which is > another way to eliminate the need to worry about Net::SSLeay::CTX_free, and > thus fix this leak. > > > So, I submit for your consideration a patch that makes $ctx an 'our' > variable, sets it when first needed, and then reuses it for > every Net::SSLeay::new > > > thanks, > > Jacob > >
ssl_ctx.diff
Description: Binary data