Branch: Tag:

2004-05-13

2004-05-13 13:39:39 by Henrik Grubbström (Grubba) <grubba@grubba.org>

A PropertyBehavior is now a multiset(string)|int(0..1).

Rev: server/base_server/prototypes.pike:1.122
Rev: server/modules/misc/webdav.pike:1.29

1:   // Protocol support for RFC 2518   // - // $Id: webdav.pike,v 1.28 2004/05/13 12:33:11 mast Exp $ + // $Id: webdav.pike,v 1.29 2004/05/13 13:39:39 grubba Exp $   //   // 2003-09-17 Henrik Grubbström   
9:   #include <module.h>   #include <request_trace.h>    - constant cvs_version = "$Id: webdav.pike,v 1.28 2004/05/13 12:33:11 mast Exp $"; + constant cvs_version = "$Id: webdav.pike,v 1.29 2004/05/13 13:39:39 grubba Exp $";   constant thread_safe = 1;   constant module_name = "DAV: Protocol support";   constant module_type = MODULE_FIRST;
299:    TRACE_LEAVE("COPY: No destination header.");    return Roxen.http_status(400, "COPY: Missing destination header.");    } -  mapping(string:int(-1..1)) propertybehavior = ([]); +  PropertyBehavior propertybehavior = (<>); // default    if (xml_data) {    // Mapping from href to behavior.    // @int
325:    foreach(prop_behav_node->get_children(), SimpleNode n) {    switch(n->get_full_name()) {    case "DAV:omit": -  if (propertybehavior[0] > 0) { +  if (!multisetp(propertybehavior) || sizeof(propertybehavior)) {    return Roxen.http_status(400, "Conflicting DAV:propertybehavior.");    } -  propertybehavior[0] = -1; +  propertybehavior = 0;    break;    case "DAV:keepalive": -  +  if (!multisetp(propertybehavior) || sizeof(propertybehavior)) { +  return Roxen.http_status(400, "Conflicting DAV:propertybehavior."); +  }    foreach(n->get_children(), SimpleNode href) {    if (href->get_full_name == "DAV:href") { -  +  if (!multisetp(propertybehavior)) { +  TRACE_LEAVE("COPY: Conflicting DAV:propertybehaviour."); +  return Roxen.http_status(400, +  "Conflicting DAV:propertybehavior."); +  }    propertybehavior[href->value_of_node()] = 1;    } else if (href->mNodeType == Parser.XML.Tree.XML_TEXT) {    if (href->get_text() != "*"){    TRACE_LEAVE("COPY: Syntax error in DAV:keepalive."); -  return Roxen.http_status(400, "Syntax error in DAV:keepalive."); +  return Roxen.http_status(400, +  "Syntax error in DAV:keepalive.");    } -  if (propertybehavior[0] < 0) { +  if (!multisetp(propertybehavior) || sizeof(propertybehavior)) {    TRACE_LEAVE("COPY: Conflicting DAV:propertybehaviour."); -  return Roxen.http_status(400, "Conflicting DAV:propertybehavior."); +  return Roxen.http_status(400, +  "Conflicting DAV:propertybehavior.");    } -  propertybehavior[0] = 1; +  propertybehavior = 1;    }    }    break;
362:       recur_func = lambda(string source, string loc, int d, RoxenModule module,    RequestID id, string destination, -  mapping(string:int(-1..1)) behavior, +  PropertyBehavior behavior,    Overwrite overwrite) {    if (!has_prefix(destination, loc)) {    // FIXME: Destination in other filesystem.