| 761 | } |
| 762 | |
| 763 | static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed) |
| 764 | { |
| 765 | struct remote_lock *lock = (struct remote_lock *)ctx->userData; |
| 766 | struct git_hash_ctx hash_ctx; |
| 767 | unsigned char lock_token_hash[GIT_MAX_RAWSZ]; |
| 768 | |
| 769 | if (tag_closed && ctx->cdata) { |
| 770 | if (!strcmp(ctx->name, DAV_ACTIVELOCK_OWNER)) { |
| 771 | lock->owner = xstrdup(ctx->cdata); |
| 772 | } else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TIMEOUT)) { |
| 773 | const char *arg; |
| 774 | if (skip_prefix(ctx->cdata, "Second-", &arg)) |
| 775 | lock->timeout = strtol(arg, NULL, 10); |
| 776 | } else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TOKEN)) { |
| 777 | lock->token = xstrdup(ctx->cdata); |
| 778 | |
| 779 | the_hash_algo->init_fn(&hash_ctx); |
| 780 | git_hash_update(&hash_ctx, lock->token, strlen(lock->token)); |
| 781 | git_hash_final(lock_token_hash, &hash_ctx); |
| 782 | |
| 783 | lock->tmpfile_suffix[0] = '_'; |
| 784 | memcpy(lock->tmpfile_suffix + 1, hash_to_hex(lock_token_hash), the_hash_algo->hexsz); |
| 785 | } |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | static void one_remote_ref(const char *refname); |
| 790 |
nothing calls this directly
no test coverage detected