Commit ed5e7310 authored by skummer's avatar skummer

ZP-170

- fixed: make sure that all incoming changes are read from the stream even if the status indicates a problem so the process can cleanly terminate

git-svn-id: https://z-push.org/svn/z-push/trunk@1374 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent f4bccba4
...@@ -390,11 +390,6 @@ class Sync extends RequestProcessor { ...@@ -390,11 +390,6 @@ class Sync extends RequestProcessor {
else else
$message = false; $message = false;
if ($status != SYNC_STATUS_SUCCESS) {
ZLog::Write(LOGLEVEL_WARN, "Ignored incoming change, global status indicates problem.");
continue;
}
switch($element[EN_TAG]) { switch($element[EN_TAG]) {
case SYNC_FETCH: case SYNC_FETCH:
array_push($actiondata["fetchids"], $serverid); array_push($actiondata["fetchids"], $serverid);
...@@ -406,6 +401,8 @@ class Sync extends RequestProcessor { ...@@ -406,6 +401,8 @@ class Sync extends RequestProcessor {
if ($status == SYNC_STATUS_SUCCESS) if ($status == SYNC_STATUS_SUCCESS)
$this->importMessage($spa, $actiondata, $element[EN_TAG], $message, $clientid, $serverid); $this->importMessage($spa, $actiondata, $element[EN_TAG], $message, $clientid, $serverid);
else
ZLog::Write(LOGLEVEL_WARN, "Ignored incoming change, global status indicates problem.");
break; break;
} }
...@@ -969,7 +966,7 @@ class Sync extends RequestProcessor { ...@@ -969,7 +966,7 @@ class Sync extends RequestProcessor {
throw new StatusException(sprintf("Sync->getImporter(): no importer for folder id '%s'", $spa->GetFolderId()), SYNC_STATUS_FOLDERHIERARCHYCHANGED); throw new StatusException(sprintf("Sync->getImporter(): no importer for folder id '%s'", $spa->GetFolderId()), SYNC_STATUS_FOLDERHIERARCHYCHANGED);
// if there is a valid state obtained after importing changes in a previous loop, we use that state // if there is a valid state obtained after importing changes in a previous loop, we use that state
if ($actiondata["failstate"] && isset($actiondata["failstate"]["failedsyncstate"])) { if (isset($actiondata["failstate"]) && isset($actiondata["failstate"]["failedsyncstate"])) {
$this->importer->Config($actiondata["failstate"]["failedsyncstate"], $spa->GetConflict()); $this->importer->Config($actiondata["failstate"]["failedsyncstate"], $spa->GetConflict());
} }
else else
......
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