MCPcopy Create free account
hub / github.com/apache/httpd / dav_fs_build_key

Function dav_fs_build_key

modules/dav/fs/lock.c:380–397  ·  view source on GitHub ↗

** dav_fs_build_key: Given a resource, return a apr_datum_t key ** to look up lock information for this file. */

Source from the content-addressed store, hash-verified

378** to look up lock information for this file.
379*/
380static apr_datum_t dav_fs_build_key(apr_pool_t *p,
381 const dav_resource *resource)
382{
383 const char *pathname = dav_fs_pathname(resource);
384 apr_datum_t key;
385
386 /* ### does this allocation have a proper lifetime? need to check */
387 /* ### can we use a buffer for this? */
388
389 /* size is TYPE + pathname + null */
390 key.dsize = strlen(pathname) + 2;
391 key.dptr = apr_palloc(p, key.dsize);
392 *key.dptr = DAV_TYPE_FNAME;
393 memcpy(key.dptr + 1, pathname, key.dsize - 1);
394 if (key.dptr[key.dsize - 2] == '/')
395 key.dptr[--key.dsize - 1] = '\0';
396 return key;
397}
398
399/*
400** dav_fs_lock_expired: return 1 (true) if the given timeout is in the past

Callers 7

dav_fs_create_lockFunction · 0.85
dav_fs_get_locksFunction · 0.85
dav_fs_find_lockFunction · 0.85
dav_fs_has_locksFunction · 0.85
dav_fs_append_locksFunction · 0.85
dav_fs_remove_lockFunction · 0.85
dav_fs_refresh_locksFunction · 0.85

Calls 1

dav_fs_pathnameFunction · 0.85

Tested by

no test coverage detected