diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2012-09-13 21:56:25 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2012-09-13 21:56:25 +0200 |
commit | 554cd8cb16910f69b8915bad9dd5dcc7091e7bb2 (patch) | |
tree | 3d7381f827d11f36ab9a6db90fda3372e69ec9cd | |
parent | de7ff9fdc76a443ff87372ca1d91e22ce5e85236 (diff) | |
parent | 99159e0991664f8c8319e634598ea6c9bd73fcc2 (diff) |
Merge branch 'master' into pbaplibsynthesis_3.4.0.16+syncevolution-1-3-99-1
-rw-r--r-- | configure.in | 2 | ||||
-rwxr-xr-x | src/syncml_tk/src/sml/xlt/all/xltdec.c | 19 | ||||
-rwxr-xr-x | src/syncml_tk/src/sml/xlt/all/xltdeccom.h | 7 | ||||
-rwxr-xr-x | src/syncml_tk/src/sml/xlt/all/xltdecwbxml.c | 8 | ||||
-rwxr-xr-x | src/syncml_tk/src/sml/xlt/all/xltdecxml.c | 8 | ||||
-rwxr-xr-x | src/sysync/binfileimplds.cpp | 3 | ||||
-rwxr-xr-x | src/sysync/customimplds.cpp | 3 |
7 files changed, 34 insertions, 16 deletions
diff --git a/configure.in b/configure.in index 3cc564f..32fa121 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ AC_INIT(src/sysync/engineinterface.cpp) AC_CONFIG_MACRO_DIR([m4]) # four digit upstream version, one additional digit for # Linux/SyncEvolution specific extensions: -AM_INIT_AUTOMAKE(synthesis, 3.4.0.16.7) +AM_INIT_AUTOMAKE(synthesis, 3.4.0.16.8) AM_CONFIG_HEADER(config.h) AC_LIBTOOL_DLOPEN diff --git a/src/syncml_tk/src/sml/xlt/all/xltdec.c b/src/syncml_tk/src/sml/xlt/all/xltdec.c index a07f24c..d9aa295 100755 --- a/src/syncml_tk/src/sml/xlt/all/xltdec.c +++ b/src/syncml_tk/src/sml/xlt/all/xltdec.c @@ -246,10 +246,15 @@ Ret_t show_decode_error(Ret_t aRc, XltDecScannerPtr_t aScanner, char *aRoutineNa SMLERRPRINTFX(DBG_ERROR,("%s: smlErr 0x%hX (%s) while parsing",aRoutineName,aRc,smlErrorText(aRc))); // Show details if (aScanner && aScanner->curtok) { + Long_t currentBytesShow = numBytesShow; + Long_t remaining; + // show what token we are parsing show_token(aScanner->curtok,DBG_ERROR); - // show hex of 32 bytes after scan position - b = aScanner->getPos(aScanner); + // show hex of at most 32 bytes after scan position + b = aScanner->getPos(aScanner, &remaining); + if (remaining < currentBytesShow) + currentBytesShow = remaining; SMLERRPRINTFX(DBG_ERROR,( "- Tag start at 0x%lX, scanner pos at 0x%lX%s, data:", (unsigned long)aScanner->curtok->start, @@ -258,16 +263,16 @@ Ret_t show_decode_error(Ret_t aRc, XltDecScannerPtr_t aScanner, char *aRoutineNa )); if (b!=NULL) { p=hexshow; - for (i=0; i<numBytesShow; i++) { + for (i=0; i<currentBytesShow; i++) { *p++ = NibbleToHexDigit(*b>>4); *p++ = NibbleToHexDigit(*b++); *p++ = ' '; } *p=0; - b-=numBytesShow; // rewind + b-=currentBytesShow; // rewind SMLERRPRINTFX(DBG_ERROR,("%s", hexshow)); p=hexshow; - for (i=0; i<numBytesShow; i++) { + for (i=0; i<currentBytesShow; i++) { *p++ = (*b>=0x20) && (*b<0x7F) ? *b : '_'; b++; } @@ -470,7 +475,7 @@ xltDecInit(const SmlEncoding_t enc, return rc; } - *ppBufPos = pDecoder->scanner->getPos(pDecoder->scanner); + *ppBufPos = pDecoder->scanner->getPos(pDecoder->scanner, NULL); *ppDecoder = (XltDecoderPtr_t)pDecoder; @@ -590,7 +595,7 @@ xltDecNext(XltDecoderPtr_t pDecoder, } } - *ppBufPos = pScanner->getPos(pScanner); + *ppBufPos = pScanner->getPos(pScanner, NULL); return SML_ERR_OK; } diff --git a/src/syncml_tk/src/sml/xlt/all/xltdeccom.h b/src/syncml_tk/src/sml/xlt/all/xltdeccom.h index 33cf526..edf9209 100755 --- a/src/syncml_tk/src/sml/xlt/all/xltdeccom.h +++ b/src/syncml_tk/src/sml/xlt/all/xltdeccom.h @@ -143,8 +143,13 @@ struct XltDecScanner_s /** * Get the current position of the scanner within the working buffer. + * + * @param pScanner (IN/OUT) + * the scanner + * @param remaining (OUT) + * number of valid bytes after current position, optional (NULL acceptable) */ - MemPtr_t (*getPos)(XltDecScannerPtr_t pScanner); + MemPtr_t (*getPos)(XltDecScannerPtr_t pScanner, Long_t *remaining); /* public attributes */ diff --git a/src/syncml_tk/src/sml/xlt/all/xltdecwbxml.c b/src/syncml_tk/src/sml/xlt/all/xltdecwbxml.c index 7826022..43865a0 100755 --- a/src/syncml_tk/src/sml/xlt/all/xltdecwbxml.c +++ b/src/syncml_tk/src/sml/xlt/all/xltdecwbxml.c @@ -124,7 +124,7 @@ struct wbxmlScannerPriv_s Ret_t (*destroy)(XltDecScannerPtr_t); Ret_t (*pushTok)(XltDecScannerPtr_t); void (*setBuf)(XltDecScannerPtr_t pScanner, const MemPtr_t pBufStart, const MemPtr_t pBufEnd); - MemPtr_t (*getPos)(XltDecScannerPtr_t pScanner); + MemPtr_t (*getPos)(XltDecScannerPtr_t pScanner, Long_t *remaining); /* public attributes */ XltDecTokenPtr_t curtok; /**< current token */ @@ -168,7 +168,7 @@ static Ret_t _destroy(XltDecScannerPtr_t); static Ret_t _nextTok(XltDecScannerPtr_t); static Ret_t _pushTok(XltDecScannerPtr_t); static void _setBuf(XltDecScannerPtr_t, const MemPtr_t, const MemPtr_t); -static MemPtr_t _getPos(XltDecScannerPtr_t); +static MemPtr_t _getPos(XltDecScannerPtr_t, Long_t *remaining); /** * Advance the current position pointer after checking whether the end of @@ -398,8 +398,10 @@ _setBuf(XltDecScannerPtr_t pScanner, const MemPtr_t pBufStart, } static MemPtr_t -_getPos(XltDecScannerPtr_t pScanner) +_getPos(XltDecScannerPtr_t pScanner, Long_t *remaining) { + if (remaining) + *remaining = ((wbxmlScannerPrivPtr_t)pScanner)->bufend - ((wbxmlScannerPrivPtr_t)pScanner)->pos; return ((wbxmlScannerPrivPtr_t)pScanner)->pos; } diff --git a/src/syncml_tk/src/sml/xlt/all/xltdecxml.c b/src/syncml_tk/src/sml/xlt/all/xltdecxml.c index 6129c40..f523e27 100755 --- a/src/syncml_tk/src/sml/xlt/all/xltdecxml.c +++ b/src/syncml_tk/src/sml/xlt/all/xltdecxml.c @@ -71,7 +71,7 @@ struct xmlScannerPriv_s Ret_t (*destroy)(XltDecScannerPtr_t); Ret_t (*pushTok)(XltDecScannerPtr_t); void (*setBuf)(XltDecScannerPtr_t pScanner, const MemPtr_t pBufStart, const MemPtr_t pBufEnd); - MemPtr_t (*getPos)(XltDecScannerPtr_t pScanner); + MemPtr_t (*getPos)(XltDecScannerPtr_t pScanner, Long_t *remaining); XltDecTokenPtr_t curtok; /**< current token */ Long_t charset; /**< 0 */ @@ -100,7 +100,7 @@ static Ret_t _destroy(XltDecScannerPtr_t); static Ret_t _nextTok(XltDecScannerPtr_t); static Ret_t _pushTok(XltDecScannerPtr_t); static void _setBuf(XltDecScannerPtr_t, const MemPtr_t, const MemPtr_t); -static MemPtr_t _getPos(XltDecScannerPtr_t); +static MemPtr_t _getPos(XltDecScannerPtr_t, Long_t *remaining); /** * Advance the current position pointer after checking whether the end of @@ -311,8 +311,10 @@ _setBuf(XltDecScannerPtr_t pScanner, const MemPtr_t pBufStart, * Get the current position of the scanner within its working buffer. */ static MemPtr_t -_getPos(XltDecScannerPtr_t pScanner) +_getPos(XltDecScannerPtr_t pScanner, Long_t *remaining) { + if (remaining) + *remaining = ((xmlScannerPrivPtr_t)pScanner)->bufend - ((xmlScannerPrivPtr_t)pScanner)->pos; return ((xmlScannerPrivPtr_t)pScanner)->pos; } diff --git a/src/sysync/binfileimplds.cpp b/src/sysync/binfileimplds.cpp index 321b7cb..8708215 100755 --- a/src/sysync/binfileimplds.cpp +++ b/src/sysync/binfileimplds.cpp @@ -2446,6 +2446,7 @@ localstatus TBinfileImplDS::SaveAdminData(bool aSessionFinished, bool aSuccessfu fTarget.lastChangeCheck=fPreviousToRemoteSyncCmpRef; #if TARGETS_DB_VERSION>=6 // - identifiers (tokens for StartDataRead) + PDEBUGPRINTFX(DBG_ADMIN+DBG_DBAPI+DBG_EXOTIC,("SaveAdminData: saving target sync token %s", fPreviousToRemoteSyncIdentifier.c_str())); AssignCString(fTarget.dummyIdentifier1,fPreviousToRemoteSyncIdentifier.c_str(),remoteAnchorMaxLen); // former lastSyncIdentifier AssignCString(fTarget.dummyIdentifier2,NULL,remoteAnchorMaxLen); // former lastSuspendIdentifier, not needed, make empty // store remote datastore's display name (is empty if we haven't got one from the remote via devInf) @@ -2597,7 +2598,7 @@ localstatus TBinfileImplDS::SaveAdminData(bool aSessionFinished, bool aSuccessfu PDEBUGPRINTFX(DBG_ERROR,("Error writing pending item file, bferr=%hd",bfe)); } } - PDEBUGPRINTFX(DBG_ADMIN+DBG_DBAPI+DBG_DETAILS,("SaveAdminData: resumeAlertCode = %hd, lastSuspendModCount = %ld",fResumeAlertCode,(long)fTarget.lastSuspendModCount)); + PDEBUGPRINTFX(DBG_ADMIN+DBG_DBAPI+DBG_DETAILS,("SaveAdminData: fTargetIndex %d resumeAlertCode = %hd, lastSuspendModCount = %ld",fTargetIndex,fResumeAlertCode,(long)fTarget.lastSuspendModCount)); // update the target record if (fTargetIndex>=0) { targetsBinFileP->updateRecord(fTargetIndex,&fTarget); diff --git a/src/sysync/customimplds.cpp b/src/sysync/customimplds.cpp index fff6625..1f7075c 100755 --- a/src/sysync/customimplds.cpp +++ b/src/sysync/customimplds.cpp @@ -3190,6 +3190,9 @@ localstatus TCustomImplDS::implSaveEndOfSession(bool aUpdateAnchors) } // also update opaque reference string possibly needed in DS API implementations fPreviousToRemoteSyncIdentifier = fCurrentSyncIdentifier; + PDEBUGPRINTFX(DBG_ADMIN+DBG_DBAPI+DBG_EXOTIC,("updating sync token (fPreviousToRemoteSyncIdentifier) from %s to current sync token %s",fPreviousToRemoteSyncIdentifier.c_str(),fCurrentSyncIdentifier.c_str())); + } else { + PDEBUGPRINTFX(DBG_ADMIN+DBG_DBAPI+DBG_EXOTIC,("keeping old sync token (fPreviousToRemoteSyncIdentifier) %s instead of updating to current sync token %s",fPreviousToRemoteSyncIdentifier.c_str(),fCurrentSyncIdentifier.c_str())); } // updating anchor means invalidating last Suspend fPreviousSuspendCmpRef = fPreviousToRemoteSyncCmpRef; // setting to current reference can do less harm than setting it to zero |