From f7fc5055bf25f9f9f5b94f494e3a7f0657540155 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 19 Jun 2012 11:35:29 +0200 Subject: CtCap: Funambol workaround Reduce number of non-standard sync modes in SyncCap by one if possible, to stay below what looks like a hard-coded limit for the number of SyncCap entries in the Funambol OneMedia server. --- src/sysync/localengineds.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/sysync/localengineds.cpp b/src/sysync/localengineds.cpp index 15a8d48..095b327 100644 --- a/src/sysync/localengineds.cpp +++ b/src/sysync/localengineds.cpp @@ -3807,13 +3807,12 @@ SmlDevInfSyncCapPtr_t TLocalEngineDS::newDevInfSyncCap(uInt32 aSyncCapMask) // if (!IS_SERVER || fSessionP->receivedSyncModeExtensions()) { + bool extended=false; if (canRestart()) { synctypeP=newPCDataString("390001"); addPCDataToList(synctypeP,&(synccapP->synctype)); + extended=true; } - synctypeP=newPCDataString("390002"); - addPCDataToList(synctypeP,&(synccapP->synctype)); - // Finally add non-standard synccaps that are outside of the // engine's control. set modes; @@ -3823,6 +3822,22 @@ SmlDevInfSyncCapPtr_t TLocalEngineDS::newDevInfSyncCap(uInt32 aSyncCapMask) ++it) { synctypeP=newPCDataString(*it); addPCDataToList(synctypeP,&(synccapP->synctype)); + extended=true; + } + + // Add fake mode to signal peer that we support extensions. + // Otherwise a server won't send them, to avoid breaking + // client's (like Nokia phones) which don't. + // + // Don't send the fake mode unnecessarily (= when some other + // non-standard modes where already added), because Funambol seems + // to have a hard-coded limit of 9 entries in the and + // complains with a 513 internal server error (when using WBXML) + // or a 'Expected "CTCap" end tag, found "CTType" end tag' (when + // using XML). + if (!extended) { + synctypeP=newPCDataString("390002"); + addPCDataToList(synctypeP,&(synccapP->synctype)); } } -- cgit v1.2.3