Commit 8cc944af authored by Manfred Kutas's avatar Manfred Kutas

ZP-895 Zpush::CheckAdvancedConfig() checks configured folders. More

logging in generateFolderHash().

Released under the Affero GNU General Public License (AGPL) version 3.
parent 28b4bead
......@@ -968,10 +968,10 @@ class ASDevice extends StateObject {
// until there aren't any collisions. Probably a smaller number is also sufficient.
while (in_array($folderId, $this->backend2folderidCache) && $cnt < 10000) {
$folderId = substr($folderOrigin . dechex(crc32($backendid . $folderName . $cnt++)), 0, 6);
ZLog::Write(LOGLEVEL_WARN, sprintf("ASDevice->generateFolderHash(): collision avoiding nr %05d. Generated hash: '%s'", $cnt, $folderId));
}
if ($cnt == 10000) {
ZLog::Write(LOGLEVEL_WARN, "ASDevice->generateFolderHash(): too many colissions while generating folder hash.");
if ($cnt >= 10000) {
throw new FatalException("ASDevice->generateFolderHash(): too many colissions while generating folder hash.");
}
return $folderId;
......
......@@ -368,7 +368,7 @@ class ZPush {
$folder = new SyncFolder();
$folder->BackendId = $af['folderid'];
$folder->serverid = ZPush::GetDeviceManager(true)->GetFolderIdForBackendId($folder->BackendId, true, DeviceManager::FLD_ORIGIN_SHARED, $af['name']);
$folder->serverid = ZPush::GetDeviceManager(true)->GetFolderIdForBackendId($folder->BackendId, true, DeviceManager::FLD_ORIGIN_CONFIG, $af['name']);
$folder->parentid = 0; // only top folders are supported
$folder->displayname = $af['name'];
$folder->type = $af['type'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment