* Addressbook/CardDAV: fix new Thunderbird 110 could not sync big addressbooks

TB 110 does an initial PROPFIND and then requests ALL resources in a single multiget REPORT, which caused two problems:
a) enabled CalDAV/CardDAV request logging switched output-buffering on and then runs out of memory --> switching it and therefore logging off for multiget REPORTS with more then 200 resources
b) PROPFIND iterator wrongly continued running, if the not found resources together with the found ones exceeded the chunk-size of 500
This commit is contained in:
ralf 2023-02-13 22:41:57 +01:00
parent 1e7b8c260b
commit 0b86ba7a20
2 changed files with 10 additions and 4 deletions

View File

@ -248,6 +248,12 @@ class addressbook_groupdav extends Api\CalDAV\Handler
{
if (!is_array($filter[self::$path_attr])) $filter[self::$path_attr] = (array)$filter[self::$path_attr];
$requested_multiget_ids =& $filter[self::$path_attr];
// stop output buffering switched on to log the response, if we should return more than 200 entries
if (ob_get_level() && count($requested_multiget_ids) > 200)
{
ob_end_flush();
}
}
$files = array();

View File

@ -139,8 +139,8 @@ class PropfindIterator implements \Iterator
if ($this->debug) error_log(__METHOD__."() returning TRUE");
return true;
}
// check if previous query gave less then CHUNK_SIZE entries --> we're done
if ($this->start && count($this->files) < self::CHUNK_SIZE)
// check if previous query gave not equal CHUNK_SIZE entries (or the last one is a not-found entry with just path / count()===1) --> we're done
if ($this->start && (count($this->files) != self::CHUNK_SIZE || count($this->files[self::CHUNK_SIZE-1]) === 1))
{
if ($this->debug) error_log(__METHOD__."() returning FALSE (no more entries)");
return false;