Roxen.git / server / base_server / module.pike

version» Context lines:

Roxen.git/server/base_server/module.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: module.pike,v 1.244 2010/06/28 06:57:57 marty Exp $ + // $Id: module.pike,v 1.245 2012/01/23 12:50:52 grubba Exp $      #include <module_constants.h>   #include <module.h>   #include <request_trace.h>      constant __pragma_save_parent__ = 1;      // Tell Pike.count_memory this is global.   constant pike_cycle_depth = 0;   
Roxen.git/server/base_server/module.pike:562:      //! RFC 2518 PROPFIND implementation with recursion according to   //! @[depth]. See @[PropertySet()->find_properties()] for details.   //!   //! @seealso   //! @[query_property_set()]   mapping(string:mixed) recurse_find_properties(string path, string mode,    int depth, RequestID id,    multiset(string)|void filt)   { +  string prefix = map(query_location()[1..]/"/", Roxen.http_encode_url)*"/";    MultiStatus.Prefixed result = -  id->get_multi_status()->prefix (id->url_base() + query_location()[1..]); +  id->get_multi_status()->prefix (id->url_base() + prefix);       mapping(string:mixed) recurse (string path, int depth) {    SIMPLE_TRACE_ENTER (this, "%s for %O, depth %d",    mode == "DAV:propname" ? "Listing property names" :    mode == "DAV:allprop" ? "Retrieving all properties" :    mode == "DAV:prop" ? "Retrieving specific properties" :    "Finding properties with mode " + mode,    path, depth);    mapping(string:mixed)|PropertySet properties = query_property_set(path, id);   
Roxen.git/server/base_server/module.pike:649:       array(mapping(string:mixed)) results;       mixed err = catch {    results = instructions->execute(properties);    };    if (err) {    properties->unroll();    throw (err);    } else { +  string prefix = map((query_location()[1..] + path)/"/", +  Roxen.http_encode_url)*"/";    MultiStatus.Prefixed result = -  id->get_multi_status()->prefix (id->url_base() + query_location()[1..] + path); +  id->get_multi_status()->prefix (id->url_base() + prefix);    int any_failed;    foreach(results, mapping(string:mixed) answer) {    if (any_failed = (answer && (answer->error >= 300))) {    break;    }    }    if (any_failed) {    // Unroll and fail any succeeded items.    int i;    mapping(string:mixed) answer =
Roxen.git/server/base_server/module.pike:1719:    "overlay");    string src_tmp = has_suffix(source, "/")?source:(source+"/");    string dst_tmp = has_suffix(destination, "/")?destination:(destination+"/");    if ((src_tmp == dst_tmp) ||    has_prefix(src_tmp, dst_tmp) ||    has_prefix(dst_tmp, src_tmp)) {    TRACE_LEAVE("Source and destination overlap.");    return Roxen.http_status(403, "Source and destination overlap.");    }    -  string loc = query_location(); +  string prefix = map(query_location()[1..]/"/", Roxen.http_encode_url)*"/";    MultiStatus.Prefixed result = -  id->get_multi_status()->prefix (id->url_base() + loc[1..]); +  id->get_multi_status()->prefix (id->url_base() + prefix);       mapping(string:mixed) recurse(string source, string destination) {    // Note: Already got an extra TRACE_ENTER level on entry here.       Stat st = stat_file(source, id);    if (!st) {    TRACE_LEAVE("Source not found.");    return 0;    }    // FIXME: Check destination?
Roxen.git/server/base_server/module.pike:1867:    // Fall back to find_file().    RequestID tmp_id = id->clone_me();    tmp_id->not_query = query_location() + source;    tmp_id->misc["new-uri"] = query_location() + destination;    tmp_id->request_headers->destination =    id->url_base() + query_location()[1..] + destination;    tmp_id->method = "MOVE";    mapping(string:mixed) res = find_file(source, tmp_id);    if (!res || res->error != 501) return res;    // Not implemented. Fall back to COPY + DELETE. +  string prefix = map(query_location()[1..]/"/", Roxen.http_encode_url)*"/";    MultiStatus.Prefixed result = -  id->get_multi_status()->prefix (id->url_base() + query_location()[1..]); +  id->get_multi_status()->prefix (id->url_base() + prefix);    res = copy_collection(source, destination, behavior, overwrite, result, id);    if (res && (res->error >= 300 || !sizeof(res))) {    // Copy failed.    return res;    }    int fail;    foreach(find_dir(source, id), string filename) {    string subsrc = combine_path_unix(source, filename);    string subdst = combine_path_unix(destination, filename);    SIMPLE_TRACE_ENTER(this, "Recursive move from %O to %O\n",