summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Zeller <luz@synthesis.ch>2010-02-19 00:08:55 +0100
committerLukas Zeller <luz@synthesis.ch>2010-02-19 00:08:55 +0100
commit510a3cfd9bfd072dcaaad76f1cebaa54e8785e88 (patch)
tree12afd6dac9e642a6f8aa6b78086f5d4a0044fc86
parent6626a57e9e249b8977688e20fab05aa67f18cf78 (diff)
parentbf4be3cb15aaa6b17f76c054ccd34959b48628f2 (diff)
Merge remote branch 'moblin/master' into luz
-rwxr-xr-xsrc/syncml_tk/src/sml/lib/all/libstr.c3
-rwxr-xr-xsrc/syncml_tk/src/sml/lib/inc/libstr.h1
-rwxr-xr-xsrc/syncml_tk/src/sml/xlt/all/xltdecxml.c3
-rwxr-xr-xsrc/syncml_tk/src/sml/xlt/all/xlttags.c2
-rwxr-xr-xsrc/sysync/syncagent.cpp12
-rwxr-xr-xsrc/sysync/synccommand.cpp10
-rwxr-xr-xsrc/sysync_SDK/Sources/enginemodulebase.cpp2
-rw-r--r--src/sysync_SDK/Sources/syerror.h6
8 files changed, 30 insertions, 9 deletions
diff --git a/src/syncml_tk/src/sml/lib/all/libstr.c b/src/syncml_tk/src/sml/lib/all/libstr.c
index 6c6a31f..9224a58 100755
--- a/src/syncml_tk/src/sml/lib/all/libstr.c
+++ b/src/syncml_tk/src/sml/lib/all/libstr.c
@@ -108,6 +108,9 @@ SML_API int smlLibStrcmp(const char *pTarget, const char *pSource){
SML_API int smlLibStrncmp(const char *pTarget, const char *pSource, int count){
return strncmp((char *)pTarget, (char *)pSource, count);
}
+SML_API int smlLibStrnCasecmp(const char *pTarget, const char *pSource, int count){
+ return strncasecmp((char *)pTarget, (char *)pSource, count);
+}
SML_API String_t smlLibStrchr(const char *pString, char character){
return strchr((char *)pString, character);
}
diff --git a/src/syncml_tk/src/sml/lib/inc/libstr.h b/src/syncml_tk/src/sml/lib/inc/libstr.h
index f3ed1ed..9aba120 100755
--- a/src/syncml_tk/src/sml/lib/inc/libstr.h
+++ b/src/syncml_tk/src/sml/lib/inc/libstr.h
@@ -86,6 +86,7 @@
SML_API_DEF String_t smlLibStrcat(const char *pTarget, const char *pSource) LIB_FUNC;
SML_API_DEF int smlLibStrcmp(const char *pTarget, const char *pSource) LIB_FUNC;
SML_API_DEF int smlLibStrncmp(const char *pTarget, const char *pSource, int count) LIB_FUNC;
+ SML_API_DEF int smlLibStrnCasecmp(const char *pTarget, const char *pSource, int count) LIB_FUNC;
SML_API_DEF String_t smlLibStrchr(const char *pString, char character) LIB_FUNC;
SML_API_DEF int smlLibStrlen(const char *pString) LIB_FUNC;
#endif
diff --git a/src/syncml_tk/src/sml/xlt/all/xltdecxml.c b/src/syncml_tk/src/sml/xlt/all/xltdecxml.c
index f35b300..427bf25 100755
--- a/src/syncml_tk/src/sml/xlt/all/xltdecxml.c
+++ b/src/syncml_tk/src/sml/xlt/all/xltdecxml.c
@@ -629,7 +629,8 @@ xmlHTMLEntity(xmlScannerPrivPtr_t pScanner, MemPtr_t *begin, int *len)
{ "gt", '>' },
{ "lt", '<' },
{ "apos", '\'' },
- { "quot", '"' }
+ { "quot", '"' },
+ { "#43", '+'}
};
MemPtr_t entity = pScanner->pos + 1;
int i;
diff --git a/src/syncml_tk/src/sml/xlt/all/xlttags.c b/src/syncml_tk/src/sml/xlt/all/xlttags.c
index da3741d..52493f6 100755
--- a/src/syncml_tk/src/sml/xlt/all/xlttags.c
+++ b/src/syncml_tk/src/sml/xlt/all/xlttags.c
@@ -179,7 +179,7 @@ SmlPcdataExtension_t getExtByName(String_t ns) {
for (;dtd->ext != SML_EXT_LAST; dtd++) {
const char *dtdname=dtd->name;
if (!dtdname) continue; /* skip empty names (should not appear but better be on the safe side) */
- if (dtd->ext==SML_EXT_UNDEFINED && smlLibStrncmp("SYNCML:SYNCML",ns,13)==0) {
+ if (dtd->ext==SML_EXT_UNDEFINED && smlLibStrnCasecmp("SYNCML:SYNCML",ns,13)==0) {
// SyncML namespace is ok without checking version!
ext = SML_EXT_UNDEFINED;
break;
diff --git a/src/sysync/syncagent.cpp b/src/sysync/syncagent.cpp
index 12bb2e1..bc0f4e0 100755
--- a/src/sysync/syncagent.cpp
+++ b/src/sysync/syncagent.cpp
@@ -1164,12 +1164,14 @@ localstatus TSyncAgent::NextMessage(bool &aDone)
// prepare engine for sync (%%% new routine in 3.2.0.3, summarizing engInitForSyncOps() and
// switching to dssta_dataaccessstarted, i.e. loading sync set), but do in only once
if (!((*pos)->testState(dssta_syncsetready))) {
- // not yet started
- status = (*pos)->engInitForClientSync();
- if (status!=LOCERR_OK) {
+ // not yet started
+ status = (*pos)->engInitForClientSync();
+ if (status!=LOCERR_OK ) {
// failed
- AbortSession(status,true);
- return getAbortReasonStatus();
+ if (status!=LOCERR_DATASTORE_ABORT) {
+ AbortSession(status,true);
+ return getAbortReasonStatus();
+ }
}
}
// start or continue (which is largely nop, as continuing works via unfinished sync command)
diff --git a/src/sysync/synccommand.cpp b/src/sysync/synccommand.cpp
index aa1c94e..1892b24 100755
--- a/src/sysync/synccommand.cpp
+++ b/src/sysync/synccommand.cpp
@@ -331,6 +331,10 @@ bool TSmlCommand::handleStatus(TStatusCommand *aStatusCmdP)
fSessionP->AbortSession(412,false,statuscode); // other party's fault: incomplete command
return true; // done with command
}
+ else if (statuscode==418) {
+ POBJDEBUGPRINTFX(fSessionP,DBG_PROTO,("Status: 418: already existed on peer --> accept as ok"));
+ return true; // done with command
+ }
else if (statuscode<500) {
// originator exception (we sent some bad stuff)
POBJDEBUGPRINTFX(fSessionP,DBG_ERROR,("Status: %hd: originator exception",statuscode));
@@ -3704,7 +3708,11 @@ bool TStatusCommand::analyze(TPackageStates aPackageState)
}
#ifdef SYDEBUG
// warn if error (don't treat slow sync status or conflict indication as errors)
- if (fStatusCode>=300 && fStatusCode!=508 && fStatusCode!=419) {
+ // - 418 = item already exits: sent by Funambol server when both client and
+ // and server have a new item which is considered identical by the server
+ // (must be really identical, minor difference will lead to a merged item
+ // which is sent back to the client without the 418). See Moblin Bugzilla #4599.
+ if (fStatusCode>=300 && fStatusCode!=508 && fStatusCode!=419 && fStatusCode!=418) {
PDEBUGPRINTFX(DBG_ERROR,(
"WARNING: RECEIVED NON-OK STATUS %hd for &html;<a name=\"SO_%ld_%ld\" href=\"#IO_%ld_%ld\">&html;command '%s'&html;</a>&html; (outgoing MsgID=%ld, CmdID=%ld)",
fStatusCode,
diff --git a/src/sysync_SDK/Sources/enginemodulebase.cpp b/src/sysync_SDK/Sources/enginemodulebase.cpp
index 441e563..327294e 100755
--- a/src/sysync_SDK/Sources/enginemodulebase.cpp
+++ b/src/sysync_SDK/Sources/enginemodulebase.cpp
@@ -58,13 +58,13 @@ TSyError TEngineModuleBase::Connect( string aEngineName,
uInt16 aDebugFlags)
{
TSyError err= LOCERR_OK;
- uInt16 cbVersion= DB_Callback_Version; // use current by default
fEngineName = aEngineName;
fPrgVersion = aPrgVersion;
fDebugFlags = aDebugFlags;
#if defined SYSYNC_ENGINE || defined SYSYNC_ENGINE_TEST
+ uInt16 cbVersion= DB_Callback_Version; // use current by default
if (fCI==NULL) {
fCI = &fCIBuffer;
fCIisStatic = true;
diff --git a/src/sysync_SDK/Sources/syerror.h b/src/sysync_SDK/Sources/syerror.h
index 5072d6d..09a6f66 100644
--- a/src/sysync_SDK/Sources/syerror.h
+++ b/src/sysync_SDK/Sources/syerror.h
@@ -157,6 +157,12 @@ enum TSyErrorEnum {
LOCERR_BADURL = 20046,
/** server not found */
LOCERR_SRVNOTFOUND = 20047,
+ /**
+ * ABORTDATASTORE() parameter to flag the current datastore as bad
+ * without aborting the whole session. Exact reason for abort depends
+ * on caller of that macro.
+ */
+ LOCERR_DATASTORE_ABORT = 20048,
/** cURL error code */
LOCERR_CURL = 21000,