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

Re: svn commit: r33748 - branches/issue-2382/subversion/svnserve

From: Stefan Sperling <stsp_at_elego.de>
Date: Sun, 19 Oct 2008 20:58:15 +0100

On Sun, Oct 19, 2008 at 10:20:25AM -0700, Greg Stein wrote:
> On Sat, Oct 18, 2008 at 6:39 PM, <stsp_at_tigris.org> wrote:
> >...
> > +++ branches/issue-2382/subversion/svnserve/listen.c Sat Oct 18 18:39:28 2008 (r33748)
> >...
> > +static apr_array_header_t *listeners;
>
> Ugh. Mutable global! (and it isn't even doc'd)
>
> Why not have init_listeners return this array, and then accept the
> array as a parameter in wait_for_client(). Both functions are called
> from the same place, so it isn't hard to just pass the value between
> them. AND it avoids a mutable global.
>
> (and if you need me to rant further about mutable globals, then ask;
> but I hope you simply agree and make the change :-))

Nice. This also enforces the order the two functions must be
called in, instead of simply having the docstring suggest so.

r33762.

> >...
> > +++ branches/issue-2382/subversion/svnserve/main.c Sat Oct 18 18:39:28 2008 (r33748)
> >...
> > + /* Process old --listen-host and --listen-port options.
> > + * While they are deprecated, we still allow them and
> > + * convert them to an equivalent --listen option. */
> > + buf = svn_stringbuf_create("", pool);
> > + if (host && port)
> > + {
> > + svn_stringbuf_appendcstr(buf, host);
> > + svn_stringbuf_appendcstr(buf, ":");
> > + svn_stringbuf_appendcstr(buf, port);
> > + APR_ARRAY_PUSH(addresses, const char *) = buf->data;
>
> APR_ARRAY_PUSH(addresses, const char *) = apr_psprintf(pool, "%s:%s",
> host, port);

Much nicer indeed. r33763.

Thanks,
Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-10-19 21:58:38 CEST

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