On 27 Nov 2003, at 22:56, Stefano Mazzocchi wrote:

Dear Jim,

I think I found the problem and I also think the attached patch fixes it.

The problem is subdle and due to the fact that at line 751 the comment says

     /* Since we found what we are looking for, return NULL
      * to stop the parse.
      */

return_val = NULL;

but reading the documentation of the CFXMLParser indicates that returning NULL stops further callbacks to be invoked, but does *NOT* terminate the parsing stage. In order to do this, I had to explicitly call the CFXMLParserAbort function with a successful response code

   CFXMLParserStatusCode code = kCFXMLStatusParseSuccessful;
   CFXMLParserAbort(parser, code, CFSTR("Found lock token"));

and this stopped the parsing.

The problem was that if we don't stop the parsing after the lock is found, the code at line 702 might generate a problem

if (((CFStringCompareWithOptions(nodeString, CFSTR("href"), comparison_range,
kCFCompareCaseInsensitive)) == kCFCompareEqualTo))
{
if (*((char **)context) == (char *)WEBDAV_LOCK_TOKEN)
{
*((char **)context) = (char *)WEBDAV_LOCK_HREF;
}
else
{
// =============== HERE IS THE PROBLEM ==============
*((char **)context) = (char *)NULL;
}
}

it appears that slide was sending another <href> element that was not inside a <locktoken> element and this was wiping out the lock previously found.

The patch stops the parsing right after the lock is found.

This fixes the problem and makes webdavfs work read/write on Slide, so

 echo "blah" > /Volumes/files/blah
 cp blah /Volumes/files/blah
 vi /Volumes/files/blah
 open -e /Volumes/Files/blah

all work.

I'm currently investigating an issue with the Finder that prevents drag/drop of files indicating that there is not enough disk space. I presume this is an issue with some parsing of the PROPFIND on the folder requests.

Hope this helps.

--
Stefano.


Attachment: webdav_parse.patch
Description: application/text

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to