On Wed, 2009-11-25 at 02:34 +0000, Chen, Congwu wrote:
> The solution I think of is:
> 1) Don't init the engine until we reliably know this is a server session or 
> client session (lost some logging capabilities)
> Or
> 2) Move these routines (those need to be done before we finally detect this 
> is a server or client session) to another function, so that leaving this 
> function will automatically destruct the underlying SharedEngine and 
> reinitialize the real engine afterwards.

I've had another look at this, because instantiating the engine twice
still has drawbacks (not so nice HTML log, overhead).

Wouldn't it work to simply move this part before the first instantiation
of the engine:
    if ( getPeerIsClient()) {
        m_serverMode = true;
    }

Then we can revert the "presync" patch and avoid instantiating the
engine anew, because it will be already the right one.

There's also a related TODO remark in DBusServer::startSession():
// TODO: how do we decide whether this is a client or server session?

I think this has become obsolete, because the Session instance supports
both the same way and the SyncContext can decide for itself what it has
to do when asked to sync.


-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to