summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-06-19 11:35:29 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2012-06-19 11:35:29 +0200
commitf7fc5055bf25f9f9f5b94f494e3a7f0657540155 (patch)
tree24885017b80fbadf008331ede9d71a20606b6d67
parentde5472173258d0923b7425e3c25599de8e0c878e (diff)
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.
-rw-r--r--src/sysync/localengineds.cpp21
1 files 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<string> 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 <SyncCap> 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));
}
}