forked from UtrechtUniversity/davrods
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprop.c
142 lines (128 loc) · 3.43 KB
/
prop.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/**
* \file
* \brief Davrods DAV property support.
* \author Chris Smeele
* \copyright Copyright (c) 2016, Utrecht University
*
* This file is part of Davrods.
*
* Davrods is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Davrods is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Davrods. If not, see <http://www.gnu.org/licenses/>.
*/
#include "prop.h"
APLOG_USE_MODULE(davrods);
static dav_prop_insert prop_insert_prop(
const dav_resource *resource,
int propid,
dav_prop_insert what,
apr_text_header *phdr
) {
return DAV_PROP_INSERT_NOTSUPP;
}
static int prop_is_writable(const dav_resource *resource, int propid) {
// We have no writable properties.
return 0;
}
const char *const davrods_namespace_uris[] = {
"DAV:",
NULL // Sentinel.
};
enum {
DAVRODS_URI_DAV = 0, // The DAV: namespace URI.
};
static dav_error *prop_patch_validate(
const dav_resource *resource,
const apr_xml_elem *elem,
int operation,
void **context,
int *defer_to_dead
) {
return dav_new_error(
resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
"Property manipulation is not supported by this server."
);
}
static dav_error *prop_patch_exec(
const dav_resource *resource,
const apr_xml_elem *elem,
int operation,
void *context,
dav_liveprop_rollback **rollback_ctx
) {
return dav_new_error(
resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
"Property manipulation is not supported by this server."
);
}
static void prop_patch_commit(
const dav_resource *resource,
int operation,
void *context,
dav_liveprop_rollback *rollback_ctx
) {
}
static dav_error *prop_patch_rollback(
const dav_resource *resource,
int operation,
void *context,
dav_liveprop_rollback *rollback_ctx
) {
return dav_new_error(
resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
"Property manipulation is not supported by this server."
);
}
const dav_hooks_liveprop davrods_hooks_liveprop = {
prop_insert_prop,
prop_is_writable,
davrods_namespace_uris,
prop_patch_validate,
prop_patch_exec,
prop_patch_commit,
prop_patch_rollback
};
const dav_liveprop_spec davrods_props[] = {
// Standard DAV properties.
{
DAVRODS_URI_DAV,
"creationdate",
DAV_PROPID_creationdate,
0
},
{
DAVRODS_URI_DAV,
"getcontentlength",
DAV_PROPID_getcontentlength,
0
},
{
DAVRODS_URI_DAV,
"getetag",
DAV_PROPID_getetag,
0
},
{
DAVRODS_URI_DAV,
"getlastmodified",
DAV_PROPID_getlastmodified,
0
},
{ 0 } // Sentinel.
};
//#define DAVRODS_PROP_COUNT (sizeof(davrods_props) / sizeof(dav_liveprop_spec) - 1)
const size_t DAVRODS_PROP_COUNT = sizeof(davrods_props) / sizeof(dav_liveprop_spec) - 1;
const dav_liveprop_group davrods_liveprop_group = {
davrods_props,
davrods_namespace_uris,
&davrods_hooks_liveprop
};