Roxen.git
/
server
/
base_server
/
module.pike
version
»
Context lines:
10
20
40
80
file
none
3
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.
187
2004/05/
09
17
:
54:
21 grubba Exp $
+
// $Id: module.pike,v 1.
188
2004/05/
10
08
:
21
:
36
grubba 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:1114:
//! //! @note //! The default implementation falls back to @[find_file()]. mapping(string:mixed) delete_file(string path, RequestID id) { // Fall back to find_file(). RequestID tmp_id = id->clone_me(); tmp_id->not_query = query_location() + path; tmp_id->method = "DELETE"; // FIXME: Logging?
-
return find_file(path, id) || Roxen.http_status(id->misc->error_code || 404);
+
return find_file(path,
tmp_
id) ||
+
Roxen.http_status(
tmp_
id->misc->error_code || 404);
} //! Delete @[path] recursively. //! @returns //! Returns @expr{0@} (zero) on success. //! Returns @expr{1@} on file not found. //! Returns @expr{2@} or @expr{3@} on other errors. int(0..3) recurse_delete_files(string path, MultiStatus.Prefixed stat, RequestID id) { Stat st = stat_file(path, id); if (!st) return 1; if (st->isdir) { // RFC 2518 8.6.2 // The DELETE operation on a collection MUST act as if a // "Depth: infinity" header was used on it. int(0..3) fail;
-
+
if (!has_suffix(path, "/")) path += "/";
foreach(find_dir(path, id) || ({}), string fname) {
-
fail |= recurse_delete_files(
path+"/"+fname
, stat, id);
+
fail |= recurse_delete_files(
path+fname
, stat, id);
} // RFC 2518 8.6.2 // 424 (Failed Dependancy) errors SHOULD NOT be in the // 207 (Multi-Status). if (fail) return fail; } mapping ret = delete_file(path, id); if (ret->error != 204) { // RFC 2518 8.6.2 // Additionally 204 (No Content) errors SHOULD NOT be returned