Add more tolerance for chunked packages

This commit is contained in:
Jörg Lehrke 2010-05-14 13:06:08 +00:00
parent 5623866894
commit 11093e933c
2 changed files with 4 additions and 6 deletions

View File

@ -212,9 +212,8 @@ class Horde_SyncML_Sync {
$contentSize = strlen($syncItem->_content); $contentSize = strlen($syncItem->_content);
if ((($size = $syncItem->getContentSize()) !== false) && if ((($size = $syncItem->getContentSize()) !== false) &&
($contentSize != $size) && abs($contentSize - $size) > 3) {
($contentSize + 1 != $size)) { Horde::logMessage('SyncML: content size mismatch for LocURI '
Horde::logMessage('SyncML: content size missmatch for LocURI '
. $syncItem->getLocURI() . ": $contentSize ($size)", . $syncItem->getLocURI() . ": $contentSize ($size)",
__FILE__, __LINE__, PEAR_LOG_ERROR); __FILE__, __LINE__, PEAR_LOG_ERROR);
$command->setStatus(RESPONSE_SIZE_MISMATCH); $command->setStatus(RESPONSE_SIZE_MISMATCH);

View File

@ -225,9 +225,8 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync {
$contentSize = strlen($syncItem->_content); $contentSize = strlen($syncItem->_content);
if ((($size = $syncItem->getContentSize()) !== false) && if ((($size = $syncItem->getContentSize()) !== false) &&
($contentSize != $size) && abs($contentSize - $size) > 3) {
($contentSize + 1 != $size)) { Horde::logMessage('SyncML: content size mismatch for LocURI ' . $syncItem->_luid .
Horde::logMessage('SyncML: content size missmatch for LocURI ' . $syncItem->_luid .
": $contentSize ($size)", __FILE__, __LINE__, PEAR_LOG_ERROR); ": $contentSize ($size)", __FILE__, __LINE__, PEAR_LOG_ERROR);
$command->setStatus(RESPONSE_SIZE_MISMATCH); $command->setStatus(RESPONSE_SIZE_MISMATCH);
return; return;