summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-11-01 11:54:31 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2012-11-01 11:54:31 +0100
commitf0bd9cd1d7924bd60c56822159a1aa423a2f0a2a (patch)
tree2173dab47fafc65e8b71b32fc391e5cc396d44a2
parent554cd8cb16910f69b8915bad9dd5dcc7091e7bb2 (diff)
parent25687680a8dd8e0aca781d99add42b47f6457fda (diff)
Merge tag 'libsynthesis_3.4.0.45' into pbaplibsynthesis_3.4.0.45+syncevolution-1-3-99-2
-rw-r--r--Synthesis_AG_Contributor_Agreement.docbin41472 -> 0 bytes
-rw-r--r--Synthesis_AG_Contributor_Agreement.pdfbin55375 -> 0 bytes
-rw-r--r--configure.in2
-rw-r--r--libsynthesis_contributor_agreement.docbin0 -> 43008 bytes
-rw-r--r--libsynthesis_contributor_agreement.pagesbin0 -> 216055 bytes
-rw-r--r--libsynthesis_contributor_agreement.pdfbin0 -> 60889 bytes
-rwxr-xr-xsrc/DB_interfaces/api_db/pluginapids.cpp8
-rw-r--r--src/DB_interfaces/odbc_db/odbcapiagent.cpp4
-rw-r--r--src/Targets/ReleasedProducts/clientEngine_opensource_ios/target_options.h2
-rw-r--r--src/Targets/ReleasedProducts/combiEngine_opensource_ios/target_options.h2
-rw-r--r--src/global_options.h4
-rw-r--r--src/platform_adapters/macosx/configfiles.mm33
-rwxr-xr-xsrc/syncml_tk/src/sml/xlt/all/xltmetinf.c48
-rwxr-xr-xsrc/sysync/binfileimplclient.cpp5
-rwxr-xr-xsrc/sysync/binfileimplds.cpp2
-rwxr-xr-xsrc/sysync/configelement.cpp4
-rwxr-xr-xsrc/sysync/customimplds.cpp8
-rwxr-xr-xsrc/sysync/debuglogger.cpp4
-rw-r--r--src/sysync/itemfield.cpp8
-rw-r--r--src/sysync/mimedirprofile.cpp6
-rwxr-xr-xsrc/sysync/scriptcontext.cpp4
-rw-r--r--src/sysync/stdlogicds.cpp29
-rwxr-xr-xsrc/sysync/syncagent.cpp67
-rwxr-xr-xsrc/sysync/syncagent.h1
-rwxr-xr-xsrc/sysync/sysync_debug.h46
-rwxr-xr-xsrc/sysync/timezones.cpp6
-rwxr-xr-xsrc/sysync_SDK/Sources/lineartime.cpp6
-rw-r--r--src/sysync_SDK/sdk_sources_cocoa/SyncEngine.m16
-rw-r--r--src/sysync_ios.xcodeproj/project.pbxproj10
-rw-r--r--src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_clientEngine_opensource_ios.xcscheme2
-rw-r--r--src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_combiEngine_opensource_ios.xcscheme6
31 files changed, 213 insertions, 120 deletions
diff --git a/Synthesis_AG_Contributor_Agreement.doc b/Synthesis_AG_Contributor_Agreement.doc
deleted file mode 100644
index 870e644..0000000
--- a/Synthesis_AG_Contributor_Agreement.doc
+++ /dev/null
Binary files differ
diff --git a/Synthesis_AG_Contributor_Agreement.pdf b/Synthesis_AG_Contributor_Agreement.pdf
deleted file mode 100644
index 1742fc4..0000000
--- a/Synthesis_AG_Contributor_Agreement.pdf
+++ /dev/null
Binary files differ
diff --git a/configure.in b/configure.in
index 32fa121..bbd6274 100644
--- a/configure.in
+++ b/configure.in
@@ -28,7 +28,7 @@ PIC_CXXFLAGS="$lt_prog_compiler_pic_CXX"
AC_SUBST(PIC_CXXFLAGS)
AC_ARG_ENABLE(debug-logs,
- AS_HELP_STRING([--debug-logs],
+ AS_HELP_STRING([--enable-debug-logs],
[For developers: add links to call location to HTML log files. Depends on Doxygen (for HTML version of source) and g++ (for __PRETTY_FUNCTION__).]),
enable_debug_logs="$enableval", enable_debug_logs="no")
if test "$enable_debug_logs" = "yes"; then
diff --git a/libsynthesis_contributor_agreement.doc b/libsynthesis_contributor_agreement.doc
new file mode 100644
index 0000000..d4aef97
--- /dev/null
+++ b/libsynthesis_contributor_agreement.doc
Binary files differ
diff --git a/libsynthesis_contributor_agreement.pages b/libsynthesis_contributor_agreement.pages
new file mode 100644
index 0000000..e9cd0c8
--- /dev/null
+++ b/libsynthesis_contributor_agreement.pages
Binary files differ
diff --git a/libsynthesis_contributor_agreement.pdf b/libsynthesis_contributor_agreement.pdf
new file mode 100644
index 0000000..e4a23df
--- /dev/null
+++ b/libsynthesis_contributor_agreement.pdf
Binary files differ
diff --git a/src/DB_interfaces/api_db/pluginapids.cpp b/src/DB_interfaces/api_db/pluginapids.cpp
index 334d242..0540a28 100755
--- a/src/DB_interfaces/api_db/pluginapids.cpp
+++ b/src/DB_interfaces/api_db/pluginapids.cpp
@@ -401,7 +401,7 @@ bool TPluginApiDS::storeField(
if (paramScan(aParams,"TZNAME",s)) {
// convert to time zone context
timecontext_t tctx;
- TimeZoneNameToContext(s.c_str(), tctx, tsfP->getGZones());
+ TimeZoneNameToContext(s.c_str(), tctx, tsfP->getGZones(), true);
tsfP->moveToContext(tctx, true); // move to new context, bind floating (and float fixed, if TZNAME=FLOATING)
}
}
@@ -1404,8 +1404,12 @@ bool TPluginApiDS::dsFinalizeLocalID(string &aLocalID)
#ifndef SDK_ONLY_SUPPORT
// only handle here if we are in charge - otherwise let ancestor handle it
if (!fDBApi_Data.Created()) return inherited::dsFinalizeLocalID(aLocalID);
+ #else
+ // still check for DBAPi to be ready at this point, because when peer messes up protocol, we
+ // can get here before the datastore has been initialized at all
+ if (!fDBApi_Data.Created()) return false; // no dataset loaded -> all localids are final (from last session)
#endif
-
+
TDB_Api_Str finalizedID;
localstatus sta = fDBApi_Data.FinalizeLocalID(aLocalID.c_str(),finalizedID);
if (sta==LOCERR_OK && !finalizedID.empty()) {
diff --git a/src/DB_interfaces/odbc_db/odbcapiagent.cpp b/src/DB_interfaces/odbc_db/odbcapiagent.cpp
index 86dc364..c2983b8 100644
--- a/src/DB_interfaces/odbc_db/odbcapiagent.cpp
+++ b/src/DB_interfaces/odbc_db/odbcapiagent.cpp
@@ -2560,7 +2560,7 @@ bool TODBCApiAgent::getColumnValueAsField(
notnull=getColumnValueAsString(aStatement,aColIndex,val,aDataCharSet, lem_cstr);
if (!notnull) goto assignzone; // assign TCTX_UNKNOWN
// convert to context
- TimeZoneNameToContext(val.c_str(), tctx, getSessionZones());
+ TimeZoneNameToContext(val.c_str(), tctx, getSessionZones(), true);
goto assignzone;
assignoffs:
tctx = TCTX_MINOFFSET(moffs);
@@ -3145,7 +3145,7 @@ bool TODBCApiAgent::getSQLiteColValueAsField(
// get zone name as string
appendStringAsUTF8((const char *)sqlite3_column_text(aStatement,aColIndex), val, aDataCharSet, lem_cstr);
// convert to context
- TimeZoneNameToContext(val.c_str(), tctx, getSessionZones());
+ TimeZoneNameToContext(val.c_str(), tctx, getSessionZones(), true);
goto assignzone;
assignoffs:
tctx = TCTX_MINOFFSET(moffs);
diff --git a/src/Targets/ReleasedProducts/clientEngine_opensource_ios/target_options.h b/src/Targets/ReleasedProducts/clientEngine_opensource_ios/target_options.h
index 694bbfb..3430f61 100644
--- a/src/Targets/ReleasedProducts/clientEngine_opensource_ios/target_options.h
+++ b/src/Targets/ReleasedProducts/clientEngine_opensource_ios/target_options.h
@@ -17,7 +17,7 @@
#if !DEBUG
#define RELEASE_VERSION
#endif
-#define RELEASE_SYDEBUG 2 // extended DBG included
+#define RELEASE_SYDEBUG 1 // no extended DBG included
//#define OPTIONAL_SYDEBUG 1
// Eval limit options
diff --git a/src/Targets/ReleasedProducts/combiEngine_opensource_ios/target_options.h b/src/Targets/ReleasedProducts/combiEngine_opensource_ios/target_options.h
index 214c41b..eebbf4a 100644
--- a/src/Targets/ReleasedProducts/combiEngine_opensource_ios/target_options.h
+++ b/src/Targets/ReleasedProducts/combiEngine_opensource_ios/target_options.h
@@ -17,7 +17,7 @@
#if !DEBUG
#define RELEASE_VERSION
#endif
-#define RELEASE_SYDEBUG 2 // extended DBG included
+#define RELEASE_SYDEBUG 1 // no extended DBG included
//#define OPTIONAL_SYDEBUG 1
// Eval limit options
diff --git a/src/global_options.h b/src/global_options.h
index 5013de1..a07ec3e 100644
--- a/src/global_options.h
+++ b/src/global_options.h
@@ -76,8 +76,8 @@
#endif
#ifndef SYSYNC_BUILDNUMBER
-#define SYSYNC_BUILDNUMBER 41
-#define SYSYNC_BUILDNUMBER_TXT "41"
+#define SYSYNC_BUILDNUMBER 45
+#define SYSYNC_BUILDNUMBER_TXT "45"
#endif
diff --git a/src/platform_adapters/macosx/configfiles.mm b/src/platform_adapters/macosx/configfiles.mm
index d8f1140..7e25099 100644
--- a/src/platform_adapters/macosx/configfiles.mm
+++ b/src/platform_adapters/macosx/configfiles.mm
@@ -320,15 +320,40 @@ lineartime_t getFileModificationDate(const char *aFileName)
#ifdef MOBOSX
-// iPhone
+// iOS
// get local device URI/ID
bool getLocalDeviceID(string &aURI)
{
UIDevice *theDevice = [UIDevice currentDevice];
- // Obtain unique ID
- aURI = [theDevice.uniqueIdentifier UTF8String];
- return true;
+ NSString *deviceID = nil;
+ #ifdef __IPHONE_6_0
+ if ([theDevice respondsToSelector:@selector(identifierForVendor)]) {
+ // iOS 6 style identifier
+ NSUUID *ifv = [theDevice identifierForVendor];
+ if (ifv) {
+ deviceID = [ifv UUIDString];
+ if (deviceID && [deviceID isEqualToString:@"00000000-0000-0000-0000-000000000000"]) {
+ deviceID = nil; // not valid, forget it!
+ }
+ }
+ }
+ #endif
+ if (deviceID==nil) {
+ // Obtain old-style unique ID, in disguise because we should not use it any more
+ // "uniqueIdentifier"
+ SEL uiSEL = NSSelectorFromString([NSString stringWithFormat:@"un%c%cu%1xI%2xnti%1xier",'i','q',0x0E,0xDE,0x0F]);
+ deviceID = [theDevice performSelector:uiSEL];
+ }
+ // now return if ok
+ if (deviceID) {
+ aURI = [deviceID UTF8String];
+ return true;
+ }
+ else {
+ aURI = "iOSDev-without-unique-ID";
+ return false; // no unique device ID
+ }
} // getLocalDeviceID
#else
diff --git a/src/syncml_tk/src/sml/xlt/all/xltmetinf.c b/src/syncml_tk/src/sml/xlt/all/xltmetinf.c
index f37a470..8d88c44 100755
--- a/src/syncml_tk/src/sml/xlt/all/xltmetinf.c
+++ b/src/syncml_tk/src/sml/xlt/all/xltmetinf.c
@@ -74,7 +74,7 @@ Ret_t buildMetInfAnchorCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
pScanner = pDecoder->scanner;
if (*ppElem != NULL)
- return SML_ERR_XLT_INVAL_SYNCML_DOC;
+ return SML_DECODEERROR(SML_ERR_XLT_INVAL_SYNCML_DOC,pScanner,"buildMetInfAnchorCmd");
if ((pAnchor = (SmlMetInfAnchorPtr_t)smlLibMalloc(sizeof(SmlMetInfAnchor_t))) == NULL)
return SML_ERR_NOT_ENOUGH_SPACE;
@@ -101,7 +101,7 @@ Ret_t buildMetInfAnchorCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
rc = buildPCData(pDecoder, (VoidPtr_t)&pAnchor->next);
break;
default:
- rc = SML_ERR_XLT_INVAL_SYNCML_DOC;
+ rc = SML_DECODEERROR(SML_ERR_XLT_INVAL_SYNCML_DOC,pScanner,"buildMetInfAnchorCmd_2");
}
if (rc != SML_ERR_OK) {
smlFreeMetinfAnchor(pAnchor);
@@ -119,6 +119,37 @@ Ret_t buildMetInfAnchorCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
return SML_ERR_OK;
}
+Ret_t buildMetinfNextCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
+ XltDecScannerPtr_t pScanner;
+ SmlMetInfAnchorPtr_t pAnchor;
+ Ret_t rc;
+
+ pScanner = pDecoder->scanner;
+
+ if (*ppElem == NULL) {
+ if ((pAnchor = (SmlMetInfAnchorPtr_t)smlLibMalloc(sizeof(SmlMetInfAnchor_t))) == NULL)
+ return SML_ERR_NOT_ENOUGH_SPACE;
+ smlLibMemset(pAnchor, 0, sizeof(SmlMetInfAnchor_t));
+ } else {
+ pAnchor = (SmlMetInfAnchorPtr_t)*ppElem;
+ if (pAnchor->next != NULL)
+ return SML_ERR_XLT_INVAL_SYNCML_DOC;
+ }
+
+ rc = buildPCData(pDecoder, (VoidPtr_t)&pAnchor->next);
+
+ if (rc != SML_ERR_OK && ppElem == NULL) {
+ smlFreeMetinfAnchor(pAnchor);
+ return rc;
+ }
+
+ if (ppElem == NULL) {
+ *ppElem = pAnchor;
+ }
+
+ return SML_ERR_OK;
+}
+
Ret_t buildMetInfMemCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
XltDecScannerPtr_t pScanner;
SmlMetInfMemPtr_t pMem;
@@ -127,7 +158,7 @@ Ret_t buildMetInfMemCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
pScanner = pDecoder->scanner;
if (*ppElem != NULL)
- return SML_ERR_XLT_INVAL_SYNCML_DOC;
+ return SML_DECODEERROR(SML_ERR_XLT_INVAL_SYNCML_DOC, pScanner, "buildMetInfMemCmd");
if ((pMem = (SmlMetInfMemPtr_t)smlLibMalloc(sizeof(SmlMetInfMem_t))) == NULL)
return SML_ERR_NOT_ENOUGH_SPACE;
@@ -166,7 +197,7 @@ Ret_t buildMetInfMemCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
break;
default:
- rc = SML_ERR_XLT_INVAL_SYNCML_DOC;
+ rc = SML_DECODEERROR(SML_ERR_XLT_INVAL_SYNCML_DOC, pScanner, "buildMetInfMemCmd_2");
}
if (rc != SML_ERR_OK) {
smlFreeMetinfMem(pMem);
@@ -193,7 +224,7 @@ Ret_t buildMetInfMetInfCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
pScanner = pDecoder->scanner;
if (*ppElem != NULL)
- return SML_ERR_XLT_INVAL_SYNCML_DOC;
+ return SML_DECODEERROR(SML_ERR_XLT_INVAL_SYNCML_DOC, pScanner, "buildMetInfMetInfCmd");
if ((pMeta = (SmlMetInfMetInfPtr_t)smlLibMalloc(sizeof(SmlMetInfMetInf_t))) == NULL)
return SML_ERR_NOT_ENOUGH_SPACE;
@@ -256,8 +287,13 @@ Ret_t buildMetInfMetInfCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem) {
rc = buildEmptyTag(pDecoder); // allow for <tag></tag> instead of <tag/>
break;
+ /* Next without Anchor, Andris Pavenis 2012-05-29 */
+ case TN_METINF_NEXT:
+ rc = buildMetinfNextCmd(pDecoder, (VoidPtr_t)&pMeta->anchor);
+ break;
+
default:
- rc = SML_ERR_XLT_INVAL_SYNCML_DOC;
+ rc = SML_DECODEERROR(SML_ERR_XLT_INVAL_SYNCML_DOC, pScanner, "buildMetInfMetInfCmd_2");
}
if (rc != SML_ERR_OK) {
smlFreeMetinfMetinf(pMeta);
diff --git a/src/sysync/binfileimplclient.cpp b/src/sysync/binfileimplclient.cpp
index 29c243a..bf803d1 100755
--- a/src/sysync/binfileimplclient.cpp
+++ b/src/sysync/binfileimplclient.cpp
@@ -1921,7 +1921,8 @@ bool TBinfileClientConfig::deleteProfile(sInt32 aProfileIndex)
if (fProfileBinFile.getNumRecords()==0) {
// last profile deleted, remove file itself to clean up as much as possible
fProfileBinFile.closeAndDelete();
- fProfileBinFile.open(); // re-open = re-create
+ // re-create
+ fProfileBinFile.create(sizeof(TBinfileDBSyncProfile),0,NULL,true);
}
else {
// make sure header is up to date (in case we terminate improperly)
@@ -2298,7 +2299,7 @@ bool TBinfileClientConfig::deleteTarget(
if (fTargetsBinFile.getNumRecords()==0) {
// last target deleted, remove file itself to clean up as much as possible
fTargetsBinFile.closeAndDelete();
- fTargetsBinFile.open(); // re-open = re-create
+ fTargetsBinFile.create(sizeof(TBinfileDBSyncTarget),0,NULL,true);
}
else {
// make sure header is up to date (in case we terminate improperly)
diff --git a/src/sysync/binfileimplds.cpp b/src/sysync/binfileimplds.cpp
index 8708215..4353b95 100755
--- a/src/sysync/binfileimplds.cpp
+++ b/src/sysync/binfileimplds.cpp
@@ -2507,7 +2507,7 @@ localstatus TBinfileImplDS::SaveAdminData(bool aSessionFinished, bool aSuccessfu
fPendingMapHeader.remotepartyID = static_cast<TBinfileImplClient *>(fSessionP)->fRemotepartyID;
fPendingMaps.setExtraHeaderDirty();
// - now pending maps (unsent ones)
- DEBUGPRINTFX(DBG_ADMIN+DBG_DBAPI+DBG_DETAILS,("SaveAdminData: saving %ld entries from fPendingAddMap to fPendingMaps binfile",(long)fPendingAddMaps.size()));
+ DEBUGPRINTFX(DBG_ADMIN+DBG_DBAPI+DBG_DETAILS,("SaveAdminData: saving %ld entries from fPendingAddMaps to fPendingMaps binfile",(long)fPendingAddMaps.size()));
for (spos=fPendingAddMaps.begin();spos!=fPendingAddMaps.end();spos++) {
string locID = (*spos).first;
dsFinalizeLocalID(locID); // pending maps might have non-final ID, so give datastore implementation to return finalized version
diff --git a/src/sysync/configelement.cpp b/src/sysync/configelement.cpp
index 76aa29c..214efd0 100755
--- a/src/sysync/configelement.cpp
+++ b/src/sysync/configelement.cpp
@@ -804,8 +804,8 @@ bool TConfigElement::endElement(const char *aElementName, bool aIsDelegated)
TzConvertTimestamp(*(fResultPtr.fTimestampP),tctx,TCTX_UTC,getSyncAppBase()->getAppZones());
break;
case pamo_timezone:
- // time zone by name
- if (!TimeZoneNameToContext(fTempString.c_str(), *(fResultPtr.fTimeContextP), getSyncAppBase()->getAppZones()))
+ // time zone by name (internal or olson)
+ if (!TimeZoneNameToContext(fTempString.c_str(), *(fResultPtr.fTimeContextP), getSyncAppBase()->getAppZones(), true))
ReportError(false,"invalid/unknown timezone name");
break;
case pamo_vtimezone:
diff --git a/src/sysync/customimplds.cpp b/src/sysync/customimplds.cpp
index 1f7075c..988dd67 100755
--- a/src/sysync/customimplds.cpp
+++ b/src/sysync/customimplds.cpp
@@ -1115,7 +1115,9 @@ localstatus TCustomImplDS::dsAfterStateChange(TLocalEngineDSState aOldState,TLoc
#endif
// reset in case that we restart
DeleteSyncSet();
+ #ifdef BASED_ON_BINFILE_CLIENT
fSyncSetLoaded=false;
+ #endif
}
// let inherited do its stuff as well
return inherited::dsAfterStateChange(aOldState,aNewState);
@@ -3126,7 +3128,7 @@ localstatus TCustomImplDS::SaveAdminData(bool aSessionFinished, bool aSuccessful
if (IS_CLIENT) {
#ifdef SYSYNC_CLIENT
// - now pending maps (unsent ones)
- PDEBUGPRINTFX(DBG_ADMIN+DBG_EXOTIC,("SaveAdminData: adding %ld entries from fPendingAddMap as mapentry_pendingmap",(long)fPendingAddMaps.size()));
+ PDEBUGPRINTFX(DBG_ADMIN+DBG_EXOTIC,("SaveAdminData: adding %ld entries from fPendingAddMaps as mapentry_pendingmap",(long)fPendingAddMaps.size()));
for (spos=fPendingAddMaps.begin();spos!=fPendingAddMaps.end();spos++) {
string locID = (*spos).first;
dsFinalizeLocalID(locID); // make sure we have the permanent version in case datastore implementation did deliver temp IDs
@@ -3693,8 +3695,8 @@ bool TCustomImplDS::storeField(
timecontext_t tctx = TCTX_UNKNOWN;
// modify time zone if params contain a TZNAME
if (paramScan(aParams,"TZNAME",s)) {
- // convert to time zone context
- TimeZoneNameToContext(s.c_str(), tctx, tsfP->getGZones());
+ // convert to time zone context (olson allowed)
+ TimeZoneNameToContext(s.c_str(), tctx, tsfP->getGZones(), true);
}
// now parse text string into field
tsfP->setAsISO8601(aValue, tctx, false);
diff --git a/src/sysync/debuglogger.cpp b/src/sysync/debuglogger.cpp
index 2d0e28d..834d350 100755
--- a/src/sysync/debuglogger.cpp
+++ b/src/sysync/debuglogger.cpp
@@ -83,7 +83,7 @@ cAppCharP const DbgOutDefaultPrefixes[numDbgOutFormats] = {
"<?xml version=\"1.0\"?>\n"
"<sysync_log version=\"1.0\">",
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
- "<html><head><title>Synthesis SyncML Engine " SYSYNC_FULL_VERSION_STRING " Log</title>\n"
+ "<html><head><title>SySync SyncML Engine " SYSYNC_FULL_VERSION_STRING " Log</title>\n"
"<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\">\n"
"<style type=\"text/css\" media=\"screen\"><!--\n"
".block { color: #0000FF; font-weight: bold; }\n"
@@ -141,7 +141,7 @@ cAppCharP const DbgOutDefaultPrefixes[numDbgOutFormats] = {
"}\n"
".doall { color: #754242; }\n"
"--></style>\n"
- "</head><body><h2>Start of log - Synthesis SyncML Engine " SYSYNC_FULL_VERSION_STRING "</h2>\n<ul>\n"
+ "</head><body><h2>Start of log - SySync SyncML Engine " SYSYNC_FULL_VERSION_STRING "</h2>\n<ul>\n"
};
cAppCharP const DbgOutDefaultSuffixes[numDbgOutFormats] = {
diff --git a/src/sysync/itemfield.cpp b/src/sysync/itemfield.cpp
index be4381b..e6f7d71 100644
--- a/src/sysync/itemfield.cpp
+++ b/src/sysync/itemfield.cpp
@@ -1575,8 +1575,8 @@ bool TTimestampField::setAsRFC822date(cAppCharP aRFC822String, timecontext_t aDe
}
}
else if (isalpha(*p)) {
- // could be time zone name (if not, ignore zone spec)
- aIgnoreZone = !TimeZoneNameToContext(p,fTimecontext,fGZonesP);
+ // could be time zone name, internal or olson name (if not, ignore zone spec)
+ aIgnoreZone = !TimeZoneNameToContext(p,fTimecontext,fGZonesP,true);
}
}
// if no valid zone, use default
@@ -2161,8 +2161,8 @@ TSyError TItemFieldKey::SetValueInternal(
sval.assign((cAppCharP)aBuffer,aValSize);
tctx = TCTX_UNKNOWN;
if (!sval.empty()) {
- // convert
- if (!TimeZoneNameToContext(sval.c_str(), tctx, tsFldP->getGZones()))
+ // convert (internal or olson names allowed)
+ if (!TimeZoneNameToContext(sval.c_str(), tctx, tsFldP->getGZones(), true))
return LOCERR_BADPARAM; // bad timezone name
}
// set context
diff --git a/src/sysync/mimedirprofile.cpp b/src/sysync/mimedirprofile.cpp
index cb123e7..5b0ecc7 100644
--- a/src/sysync/mimedirprofile.cpp
+++ b/src/sysync/mimedirprofile.cpp
@@ -1533,9 +1533,9 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
tctx = TCTX_MINOFFSET(fldP->getAsInteger());
}
else if (!fldP->isEmpty()) {
- // string field can be timezone name or numeric minute offset
+ // string field can be timezone name (internal or olson) or numeric minute offset
fldP->getAsString(s);
- if (!TimeZoneNameToContext(s.c_str(),tctx,getSessionZones())) {
+ if (!TimeZoneNameToContext(s.c_str(),tctx,getSessionZones(), true)) {
// if not recognized as time zone name, use integer value
tctx = TCTX_MINOFFSET(fldP->getAsInteger());
}
@@ -3486,7 +3486,7 @@ bool TMimeDirProfileHandler::MIMEStringToField(
fPropTZIDtctx = tctx;
goto timecontext;
}
- else if (TimeZoneNameToContext(aText, tctx, getSessionZones())) {
+ else if (TimeZoneNameToContext(aText, tctx, getSessionZones(), true)) {
// found valid TZID property, save it so we can use it for all values of this property that don't specify their own TZ
PDEBUGPRINTFX(DBG_ERROR,("Warning: TZID %s could be resolved against internal name, but appropriate VTIMEZONE is missing",aText));
fPropTZIDtctx=tctx;
diff --git a/src/sysync/scriptcontext.cpp b/src/sysync/scriptcontext.cpp
index b3af39c..88b29ea 100755
--- a/src/sysync/scriptcontext.cpp
+++ b/src/sysync/scriptcontext.cpp
@@ -341,8 +341,8 @@ public:
tctx = TCTX_UNKNOWN;
}
else {
- // search for timezone by name
- if (!TimeZoneNameToContext(str.c_str(), tctx, aFuncContextP->getSession()->getSessionZones())) {
+ // search for timezone by name (internal or olson)
+ if (!TimeZoneNameToContext(str.c_str(), tctx, aFuncContextP->getSession()->getSessionZones(), true)) {
// last attempt is parsing it as a ISO8601 offset spec
ISO8601StrToContext(str.c_str(), tctx);
}
diff --git a/src/sysync/stdlogicds.cpp b/src/sysync/stdlogicds.cpp
index 5945cf2..04eee91 100644
--- a/src/sysync/stdlogicds.cpp
+++ b/src/sysync/stdlogicds.cpp
@@ -880,15 +880,16 @@ bool TStdLogicDS::logicGenerateSyncCommandsAsServer(
syncopcmdP=NULL;
// possibly, we have a NULL command here (e.g. in case it could not be generated due to MaxObjSize restrictions)
if (cmdP) {
+ // We pass the command to the issue mechanism - last chance to count is here.
+ // Note: the command might be queued and actually sent in a subsequent message.
+ fItemsSent++; // overall counter for statistics
+ itemcount++; // per message counter
+ DB_PROGRESS_EVENT(this,pev_itemsent,fItemsSent,getNumberOfChanges(),0); // send event (but no check for abort)
+ // now issue
if (!fSessionP->issuePtr(cmdP,aNextMessageCommands,aInterruptedCommandP)) {
alldone=false; // issue failed (no room in message), not finished so far
- break;
+ break; // stop trying to issue more commands
}
- // count item sent
- fItemsSent++; // overall counter for statistics
- itemcount++; // per message counter
- // send event (but no check for abort)
- DB_PROGRESS_EVENT(this,pev_itemsent,fItemsSent,getNumberOfChanges(),0);
}
}; // while not aborted and not message full
// we are not done until all aNextMessageCommands are also out
@@ -1039,19 +1040,23 @@ bool TStdLogicDS::logicGenerateSyncCommandsAsClient(
syncopcmdP=NULL;
// possibly, we have a NULL command here (e.g. in case it could not be generated due to MaxObjSize restrictions)
if (cmdP) {
- if (!fSessionP->issuePtr(cmdP,aNextMessageCommands,aInterruptedCommandP)) {
- alldone=false; // issue failed (no room in message), not finished so far
- break;
- }
- // count item sent
+ // We pass the command to the issue mechanism - last chance to count is here.
+ // Note: the command might be queued and actually sent in a subsequent message.
fItemsSent++;
- // send event and check for abort
#ifdef PROGRESS_EVENTS
+ // send progress event and check for abort
if (!DB_PROGRESS_EVENT(this,pev_itemsent,fItemsSent,getNumberOfChanges(),0)) {
implEndDataRead(); // terminate reading
fSessionP->AbortSession(500,true,LOCERR_USERABORT);
return false; // error
}
+ #endif
+ // issue now
+ if (!fSessionP->issuePtr(cmdP,aNextMessageCommands,aInterruptedCommandP)) {
+ alldone=false; // issue failed (no room in message), not finished so far
+ break;
+ }
+ #ifdef PROGRESS_EVENTS
// check for "soft" suspension
if (!SESSION_PROGRESS_EVENT(fSessionP,pev_suspendcheck,NULL,0,0,0)) {
fSessionP->SuspendSession(LOCERR_USERSUSPEND);
diff --git a/src/sysync/syncagent.cpp b/src/sysync/syncagent.cpp
index 71540d4..11ea6ac 100755
--- a/src/sysync/syncagent.cpp
+++ b/src/sysync/syncagent.cpp
@@ -835,6 +835,31 @@ string TSyncAgent::getDeviceType(void)
} // TSyncAgent::getDeviceType
+
+bool TSyncAgent::checkAllFromClientOnly()
+{
+ bool allFromClientOnly=false;
+ // Note: the map phase will not take place, if all datastores are in
+ // send-to-server-only mode and we are not in non-conformant old
+ // synthesis-compatible fCompleteFromClientOnly mode.
+ #ifdef SYSYNC_SERVER
+ if (!fCompleteFromClientOnly)
+ #endif
+ {
+ // let all local datastores know that message has ended
+ allFromClientOnly=true;
+ for (TLocalDataStorePContainer::iterator pos=fLocalDataStores.begin(); pos!=fLocalDataStores.end(); ++pos) {
+ // check sync modes
+ if ((*pos)->isActive() && (*pos)->getSyncMode()!=smo_fromclient) {
+ allFromClientOnly=false;
+ break;
+ }
+ }
+ }
+ return allFromClientOnly;
+}
+
+
#ifdef SYSYNC_CLIENT
// initialize the client session and link it with the SML toolkit
@@ -1539,26 +1564,6 @@ bool TSyncAgent::ClientMessageStarted(SmlSyncHdrPtr_t aContentP, TStatusCommand
} // TSyncAgent::ClientMessageStarted
-bool TSyncAgent::checkAllFromClientOnly()
-{
- bool allFromClientOnly=false;
- // Note: the map phase will not take place, if all datastores are in
- // send-to-server-only mode and we are not in non-conformant old
- // synthesis-compatible fCompleteFromClientOnly mode.
- if (!fCompleteFromClientOnly) {
- // let all local datastores know that message has ended
- allFromClientOnly=true;
- for (TLocalDataStorePContainer::iterator pos=fLocalDataStores.begin(); pos!=fLocalDataStores.end(); ++pos) {
- // check sync modes
- if ((*pos)->isActive() && (*pos)->getSyncMode()!=smo_fromclient) {
- allFromClientOnly=false;
- break;
- }
- }
- }
- return allFromClientOnly;
-}
-
// determines new package states and sets fInProgress
void TSyncAgent::ClientMessageEnded(bool aIncomingFinal)
{
@@ -3164,6 +3169,15 @@ TSyError TSyncAgent::ServerSessionStep(uInt16 &aStepCmd, TEngineProgressInfo *aI
// handle pre-processed step command according to current engine state
switch (fServerEngineState) {
+ // Almost done state
+ case ses_almostdone:
+ // everything done, except for termination of session
+ // - do it now
+ TerminateSession();
+ // - now done
+ fServerEngineState = ses_done;
+ // fall through to done state
+
// Done state
case ses_done :
// session done, nothing happens any more
@@ -3340,12 +3354,10 @@ TSyError TSyncAgent::ServerGeneratingStep(uInt16 &aStepCmd, TEngineProgressInfo
// no more data to send
aStepCmd = STEPCMD_OK; // need one more step to finish
}
- // in any case, if done, all susequent steps will return STEPCMD_DONE
+ // in any case, if done, subsequent steps will terminate the session and return STEPCMD_DONE
if (done) {
- // Session is done
- TerminateSession();
// subsequent steps will all return STEPCMD_DONE
- fServerEngineState = ses_done;
+ fServerEngineState = ses_almostdone;
}
// request reset
fRequestSize = 0;
@@ -3968,11 +3980,10 @@ static const TStructFieldInfo ServerParamFieldInfos[] =
{ "displayalert", VALTYPE_TEXT, false, 0, 0, &readDisplayAlert, NULL },
#endif
#endif
+ { "restartsync", VALTYPE_INT8, true, 0, 0, &readRestartSync, &writeRestartSync },
// write into debug log
- { "errorMsg", VALTYPE_TEXT, true, 0, 0, NULL, &writeErrorMsg },
- { "debugMsg", VALTYPE_TEXT, true, 0, 0, NULL, &writeDebugMsg },
- // restart sync
- { "restartsync", VALTYPE_INT8, true, 0, 0, &readRestartSync, &writeRestartSync }
+ { "errorMsg", VALTYPE_TEXT, true, 0, 0, NULL, &writeErrorMsg },
+ { "debugMsg", VALTYPE_TEXT, true, 0, 0, NULL, &writeDebugMsg },
};
// get table describing the fields in the struct
diff --git a/src/sysync/syncagent.h b/src/sysync/syncagent.h
index 48a0141..898b4e7 100755
--- a/src/sysync/syncagent.h
+++ b/src/sysync/syncagent.h
@@ -61,6 +61,7 @@ typedef enum {
ses_processing, ///< ready to perform next STEPCMD_STEP to process SyncML messages
ses_generating, ///< ready to perform next STEPCMD_STEP to generate SyncML messages
ses_dataready, ///< data is ready to be sent, waiting for STEPCMD_SENTDATA
+ ses_almostdone, ///< session done, but termination delayed until next step
ses_done, ///< session done
numServerEngineStates
} TServerEngineState;
diff --git a/src/sysync/sysync_debug.h b/src/sysync/sysync_debug.h
index aeaa2da..f147037 100755
--- a/src/sysync/sysync_debug.h
+++ b/src/sysync/sysync_debug.h
@@ -104,29 +104,29 @@ TDebugLogger *getDbgLogger(void);
// output to console macro
#ifdef CONSOLEINFO
-# ifdef CONSOLEINFO_LIBC
- // Short-circuit all of the intermediate layers and use libc directly;
- // useful to avoid dependencies in libsmltk on libsynthesis.
- // Because a lot of libs log to stderr, include a unique prefix.
- // Assumes that all printf format strings are plain strings.
- #define CONSOLEPUTS(m) CONSOLE_PRINTF_VARARGS("%s", (m))
-#define CONSOLE_PRINTF_VARARGS(_m, _args...) SySync_ConsolePrintf(stderr, "SYSYNC " _m "\n", ##_args)
- #define CONSOLEPRINTF(m) CONSOLE_PRINTF_VARARGS m
-
- // default implementation invokes fprintf, can be set by app
- // @param stream stderr, useful for invoking fprintf directly
- // @param format guaranteed to start with "SYSYNC " (see above)
-#ifdef __cplusplus
- extern "C" {
-#endif
- extern int (*SySync_ConsolePrintf)(FILE *stream, const char *format, ...);
-#ifdef __cplusplus
- }
-#endif
-# else // CONSOLEINFO_LIBC
- #define CONSOLEPUTS(m) ConsolePuts(m)
- #define CONSOLEPRINTF(m) ConsolePrintf m
-# endif // CONSOLEINFO_LIBC
+ #ifdef CONSOLEINFO_LIBC
+ // Short-circuit all of the intermediate layers and use libc directly;
+ // useful to avoid dependencies in libsmltk on libsynthesis.
+ // Because a lot of libs log to stderr, include a unique prefix.
+ // Assumes that all printf format strings are plain strings.
+ #define CONSOLEPUTS(m) CONSOLE_PRINTF_VARARGS("%s", (m))
+ #define CONSOLE_PRINTF_VARARGS(_m, _args...) SySync_ConsolePrintf(stderr, "SYSYNC " _m "\n", ##_args)
+ #define CONSOLEPRINTF(m) CONSOLE_PRINTF_VARARGS m
+
+ // default implementation invokes fprintf, can be set by app
+ // @param stream stderr, useful for invoking fprintf directly
+ // @param format guaranteed to start with "SYSYNC " (see above)
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ extern int (*SySync_ConsolePrintf)(FILE *stream, const char *format, ...);
+ #ifdef __cplusplus
+ }
+ #endif
+ #else // CONSOLEINFO_LIBC
+ #define CONSOLEPUTS(m) ConsolePuts(m)
+ #define CONSOLEPRINTF(m) ConsolePrintf m
+ #endif // CONSOLEINFO_LIBC
#else
#define CONSOLEPUTS(m)
#define CONSOLEPRINTF(m)
diff --git a/src/sysync/timezones.cpp b/src/sysync/timezones.cpp
index 3f8796b..a2a2ecf 100755
--- a/src/sysync/timezones.cpp
+++ b/src/sysync/timezones.cpp
@@ -889,11 +889,13 @@ bool TimeZoneContextToName( timecontext_t aContext, string &aName, GZones* g,
tz_entry t;
aName= "UNKNOWN";
+ #ifdef ANDROID
// setting it via param does not work currently for some reasons, switch it on permanently for Android
-//#ifdef ANDROID --
+ // BUT NOT GENERALLY - IT CHANGES SEMANTICS OF THE WHOLE TIME ZONE NAMING SYSTEM!
+ #warning "%%% overriding passed aPrefIdent argument with constant, forcing olson name output"
aPrefIdent= "o";
//__android_log_print( ANDROID_LOG_DEBUG, "ContextToName", "pref='%s' / aContext=%d\n", aPrefIdent, aContext );
-//#endif --
+ #endif
// if aPrefIndent contains "o", this means we'd like to see olson name, if possible
// %%% for now, we can return olson for the built-ins only
diff --git a/src/sysync_SDK/Sources/lineartime.cpp b/src/sysync_SDK/Sources/lineartime.cpp
index 6c8b6f5..f402b24 100755
--- a/src/sysync_SDK/Sources/lineartime.cpp
+++ b/src/sysync_SDK/Sources/lineartime.cpp
@@ -61,8 +61,8 @@ int timeConv(int argc, const char *argv[])
intime = getSystemNowAs(incontext,&zones);
}
else {
- // get input context from name
- if (!TimeZoneNameToContext(inzone.c_str(),incontext,&zones))
+ // get input context from name (internal or olson)
+ if (!TimeZoneNameToContext(inzone.c_str(),incontext,&zones, true))
incontext=TCTX_UNKNOWN;
// input time from 3rd argument
if (argc!=3) {
@@ -95,7 +95,7 @@ int timeConv(int argc, const char *argv[])
s.erase(); ContextToISO8601StrAppend(s, stdoffs, true);
CONSOLEPRINTF(("Input time zone represented as TZ/DAYLIGHT :\n\nTZ:%s\nDAYLIGHT:%s\n",s.c_str(),z.c_str()));
}
- else if (!TimeZoneNameToContext(outzone.c_str(),outcontext,&zones))
+ else if (!TimeZoneNameToContext(outzone.c_str(),outcontext,&zones, true))
outcontext=TCTX_UNKNOWN;
// now show
CONSOLEPRINTF((""));
diff --git a/src/sysync_SDK/sdk_sources_cocoa/SyncEngine.m b/src/sysync_SDK/sdk_sources_cocoa/SyncEngine.m
index 7fcd54f..88a0f36 100644
--- a/src/sysync_SDK/sdk_sources_cocoa/SyncEngine.m
+++ b/src/sysync_SDK/sdk_sources_cocoa/SyncEngine.m
@@ -9,7 +9,7 @@
- (id)initWithCI:(UI_Call_In)aCI andSessionHandle:(SessionH)aSessionH;
{
- if ([super init]!=nil) {
+ if ((self = [super init])) {
fCI = aCI;
fSessionH = aSessionH;
// also prepare tunnel wrapper
@@ -32,7 +32,9 @@
}
}
// done
+ #if !__has_feature(objc_arc)
[super dealloc];
+ #endif
} // dealloc
@@ -87,7 +89,9 @@
SettingsKey *sessionKey = [self newOpenSessionKeyWithMode:0 err:&sta];
if (sta==LOCERR_OK) {
[sessionKey setStringValueByName:"debugMsg" toValue:aMessage];
+ #if !__has_feature(objc_arc)
[sessionKey release];
+ #endif
}
}
@@ -98,7 +102,9 @@
SettingsKey *sessionKey = [self newOpenSessionKeyWithMode:0 err:&sta];
if (sta==LOCERR_OK) {
[sessionKey setStringValueByName:"errorMsg" toValue:aMessage];
+ #if !__has_feature(objc_arc)
[sessionKey release];
+ #endif
}
}
@@ -295,7 +301,7 @@
// empty prefix if none specified
if (aEntryPointPrefix==nil) aEntryPointPrefix = @"";
// init superclass and DLL
- if (self == [super init]) {
+ if ((self = [super init])) {
ConnectEngine_Func ConnectEngine_Var = NULL;
#ifdef SYSYNC_ENGINE_STATIC
// static: just directly use the entry point.
@@ -345,7 +351,9 @@
DBGNSLOG(@"SySync engine platform = '%@'\n", [engineInfo stringValueByName:"platform"]);
DBGNSLOG(@"library product name = '%@'\n", [engineInfo stringValueByName:"name"]);
DBGNSLOG(@"version comment = '%@'\n", [engineInfo stringValueByName:"comment"]);
+ #if !__has_feature(objc_arc)
[engineInfo release];
+ #endif
}
}
}
@@ -353,7 +361,9 @@
sta=LOCERR_OUTOFMEM; // probably...
// kill or go
if (sta!=LOCERR_OK) {
+ #if !__has_feature(objc_arc)
[self dealloc];
+ #endif
return nil;
}
// ok
@@ -395,7 +405,9 @@
fCI = NULL;
DisconnectEngine_Var = NULL;
// done
+ #if !__has_feature(objc_arc)
[super dealloc];
+ #endif
}
diff --git a/src/sysync_ios.xcodeproj/project.pbxproj b/src/sysync_ios.xcodeproj/project.pbxproj
index 4152bd3..f5a1fb2 100644
--- a/src/sysync_ios.xcodeproj/project.pbxproj
+++ b/src/sysync_ios.xcodeproj/project.pbxproj
@@ -1770,7 +1770,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0430;
+ LastUpgradeCheck = 0440;
ORGANIZATIONNAME = plan44.ch;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "sysync_ios" */;
@@ -2106,10 +2106,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = (
- armv6,
- armv7,
- );
GCC_C_LANGUAGE_STANDARD = c99;
GCC_THUMB_SUPPORT = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -2125,10 +2121,6 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- armv6,
- armv7,
- );
GCC_C_LANGUAGE_STANDARD = c99;
GCC_THUMB_SUPPORT = NO;
GENERATE_MASTER_OBJECT_FILE = YES;
diff --git a/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_clientEngine_opensource_ios.xcscheme b/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_clientEngine_opensource_ios.xcscheme
index 4e2e45c..13316e8 100644
--- a/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_clientEngine_opensource_ios.xcscheme
+++ b/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_clientEngine_opensource_ios.xcscheme
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
+ LastUpgradeVersion = "0440"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -37,6 +38,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
diff --git a/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_combiEngine_opensource_ios.xcscheme b/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_combiEngine_opensource_ios.xcscheme
index 04507cc..348f68c 100644
--- a/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_combiEngine_opensource_ios.xcscheme
+++ b/src/sysync_ios.xcodeproj/xcshareddata/xcschemes/static_combiEngine_opensource_ios.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0430"
+ LastUpgradeVersion = "0440"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,8 +23,8 @@
</BuildActionEntries>
</BuildAction>
<TestAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>