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 - 2001, Roxen IS. - // $Id: module.pike,v 1.214 2004/05/17 18:22:21 mast Exp $ + // $Id: module.pike,v 1.215 2004/06/02 21:49:32 mast Exp $      #include <module_constants.h>   #include <module.h>   #include <request_trace.h>      constant __pragma_save_parent__ = 1;      inherit "basic_defvar";   mapping(string:array(int)) error_log=([]);   
Roxen.git/server/base_server/module.pike:418:    "No such file or directory.");    }    if (mappingp (properties))    return properties;    return properties->query_property(prop_name) ||    Roxen.http_status(Protocols.HTTP.HTTP_NOT_FOUND, "No such property.");   }      //! RFC 2518 PROPFIND implementation with recursion according to   //! @[depth]. See @[find_properties] for details. - void recurse_find_properties(string path, string mode, + mapping(string:mixed) recurse_find_properties(string path, string mode,    int depth, RequestID id,    multiset(string)|void filt)   {    MultiStatus.Prefixed result =    id->get_multi_status()->prefix (id->url_base() + query_location()[1..]);    -  void recurse (string path, int depth) { +  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);       if (!properties) {    SIMPLE_TRACE_LEAVE ("No such file or dir"); -  return; +  return 0;    }       {    mapping(string:mixed) ret = mappingp (properties) ?    properties : properties->find_properties(mode, result, filt);       if (ret) { -  result->add_status (path, ret->error, ret->rettext); +     SIMPLE_TRACE_LEAVE ("Got status %d: %O", ret->error, ret->rettext); -  return; +  return ret;    }    }       if (properties->get_stat()->isdir) {    if (depth <= 0) {    SIMPLE_TRACE_LEAVE ("Not recursing due to depth limit"); -  return; +  return 0;    }    depth--;    foreach(find_dir(path, id) || ({}), string filename) { -  recurse(combine_path_unix(path, filename), depth); +  filename = combine_path_unix(path, filename); +  if (mapping(string:mixed) sub_res = recurse(filename, depth)) +  if (sizeof (sub_res)) +  result->add_status (filename, sub_res->error, sub_res->rettext);    }    }       SIMPLE_TRACE_LEAVE (""); -  +  return ([]);    };    -  recurse (path, depth); +  return recurse (path, depth);   }      mapping(string:mixed) patch_properties(string path,    array(PatchPropertyCommand) instructions,    RequestID id)   {    SIMPLE_TRACE_ENTER (this, "Patching properties for %O", path);    mapping(string:mixed)|PropertySet properties = query_property_set(path, id);       if (!properties) {