[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: Arlie Davis <adavis_at_stonestreetone.com>
Date: 2006-02-24 21:41:28 CET

> There are already implemented svn_error_wrap_apr(),
> apr_get_os_errro() and APR_FROM_OS_ERROR which is
> better than home-bred svn_error_create_win32()/get_win32_error_text()

I've converted my code to use this. Thanks.

> 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.

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.

After this post, I'm going to submit a patch for the feature.

Thanks all.

-- arlie

-----Original Message-----
From: Ivan Zhakov [mailto:chemodax@gmail.com]
Sent: Friday, February 24, 2006 1:16 PM
To: Arlie Davis
Cc: dev@subversion.tigris.org
Subject: Re: Diffs for running svnserve as a Win32 service

On 2/23/06, Arlie Davis <adavis@stonestreetone.com> wrote:
> Ok, here's the first cut of the service implementation. I welcome
> feedback, testing, etc. Before sending any feedback, though, please
> read the instructions below, especially the "Known Issues" section.
>
First of all, please provide log message as hacking.html states.

I closely look to you patch latter. But there are several things that I
mentioned while quick look through:
There are already implemented svn_error_wrap_apr(), apr_get_os_errro() and
APR_FROM_OS_ERROR which is better than home-bred
svn_error_create_win32()/get_win32_error_text()
Also better use Apache Portable Runtime API for thread operations and might
for closing sockets (apr_socket_close as HTTPD does). Look to APR
documentation: http://apr.apache.org/docs/apr/

--
Ivan Zhakov
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 24 21:42:42 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.