diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php index 1e4ff612f0..6eb923714c 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php @@ -26,6 +26,7 @@ class Horde_SyncML_Command_Sync_SyncElement extends Horde_SyncML_Command { var $_status = RESPONSE_OK; var $_curItem; var $_items = array(); + var $_failed = array(); var $_moreData = false; var $_command = false; @@ -101,15 +102,24 @@ class Horde_SyncML_Command_Sync_SyncElement extends Horde_SyncML_Command { $state->curSyncItem = &$this->_curItem; Horde::logMessage('SyncML: moreData item saved for LocURI ' . $this->_curItem->_luid, __FILE__, __LINE__, PEAR_LOG_DEBUG); } else { - if (strtolower($this->_curItem->getContentFormat()) == 'b64') { - $content = $this->_curItem->getContent(); - $content = ($content ? base64_decode($content) : ''); - $this->_curItem->setContent($content); - #Horde::logMessage('SyncML: BASE64 encoded item for LocURI ' - # . $this->_curItem->_luid . ":\n $content", __FILE__, __LINE__, PEAR_LOG_DEBUG); + $content = $this->_curItem->getContent(); + $contentSize = strlen($content); + if ((($size = $this->_curItem->getContentSize()) !== false) && + abs($contentSize - $size) > 3) { + Horde::logMessage('SyncML: content size mismatch for LocURI ' . $this->_luid . + ": $contentSize ($size) : " . $content, + __FILE__, __LINE__, PEAR_LOG_WARNING); + $this->_failed[$this->_luid] = $this->_curItem; + } else { + if (strtolower($this->_curItem->getContentFormat()) == 'b64') { + $content = ($content ? base64_decode($content) : ''); + $this->_curItem->setContent($content); + #Horde::logMessage('SyncML: BASE64 encoded item for LocURI ' + # . $this->_curItem->_luid . ":\n $content", __FILE__, __LINE__, PEAR_LOG_DEBUG); + } + #Horde::logMessage('SyncML: Data for ' . $this->_luid . ': ' . $this->_curItem->getContent(), __FILE__, __LINE__, PEAR_LOG_DEBUG); + $this->_items[$this->_luid] = $this->_curItem; } - #Horde::logMessage('SyncML: Data for ' . $this->_luid . ': ' . $this->_curItem->getContent(), __FILE__, __LINE__, PEAR_LOG_DEBUG); - $this->_items[$this->_luid] = $this->_curItem; } } unset($this->_contentSize); @@ -167,6 +177,10 @@ class Horde_SyncML_Command_Sync_SyncElement extends Horde_SyncML_Command { function getSyncElementItems() { return (array)$this->_items; } + + function getSyncElementFailures() { + return (array)$this->_failed; + } function getLocURI() { diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync.php index 5576f996f6..128a08dc69 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync.php @@ -209,16 +209,6 @@ class Horde_SyncML_Sync { $guid = false; - $contentSize = strlen($syncItem->_content); - if ((($size = $syncItem->getContentSize()) !== false) && - abs($contentSize - $size) > 3) { - Horde::logMessage('SyncML: content size mismatch for LocURI ' . $syncItem->_luid . - ": $contentSize ($size) : " . $syncItem->_content, - __FILE__, __LINE__, PEAR_LOG_WARNING); - //$command->setStatus(RESPONSE_SIZE_MISMATCH); - continue; - } - if (is_a($command, 'Horde_SyncML_Command_Sync_Add')) { if ($sync_conflicts > CONFLICT_RESOLVED_WITH_DUPLICATE) { // We enforce the client not to change anything diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php index d4cc0a59ad..0a48dde77b 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php @@ -217,16 +217,6 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync { foreach($syncElementItems as $syncItem) { - $contentSize = strlen($syncItem->_content); - if ((($size = $syncItem->getContentSize()) !== false) && - abs($contentSize - $size) > 3) { - Horde::logMessage('SyncML: content size mismatch for LocURI ' . $syncItem->_luid . - ": $contentSize ($size) : " . $syncItem->_content, - __FILE__, __LINE__, PEAR_LOG_WARNING); - //$command->setStatus(RESPONSE_SIZE_MISMATCH); - continue; - } - if(!$contentType = $syncItem->getContentType()) { $contentType = $state->getPreferedContentType($type); }