[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] cleanup the neon socket when closing the ra_session

From: Joe Orton <joe_at_manyfish.co.uk>
Date: 2007-07-06 22:03:31 CEST

On Fri, Jul 06, 2007 at 07:53:19PM +0200, Stefan Küng wrote:
> Well, I'm not that familiar with the neon code, but from what I can see
> it should be thread safe. But just to be sure, I've cc'ed Joe Orton. I
> guess he's the one who could clear this issue up.
>
> Joe, is the ne_sock_exit() function thread-safe? If not, then when
> should this be called?

ne_sock_exit() destroys any process-global state created by
ne_sock_init(), so no, it's not thread-safe. The OpenSSL locking
callbacks are one case of such process-global state - the other case is
in the use of the Win32 socket/SSPI libraries.

ne_sock_exit() should only be used (if at all) when you know there will
be no subsequent use of neon within the process by the caller. AFAIK
this isn't true in the ra_dav session cleanup, since there are two
sessions and there will be another call to ne_session_destroy().

(Looking at the code, ra_dav should really just call ne_sock_init() once
in svn_ra_dav__init, I think; it's unnecessary/wrong to call it each
time an RA session is opened.)

joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 6 22:03:19 2007

This is an archived mail posted to the Subversion Dev mailing list.