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

Function dav_insert_coreprop

modules/dav/main/props.c:338–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338static dav_error * dav_insert_coreprop(dav_propdb *propdb,
339 int propid, const char *name,
340 dav_prop_insert what,
341 apr_text_header *phdr,
342 dav_prop_insert *inserted)
343{
344 const char *value = NULL;
345 dav_error *err;
346
347 *inserted = DAV_PROP_INSERT_NOTDEF;
348
349 /* fast-path the common case */
350 if (propid == DAV_PROPID_CORE_UNKNOWN)
351 return NULL;
352
353 switch (propid) {
354
355 case DAV_PROPID_CORE_lockdiscovery:
356 if (propdb->flags & DAV_PROPDB_DISABLE_LOCKDISCOVERY) {
357 value = "";
358 break;
359 }
360
361 if (propdb->lockdb != NULL) {
362 dav_lock *locks;
363
364 if ((err = dav_lock_query(propdb->lockdb, propdb->resource,
365 &locks)) != NULL) {
366 return dav_push_error(propdb->p, err->status, 0,
367 "DAV:lockdiscovery could not be "
368 "determined due to a problem fetching "
369 "the locks for this resource.",
370 err);
371 }
372
373 /* fast-path the no-locks case */
374 if (locks == NULL) {
375 value = "";
376 }
377 else {
378 /*
379 ** This may modify the buffer. value may point to
380 ** wb_lock.pbuf or a string constant.
381 */
382 value = dav_lock_get_activelock(propdb->r, locks,
383 &propdb->wb_lock);
384
385 /* make a copy to isolate it from changes to wb_lock */
386 value = apr_pstrdup(propdb->p, propdb->wb_lock.buf);
387 }
388 }
389 break;
390
391 case DAV_PROPID_CORE_supportedlock:
392 if (propdb->lockdb != NULL) {
393 value = (*propdb->lockdb->hooks->get_supportedlock)(propdb->resource);
394 }
395 break;

Callers 3

dav_insert_livepropFunction · 0.85
dav_get_allpropsFunction · 0.85

Calls 4

dav_lock_queryFunction · 0.85
dav_push_errorFunction · 0.85
dav_lock_get_activelockFunction · 0.85
dav_do_prop_subreqFunction · 0.85

Tested by

no test coverage detected