Check for all no-temporary errors on USERINFO

This commit is contained in:
wbaumann 2011-12-18 15:39:52 +00:00
parent 0d5eee4626
commit 1fd39b4739
4 changed files with 19 additions and 8 deletions

View File

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

2011-12-18 Werner Baumann (werner.baumann@onlinehome.de)
* webdav.c, dav_quota:
Check for all but temporary errors on USERINFO.
* dav_fuse.c, fuse_stat:
dav_coda.c, coda_statfs:
Return ENOSYS if dav_statfs fails (this should never
happen).

2011-06-29 Werner Baumann (werner.baumann@onlinehome.de)
* mount_davfs.c, mount_davfs.h:
Check for relative mount point.

View File

@ -691,7 +691,7 @@ coda_statfs(void)

dav_stat *st = dav_statfs();
if (!st) {
oh->result = EIO;
oh->result = ENOSYS;
return sizeof(struct coda_out_hdr);
}


View File

@ -980,7 +980,7 @@ fuse_stat(void)

dav_stat *st = dav_statfs();
if (!st) {
oh->error = -EIO;
oh->error = -ENOSYS;
return sizeof(struct fuse_out_header);
}


View File

@ -1136,6 +1136,9 @@ dav_quota(const char *path, off64_t *total, off64_t *used)
static int use_rfc = 1;
static int use_userinfo = 1;

if (!use_rfc && !use_userinfo)
return EIO;

quota_context ctx;
ctx.error = 0;
ctx.total = 0;
@ -1159,16 +1162,16 @@ dav_quota(const char *path, off64_t *total, off64_t *used)

if (ret && use_userinfo) {
ctx.error = 0;
ne_request *req = ne_request_create(session, "USERINFO", spath);
ne_add_response_body_reader(req, ne_accept_2xx, quota_reader, &ctx);
ret = ne_request_dispatch(req);
ret = get_error(ret, "USERINFO");
ne_request_destroy(req);
ne_request *req = ne_request_create(session, "USERINFO", spath);
ne_add_response_body_reader(req, ne_accept_2xx, quota_reader, &ctx);
ret = ne_request_dispatch(req);
ret = get_error(ret, "USERINFO");
ne_request_destroy(req);

if (!ret) {
if (ctx.error)
ret = EIO;
} else if (ret == EINVAL) {
} else if (ret != EAGAIN) {
use_userinfo = 0;
}
}