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

Function dav_generic_parse_locktoken

modules/dav/lock/locks.c:263–286  ·  view source on GitHub ↗

* dav_generic_parse_locktoken * * Parse an opaquelocktoken URI into a locktoken. */

Source from the content-addressed store, hash-verified

261 * Parse an opaquelocktoken URI into a locktoken.
262 */
263static dav_error * dav_generic_parse_locktoken(apr_pool_t *p,
264 const char *char_token,
265 dav_locktoken **locktoken_p)
266{
267 dav_locktoken *locktoken;
268
269 if (ap_strstr_c(char_token, "opaquelocktoken:") != char_token) {
270 return dav_new_error(p,
271 HTTP_BAD_REQUEST, DAV_ERR_LOCK_UNK_STATE_TOKEN, 0,
272 "The lock token uses an unknown State-token "
273 "format and could not be parsed.");
274 }
275 char_token += 16;
276
277 locktoken = apr_pcalloc(p, sizeof(*locktoken));
278 if (apr_uuid_parse(&locktoken->uuid, char_token)) {
279 return dav_new_error(p, HTTP_BAD_REQUEST, DAV_ERR_LOCK_PARSE_TOKEN, 0,
280 "The opaquelocktoken has an incorrect format "
281 "and could not be parsed.");
282 }
283
284 *locktoken_p = locktoken;
285 return NULL;
286}
287
288/*
289 * dav_generic_format_locktoken

Callers

nothing calls this directly

Calls 2

ap_strstr_cFunction · 0.85
dav_new_errorFunction · 0.85

Tested by

no test coverage detected