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.
136
2003/06/
11
17
:
08
:
00
grubba Exp $
+
// $Id: module.pike,v 1.
137
2003/06/
16
15
:
35
:
11
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:321:
//! Returns the value of the specified property, or an error code //! mapping. //! //! @note //! Returning a string is shorthand for returning an array //! with a single text node. string|array(Parser.XML.Tree.Node)|mapping(string:mixed) query_property(string path, string prop_name, RequestID id) { Stat st = stat_file(path, id);
-
if (!st) return
0;
// FIXME:
No such file.
+
if (!st) return
Roxen.http_low_answer(404,
"
No such file
or directory
.
");
switch(prop_name) { case "DAV:creationdate": // 13.1 return iso8601_date_time(st->ctime); case "DAV:displayname": // 13.2 return combine_path(query_location(), path); case "DAV:getcontentlength": // 13.4 if (st->isreg) { return (string)st->size; } break;
Roxen.git/server/base_server/module.pike:351:
case "DAV:resourcetype": // 13.9 if (st->isdir) { return ({ Parser.XML.Tree.Node(Parser.XML.Tree.XML_ELEMENT, "DAV:collection", ([]), 0, "DAV:collection") }); // 12.2 } return ""; default: break; }
-
return
0;
//
FIXME:
No such property.
+
//
RFC
2518
8.1:
+
//
A request to retrieve the value of a property which does not
+
//
exist is an error and MUST be noted, if the response uses a
+
// multistatus XML element, with a response XML element which
+
// contains a 404 (Not Found) status value.
+
return Roxen.http_low_answer(404, "
No such property.
");
} //! Attempt to set property @[prop_name] for @[path] to @[value]. //! //! @param value //! Value to set the node to. //! The case of an array of a single text node is special cased, //! and is sent as a @expr{string@}. //! //! @returns