Commit ee966766 authored by sebastian's avatar sebastian

ZP-623 #comment log folderid and number of remove requests

git-svn-id: https://z-push.org/svn/z-push/trunk@1970 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 8155628f
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* Created : 14.02.2011 * Created : 14.02.2011
* *
* Copyright 2007 - 2013 Zarafa Deutschland GmbH * Copyright 2007 - 2013, 2015 Zarafa Deutschland GmbH
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3, * it under the terms of the GNU Affero General Public License, version 3,
...@@ -210,7 +210,7 @@ class ExportChangesICS implements IExportChanges{ ...@@ -210,7 +210,7 @@ class ExportChangesICS implements IExportChanges{
throw new StatusException("ExportChangesICS->InitializeExporter(): Error, exporter or essential data not available", SYNC_FSSTATUS_CODEUNKNOWN, null, LOGLEVEL_ERROR); throw new StatusException("ExportChangesICS->InitializeExporter(): Error, exporter or essential data not available", SYNC_FSSTATUS_CODEUNKNOWN, null, LOGLEVEL_ERROR);
// PHP wrapper // PHP wrapper
$phpwrapper = new PHPWrapper($this->session, $this->store, $importer); $phpwrapper = new PHPWrapper($this->session, $this->store, $importer, $this->folderid);
// with a folderid we are going to get content // with a folderid we are going to get content
if($this->folderid) { if($this->folderid) {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* Created : 14.02.2011 * Created : 14.02.2011
* *
* Copyright 2007 - 2013 Zarafa Deutschland GmbH * Copyright 2007 - 2015 Zarafa Deutschland GmbH
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3, * it under the terms of the GNU Affero General Public License, version 3,
...@@ -59,6 +59,7 @@ class PHPWrapper { ...@@ -59,6 +59,7 @@ class PHPWrapper {
private $mapiprovider; private $mapiprovider;
private $store; private $store;
private $contentparameters; private $contentparameters;
private $folderid;
/** /**
...@@ -66,15 +67,17 @@ class PHPWrapper { ...@@ -66,15 +67,17 @@ class PHPWrapper {
* *
* @param ressource $session * @param ressource $session
* @param ressource $store * @param ressource $store
* @param IImportChanges $importer incoming changes from ICS are forwarded here * @param IImportChanges $importer incoming changes from ICS are forwarded here.
* @param string $folderid the folder this wrapper was configured for.
* *
* @access public * @access public
* @return * @return
*/ */
public function PHPWrapper($session, $store, $importer) { public function PHPWrapper($session, $store, $importer, $folderid) {
$this->importer = &$importer; $this->importer = &$importer;
$this->store = $store; $this->store = $store;
$this->mapiprovider = new MAPIProvider($session, $this->store); $this->mapiprovider = new MAPIProvider($session, $this->store);
$this->folderid = $folderid;
} }
/** /**
...@@ -157,8 +160,12 @@ class PHPWrapper { ...@@ -157,8 +160,12 @@ class PHPWrapper {
* @return * @return
*/ */
public function ImportMessageDeletion($flags, $sourcekeys) { public function ImportMessageDeletion($flags, $sourcekeys) {
if (count($sourcekeys) > 1000) { $amount = count($sourcekeys);
throw new StatusException("ImportChangesICS->ImportMessageDeletion(): Detected more than 1000 remove requests from ICS. Triggering folder re-sync.", SYNC_STATUS_INVALIDSYNCKEY, null, LOGLEVEL_ERROR); if ($amount > 1000) {
throw new StatusException(sprintf("ImportChangesICS->ImportMessageDeletion(): Received %d remove requests from ICS for folder '%s' (max. 1000 allowed). Triggering folder re-sync.", $amount, bin2hex($this->folderid)), SYNC_STATUS_INVALIDSYNCKEY, null, LOGLEVEL_ERROR);
}
else {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ImportChangesICS->ImportMessageDeletion(): Received %d remove requests from ICS", $amount));
} }
foreach($sourcekeys as $sourcekey) { foreach($sourcekeys as $sourcekey) {
$this->importer->ImportMessageDeletion(bin2hex($sourcekey)); $this->importer->ImportMessageDeletion(bin2hex($sourcekey));
......
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