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

Re: svn commit: r18245 - trunk/subversion/libsvn_ra_serf

From: Greg Stein <gstein_at_lyra.org>
Date: 2006-01-27 03:02:36 CET

On Thu, Jan 26, 2006 at 01:45:14AM -0600, jerenkrantz@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_ra_serf/serf.c Thu Jan 26 01:45:11 2006
>...
> +static const char *
> +expand_ns(propfind_context_t *ctx, const char *ns_name)
> +{
> + ns_t *ns;
> + for (ns = ctx->ns_list; ns; ns = ns->next)
> + {
> + if (strcasecmp(ns->namespace, ns_name) == 0)

XML is case-sensitive. Should just be strcmp().

>...
> +static void XMLCALL
> +start_propfind(void *userData, const char *name, const char **attrs)
> +{
>...
> + if (ctx->in_prop && !ctx->name)
> + {
> + ctx->ns = ns;
> + ctx->name = apr_pstrdup(ctx->pool, name);
> + /* we want to flag the cdata handler to pick up what's next. */
> + ctx->collect_cdata = 1;
> + }

Note: you need to look at the DAV:status element to figure out which
properties are okay. Some might be 404'd. Also note that the status
can be reported before *or* after the list of property values.

> +
> + /* check for 'prop' */
> + if (!ctx->in_prop && strcasecmp(name, "prop") == 0)

strcmp()

>...
> +static void XMLCALL
> +cdata_propfind(void *userData, const char *data, int len)
> +{
> + propfind_context_t *ctx = userData;
> + if (ctx->collect_cdata)
> + {
> + ctx->val = apr_pstrndup(ctx->pool, data, len);

apr_pstrmemdup() is more efficient.

>...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 27 02:58:44 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.