summaryrefslogtreecommitdiff
path: root/modules/dav/fs
diff options
context:
space:
mode:
authorArno Töll <arno@debian.org>2014-07-20 06:23:00 -1100
committerArno Töll <arno@debian.org>2014-07-20 06:23:00 -1100
commitcb35beef2a938b80c9e4b5d6a408eca437aa74db (patch)
tree87ae6e0d2b3a8ce318fe8ab559494808a451035e /modules/dav/fs
parent2a463b3cd73c32ee9dcd508248d0194923f435f4 (diff)
downloadapache2-cb35beef2a938b80c9e4b5d6a408eca437aa74db.tar.gz
Imported Upstream version 2.4.10
Diffstat (limited to 'modules/dav/fs')
-rw-r--r--modules/dav/fs/repos.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c
index ae6f5c0e..6c4c44b1 100644
--- a/modules/dav/fs/repos.c
+++ b/modules/dav/fs/repos.c
@@ -717,13 +717,13 @@ static dav_error * dav_fs_get_resource(
resource->pool = r->pool;
/* make sure the URI does not have a trailing "/" */
- len = strlen(r->unparsed_uri);
- if (len > 1 && r->unparsed_uri[len - 1] == '/') {
- s = apr_pstrmemdup(r->pool, r->unparsed_uri, len-1);
+ len = strlen(r->uri);
+ if (len > 1 && r->uri[len - 1] == '/') {
+ s = apr_pstrmemdup(r->pool, r->uri, len-1);
resource->uri = s;
}
else {
- resource->uri = r->unparsed_uri;
+ resource->uri = r->uri;
}
if (r->finfo.filetype != APR_NOFILE) {
@@ -1482,18 +1482,6 @@ static dav_error * dav_fs_remove_resource(dav_resource *resource,
return dav_fs_deleteset(info->pool, resource);
}
-/* Take an unescaped path component and escape it and append it onto a
- * dav_buffer for a URI */
-static apr_size_t dav_fs_append_uri(apr_pool_t *p, dav_buffer *pbuf,
- const char *path, apr_size_t pad)
-{
- const char *epath = ap_escape_uri(p, path);
- apr_size_t epath_len = strlen(epath);
-
- dav_buffer_place_mem(p, pbuf, epath, epath_len + 1, pad);
- return epath_len;
-}
-
/* ### move this to dav_util? */
/* Walk recursively down through directories, *
* including lock-null resources as we go. */
@@ -1549,7 +1537,6 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth)
}
while ((apr_dir_read(&dirent, APR_FINFO_DIRENT, dirp)) == APR_SUCCESS) {
apr_size_t len;
- apr_size_t escaped_len;
len = strlen(dirent.name);
@@ -1592,7 +1579,7 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth)
/* copy the file to the URI, too. NOTE: we will pad an extra byte
for the trailing slash later. */
- escaped_len = dav_fs_append_uri(pool, &fsctx->uri_buf, dirent.name, 1);
+ dav_buffer_place_mem(pool, &fsctx->uri_buf, dirent.name, len + 1, 1);
/* if there is a secondary path, then do that, too */
if (fsctx->path2.buf != NULL) {
@@ -1625,7 +1612,7 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth)
fsctx->path2.cur_len += len;
/* adjust URI length to incorporate subdir and a slash */
- fsctx->uri_buf.cur_len += escaped_len + 1;
+ fsctx->uri_buf.cur_len += len + 1;
fsctx->uri_buf.buf[fsctx->uri_buf.cur_len - 1] = '/';
fsctx->uri_buf.buf[fsctx->uri_buf.cur_len] = '\0';
@@ -1691,8 +1678,8 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth)
*/
dav_buffer_place_mem(pool, &fsctx->path1,
fsctx->locknull_buf.buf + offset, len + 1, 0);
- dav_fs_append_uri(pool, &fsctx->uri_buf,
- fsctx->locknull_buf.buf + offset, 0);
+ dav_buffer_place_mem(pool, &fsctx->uri_buf,
+ fsctx->locknull_buf.buf + offset, len + 1, 0);
if (fsctx->path2.buf != NULL) {
dav_buffer_place_mem(pool, &fsctx->path2,
fsctx->locknull_buf.buf + offset,