* dav_generic_parse_locktoken * * Parse an opaquelocktoken URI into a locktoken. */
| 261 | * Parse an opaquelocktoken URI into a locktoken. |
| 262 | */ |
| 263 | static 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 |
nothing calls this directly
no test coverage detected