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

Re: svn commit: r34928 - branches/http-protocol-v2/subversion/libsvn_ra_serf

From: Greg Stein <gstein_at_gmail.com>
Date: Sat, 27 Dec 2008 04:50:36 -0800

Note that this compares the first three chars case-*sensitively*,
while the rest is insensitive. Header names are intended to be
insensitive.

I'd recommend just dropping the "optimization" of initially checking
the first 3 characters. The string compares are going to be *real*
fast if the first 3 chars do not match (since they'll exit after
checking just a few chars). And relative to getting those headers from
the network, the cycles savings is moot.

*cough* premature optimization *cough*

:-)

Cheers,
-g

On Wed, Dec 24, 2008 at 10:58, Ben Collins-Sussman <sussman_at_red-bean.com> wrote:
> Author: sussman
> Date: Wed Dec 24 10:58:33 2008
> New Revision: 34928
>
> Log:
> Bugfix spotted by gstein.
>
> * subversion/libsvn_ra_serf/options.c
> (capabilities_headers_iterator_callback): compare first 3 chars of key with "SVN".
>
> Modified:
> branches/http-protocol-v2/subversion/libsvn_ra_serf/options.c
>
> Modified: branches/http-protocol-v2/subversion/libsvn_ra_serf/options.c
> URL: http://svn.collab.net/viewvc/svn/branches/http-protocol-v2/subversion/libsvn_ra_serf/options.c?pathrev=34928&r1=34927&r2=34928
> ==============================================================================
> --- branches/http-protocol-v2/subversion/libsvn_ra_serf/options.c Wed Dec 24 09:57:02 2008 (r34927)
> +++ branches/http-protocol-v2/subversion/libsvn_ra_serf/options.c Wed Dec 24 10:58:33 2008 (r34928)
> @@ -311,7 +311,7 @@ capabilities_headers_iterator_callback(v
> }
>
> /* SVN-specific headers -- if present, server supports HTTP protocol v2 */
> - if (svn_cstring_casecmp(key, "svn") == 0)
> + if (strncmp(key, "SVN", 3) == 0)
> {
> if (svn_cstring_casecmp(key, SVN_DAV_ROOT_STUB_HEADER) == 0)
> orc->session->root_stub = apr_pstrdup(orc->session->pool, val);
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=991792
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993687
Received on 2008-12-27 13:50:51 CET

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.