Merge pull request #9174 from nextcloud/dav-free-space-message

log more information about insufficient storage in dav plugin
This commit is contained in:
Morris Jobke 2018-04-17 23:01:01 +02:00 committed by GitHub
commit 13d21f5989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -166,11 +166,11 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
$path = rtrim($parentPath, '/') . '/' . $info['name'];
}
$freeSpace = $this->getFreeSpace($path);
if ($freeSpace !== FileInfo::SPACE_UNKNOWN && $freeSpace !== FileInfo::SPACE_UNLIMITED && $length > $freeSpace) {
if ($freeSpace >= 0 && $length > $freeSpace) {
if (isset($chunkHandler)) {
$chunkHandler->cleanup();
}
throw new InsufficientStorage();
throw new InsufficientStorage("Insufficient space in $path, $length required, $freeSpace available");
}
}
return true;