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

Re: r761: Could not read status line (New Info)

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-10 11:57:17 CET

As Jay found, you cannot simply set the value to NULL :-)

If the FS doesn't return the property, then that means it isn't defined.
Therefore, the function should just bail and return DAV_PROP_INSERT_NOTDEF.

mod_dav will Do The Right Thing from there:

* if a client specifically asks for it, they get a 404 for that prop
* if the clients asks for "all [available] props", then it simply won't be
  present in the result

Cheers,
-g

p.s. and hoo boy, I gotta change that function to allow an error return...

On Wed, Jan 09, 2002 at 11:49:41PM -0600, Jay Freeman (saurik) wrote:
> Ben:
>
> OK, I did an update just now, and noticed that someone added the code to
> set value to NULL. Unfortunately, later code doesn't want to jive.
> First, there's that "assert: value != NULL" comment that should worry
> SOMEONE :).
>
> The later code is doing checks based on *value == '\0', and is using
> sprintf() on the result even if there isn't one (which would generate a
> nasty "(null)" in the output)... this code seems like it would be
> happier if value were set to "" rather than NULL. To point out, I tried
> changing the current code from value = NULL to value = "" and it
> at least _seems_ to work now.
>
> [root(4)@dreadnought bin]# gdb httpd
> GNU gdb Red Hat Linux (5.1-2)
> Copyright 2001 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for
> details.
> This GDB was configured as "i386-redhat-linux"...
> (gdb) run -X
> Starting program: /usr/local/apache2/bin/httpd -X
> [New Thread 1024 (LWP 30061)]
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1024 (LWP 30061)]
> 0x40048109 in dav_svn_insert_prop (resource=0xbfffeb74, propid=20026,
> what=DAV_PROP_INSERT_VALUE, phdr=0xbfffea70)
> at subversion/mod_dav_svn/liveprops.c:360
> 360 if (what == DAV_PROP_INSERT_NAME
> (gdb) list
> 355 /* get the information and global NS index for the property */
> 356 global_ns = dav_get_liveprop_info(propid,
> &dav_svn_liveprop_group, &info);
> 357
> 358 /* assert: info != NULL && info->name != NULL */
> 359
> 360 if (what == DAV_PROP_INSERT_NAME
> 361 || (what == DAV_PROP_INSERT_VALUE && *value == '\0')) {
> 362 s = apr_psprintf(p, "<lp%d:%s/>" DEBUG_CR, global_ns,
> info->name);
> 363 }
> 364 else if (what == DAV_PROP_INSERT_VALUE) {
> (gdb) print value
> $1 = 0x0
> (gdb)
>
> Sincerely,
> Jay Freeman (saurik)
> saurik@saurik.com
>
> -----Original Message-----
> From: sussman@collab.net [mailto:sussman@collab.net]
> Sent: Wednesday, January 09, 2002 10:40 AM
> To: Jay Freeman (saurik)
> Cc: svn-dev
> Subject: Re: r761: Could not read status line (New Info)
>
> "Jay Freeman \(saurik\)" <saurik@saurik.com> writes:
>
> > 189 value = apr_xml_quote_string(p, last_author->data, 1);
> > (gdb) print last_author
> > $1 = (struct {...} *) 0x0
> > (gdb) list
> > 184 /* ### what to do? */
> > 185 value = "###error###";
> > 186 break;
> > 187 }
> > 188
> > 189 value = apr_xml_quote_string(p, last_author->data, 1);
> > 190 break;
>
> Thanks, Jay. I see the problem.
>
> Greg, if the client explicitly requests a creator-displayname
> property, and the fs returns a NULL value, what should
> dav_svn_insert_prop do? Just set 'value' to NULL as well?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

-- 
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 Sat Oct 21 14:36:55 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.