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

Re: ra_dav->unlock()

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-01-07 14:38:52 CET

On Jan 7, 2005, at 1:54 AM, Greg Hudson wrote:

> On Thu, 2005-01-06 at 23:01, Ben Collins-Sussman wrote:
>> The problem is that in order to issue an http UNLOCK request, I need a
>> URI to run it on. But RA->unlock() takes only a token, not a path!
> I'm confused.
> When I asked why we needed a libsvn_fs table indexed by lock token (and
> not just one indexed by path), I thought I was told that it's because
> DAV needs a way to unlock by token. But if the DAV unlock request
> includes a URL (which corresponds to an FS path), then why do we need
> to
> be able to unlock by token only?

As Julian said, the DAV protocol itself doesn't unlock by token.

But mod_dav's locking-vtable defines at least two functions that need
to be able to *look up* a lock by token. The functions receive a
dav_resource and a token, and are instructed to either return the
associated lock_t structure or to refresh the associated lock. (The
reason both path and token are passed is because it's possible for a
DAV server supports multiple shared locks on a path.)

In any case, this is why svn_fs.h defines both


Looking over the two mod_dav_svn vtable funcs (dav_svn_refresh_locks()
and dav_svn_find_lock())... they *could* be reimplemented to call
_lock_from_path() instead of _lock_from_token() if we really wanted
that. IOW, if we wanted to delete the _lock_from_token() API from
svn_fs.h altogether, we'd be just fine. I don't think there are any
other callers. But as a matter of completeness, it seems odd for our
fs locking API to return tokens that "represent locks", and yet not
have an API to lookup by token.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 7 14:40:03 2005

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.