If property not found try property without namespace
This commit is contained in:
parent
9bf8e61826
commit
0b8556f838
@ -1,6 +1,11 @@
|
||||
ChangeLog for davfs2
|
||||
--------------------
|
||||
|
||||
2009-06-07 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* webdav.c, prop_result:
|
||||
If property not found try property without namespace.
|
||||
(idea by Dirk Arend <d.arend@avm.de>)
|
||||
|
||||
2009-06-06 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* cache.c, dav_statfs:
|
||||
Use retry time instead of dir_refresh.
|
||||
|
2
THANKS
2
THANKS
@ -6,10 +6,10 @@ and bug reports, patiently testing and hunting bugs,
|
||||
and giving good advise.
|
||||
============================================================
|
||||
|
||||
Dirk Arend <d.arend@avm.de>
|
||||
Reto Bachmann-Gmuer <rebach@users.sourceforge.net>
|
||||
Adrian Bridgett
|
||||
Anthony Baxter <anthonybaxter@users.sourceforge.net>
|
||||
Dirk Arend <d.arend@avm.de>
|
||||
Luciano Bello <lbello@users.sourceforge.net>
|
||||
Vladimir Bormotov <bormotov@users.sourceforge.net>
|
||||
butchie55 <butchie55@users.sourceforge.net>
|
||||
|
22
src/webdav.c
22
src/webdav.c
@ -121,6 +121,16 @@ static const ne_propname prop_names[] = {
|
||||
[END] = {NULL, NULL}
|
||||
};
|
||||
|
||||
static const ne_propname anonymous_prop_names[] = {
|
||||
[ETAG] = {NULL, "getetag"},
|
||||
[LENGTH] = {NULL, "getcontentlength"},
|
||||
[CREATION] ={NULL, "creationdate"},
|
||||
[MODIFIED] = {NULL, "getlastmodified"},
|
||||
[TYPE] = {NULL, "resourcetype"},
|
||||
[EXECUTE] = {NULL, "executable"},
|
||||
[END] = {NULL, NULL}
|
||||
};
|
||||
|
||||
/* Properties to be retrieved from the server. This constants
|
||||
are used by dav_quota(). */
|
||||
enum {
|
||||
@ -1693,6 +1703,8 @@ prop_result(void *userdata, const ne_uri *uri, const ne_prop_result_set *set)
|
||||
const char *data;
|
||||
|
||||
data = ne_propset_value(set, &prop_names[TYPE]);
|
||||
if (!data)
|
||||
data = ne_propset_value(set, &anonymous_prop_names[TYPE]);
|
||||
if (data && strstr(data, "collection"))
|
||||
result->is_dir = 1;
|
||||
|
||||
@ -1728,9 +1740,13 @@ prop_result(void *userdata, const ne_uri *uri, const ne_prop_result_set *set)
|
||||
}
|
||||
|
||||
data = ne_propset_value(set, &prop_names[ETAG]);
|
||||
if (!data)
|
||||
data = ne_propset_value(set, &anonymous_prop_names[ETAG]);
|
||||
result->etag = normalize_etag(data);
|
||||
|
||||
data = ne_propset_value(set, &prop_names[LENGTH]);
|
||||
if (!data)
|
||||
data = ne_propset_value(set, &anonymous_prop_names[LENGTH]);
|
||||
if (data)
|
||||
#if _FILE_OFFSET_BITS == 64
|
||||
result->size = strtoll(data, NULL, 10);
|
||||
@ -1739,6 +1755,8 @@ prop_result(void *userdata, const ne_uri *uri, const ne_prop_result_set *set)
|
||||
#endif /* _FILE_OFFSET_BITS != 64 */
|
||||
|
||||
data = ne_propset_value(set, &prop_names[CREATION]);
|
||||
if (!data)
|
||||
data = ne_propset_value(set, &anonymous_prop_names[CREATION]);
|
||||
if (data) {
|
||||
result->ctime = ne_iso8601_parse(data);
|
||||
if (result->ctime == (time_t) -1)
|
||||
@ -1748,6 +1766,8 @@ prop_result(void *userdata, const ne_uri *uri, const ne_prop_result_set *set)
|
||||
}
|
||||
|
||||
data = ne_propset_value(set, &prop_names[MODIFIED]);
|
||||
if (!data)
|
||||
data = ne_propset_value(set, &anonymous_prop_names[MODIFIED]);
|
||||
if (data) {
|
||||
result->mtime = ne_httpdate_parse(data);
|
||||
if (result->mtime == (time_t) -1)
|
||||
@ -1757,6 +1777,8 @@ prop_result(void *userdata, const ne_uri *uri, const ne_prop_result_set *set)
|
||||
}
|
||||
|
||||
data = ne_propset_value(set, &prop_names[EXECUTE]);
|
||||
if (!data)
|
||||
data = ne_propset_value(set, &anonymous_prop_names[EXECUTE]);
|
||||
if (!data) {
|
||||
result->is_exec = -1;
|
||||
} else if (*data == 'T') {
|
||||
|
Loading…
Reference in New Issue
Block a user