Branch: Tag:

2004-05-10

2004-05-10 14:57:29 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Updated to use the new recurse_copy_files() API.

Rev: server/modules/misc/webdav.pike:1.24

1:   // Protocol support for RFC 2518   // - // $Id: webdav.pike,v 1.23 2004/05/10 11:44:11 grubba Exp $ + // $Id: webdav.pike,v 1.24 2004/05/10 14:57:29 grubba Exp $   //   // 2003-09-17 Henrik Grubbström   
9:   #include <module.h>   #include <request_trace.h>    - constant cvs_version = "$Id: webdav.pike,v 1.23 2004/05/10 11:44:11 grubba Exp $"; + constant cvs_version = "$Id: webdav.pike,v 1.24 2004/05/10 14:57:29 grubba Exp $";   constant thread_safe = 1;   constant module_name = "DAV: Protocol support";   constant module_type = MODULE_FIRST;
294:    TRACE_LEAVE("COPY: No destination header.");    return Roxen.http_status(400, "COPY: Missing destination header.");    } -  extras = ({ id->misc["new-uri"] }); +     mapping(string:int(-1..1)) propertybehavior = ([]);    if (xml_data) {    // Mapping from href to behavior.
346:    }    }    } -  extras += ({ propertybehavior }); +  extras = ({ id->misc["new-uri"], +  propertybehavior, +  id->request_headers->overwrite? +  (lower_case(id->request_headers->overwrite)=="t"?1:-1):0, +  });       recur_func = lambda(string source, string loc, int d, RoxenModule module,    MultiStatus.Prefixed stat, RequestID id,    string destination, -  mapping(string:int(-1..1)) behavior) { +  mapping(string:int(-1..1)) behavior, +  int(-1..1) overwrite) {    if (!has_prefix(destination, loc)) {    // FIXME: Destination in other filesystem.    return 0;
360:    destination = destination[sizeof(loc)..];    mapping res =    module->recurse_copy_files(source, destination, d, -  behavior, stat, id); +  behavior, overwrite, stat, id);    if (res && ((res->error == 201) || (res->error == 204))) {    empty_result = res;    return 0;