server sync session: detect final sync mode, part II (BMC #2786)

testOneWayFromClient was still failing in server mode because of a
similar issue as with slow sync as fallback for refresh-from-server:
the client can ask for a two-way sync and then withhold all of its own
changes to achieve the same effect.

Detect this based on the requested sync mode.
This commit is contained in:
Patrick Ohly 2011-04-20 15:17:40 +02:00
parent feec9fffc5
commit 2587fe9382

View file

@ -1595,6 +1595,17 @@ void SyncContext::displaySourceProgress(sysync::TProgressEventEnum type,
switch (extra3) {
case 0:
mode = SYNC_TWO_WAY;
if (m_serverMode &&
m_serverAlerted &&
source.getSync() == "one-way-from-server") {
// As in the slow/refresh-from-server case below,
// pretending to do a two-way incremental sync
// is a correct way of executing the requested
// one-way sync, as long as the client doesn't
// send any of its own changes. The Synthesis
// engine does that.
mode = SYNC_ONE_WAY_FROM_SERVER;
}
break;
case 1:
mode = SYNC_ONE_WAY_FROM_SERVER;