resolve , returning <*direct> */
| 662 | |
| 663 | /* resolve <indirect>, returning <*direct> */ |
| 664 | static dav_error * dav_fs_resolve(dav_lockdb *lockdb, |
| 665 | dav_lock_indirect *indirect, |
| 666 | dav_lock_discovery **direct, |
| 667 | dav_lock_discovery **ref_dp, |
| 668 | dav_lock_indirect **ref_ip) |
| 669 | { |
| 670 | dav_error *err; |
| 671 | dav_lock_discovery *dir; |
| 672 | dav_lock_indirect *ind; |
| 673 | |
| 674 | if ((err = dav_fs_load_lock_record(lockdb, indirect->key, |
| 675 | DAV_CREATE_LIST, |
| 676 | &dir, &ind)) != NULL) { |
| 677 | /* ### insert a higher-level description? */ |
| 678 | return err; |
| 679 | } |
| 680 | if (ref_dp != NULL) { |
| 681 | *ref_dp = dir; |
| 682 | *ref_ip = ind; |
| 683 | } |
| 684 | |
| 685 | for (; dir != NULL; dir = dir->next) { |
| 686 | if (!dav_compare_locktoken(indirect->locktoken, dir->locktoken)) { |
| 687 | *direct = dir; |
| 688 | return NULL; |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | /* No match found (but we should have found one!) */ |
| 693 | |
| 694 | /* ### use a different description and/or error ID? */ |
| 695 | return dav_new_error(lockdb->info->pool, |
| 696 | HTTP_INTERNAL_SERVER_ERROR, |
| 697 | DAV_ERR_LOCK_CORRUPT_DB, 0, |
| 698 | "The lock database was found to be corrupt. " |
| 699 | "An indirect lock's direct lock could not " |
| 700 | "be found."); |
| 701 | } |
| 702 | |
| 703 | /* --------------------------------------------------------------- |
| 704 | ** |
no test coverage detected