Lines Matching defs:fsctx

1489 static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth)
1491 const dav_walk_params *params = fsctx->params;
1495 int isdir = fsctx->res1.collection;
1500 err = (*params->func)(&fsctx->wres,
1514 dav_check_bufsize(pool, &fsctx->path1, DAV_BUFFER_PAD);
1515 fsctx->path1.buf[fsctx->path1.cur_len++] = '/';
1516 fsctx->path1.buf[fsctx->path1.cur_len] = '\0'; /* in pad area */
1519 if (fsctx->path2.buf != NULL) {
1520 dav_check_bufsize(pool, &fsctx->path2, DAV_BUFFER_PAD);
1521 fsctx->path2.buf[fsctx->path2.cur_len++] = '/';
1522 fsctx->path2.buf[fsctx->path2.cur_len] = '\0'; /* in pad area */
1528 fsctx->res1.exists = 1;
1531 fsctx->res1.collection = 0;
1532 fsctx->res2.collection = 0;
1535 if ((status = apr_dir_open(&dirp, fsctx->path1.buf, pool)) != APR_SUCCESS) {
1570 dav_buffer_place_mem(pool, &fsctx->path1, dirent.name, len + 1, 0);
1572 status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf,
1583 dav_buffer_place_mem(pool, &fsctx->uri_buf, dirent.name, len + 1, 1);
1586 if (fsctx->path2.buf != NULL) {
1587 dav_buffer_place_mem(pool, &fsctx->path2, dirent.name, len + 1, 0);
1591 fsctx->info1.pathname = fsctx->path1.buf;
1592 fsctx->info2.pathname = fsctx->path2.buf;
1595 fsctx->res1.uri = fsctx->uri_buf.buf;
1598 if (fsctx->info1.finfo.filetype == APR_REG) {
1600 if ((err = (*params->func)(&fsctx->wres,
1606 else if (fsctx->info1.finfo.filetype == APR_DIR) {
1607 apr_size_t save_path_len = fsctx->path1.cur_len;
1608 apr_size_t save_uri_len = fsctx->uri_buf.cur_len;
1609 apr_size_t save_path2_len = fsctx->path2.cur_len;
1612 fsctx->path1.cur_len += len;
1613 fsctx->path2.cur_len += len;
1616 fsctx->uri_buf.cur_len += len + 1;
1617 fsctx->uri_buf.buf[fsctx->uri_buf.cur_len - 1] = '/';
1618 fsctx->uri_buf.buf[fsctx->uri_buf.cur_len] = '\0';
1621 fsctx->res1.collection = 1;
1622 fsctx->res2.collection = 1;
1626 if ((err = dav_fs_walker(fsctx, depth - 1)) != NULL) {
1632 fsctx->path1.cur_len = save_path_len;
1633 fsctx->path2.cur_len = save_path2_len;
1634 fsctx->uri_buf.cur_len = save_uri_len;
1636 fsctx->res1.collection = 0;
1637 fsctx->res2.collection = 0;
1653 fsctx->path1.buf[fsctx->path1.cur_len - 1] = '\0';
1656 fsctx->res1.collection = 1;
1657 if ((err = dav_fs_get_locknull_members(&fsctx->res1,
1658 &fsctx->locknull_buf)) != NULL) {
1664 fsctx->path1.buf[fsctx->path1.cur_len - 1] = '/';
1667 fsctx->res1.exists = 0;
1668 fsctx->res1.collection = 0;
1669 memset(&fsctx->info1.finfo, 0, sizeof(fsctx->info1.finfo));
1671 while (offset < fsctx->locknull_buf.cur_len) {
1672 apr_size_t len = strlen(fsctx->locknull_buf.buf + offset);
1680 dav_buffer_place_mem(pool, &fsctx->path1,
1681 fsctx->locknull_buf.buf + offset, len + 1, 0);
1682 dav_buffer_place_mem(pool, &fsctx->uri_buf,
1683 fsctx->locknull_buf.buf + offset, len + 1, 0);
1684 if (fsctx->path2.buf != NULL) {
1685 dav_buffer_place_mem(pool, &fsctx->path2,
1686 fsctx->locknull_buf.buf + offset,
1691 fsctx->info1.pathname = fsctx->path1.buf;
1692 fsctx->info2.pathname = fsctx->path2.buf;
1695 fsctx->res1.uri = fsctx->uri_buf.buf;
1727 if ((err = dav_lock_query(params->lockdb, &fsctx->res1,
1735 (err = (*params->func)(&fsctx->wres,
1745 fsctx->res1.exists = 1;
1750 fsctx->path1.buf[--fsctx->path1.cur_len] = '\0';
1751 fsctx->uri_buf.buf[--fsctx->uri_buf.cur_len] = '\0';
1752 if (fsctx->path2.buf != NULL) {
1753 fsctx->path2.buf[--fsctx->path2.cur_len] = '\0';
1757 fsctx->res1.collection = 1;
1759 return (*params->func)(&fsctx->wres, DAV_CALLTYPE_POSTFIX);
1770 dav_fs_walker_context fsctx = { 0 };
1783 fsctx.params = params;
1784 fsctx.wres.walk_ctx = params->walk_ctx;
1785 fsctx.wres.pool = params->pool;
1789 fsctx.res1 = *params->root;
1790 fsctx.res1.pool = params->pool;
1792 fsctx.res1.info = &fsctx.info1;
1793 fsctx.info1 = *params->root->info;
1796 dav_buffer_init(params->pool, &fsctx.path1, fsctx.info1.pathname);
1797 fsctx.info1.pathname = fsctx.path1.buf;
1802 fsctx.wres.walk_ctx = &cm_ctx;
1804 cm_ctx.res_dst = &fsctx.res2;
1808 fsctx.res2 = *root_dst;
1809 fsctx.res2.exists = 0;
1810 fsctx.res2.collection = 0;
1811 fsctx.res2.uri = NULL; /* we don't track this */
1812 fsctx.res2.pool = params->pool;
1814 fsctx.res2.info = &fsctx.info2;
1815 fsctx.info2 = *root_dst->info;
1818 memset(&fsctx.info2.finfo, 0, sizeof(fsctx.info2.finfo));
1821 dav_buffer_init(params->pool, &fsctx.path2, fsctx.info2.pathname);
1822 fsctx.info2.pathname = fsctx.path2.buf;
1826 dav_buffer_init(params->pool, &fsctx.uri_buf, params->root->uri);
1829 if (fsctx.res1.collection
1830 && fsctx.uri_buf.buf[fsctx.uri_buf.cur_len - 1] != '/') {
1833 fsctx.uri_buf.buf[fsctx.uri_buf.cur_len++] = '/';
1834 fsctx.uri_buf.buf[fsctx.uri_buf.cur_len] = '\0';
1838 fsctx.res1.uri = fsctx.uri_buf.buf;
1841 fsctx.wres.resource = &fsctx.res1;
1844 err = dav_fs_walker(&fsctx, depth);
1845 *response = fsctx.wres.response;