Save member lock_expire to index file

This commit is contained in:
wbaumann 2009-06-08 19:58:22 +00:00
parent f2efbdce30
commit d3b5b34109
2 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,10 @@
ChangeLog for davfs2 ChangeLog for davfs2
-------------------- --------------------


2009-06-08 Werner Baumann (werner.baumann@onlinehome.de)
* cache.c, write_node et al:
Save member lock_expire to index file.

2009-06-07 Werner Baumann (werner.baumann@onlinehome.de) 2009-06-07 Werner Baumann (werner.baumann@onlinehome.de)
* webdav.c, prop_result: * webdav.c, prop_result:
If property not found try property without namespace. If property not found try property without namespace.

View File

@ -96,6 +96,7 @@ enum {
SMTIME, SMTIME,
ETAG, ETAG,
MIME, MIME,
LOCK_EXPIRE,
DIRTY, DIRTY,
REMOTE_EXISTS, REMOTE_EXISTS,
END END
@ -119,6 +120,7 @@ static const char* const type[] = {
[SMTIME] = "smtime", [SMTIME] = "smtime",
[ETAG] = "etag", [ETAG] = "etag",
[MIME] = "mime", [MIME] = "mime",
[LOCK_EXPIRE] = "lock_expire",
[DIRTY] = "dirty", [DIRTY] = "dirty",
[REMOTE_EXISTS] = "remote_exists", [REMOTE_EXISTS] = "remote_exists",
[END] = NULL [END] = NULL
@ -3078,6 +3080,11 @@ write_node(dav_node *node, FILE *file, const char *indent)


if (is_reg(node) && !is_backup(node) if (is_reg(node) && !is_backup(node)
&& (is_dirty(node) || is_created(node))) { && (is_dirty(node) || is_created(node))) {
lt = localtime(&node->lock_expire);
strftime(t, 64, "(%FT%T%z)", lt);
if (fprintf(file, "%s<d:%s>%li%s</d:%s>\n", ind, type[LOCK_EXPIRE],
node->lock_expire, t, type[LOCK_EXPIRE]) < 0)
return -1;
if (fprintf(file, "%s<d:%s>%i</d:%s>\n", ind, type[REMOTE_EXISTS], if (fprintf(file, "%s<d:%s>%i</d:%s>\n", ind, type[REMOTE_EXISTS],
node->remote_exists, type[REMOTE_EXISTS]) < 0) node->remote_exists, type[REMOTE_EXISTS]) < 0)
return -1; return -1;
@ -3206,6 +3213,9 @@ xml_end_date(void *userdata, int state, const char *nspace, const char *name)
case SMTIME: case SMTIME:
(*((dav_node **) userdata))->smtime = t; (*((dav_node **) userdata))->smtime = t;
break; break;
case LOCK_EXPIRE:
(*((dav_node **) userdata))->lock_expire = t;
break;
default: default:
return -1; return -1;
} }
@ -3537,6 +3547,8 @@ xml_start_date(void *userdata, int parent, const char *nspace,
ret = CTIME; ret = CTIME;
} else if (strcmp(name, type[SMTIME]) == 0) { } else if (strcmp(name, type[SMTIME]) == 0) {
ret = SMTIME; ret = SMTIME;
} else if (strcmp(name, type[LOCK_EXPIRE]) == 0) {
ret = LOCK_EXPIRE;
} else { } else {
return 0; return 0;
} }