-static void crawl_remote_refs(char *path);
-
-static void handle_crawl_ref_ctx(struct xml_ctx *ctx, int tag_closed)
-{
- struct remote_dentry *dentry = (struct remote_dentry *)ctx->userData;
-
-
- if (tag_closed) {
- if (!strcmp(ctx->name, DAV_PROPFIND_RESP) && dentry->name) {
- if (dentry->is_dir) {
- if (strcmp(dentry->name, dentry->base)) {
- crawl_remote_refs(dentry->name);
- }
- } else {
- one_remote_ref(dentry->name);
- }
- } else if (!strcmp(ctx->name, DAV_PROPFIND_NAME) && ctx->cdata) {
- dentry->name = xmalloc(strlen(ctx->cdata) -
- remote->path_len + 1);
- strcpy(dentry->name,
- ctx->cdata + remote->path_len);
- } else if (!strcmp(ctx->name, DAV_PROPFIND_COLLECTION)) {
- dentry->is_dir = 1;
- }
- } else if (!strcmp(ctx->name, DAV_PROPFIND_RESP)) {
- dentry->name = NULL;
- dentry->is_dir = 0;
- }
-}
-
-static void handle_remote_object_list_ctx(struct xml_ctx *ctx, int tag_closed)
-{
- char *path;
- char *obj_hex;
-
- if (tag_closed) {
- if (!strcmp(ctx->name, DAV_PROPFIND_NAME) && ctx->cdata) {
- path = ctx->cdata + remote->path_len;
- if (strlen(path) != 50)
- return;
- path += 9;
- obj_hex = xmalloc(strlen(path));
- strncpy(obj_hex, path, 2);
- strcpy(obj_hex + 2, path + 3);
- one_remote_object(obj_hex);
- free(obj_hex);
- }
- }
-}