Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2001, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.533 2003/06/10 12:22:13 anders Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.534 2003/06/11 15:47:42 grubba Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>   #include <timers.h>      #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)      // --- Locale defines ---   //<locale-token project="roxen_start"> LOC_S </locale-token>
Roxen.git/server/base_server/configuration.pike:1781:    // int d    // RoxenModule module    // RequestID id    // mixed ... extras    function(string,int,RoxenModule,MultiStatus,RequestID,mixed ...:void)    recur_func;    array(mixed) extras = ({});       switch(id->method) {    case "PROPFIND": // Get meta data. +  if (xml_data) {    Parser.XML.Tree.Node propfind =    xml_data->get_first_element("DAV:propfind", 1);    if (!propfind) {    return Roxen.http_low_answer(400, "Missing DAV:propfind.");    }    /* Valid children of <DAV:propfind> are    * <DAV:propname />    * or    * <DAV:allprop />    * or
Roxen.git/server/base_server/configuration.pike:1828:    multiset(string) filt) {    module->recurse_find_properties(path, "DAV:prop", d,    stat, id, filt);    };    extras = ({ (multiset)(prop->get_children()->get_full_name()) });    break;    default:    break;    }    } +  } else { +  // RFC 2518 8.1: +  // A client may choose not to submit a request body. An empty +  // PROPFIND request body MUST be treated as a request for the +  // names and values of all properties. +  recur_func = lambda(string path, int d, RoxenModule module, +  MultiStatus stat, RequestID id) { +  module->recurse_find_properties(path, "DAV:allprop", d, +  stat, id); +  }; +  }    break;    case "PROPPATCH": // Set/delete meta data.    Parser.XML.Tree.Node propupdate =    xml_data->get_first_element("DAV:propertyupdate", 1);    if (!propupdate) {    return Roxen.http_low_answer(400, "Missing DAV:propertyupdate.");    }    /* Valid children of <DAV:propertyupdate> are any combinations of    * <DAV:set><DAV:prop>{propertylist}*</DAV:prop></DAV:set>    * and
Roxen.git/server/base_server/configuration.pike:1887:    extras = ({ instructions });    break;    default:    break;    }    if (!recur_func) {    TRACE_LEAVE("Bad DAV request.");    return Roxen.http_low_answer(400, "Bad DAV request (23.3.2.2).");    }    // FIXME: Security, DoS, etc... -  MultiStatus result = MultiStatus(); +  MultiStatus result = +  MultiStatus()->prefix(sprintf("%s://%s%s%s", +  id->port_obj->prot_name, +  id->misc->host || id->port_obj->ip, +  (id->port_obj->port == id->port_obj->port)? +  "":(string)id->port_obj->port, +  id->port_obj->path||""));    string href = id->not_query;    string href_prefix = combine_path(href, "./");    foreach(location_modules(), [string loc, function fun]) {    int d = depth;    string path;    TRACE_ENTER(sprintf("Trying module mounted at %O...", loc),    function_object(fun));    if (has_prefix(href, loc)) {    // href = loc + path.    path = href[sizeof(loc)..];