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

Function dav_get_locktoken_list

modules/dav/main/util.c:1803–1840  ·  view source on GitHub ↗

dav_get_locktoken_list: * * Sets ltl to a locktoken_list of all positive locktokens in header, * else NULL if no If-header, or no positive locktokens. */

Source from the content-addressed store, hash-verified

1801 * else NULL if no If-header, or no positive locktokens.
1802 */
1803DAV_DECLARE(dav_error *) dav_get_locktoken_list(request_rec *r,
1804 dav_locktoken_list **ltl)
1805{
1806 dav_error *err;
1807 dav_if_header *if_header;
1808 dav_if_state_list *if_state;
1809 dav_locktoken_list *lock_token = NULL;
1810
1811 *ltl = NULL;
1812
1813 if ((err = dav_process_if_header(r, &if_header)) != NULL) {
1814 /* ### add a higher-level description? */
1815 return err;
1816 }
1817
1818 while (if_header != NULL) {
1819 if_state = if_header->state; /* Beginning of the if_state linked list */
1820 while (if_state != NULL) {
1821 if (if_state->condition == DAV_IF_COND_NORMAL
1822 && if_state->type == dav_if_opaquelock) {
1823 lock_token = apr_pcalloc(r->pool, sizeof(dav_locktoken_list));
1824 lock_token->locktoken = if_state->locktoken;
1825 lock_token->next = *ltl;
1826 *ltl = lock_token;
1827 }
1828 if_state = if_state->next;
1829 }
1830 if_header = if_header->next;
1831 }
1832 if (*ltl == NULL) {
1833 /* No nodes added */
1834 return dav_new_error(r->pool, HTTP_BAD_REQUEST, DAV_ERR_IF_ABSENT, 0,
1835 "No locktokens were specified in the \"If:\" "
1836 "header, so the refresh could not be performed.");
1837 }
1838
1839 return NULL;
1840}
1841
1842#if 0 /* not needed right now... */
1843

Callers 2

dav_method_lockFunction · 0.85
mod_dav.hFile · 0.85

Calls 2

dav_process_if_headerFunction · 0.85
dav_new_errorFunction · 0.85

Tested by

no test coverage detected