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

Function dav_fs_parse_locktoken

modules/dav/fs/lock.c:242–266  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

240** Parse an opaquelocktoken URI into a locktoken.
241*/
242static dav_error * dav_fs_parse_locktoken(
243 apr_pool_t *p,
244 const char *char_token,
245 dav_locktoken **locktoken_p)
246{
247 dav_locktoken *locktoken;
248
249 if (ap_strstr_c(char_token, "opaquelocktoken:") != char_token) {
250 return dav_new_error(p,
251 HTTP_BAD_REQUEST, DAV_ERR_LOCK_UNK_STATE_TOKEN, 0,
252 "The lock token uses an unknown State-token "
253 "format and could not be parsed.");
254 }
255 char_token += 16;
256
257 locktoken = apr_pcalloc(p, sizeof(*locktoken));
258 if (apr_uuid_parse(&locktoken->uuid, char_token)) {
259 return dav_new_error(p, HTTP_BAD_REQUEST, DAV_ERR_LOCK_PARSE_TOKEN, 0,
260 "The opaquelocktoken has an incorrect format "
261 "and could not be parsed.");
262 }
263
264 *locktoken_p = locktoken;
265 return NULL;
266}
267
268/*
269** dav_fs_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