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

Re: Diffs for running svnserve as a Win32 service

From: Ivan Zhakov <chemodax_at_gmail.com>
Date: 2006-02-25 09:07:37 CET

On 2/24/06, Arlie Davis <adavis@stonestreetone.com> wrote:
> > Also better use Apache Portable Runtime API for thread operations
> > and might for closing sockets (apr_socket_close as HTTPD does).
> Ok, this is two different issues. First, threads: I looked at using
> APR threads, but there is actually nothing to be gained from doing so.
> The one thread that gets created runs for a very short period of time,
> and does not use the APR at all. Using the APR functions for thread
> management doesn't have any benefit (this is already a platform-
> specific piece), and just gets in the way.
Subversion built over APR, so anyway better use APR functions. Even
for platform-specific stuff. Who can garauntee that APR wouldn't add
some significat code in apr_thread_create for pool management? Another
reason to APR: there are much more people know APR and can read code.

> Second, the call to closesocket. The current technique for stopping
> svnserve is not pretty, but I don't see a better way to do it.
> Calling apr_socket_close could actually cause a serious program
> (segmentation fault), because main() (and the functions that it
> calls) would exit the loop and would very likely touch fields within
> the apr_socket_t instance. If the service dispatcher thread freed
> that memory, by calling apr_socket_close, then main() would be
> touching freed memory. But by closing the socket handle, we insure
> that this cannot happen -- the worst thing that happens is that
> the socket *handle* (not structure) gets closed twice, which is ok.
I've looked to svnserve and didn't find when it closes socket on error?

Ivan Zhakov
Received on Sat Feb 25 09:08:03 2006

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