** dav_fs_parse_locktoken ** ** Parse an opaquelocktoken URI into a locktoken. */
| 240 | ** Parse an opaquelocktoken URI into a locktoken. |
| 241 | */ |
| 242 | static 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 |
nothing calls this directly
no test coverage detected